Database Fundamentals
DanielPodolsky/ownyourcode
Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.
MongoDB schema design patterns and anti-patterns. An agent skill from mongodb/agent-skills.
$ npx skills add mongodb/agent-skills --skill mongodb-schema-design -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mongodb/agent-skills mongodb-schema-design --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mongodb-schema-design .claude/skills/mongodb-schema-design && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mongodb-schema-design" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-design into .claude/skills/mongodb-schema-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-schema-design", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-designType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add mongodb/agent-skills --skill mongodb-schema-design -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mongodb/agent-skills mongodb-schema-design --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/mongodb-schema-design .agents/skills/mongodb-schema-design && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mongodb-schema-design" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-design into .agents/skills/mongodb-schema-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-schema-design", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mongodb/agent-skills --skill mongodb-schema-design -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mongodb/agent-skills mongodb-schema-design --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/mongodb-schema-design .cursor/skills/mongodb-schema-design && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mongodb-schema-design" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-design into .cursor/skills/mongodb-schema-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-schema-design", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/mongodb/agent-skills.git --path skills/mongodb-schema-design--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add mongodb/agent-skills --skill mongodb-schema-design -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mongodb/agent-skills mongodb-schema-design --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/mongodb-schema-design .gemini/skills/mongodb-schema-design && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mongodb-schema-design" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-design into .gemini/skills/mongodb-schema-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-schema-design", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install mongodb/agent-skills mongodb-schema-designInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add mongodb/agent-skills --skill mongodb-schema-design -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/mongodb-schema-design .github/skills/mongodb-schema-design && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mongodb-schema-design" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-design into .github/skills/mongodb-schema-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-schema-design", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mongodb/agent-skills --skill mongodb-schema-design -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install mongodb/agent-skills mongodb-schema-design --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mongodb/agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/mongodb-schema-design .opencode/skills/mongodb-schema-design && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mongodb-schema-design" agent skill from https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-design into .opencode/skills/mongodb-schema-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mongodb-schema-design", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mongodb-schema-designMongoDB schema design patterns and anti-patterns. An agent skill from mongodb/agent-skills.
Mongodb Schema Design is an agent skill from mongodb/agent-skills, published by the product's own GitHub organization. MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues caused by schema problems. Triggers on "design schema", "embed vs reference", "MongoDB data model", "schema review", "unbounded arrays", "one-to-many", "tree structure", "16MB limit", "schema validation", "JSON Schema", "time series", "schema migration", "polymorphic", "TTL", "data lifecycle", "archive", "index explosion", "unnecessary indexes"…
Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 21 other files, including reference files (for example `references/antipattern-excessive-lookups.md`, `references/antipattern-unnecessary-collections.md` and `references/antipattern-unnecessary-indexes.md`).
It sits in Databases, covering NoSQL databases, Database schema design and Forms and validation. It works with MongoDB and SQL. The repository describes itself as: Use the official MongoDB Skills with your favorite coding agent to build faster. The licence is Apache-2.0.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 18b014e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Mongodb Schema Design loads about 3.4k tokens when it runs, and up to ~30k if it reads all its reference files. Until then it costs about 144 tokens; SKILL.md has 1,616 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from mongodb/agent-skills at commit 18b014e, republished under its Apache-2.0 licence (© mongodb). 1,616 words, ~3,407 tokens.
.claude/skills/mongodb-schema-design/SKILL.md (or your agent's skills folder). This skill also uses 20 other files; get the full folder from GitHub.Data modeling patterns and anti-patterns for MongoDB, maintained by MongoDB. Bad schema is the root cause of most MongoDB performance and cost issues—queries and indexes cannot fix a fundamentally wrong model.
Reference these guidelines when:
Do not immediately recommend a pattern or schema change without understanding the broader context. Together with the user, analyze access patterns to identify pain points and opportunities for optimization.
Step 1: Assess the environment Ask the user:
Step 2: Determine workload type Is the workload read-heavy, write-heavy, or balanced? This will influence which diagnostic sources are most relevant. Ask the user:
Verify with db.serverStatus().opcounters.
Step 3: Work with the user to choose the best source(s) Recommend the best source(s) for their situation, explaining the tradeoffs. For schema design decisions, we often need to combine multiple sources for a complete picture.
Step 4: Proceed with analysis Only after source selection, fetch data or guide the user through analysis.
Combining Query Stats and Slow Query Logs:
Use both together for comprehensive analysis:
"Data that is accessed together should be stored together."
This is MongoDB's core philosophy. Embedding related data eliminates joins, reduces round trips, and enables atomic updates. Reference only when you must.
A core way to implement this philosophy is the fact that MongoDB exposes flexible schemas. This means you can have different fields in different documents, and even different structures. This allows you to model data in the way that best fits your access patterns, without being constrained by a rigid schema. For example, if different documents have different sets of fields, that is perfectly fine as long as it serves your application's needs. You can also use schema validation to enforce certain rules while still allowing for flexibility.
Another implication of the key principle is that information about the expected read and write workload becomes very relevant to schema design. If pieces of information from different entities are often queried or updated together, that means that prioritizing co-location of that data in the same document can lead to significant performance benefits. On the other hand, if certain pieces of information are rarely accessed together, it may make sense to store them separately to avoid loading more data than necessary.
$jsonSchema validator to catch invalid data at the database level (type checks, required fields, enum constraints, array size limits). Start with validationLevel: "moderate" and validationAction: "warn" on existing collections, then tighten to strict/error.$bsonSize.| Relationship | Cardinality | Access Pattern | Recommendation |
|---|---|---|---|
| One-to-One | 1:1 | Always together | Embed |
| One-to-Few | 1:N (N < 100) | Usually together | Embed array |
| One-to-Many | 1:N (N > 100) | Often separate | Reference |
| Many-to-Many | M:N | Varies | Two-way reference |
This is a rough guideline, and whether to embed or reference depends on your specific access patterns, data size, and read/write frequencies. Always verify with your actual workload.
Each reference file listed above contains detailed explanations and code examples. Use the descriptions in the Quick Reference to identify which files are relevant to your current task.
Each reference file contains:
For automatic verification, connect the MongoDB MCP Server.
If the MCP server is running and connected, I can automatically run verification commands to check your actual schema, document sizes, array lengths, index usage, slow query logs, and more. This allows me to provide tailored recommendations based on your real data, not just code patterns.
⚠️ Security: Use --readOnly for safety. Remove only if you need write operations.
When connected, I can automatically:
mcp__mongodb__collection-schemamcp__mongodb__aggregatemcp__mongodb__db-statsI will NEVER execute write operations without your explicit approval.
Before any write or destructive operation via MCP, I will: (1) summarize the exact operation (collection, index/validator, estimated number of docs affected), and (2) ask for explicit confirmation (yes/no). I will not proceed on partial or ambiguous approvals.
| Operation Type | MCP Tools | Action |
|---|---|---|
| Read (Safe) | find, aggregate, collection-schema, db-stats, count | I may run automatically to verify |
| Write (Requires Approval) | update-many, insert-many, create-collection | I will show the command and wait for your "yes" |
| Destructive (Requires Approval) | delete-many, drop-collection, drop-database | I will warn you and require explicit confirmation |
When I recommend schema changes or data modifications:
Your database, your decision. I'm here to advise, not to act unilaterally.
If you're not sure about a recommendation:
We're a team—let's get this right together.
© mongodb, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 20 other files (references) in skills/mongodb-schema-design of mongodb/agent-skills.
Open the folder on GitHubat commit 18b014e
We found 6 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in mongodb/agent-skills, which our catalogue first saw on October 7, 2026.
Mongodb Schema Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Mongodb Schema Design this skillmongodb/agent-skills | 190 | 2 repos | ~3.4k | Automated safety check: Pass | Apache-2.0 | |
| Database FundamentalsDanielPodolsky/ownyourcode | 290 | 1 repos | ~1.6k | Automated safety check: Pass | MIT | |
| DB SculptorEliasOulkadi/shokunin | 114 | — | ~3.1k | Automated safety check: Notes | MIT | |
| Discover Databaserand/cc-polymath | 181 | — | ~2k | Automated safety check: Pass | MIT | |
| DatabasesMicrock/ordinary-claude-skills | 403 | — | ~1.9k | Automated safety check: Notes | MIT | |
| Rhctlsaidake/rhctl | 106 | — | ~4k | Automated safety check: Notes | Apache-2.0 |
DanielPodolsky/ownyourcode
Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.
EliasOulkadi/shokunin
Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…
rand/cc-polymath
Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.
Microck/ordinary-claude-skills
Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin).
saidake/rhctl
Run and author rhctl CLI workflows and remote environment scripts under scripts/ (PostgreSQL, JetStream, Docker, Redis, MongoDB, AWS LocalStack, execute/upload/patch).
cin12211/orca-q
Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.
mongodb/agent-skills
Help with MongoDB query optimization and indexing. An agent skill from mongodb/agent-skills.
mongodb/agent-skills
Review a proposed Agent Skill for structural validity and content quality before publishing.
mongodb/agent-skills
Guide users through configuring key MongoDB MCP server options.
mongodb/agent-skills
Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents.
mongodb/agent-skills
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language.
mongodb/agent-skills
Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions.
Categories
MongoDB schema design patterns and anti-patterns. An agent skill from mongodb/agent-skills. Mongodb Schema Design is an agent skill from mongodb/agent-skills, published by the product's own GitHub organization. MongoDB schema design patterns and anti-patterns.
Mongodb Schema Design fits situations like: designing data models; reviewing schemas; migrating from SQL; troubleshooting performance issues caused by schema problems.
Run `npx skills add mongodb/agent-skills --skill mongodb-schema-design -a claude-code`. Or copy the skill folder (skills/mongodb-schema-design in mongodb/agent-skills) into .claude/skills/mongodb-schema-design in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mongodb/agent-skills --skill mongodb-schema-design -a codex`. Or copy the skill folder (skills/mongodb-schema-design in mongodb/agent-skills) into .agents/skills/mongodb-schema-design in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mongodb/agent-skills --skill mongodb-schema-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mongodb-schema-design, .gemini/skills/mongodb-schema-design, .github/skills/mongodb-schema-design and .opencode/skills/mongodb-schema-design in your project.
SKILL.md names no scripts, command-line tools or credentials: Mongodb Schema Design is instructions for the agent only.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Mongodb Schema Design is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 27k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Mongodb Schema Design: Database Fundamentals (DanielPodolsky/ownyourcode, 290 stars), DB Sculptor (EliasOulkadi/shokunin, 114 stars), Discover Database (rand/cc-polymath, 181 stars) and Databases (Microck/ordinary-claude-skills, 403 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
mongodb (a GitHub organization, an official publisher) maintains it in mongodb/agent-skills, which has 190 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 7, 2026.
Source: mongodb/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.