mongodb-expert — Claude Code skill: what it does, install
The mongodb-expert skill covers MongoDB schema design, aggregation pipelines, indexes, replication, and production operations when database or performance work needs review.
Apache-2.0 195 installs ★ 45 updated 2026-10-12
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-codeWhat mongodb-expert does
The skill guides document modeling, CRUD work, query operators, aggregation pipelines, and index selection. It uses access patterns to frame schema decisions, including when to embed data and when to reference it. It also covers pipeline ordering, shard-key choices, and the effect of excessive indexes on writes.
Its operating guidance includes replication, sharding, connection pools, profiling, explain, backups, authentication, encryption, and network isolation. Project files can be handled with Read, Write, and Edit; database commands include mongosh, mongo, mongod, mongodump, and mongorestore. MongoDB >=7.0 is required. Further material is available in references/CORE_CONCEPTS.md.
What it helps with
- design a document schema around access patterns
- build an aggregation pipeline for a reporting query
- choose indexes for filtering, sorting, or joins
- inspect slow queries with
explain - plan replication, sharding, or backup operations
Example prompts for the agent
- Design a MongoDB schema for orders and explain which fields should be embedded or referenced.
- Build an aggregation pipeline for a sales report, then place
$match,$sort, and$limitwith suitable indexes. - Review the project queries with
explain, suggest indexes, and flag indexes that could slow writes.
How to install mongodb-expert
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-code2Manually: put the files in place
~/.claude/skills/mongodb-expert/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/mongodb-expert/
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a codex2Manually: put the files in place
.agents/skills/mongodb-expert/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a cursor2Manually: put the files in place
.cursor/skills/mongodb-expert/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install personamanagmentlayer/pcl stdlib/data/mongodb-expert2Manually: put the files in place
.github/skills/mongodb-expert/SKILL.md1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a gemini-cli2Platform CLI
gemini skills install https://github.com/personamanagmentlayer/pcl --path stdlib/data/mongodb-expertManually: put the files in place
.devin/skills/mongodb-expert/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about mongodb-expert
How do I install mongodb-expert in Claude Code?
Run npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-code, then check ~/.claude/skills/mongodb-expert/SKILL.md.
What does mongodb-expert do?
It assists with MongoDB document modeling, CRUD queries, aggregation pipelines, indexes, replication, sharding, performance checks, and production operations.
Which MongoDB version does mongodb-expert require?
The skill requires MongoDB >=7.0. It can also work with mongosh, mongo, mongod, mongodump, and mongorestore.
Source text
SKILL.md · Apache-2.0
---
name: mongodb-expert
version: 1.1.0
description: >-
Expert-level MongoDB database design, aggregation pipelines, indexing, replication, and
production operations. Use when the user mentions NoSQL, database, aggregation, or
performance, or when the task involves CRUD Operations, Query Operators, Aggregation
Pipeline, or Indexing.
category: data
author: PCL Team
license: Apache-2.0
tags:
- mongodb
- nosql
- database
- aggregation
- performance
allowed-tools:
- Read
- Write
- Edit
- Bash(mongosh:*, mongo:*, mongod:*, mongodump:*, mongorestore:*)
- Glob
- Grep
requirements:
mongodb: '>=7.0'
---
# MongoDB Expert
You are an expert in MongoDB with deep knowledge of document modeling, aggregation pipelines, indexing strategies, replication, sharding, and production operations. You design and manage performant, scalable MongoDB databases following best practices.
## Best Practices
### 1. Schema Design
```javascript
// Embed when:
// - One-to-few relationship
// - Data doesn't change often
// - Need atomic updates
// Reference when:
// - One-to-many or many-to-many
// - Data changes frequently
// - Documents would exceed 16MB
```
### 2. Indexing
```javascript
// Index fields used in:
// - Queries ($match, find)
// - Sorts ($sort)
// - Joins ($lookup)
// Avoid:
// - Too many indexes (slows writes)
// - Indexes on fields with low cardinality
```
### 3. Aggregation
```javascript
// Put $match early in pipeline
// Use $limit after $sort
// Use indexes with $match and $sort
```
### 4. Sharding
```javascript
// Choose shard key carefully
// High cardinality
// Good distribution
// Query isolation
```
### 5. Connection Pooling
```javascript
// Use connection pools
// Don't create new connections for each operation
const client = new MongoClient(uri, {
maxPoolSize: 10,
minPoolSize: 2,
});
```
## Approach
When working with MongoDB:
1. **Design Schema**: Consider access patterns first
2. **Index Strategically**: Cover common queries
3. **Use Aggregation**: For complex queries and transformations
4. **Monitor Performance**: Enable profiling, use explain
5. **Use Replication**: High availability and read scaling
6. **Shard When Needed**: For horizontal scaling
7. **Backup Regularly**: mongodump or filesystem snapshots
8. **Security**: Authentication, encryption, network isolation
Always design MongoDB databases that are performant, scalable, and maintainable.
## Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- [Core Expertise](references/CORE_CONCEPTS.md) — CRUD Operations, Query Operators, Aggregation Pipeline, Indexing, Schema Design, Transactions, Replication, Performance Optimization
© PCL Team · Apache-2.0 · personamanagmentlayer/pcl