agentleFS
caiaffacaiaffa/claude-code-ultimate-engineering-system/skills/database-engineering/SKILL.md

database-engineering

Skill17 starsChanged 58 days agoMITView on GitHub

Design and review Postgres schema, queries, migrations, and access paths — correctness, performance, indexing, and migration safety. Covers SQL engineering and Postgres performance/safety.

5 other projects use a version of this.

Adopted by

Most recently taken up by

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

    Every query that filters or joins must have a supporting index — verify with EXPLAIN.

    line 19
  2. Distinctive:

    No N+1: batch or join instead of per-row queries.

    line 20
  3. Distinctive:

    Every migration must have a tested rollback or be explicitly marked irreversible.

    line 30

“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.

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

Mission

Produce data access that is correct, performant under real load, and safe to migrate without downtime.

When to use

  • Writing or reviewing queries, schema, or migrations.
  • Diagnosing slow queries or lock contention.

Handoff

  • Receives from: backend-platform-engineer or architecture-decisions.
  • Hands off to: backend-platform-engineer (implement), reliability-engineer (production impact).

Query & schema

  • Every query that filters or joins must have a supporting index — verify with EXPLAIN.
  • No N+1: batch or join instead of per-row queries.
  • Select only needed columns; avoid SELECT *.
  • Constraints (NOT NULL, FK, UNIQUE) belong in the schema, not just app code.
  • Beware unbounded result sets — paginate.

Migration safety (zero-downtime)

  • Adding a column: nullable or with a default that doesn't rewrite the table.
  • Adding an index: CREATE INDEX CONCURRENTLY.
  • Dropping/renaming: multi-step — deploy code that tolerates both states first.
  • Backfills: batched, throttled, resumable — never one giant UPDATE.
  • Every migration must have a tested rollback or be explicitly marked irreversible.

Performance & safety

  • Long transactions hold locks — keep them short.
  • Know the lock level of each DDL statement.
  • Connection pool sized to the database, not the app instance count.
  • Statement timeout set so a runaway query can't pin the DB.

Red flags

  • Migration that rewrites a large table in one statement.
  • Query with no index and no row-count bound.
  • CREATE INDEX without CONCURRENTLY on a live table.

Output

Notes covering: index plan (with EXPLAIN evidence), migration steps + rollback, lock impact, expected behavior at production row counts.

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.