mongodb-document-modeling

mongodb-document-modeling is a skill for Claude Code, Codex from vaquarkhan/Fullstack-development-agent-skills. It costs 36 tokens per session (479 once invoked), scanned A, original, MIT.

Guidance for designing MongoDB data, where information is stored as flexible JSON-like documents rather than rows in tables.

In plain words
What is it for?
Use it to choose embedded data or references, create validation rules and indexes, build aggregation pipelines, plan transactions and sharding, and review slow queries.
Why use it?
It helps keep document shapes, indexes, tenant separation, and high-volume data safe and efficient as the application grows.

Skill for Claude CodeCodex

Part of the fullstack-development-agent-skills plugin — 36 skills, 10 commands, 6 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/vaquarkhan/fullstack-development-agent-skills/mongodb-document-modeling
Any agent
npx skills add vaquarkhan/Fullstack-development-agent-skills --skill mongodb-document-modeling
Clone the repo
git clone --depth 1 https://github.com/vaquarkhan/Fullstack-development-agent-skills

Made for: Claude Code, Codex.

Or install fullstack-development-agent-skills, the plugin that ships this one along with the rest of its 36 skills, 10 commands, 6 agents.

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-document-modeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/vaquarkhan/fullstack-development-agent-skills/mongodb-document-modeling.svg)](https://agentmods.dev/skills/vaquarkhan/fullstack-development-agent-skills/mongodb-document-modeling)
Your own site
<a href="https://agentmods.dev/skills/vaquarkhan/fullstack-development-agent-skills/mongodb-document-modeling"><img src="https://agentmods.dev/badge/skills/vaquarkhan/fullstack-development-agent-skills/mongodb-document-modeling.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 479 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00036 $0.00479
Opus 5 $0.00018 $0.00239
Sonnet 5 $0.00007 $0.00096
Haiku 4.5 $0.00004 $0.00048

Measured 4d ago against content hash 826993fe9e28, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mongodb-document-modeling 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 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (examples/bad-example.js, examples/good-example.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skill-packs/data/mongodb/mongodb-document-modeling/SKILL.md · 61 lines

How it starts

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

MongoDB Document Modeling

Use When

  • Modeling domains in MongoDB (Atlas or self-hosted)
  • Designing embed vs reference, indexes, and aggregation for app queries
  • Pairing with Node, Java, Python, or Go services using MongoDB drivers

Workflow

  1. Map access patterns first — one document shape per dominant query pattern.
  2. Choose embed vs reference; cap array growth; use bucketing for high-volume subdocs.
  3. Define JSON Schema validation and compound indexes for hot queries.
  4. Implement transactions only when cross-document invariants require them.
  5. Plan sharding keys early if tenant scale warrants it.
  6. Monitor slow queries and index hit rates in Atlas or profiler.

Required Checks

  • Every production query uses supporting index (explain plan reviewed)
  • Tenant isolation enforced in query filter — not only application logic
  • Unbounded arrays avoided or capped with archival strategy
  • Write concern and read concern documented per use case

Examples And Templates

See examples/ for side-by-side good vs bad patterns agents commonly get wrong. See templates/ for copy-paste starters aligned with this skill.

Decision Framework

  • Embed when data is read together and bounded; reference when shared or unbounded.
  • Prefer aggregation pipeline for analytics; avoid $lookup storms without indexes.
  • Change streams for CDC to search/cache — not polling entire collections.
  • Use transactions sparingly; design atomic single-document updates when possible.

Common Rationalizations And Rebuttals

  • "Mongo is schema-less." -> Undocumented schema causes production drift; use validation.
  • "Indexes slow writes." -> Missing indexes slow reads more; right-size indexes per query.
  • "ObjectId everywhere." -> Use UUID strings for client-facing IDs when integrating APIs.

Evidence Pack

  • explain() output for top 5 queries
  • Index list with rationale
  • Schema validation rules
  • Tenant isolation test cases

Exit Criteria

  • Hot queries are indexed and tenant-scoped
  • Document shapes match access patterns without unbounded growth
  • Operational monitoring for slow ops is configured

Read the full file on GitHub · 61 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 61 lines · 36 tokens per session scan A 826993fe9e28

Subscribe to this mod's changes

mongodb-document-modeling is a skill published in the GitHub repository vaquarkhan/Fullstack-development-agent-skills (2 stars, last pushed 20d ago), licensed MIT. It adds 36 tokens to every session and 479 once invoked, about $0.0002 per session on Opus 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-31.

Related

Other skills, from other repositories