skills/index-advisor/SKILL.md
Analyzes existing queries and schema to detect missing indexes. Suggests covering and composite indexes to optimize slow queries.
npx skillsauth add fatih-developer/fth-skills index-advisorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill focuses on making database reads remarkably fast while minimizing write amplification and storage bloat. It recommends standard, composite, partial, and covering indexes based on actual or predicted query workload.
Core principle: Indexes are not free. Every index accelerates reads but slows down writes, inserts, and consumes disk space.
schema-architect.EXPLAIN or read actual index usage statistics if the user explicitly requests it.For Composite Indexes, always apply the rule of Equality, Sort, Range:
= or IN.ORDER BY.>, <, or BETWEEN.Example Query:
SELECT * FROM orders WHERE tenant_id = 5 AND status = 'active' ORDER BY created_at DESC LIMIT 10
Recommended Optimal Index: (tenant_id, status, created_at DESC)
Select the correct index type according to the target database engine:
WHERE status = 'pending').Optimization isn't just about adding new indexes. Identify candidates for removal:
(A) is entirely redundant and should be dropped if you just created an index on (A, B).Required Outputs (Must write BOTH to docs/database-report/):
docs/database-report/index-advisor-report.md)### 🚀 Index Optimization Report
- **Query Addressed:** [Identify specific SQL query]
- **Applied Rule:** Equality, Sort, Range match.
- **Expected Impact:** Prevention of sequential scan of 1M rows.
#### 🌟 REQUIRED FIX
```sql
CREATE INDEX CONCURRENTLY idx_orders_tenant_status_date
ON orders (tenant_id, status, created_at DESC);
DROP INDEX CONCURRENTLY idx_orders_tenant;
2. **Machine-Readable JSON (`docs/database-report/index-advisor-output.json`)**
```json
{
"skill": "index-advisor",
"recommended_indexes": [
{"table": "orders", "columns": ["tenant_id", "status", "created_at"], "type": "B-Tree", "action": "CREATE"}
],
"redundant_indexes": [
{"table": "orders", "index_name": "idx_orders_tenant", "action": "DROP"}
]
}
CREATE INDEX CONCURRENTLY in PostgreSQL to avoid locking the table taking down production operations.(is_active) without a partial clause is an anti-pattern.tools
Create, optimize, critique, and structure prompts for AI systems. Use this skill whenever the user is designing or improving a prompt, system prompt, coding prompt, image prompt, evaluation rubric, agent prompt, workflow prompt, or MCP-oriented prompt package. Also use it when the user asks to turn vague AI behavior into a precise instruction set, tool policy, agent spec, or prompt architecture.
testing
Assumption-first architecture review skill to stress-test project plans and expose hidden risks.
testing
Enforce and manage DESIGN.md specifications, extract design systems from URLs, and combine design reasoning with token roles to prevent drift.
testing
Forces the agent to act with a Claude-like product mindset, prioritizing user journey, UX states, and visual quality before coding.