query-optimization
Skill0 starsChanged 7 months agoMITView on GitHub
Analyze slow or expensive queries and recommend indexing, shape, and access-path improvements before performance issues harden into the design.
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 6 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 6 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
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- duyet/clickhouse-monitoring★ 303same name
- nahid-sparktales/agent-dispatcher★ 59same name
- Indium-AI-Labs/indium-agentkit★ 18same name
- Ionate-Technologies/indium-agentkit★ 17same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- novatic-cu/nova-skills★ 1same name
- Abdox-menara/guard-skills★ 0same name
- jars-demo/jars-skills★ 0same 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.
Used alongsideProjects with it also use background-jobs and product-analytics.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
YepAPISkillbackground-jobs
Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.
Also in 3 projects that use this
SkeneTechnologiesSkillproduct-analytics
When the user wants to set up product analytics -- including event taxonomy, tracking plans, funnel analysis, or tool selection (Mixpanel, Amplitude, PostHog). Also use when the user says "event tracking," "analytics setup," "tracking plan," "analytics implementation," or "user identification." For PLG metrics, see plg-metrics. For experimentation, see growth-experimentation.
Also in 3 projects that use this
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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

