mongodb-expert — скилл для Claude Code: установка
Скилл mongodb-expert помогает проектировать MongoDB, писать aggregation pipelines, подбирать индексы и разбирать вопросы репликации и production-операций.
Apache-2.0 195 установок ★ 45 обновлён 2026-10-12
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-codeЧто делает mongodb-expert
Скилл разбирает CRUD-операции, операторы запросов, схемы документов, aggregation pipelines и стратегии индексации. Он помогает выбрать между встраиванием и ссылками, учитывать шаблоны доступа, порядок стадий $match и $sort, а также ограничения документов размером 16MB.
Внутри есть рекомендации по репликации, шардированию, connection pooling, профилированию, explain, резервному копированию и безопасности. Для работы с базой доступны mongosh, mongo, mongod, mongodump и mongorestore, а файлы проекта можно читать и менять через Read, Write и Edit. Скиллу нужен MongoDB >=7.0. Подробные материалы хранятся в references/CORE_CONCEPTS.md.
Какие задачи решает
- спроектировать схему документов под шаблоны доступа
- собрать aggregation pipeline для сложного запроса
- подобрать индексы для фильтрации и сортировки
- проверить причины медленных запросов через
explain - подготовить репликацию, шардирование или резервное копирование
Примеры запросов агенту
- Спроектируй схему MongoDB для заказов и объясни, что лучше встроить, а что вынести в отдельную коллекцию.
- Собери aggregation pipeline для отчёта по продажам и расставь
$match,$sortи$limitс учётом индексов. - Проверь запросы в проекте через
explain, предложи индексы и укажи, какие из них могут замедлить запись.
Как установить mongodb-expert
1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-code2Вручную: положить файлы
~/.claude/skills/mongodb-expert/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/mongodb-expert/
1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a codex2Вручную: положить файлы
.agents/skills/mongodb-expert/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a cursor2Вручную: положить файлы
.cursor/skills/mongodb-expert/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install personamanagmentlayer/pcl stdlib/data/mongodb-expert2Вручную: положить файлы
.github/skills/mongodb-expert/SKILL.md1Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a gemini-cli2Командой платформы
gemini skills install https://github.com/personamanagmentlayer/pcl --path stdlib/data/mongodb-expertВручную: положить файлы
.devin/skills/mongodb-expert/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о mongodb-expert
Как установить mongodb-expert в Claude Code?
Выполните npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-code, затем проверьте файл ~/.claude/skills/mongodb-expert/SKILL.md.
Что делает mongodb-expert?
Скилл помогает проектировать MongoDB, строить aggregation pipelines, выбирать индексы и разбирать репликацию, шардирование, производительность и production-операции.
Какая версия MongoDB нужна для mongodb-expert?
Для работы скилла требуется MongoDB >=7.0. Он также умеет работать с командами mongosh, mongo, mongod, mongodump и mongorestore.
Исходный текст
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