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.
npx skills add hamzabellouch/agent-skills --skill mongodb-schema-and-indexinggit clone --depth 1 https://github.com/hamzabellouch/agent-skillsWrote 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.
[](https://agentmods.dev/skills/hamzabellouch/agent-skills/mongodb-schema-and-indexing)<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/mongodb-schema-and-indexing"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/mongodb-schema-and-indexing/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.
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/mongodb-schema-and-indexing"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/mongodb-schema-and-indexing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00054 | $0.01510 |
| Opus 5.5 | $0.00022 | $0.00604 |
| Sonnet 5.5 | $0.00011 | $0.00302 |
| Haiku 4.5 | $0.00005 | $0.00151 |
Grade A, and why
mongodb-schema-and-indexing 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MongoDB Schema Design & Indexing Optimization Guide
Comprehensive architectural reference for MongoDB schema modeling, high-performance indexing, aggregation pipeline tuning, and cluster sharding strategies.
1. Schema Modeling Framework: Embedding vs. Referencing
Decision Matrix
Do entities have a 1:1 or 1:Few relationship?
/ \
YES NO
/ \
Embed data inside parent document Do child documents grow unbounded?
/ \
YES NO
/ \
Use Two-Way Referencing Embed with Subset Pattern
| Factor | Embedded Subdocuments | Referenced Documents (Normalized) |
|---|---|---|
| Query Performance | Fast ($O(1)$ single read, no joins) | Requires $lookup or application-side joins |
| Atomicity | Atomic updates across whole document | Requires Multi-Document Transactions (session) |
| Document Size Limit | Subject to 16 MB BSON hard limit | Multi-document architecture bypasses limit |
| Data Redundancy | Possible duplication across documents | Single source of truth |
2. Advanced MongoDB Design Patterns
2.1 Subset Pattern
- Problem: Large embedded array (e.g., 5,000 product reviews) causes huge document size and slow memory loading.
- Solution: Keep only the 10 most recent reviews in the main product document; store all historical reviews in a separate
reviewscollection.
2.2 Extended Reference Pattern
- Problem: Frequent joins (
$lookup) just to fetch 1 or 2 fields (e.g.,customerNameandcustomerEmailon anOrder). - Solution: Copy immutable or rarely changed target fields directly into the order document:
{ "_id": ObjectId("6697a4..."), "totalAmount": 149.99, "customer": { "id": ObjectId("6697a2..."), "name": "Jane Doe", "email": "[email protected]" } }
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.
- 1mo ago First seen · 165 lines · 54 tokens per session scan A bc3b74db6a4a
mongodb-schema-and-indexing is a skill published in the GitHub repository hamzabellouch/agent-skills (8 stars, last pushed 11d ago), licensed MIT. It adds 54 tokens to every session and 1,510 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
mongodb
Expert MongoDB document database assistance covering aggregation pipelines, compound indexes, replica sets, and sharding. Use when designing flexible JSON schemas, querying geospatial data, or scaling document stores.
mongodb-connection
Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill when working/updating/reviewing on functions that instantiate or configure a MongoDB client (eg, when calling connect()), configuring connection pools, troubleshooting connection errors…
mongodb-schema-design
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…
mongodb-query-optimizer
Help with MongoDB query optimization and indexing. Use only when the user asks for optimization or performance: "How do I optimize this query?", "How do I index this?", "Why is this query slow?", "Can you fix my slow queries?", "What are the slow queries on my cluster?", etc. Do not invoke for general MongoDB query…
mongodb-search-and-ai
Covers everything about search in MongoDB: Atlas Search (full-text), Vector Search (semantic), and Hybrid Search. Use this skill for ANY question about MongoDB search, including open-ended and explanatory ones asked before the user has any data or use case — 'how does search work in MongoDB?', 'I'm new to MongoDB…
qdrant-migration-tool
Guides use of the Qdrant Migration Tool CLI to move vectors, metadata, and sparse embeddings from another vector database into Qdrant. Use when someone asks 'how do I migrate from Pinecone/Weaviate/Milvus/Elasticsearch/OpenSearch/pgvector/s3/Azure/Chroma/Redis/MongoDB/FAISS/Solr to Qdrant', 'move my vector database to…