agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-postgresql/SKILL.md

senior-postgresql

Skill2 starsChanged 5 days agoMITView on GitHub

Use when designing, reviewing, tuning, migrating, securing, or troubleshooting PostgreSQL schemas, SQL, indexes, EXPLAIN plans, transactions, locks, JSONB, replication, backups, or database operations.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use parameterized SQL, correct types, declarative constraints, set-based operations, and clear ownership.

    line 16
  2. Very specific:

    Use EXPLAIN (ANALYZE, BUFFERS) on safe representative workloads to establish a baseline and validate a change.

    line 17
  3. Very specific:

    Avoid SELECT *, implicit casts, non-indexable predicates, N+1 access, accidental Cartesian joins, unbounded reads, unsafe dynamic SQL, and …

    line 23
  4. Distinctive:

    Use the least privilege roles, row-level security only with a reviewed policy model, and no credentials or sensitive data in logs or …

    line 25
  5. Distinctive:

    Do not change backup, restore, replication, retention, or production data without explicit authorization.

    line 26
  6. Distinctive:

    Verify functional semantics, constraints, permissions, concurrent writers/readers, migration forward/rollback, and performance evidence.

    line 30

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

Senior PostgreSQL

Role

Deliver PostgreSQL changes that maintain data integrity, work under real concurrency, and are measured against representative workload rather than intuition.

Workflow

  1. Inspect schema, constraints, migrations, data scale, query callers, PostgreSQL version, extensions, autovacuum health, statistics, locks, and deployment process.
  2. Define the invariant, query shape, expected cardinality, isolation behavior, performance target, operational risk, and reversible path.
  3. Use parameterized SQL, correct types, declarative constraints, set-based operations, and clear ownership. Keep JSONB flexible only where schema variability is real and query/index behavior remains intentional.
  4. Use EXPLAIN (ANALYZE, BUFFERS) on safe representative workloads to establish a baseline and validate a change. Account for stale statistics, cache effects, selectivity, and write amplification.
  5. Design indexes deliberately: B-tree by default, partial or expression indexes only for proven predicates, GIN/GiST when data operators require them. Consider concurrent index creation and index maintenance cost.
  6. Make migration locks, table rewrites, backfills, transaction duration, replicas, and rollback explicit. Stage large operations to protect availability.

Query and Concurrency Rules

  • Avoid SELECT *, implicit casts, non-indexable predicates, N+1 access, accidental Cartesian joins, unbounded reads, unsafe dynamic SQL, and OFFSET pagination on deep large datasets without a reasoned trade-off.
  • Respect MVCC: long transactions can block vacuum and cause bloat; lock only what is necessary; design retries for serialization or deadlock failures where needed.
  • Use the least privilege roles, row-level security only with a reviewed policy model, and no credentials or sensitive data in logs or client-visible errors.
  • Do not change backup, restore, replication, retention, or production data without explicit authorization.

Verification

Verify functional semantics, constraints, permissions, concurrent writers/readers, migration forward/rollback, and performance evidence. State PostgreSQL version, workload assumptions, and any production-only uncertainty.

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.