agentleFS
metacircu1armetacircu1ar/hive_skills/skills/audit/audit-database-performance/SKILL.md

audit-database-performance

Skill4 starsChanged 2 months agoMITView on GitHub

Audit database-backed application code for missing indexes, unbounded result sets, missing pagination, expensive joins, and connection pool risks. Use when reviewing list endpoints, filtered queries, joins, migrations, ORM code, production readiness, or scaling risks before launch.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is 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.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every frequently filtered, joined, ordered, or foreign-key column should be covered by a suitable index.

    line 17
  2. Very specific:

    Search and admin views should avoid unbounded all, find_many, SELECT *, broad preloads, and full-table exports in request handlers.

    line 22

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

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

Audit Database Performance

Find database access patterns that work at small scale but become slow or unstable under ordinary production traffic.

Workflow

  1. Identify database technology and access patterns:
    • ORM, query builder, raw SQL, migrations, schemas, indexes, connection settings, and pooling.
  2. Inventory high-risk queries:
    • List endpoints, search endpoints, exports, dashboards, joins, filtered queries, sorted queries, background jobs, and admin reports.
  3. Check indexes:
    • Every frequently filtered, joined, ordered, or foreign-key column should be covered by a suitable index.
    • Composite indexes should match common query shapes and ordering.
    • Flag indexes that are missing for obvious production paths; avoid speculative index spam.
  4. Check result bounds:
    • List endpoints should paginate or enforce limits.
    • Search and admin views should avoid unbounded all, find_many, SELECT *, broad preloads, and full-table exports in request handlers.
    • Background jobs should batch large data sets.
  5. Check connection resilience:
    • Production pool size and timeout settings exist.
    • App worker count, job workers, and database max connections are plausibly coordinated.
    • Serverless apps avoid opening unbounded direct database connections when a pooler is required.

Useful Searches

For each issue, connect the query to a route or job and the migration/schema that lacks the supporting index or limit. When possible, include the exact filter/join/order columns.

Useful search terms include where, join, order, preload, include, limit, offset, cursor, paginate, all, findMany, SELECT, index, references, foreign_key, pool, and DATABASE_URL.

Output

Group findings by severity:

  • Critical: unbounded request path likely to time out or exhaust memory.
  • High: missing index on common production query or join.
  • Medium: weak pagination, inefficient preload/include, pool config risk.
  • Low: cleanup or documentation issue.

Each finding must include file and line, query shape, why it scales poorly, suggested migration/code fix, and the test or instrumentation that would confirm the improvement.

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.