/db-optimize
Diagnose slow queries or data-access code with real execution plans, find root causes (N+1, unusable indexes, offset pagination, over-fetching), and propose ranked fixes with measurement plans. Does not apply schema changes.
What it does
Diagnose slow queries or data-access code with real execution plans, find root causes (N+1, unusable indexes, offset pagination, over-fetching), and propose ranked fixes with measurement plans. Does not apply schema changes.
- Category
- databaseperformance
- Platforms
- backend
- Frameworks and tools
- postgresql
- Capabilities
- databaseperformancereview
Example tasks
- /db-optimize SELECT * FROM orders WHERE user_id = $1 ORDER BY created_at DESC
- /db-optimize the /orders endpoint takes 4s
- /db-optimize slow-query-log.txt
Works with
Requires (installed automatically)
Recommended alongside
Permissions summary
Files
Reads files only
Shell
Runs a limited set of commands
Network
No network
Permissions are declared in the component manifest and compiled into each client's tool list. Components are built for least privilege.
Supported environments
| Client | Support | Installed as |
|---|---|---|
| Claude Code | Native | .claude/commands/<id>.md |
| OpenAI Codex | Adapter | .codex/prompts/<id>.md |
| Cursor | Native | .cursor/commands/<id>.md |
| VS Code (Copilot) | Native | .github/prompts/<id>.prompt.md |
| Generic markdown | Adapter | docs/forgekit/commands/<id>.md |
Claude Code is the native reference. Other clients use adapters, so behaviour is close but not identical. See the compatibility matrix.
Included in packs
What is inside
This is a premium component, so its prompt is delivered only through signed downloads to licensed accounts. Here is the outline of its sections (18 lines in total).
- 01Output format
Version and changelog
Latest version 1.0.0. Requires DevBuildKit CLI 1.0.0 or newer.
Changelog — /db-optimize
1.0.0
- Initial release.