query-optimization
Skill0 starsChanged 8 months agoMITView on GitHub
Analyze slow or expensive queries and recommend indexing, shape, and access-path improvements before performance issues harden into the design.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
- novatic-cu/nova-skillstheir own version, first seen Sep 20, 2026
- VersoXBT/claude-initial-setuptheir own version, first seen Mar 9, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- nahid-sparktales/agent-dispatcher★ 59same name
- VersoXBT/claude-initial-setup★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- novatic-cu/nova-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codex/AGENTS.mdAGENTS.md
- claude/CLAUDE.mdCLAUDE.md
- backend-refactorSkill
- buildSkill
- discussSkill
- docSkill
- frontend-designSkill
- frontend-refactorSkill
- low-altitude-interviewerSkill
- pdfSkill
- repo-bootstrapSkill
- skill-maintenanceSkill
- tdd-executionSkill
- architecture-guardrailsSkill
- closed-loop-testingSkill
- harness-marathonSkill
- task-harnessSkill
- api-designSkill
- architecture-designSkill
- brainstormSkill
- codex-record-retrospectiveSkill
- database-designSkill
- integration-designSkill
- map-codebaseSkill
- migration-designSkill
- observability-designSkill
- planSkill
- scalability-checkSkill
- service-boundary-reviewSkill
- api-change-checkSkill
- browseSkill
- bugfix-verificationSkill
- debugSkill
- incident-debugSkill
- performance-investigationSkill
- qaSkill
- reviewSkill
- security-reviewSkill
- verifySkill
- release-checkSkill
- shipSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
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 8
Use this skill when the problem is query latency, scan cost, N+1 access, pagination inefficiency, or uncertainty about the right index or …
- Distinctive: line 22
avoid local optimizations that hurt write cost or correctness
- Distinctive: line 33
Check for obvious waste:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Query Optimization
Use this skill when the problem is query latency, scan cost, N+1 access, pagination inefficiency, or uncertainty about the right index or access path.
Read First
- query code and ORM usage
- explain plans, logs, or observed latency evidence
- table sizes and expected growth
harness/state.mdif it existsharness/history.mdif it exists
Goals
- optimize based on evidence instead of folklore
- match indexes to real filters, joins, and sort paths
- separate query-shape fixes from schema fixes
- avoid local optimizations that hurt write cost or correctness
Steps
- Restate the slow path and its evidence.
- Identify the exact query shape:
- filters
- joins
- ordering
- pagination
- selected columns
- Check for obvious waste:
- N+1 access
- wide selects
- missing limits
- unbounded scans
- Compare improvement options:
- query rewrite
- index change
- denormalization or cache
- Estimate the write, storage, and maintenance cost of the optimization.
- Recommend the smallest evidence-backed improvement first.
Output
Report:
- slow path summary
- query shape
- evidence used
- recommended optimization
- cost or trade-off
- verification plan
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.

