01
It starts by itself
weekly slow query review. Runs in Claude Code routine.
- ↻ weekly slow query review
0 7 * * 1
Suggest indexes for slow queries.
Install the MongoDB Query Optimizer skill and make it a habit: follow https://gethabit.dev/skills/mongodb/mongodb-query-optimizer.md
7K installs190 starsApache-2.0 licenceSource on GitHub ↗

MongoDB Query Optimizer
by mongodb · 7K installs
The skill
The mongodb query optimizer skill helps agents find why MongoDB queries are slow and suggest indexes, using explain, collection indexes and Atlas Performance Advisor through MongoDB MCP.
Only when you ask.
The habit
Suggest indexes for slow queries.
↻ Runs by itselfweekly slow query review
When does it start? How does it check its work? What does it remember?
Stops after the 5 slowest queries per run.
Your agent reads references/core-indexing-principles.md and references/antipattern-examples.md.
It calls atlas-list-projects, then atlas-get-performance-advisor with slowQueryLogs and suggestedIndexes.
For the slowest and most frequent, it calls collection-indexes, explain and find.
It compares documents scanned with documents returned and looks for in-memory sorts.
It suggests the highest-impact indexes with short reasons, as suggestions.
It creates an index only after you approve.
It writes only in its own folder and asks you before anything goes out.
Read both lists. If the left one sounds like you, the MongoDB Query Optimizer skill helps.
It suggests removal only when Atlas Performance Advisor recommends it.
General analysis needs Atlas MCP credentials. Without them it suggests indexes from query shape only.
Copy the prompt at the top into your agent. It installs the skill from mongodb/agent-skills and sets up the habit. Or run npx skills add mongodb/agent-skills --skill mongodb-query-optimizer.
Yes. It is published under Apache-2.0. Habit is free too.
Install the MongoDB Query Optimizer skill and make it a habit: follow https://gethabit.dev/skills/mongodb/mongodb-query-optimizer.md
All mongodb skills →More ops skills →
Works in
Made by mongodb, published under Apache-2.0. Habit links to the original and never changes it. Is this your skill?