post-impl-check-indexes
Skill12 starsChanged 8 days agoMITView on GitHub
Post-implementation check: database index audit — missing indexes on foreign keys and frequently filtered columns.
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adlc-scriptingSkill
- architect-assistantSkill
- big-prod-e2e-testSkill
- ceSkill
- changelogSkill
- check-fix-buildSkill
- db-state-updateSkill
- git-branchingSkill
- github-issuesSkill
- hook-debuggingSkill
- migrations-data-integritySkill
- morning-checkSkill
- nodejs-scriptSkill
- pocSkill
- post-impl-check-client-component-sizeSkill
- post-impl-check-cost-calc-no-autoSkill
- post-impl-check-kb-actualSkill
- post-impl-check-migrationsSkill
- post-impl-check-performance-no-autoSkill
- post-impl-check-security-no-autoSkill
- security-checkSkill
- server-e2e-testsSkill
- session-kb-suggestSkill
- sql-reviewSkill
- ui-componentsSkill
- update-install-instructionsSkill
- use-playwrightSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Default sort columns on list endpoints that always sort by the same field
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are performing a database index audit of the schema changes introduced by a task.
Task: $ARGUMENTS
Locate the changed files (skip if the caller already provided them): read the task's
impl-plan.md — glob docs/tasks/todo/$ARGUMENTS/impl-plan.md, fallback
docs/tasks/done/$ARGUMENTS/impl-plan.md. Task folders are named <YYYY-MM-DD>-<slug> and the
caller passes that whole folder name; if it was given only a partial id, widen to
docs/tasks/*/*$ARGUMENTS*/impl-plan.md. (Do not glob a bare directory such as
docs/tasks/todo/$ARGUMENTS/; the Glob tool only matches files, so a directory-only pattern
returns nothing even when the folder exists.) Read it for the created/modified files;
if no plan exists, use git diff --name-only HEAD~1 HEAD plus git status --short. Focus on:
- Migration files — in this repo,
server/drizzle/migrations/. Look forCREATE TABLE,ALTER TABLE,ADD COLUMN, existingCREATE INDEXstatements. - Entity/model/schema files — column definitions, relation decorators, foreign key fields.
- Repository/service files —
WHERE,ORDER BY,JOIN ONconditions referencing specific columns.
Audit categories
Foreign Key Columns Without Indexes
- Any foreign-key column (e.g.,
userId,repositoryId,sessionId) with no corresponding index in a migration - Note: PostgreSQL does NOT auto-create indexes on foreign keys (MySQL does)
Columns Used in WHERE Clauses Without Indexes
- Columns referenced in
WHEREconditions in repository queries that lack an index - Frequently queried filter columns (status, type, date ranges)
Columns Used in ORDER BY Without Indexes
ORDER BYcolumns lacking an index, especially combined with filtering (composite index may be needed)- Default sort columns on list endpoints that always sort by the same field
Composite Index Opportunities
- Columns always queried together in the same
WHEREclause — a composite index beats two separate ones - Columns appearing together in both
WHEREandORDER BY(covering index opportunity)
Redundant Indexes
- Indexes that are a prefix subset of an existing composite index; duplicate indexes on the same column
Severity and reporting
- HIGH: missing index on a foreign key or high-traffic filter column that will cause full table scans at scale
- MEDIUM: missing index on a frequent ORDER BY or secondary filter column; suboptimal separate indexes where a composite fits
- LOW: redundant/duplicate index adding write overhead; minor optimization on a low-traffic path
Report each finding as [SEVERITY] <file>:<line> — <description>, including the suggested index
DDL or decorator (e.g. CREATE INDEX idx_logs_session_id ON logs(session_id);), then a one-line
count summary. If none: No index issues found.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

