Tencent's skill-evolution harness: it rewrites a whole skill folder — SKILL.md, scripts and references together — and lands every decision as a real Git issue, PR and wiki entry you can review.
MongoDB Schema Design
Summary
MongoDB's official data-modelling skill — embed-vs-reference decisions, relationship patterns and the anti-patterns that quietly wreck performance and cost.
Features
- Decides embed vs reference from access patterns rather than habit
- Flags the three headline anti-patterns: unnecessary collections, excessive $lookup, unused indexes
- Covers one-to-many, many-to-many, polymorphic, tree and bucketing patterns
- Handles the 16MB document limit, unbounded arrays and index explosion
- Adds JSON Schema validation to existing collections safely
- Includes time-series, TTL, archiving and schema-migration guidance
Install This Skill
Add this skill to your favorite AI agent in a few steps.
Skill Content
Usage Instructions
Learn how to use this skill with different AI agents.
Example Usage
"We're porting an orders table with a line_items child table out of Postgres. Should line items be embedded in the order document, and what breaks if an order can have 5,000 of them?"
Description
An official MongoDB agent skill covering the part of MongoDB work that indexes cannot rescue you from. As the skill puts it: bad schema is the root cause of most MongoDB performance and cost problems, and queries and indexes cannot fix a fundamentally wrong model. It gives an agent MongoDB's own modelling guidance instead of the half-remembered relational habits that produce over-normalised collections and $lookup-heavy read paths.
When it fires
Designing a schema from scratch, migrating off a relational database, reviewing an existing model for performance problems, deciding between embedding and referencing, modelling one-to-one / one-to-many / many-to-many relationships, building tree or hierarchical structures, hitting the 16 MB document ceiling, or reacting to an Atlas Schema Suggestion or Performance Advisor warning.
What is inside
The skill is organised as a quick-reference index into a set of focused reference documents, so the agent loads only the rule it needs:
- Anti-patterns — unnecessary collections (splitting homogeneous data across many collections), excessive
$lookupfrom over-normalisation, and unnecessary or overlapping indexes. - Relationship patterns — embed versus reference, one-to-many strategies, and the extended-reference and subset patterns for read-heavy access.
- Structural patterns — polymorphic documents, document versioning, tree and hierarchy models, bucketing and the approximation pattern.
- Lifecycle — time-series collections, TTL indexes, archiving and schema migration paths.
- Validation — adding JSON Schema validation to existing collections without breaking writers.
Installing it
Apache-2.0, version 1.0.0, maintained by MongoDB in the mongodb/agent-skills repository. Install the whole set with npx skills add mongodb/agent-skills, install the mongodb-atlas plugin from the Claude, Cursor, Codex, Copilot or Grok marketplaces (which bundles the skills alongside the MongoDB-hosted Atlas MCP server over OAuth), or copy the single skill folder into your agent's skills directory.
Related Skills
Take an OpenSearch search application from requirements to a running cluster — BM25, dense and sparse vectors, hybrid retrieval, agentic search and RAG, with relevance evaluation built in.
Auth0's official agent skill: a router that detects your framework and intent, then loads the right Auth0 guidance for login, MFA, Organizations, tenant audits, debugging or provider migration.
Redis' own guidance for FT.CREATE schema design, FT.SEARCH / FT.AGGREGATE / FT.HYBRID, HNSW vector similarity and RAG retrieval pipelines.