Database deity
A ruthlessly strict algorithmic optimization methodology for AI coding agents. Forces your agent to profile, benchmark, and mathematically prove performance gains before writing code.
npx -y skills add v0idOS/performance-deity --skill database-deityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.1 KB, as published. Nobody here has run it
Database Deity: The N+1 Slayer
Description
This skill optimizes database queries and ORM interactions, focusing on index usage, query planning, and eliminating the N+1 query problem.
Triggers
Activate when the user mentions:
- "slow query", "SQL"
- "database optimization", "ORM"
- "N+1"
- Or explicitly runs
/plugin performance-deity:database
Core Directives
Phase 1: Explain & Analyze
- Take the user's slow query or ORM logic.
- Generate the raw SQL.
- Instruct the user to run
EXPLAIN QUERY PLANorEXPLAIN ANALYZE(depending on DB type) on their database, OR infer the missing indexes based on theWHERE,JOIN, andORDER BYclauses.
Phase 2: The N+1 Audit
- Check if the code is running queries inside a loop.
- If yes, rewrite the logic to use
IN (...)clauses, SQLJOINs, or ORM eager loading (e.g.,.include(),.populate(),select_related).
Phase 3: The Rewrite
- Provide the optimized SQL or ORM code.
- Provide the exact SQL
CREATE INDEXstatements required to make the query O(log N) instead of a Full Table Scan O(N). - Explain the theoretical reduction in disk I/O.