claude-code-mastery-project-starter-kit: Skill for Claude Code

.claude/skills/mongodb-rules/SKILL.md

mongodb-rules is a skill for Claude Code from TheDecipherist/claude-code-mastery-project-starter-kit. It costs 63 tokens per session (1,536 once invoked), scanned A, original, MIT.

A set of rules for writing MongoDB data-access code with the native driver or StrictDB, including queries, writes, indexes, aggregations, upserts, connections, and data models.

In plain words
What is it for?
Use it when modifying MongoDB queries or schemas, building adapters, handling ObjectId values, managing shared connections, writing indexes, or implementing reads and writes.
Why use it?
It prevents common database bugs and operational problems, such as mismatched ID types, too many client connections, hardcoded credentials, and data-access logic scattered through application code.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is TheDecipherist/claude-code-mastery-project-starter-kit's own configuration. It tells Claude Code how to work on claude-code-mastery-project-starter-kit itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-code-mastery-project-starter-kit configures →

Reuse

Borrowing it

Nothing to install: this file belongs to TheDecipherist/claude-code-mastery-project-starter-kit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/TheDecipherist/claude-code-mastery-project-starter-kit/main/.claude/skills/mongodb-rules/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mongodb-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/thedecipherist/claude-code-mastery-project-starter-kit/mongodb-rules/github.svg)](https://agentmods.dev/skills/thedecipherist/claude-code-mastery-project-starter-kit/mongodb-rules)
Your own site
<a href="https://agentmods.dev/skills/thedecipherist/claude-code-mastery-project-starter-kit/mongodb-rules"><img src="https://agentmods.dev/badge/skills/thedecipherist/claude-code-mastery-project-starter-kit/mongodb-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mongodb-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/thedecipherist/claude-code-mastery-project-starter-kit/mongodb-rules"><img src="https://agentmods.dev/badge/skills/thedecipherist/claude-code-mastery-project-starter-kit/mongodb-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,536 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.01536
Opus 5.5 $0.00025 $0.00614
Sonnet 5.5 $0.00013 $0.00307
Haiku 4.5 $0.00006 $0.00154

Measured 2mo ago against content hash bd2f50271a86, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mongodb-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/mongodb-rules/SKILL.md · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MongoDB Data-Access Rules

Non-negotiable for this codebase. From production, not preference.

Driver and connection

  • Prefer StrictDB; fall back to the native driver. Use StrictDB when it's installed, otherwise the native MongoDB driver directly. Never Mongoose, either way.
  • Data access stays in the adapter, never raw collections scattered through feature code.
  • One shared MongoClient for the whole app, created once at startup and reused everywhere. The client is the pool. Never create one per request, that exhausts connections and looks like "MongoDB went down" under load. In serverless, declare the client at module scope, outside the handler, so warm invocations reuse it.
  • URI comes from an env var, never hardcoded. Close the client on SIGTERM/SIGINT.

Identity and types

  • _id is an ObjectId, not a string. A string _id against an ObjectId document matches nothing, silently. This is the number-one "my id query returns nothing" bug. Wrap incoming ids with new ObjectId(id); for an $in list, convert every element.
  • Never put _id in the body of any write. Identity goes in the filter; on insert MongoDB generates it. Restating it after a JSON round-trip throws code 66 (immutable field altered).
  • JSON strips both ObjectId and Date to strings. Re-hydrate at the boundary before you query or save, or lookups match nothing and date filters break. Use a parse-time reviver (parseMongo) or a bounded post-parse walk (rehydrateTypes, maxDepth=3). Never patch the global JSON.parse. Guard with ObjectId.isValid and a skipKeys list.
  • Consider a natural string _id (email, SKU, slug) to sidestep the type dance entirely, then ids are strings end to end.
  • Only _id is indexed by default. Sorting by _id gives roughly creation order for free, but store an explicit createdAt when creation time matters; don't rely on the ObjectId's embedded timestamp.

Querying

  • null is not "missing". { field: null } matches both explicit null AND absent documents. Use { field: { $exists: false } } for missing, and { field: { $ne: null } } for "has a real value" (which excludes both null and missing).
  • Reads are aggregation pipelines, not find().
  • Arrays-within-arrays aren't queryable past about three levels (maxDepth=3). If you need to, the model is wrong, flatten it.

Read the full file on GitHub · 66 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 66 lines · 63 tokens per session scan A bd2f50271a86

Subscribe to this mod's changes

mongodb-rules is a skill published in the GitHub repository TheDecipherist/claude-code-mastery-project-starter-kit (342 stars, last pushed 4mo ago), licensed MIT. It adds 63 tokens to every session and 1,536 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

mongodb-rules compared with skills from other repositories

mongodb-rules next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mongodb-rulesTheDecipherist/claude-code-mastery-project-starter-kitSkill3424mo agoMITA63Claude Code
dbxt8y2/dbxSkill29kyesterdayApache-2.0A74Claude Code, Codex
azure-mgmt-mongodbatlas-dotnetmicrosoft/skillsSkill3.2kyesterdayMITA64Claude Code
nosqliPurpleAILAB/DecepticonSkill6.5k8d agoApache-2.0A38Claude Code, Codex
byted-volcengine-mongodbbytedance/agentkit-samplesSkill484todayApache-2.0A82Claude Code, Codex
commerce-app-storageadobe/skillsSkill319yesterdayApache-2.0A78Claude Code
mongodb-connectionfcakyon/claude-codex-settingsSkill1.2kyesterdayApache-2.0A122Claude Code