agentleFS
v0idOSv0idOS/performance-deity/skills/database/SKILL.md

database

Skill2 starsChanged 7 months agoMITView on GitHub

Diagnose and fix slow database queries. Runs EXPLAIN ANALYZE, identifies missing indexes, eliminates N+1 ORM patterns, and provides exact CREATE INDEX statements.

24 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use payment, monitoring and 10 more.

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.
  • lightpointventuresSkill

    payment

    当用户想加支付、收款、集成 Stripe、做订阅付费时使用 — 集成支付系统,支持一次性和订阅

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    monitoring

    Claude monitoring and usage tracking tools (UV, claude-monitor, claude-usage-cli). Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `monitoring` work when listed in TEAM.yaml or explicitly requested.

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    i18n

    Internationalization and localization

    Also in 3 projects that use this

  • OpenAISkill

    email

    Email sending integration guidance — Resend (native Vercel Marketplace) with React Email templates. Covers API setup, transactional emails, domain verification, and template patterns. Use when sending emails from a Vercel-deployed application.

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 2

    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
  1. Distinctive:

    Check whether queries are issued inside a loop.

    line 15
  2. Distinctive:

    Before/after query plan summary:

    line 29

“Common” is measured: kept by at least 6 in 10 of the 16 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Execute all three phases in order.

Phase 1 — Analysis

  1. Take the slow query or ORM code.
  2. Generate the equivalent raw SQL.
  3. Either instruct the user to run EXPLAIN QUERY PLAN (SQLite) or EXPLAIN ANALYZE (Postgres/MySQL), or infer missing indexes directly from the WHERE, JOIN, and ORDER BY clauses.

Phase 2 — N+1 Audit

Check whether queries are issued inside a loop. If yes, rewrite using:

  • IN (...) batch clause
  • SQL JOIN
  • ORM eager loading:
    • .include() — Prisma
    • .populate() — Mongoose
    • select_related() / prefetch_related() — Django

Phase 3 — Rewrite

  1. Provide the optimized SQL or ORM code.
  2. Provide the exact CREATE INDEX statements required.
  3. Explain the disk I/O reduction: Full Table Scan O(N) → Index Lookup O(log N).

Before/after query plan summary:

MetricBeforeAfter
Scan typeFull Table ScanIndex Lookup
ComplexityO(N)O(log N)
Query count (per page load)N+11

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.