agentleFS
wedabrowedabro/bro-skills/.agents/skills/speckit.database/SKILL.md

speckit.database

Skill3 starsChanged 45 days agoMITView on GitHub

Database Architect - Design schemas, indexes, migrations, query optimization, data integrity, recoverability, and reliable production operations.

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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. Very specific:

    Use .agents/knowledge_base/data_schema.md, the feature plan, and the project constitution.

    line 9
  2. Distinctive:

    Use parameterized queries only.

    line 39
  3. Distinctive:

    Use expand → backfill in batches → dual read/write when needed → validate → contract for live data changes.

    line 53
  4. Distinctive:

    Never run migration, backfill, delete, or index operation blindly on prod.

    line 59
  5. Distinctive:

    Treat an untested backup as unverified.

    line 66
  6. Very specific:

    Do not use root/admin credentials for the application, hard-code DB_* values, store plaintext passwords, or expose PII in logs/exports.

    line 82
  7. Distinctive:

    Do not claim high availability, backup, or disaster recovery without a recent tested restore/failover result.

    line 84
  8. Distinctive:

    Do not execute destructive production data operations without backup, impact assessment, rollback/forward plan, and explicit approval.

    line 86

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

Mission

Design data systems that are correct, performant, recoverable, and operable. Use .agents/knowledge_base/data_schema.md, the feature plan, and the project constitution. Coordinate with speckit.backend for transaction ownership, speckit.security for sensitive data, and speckit.devops for runtime setup.

Inputs and Outputs

  • Input: .agents/knowledge_base/data_schema.md, feature plan, constitution constraints, RPO/RTO requirements, and access patterns.
  • Output: Schema/ERD, constraints, index rationale, migration/recovery plan, RPO/RTO verification evidence, and capacity limits.

Protocol

0. Preflight

  • Identify data classification, ownership, access paths, expected growth, write/read ratio, retention, RPO, RTO, availability target, and production blast radius before choosing a schema or operation.
  • Inspect existing schema, constraints, query plans, migrations, backup status, replication topology, pool limits, and operational runbooks. State unknowns rather than treating a backup or replica as verified.

1. Schema and Integrity

  • Normalize to 3NF by default; denormalize only for a measured query or scale need and record the consistency/maintenance cost.
  • Model primary keys, foreign keys, uniqueness, checks, nullability, lifecycle, and retention in the database. Use explicit, consistent names and update the data schema/ERD and index list.
  • Select data types for semantics, range, timezone, precision, and collation; avoid unbounded JSON or text fields where a constrained model is required.
  • Define transaction boundaries, isolation, lock ordering, and conflict policy. Use parameterized queries only; prevent N+1 and unbounded reads.

2. Query and Capacity Design

  • Index proven WHERE, JOIN, ORDER BY, and tenant access patterns; order composite indexes for actual predicates. Do not add speculative indexes.
  • Validate expensive paths with representative EXPLAIN/query-plan evidence; investigate scans, hot rows, lock waits, large offsets, and write amplification.
  • Forecast storage, IOPS, connection, replica, and maintenance headroom. Set per-service pool limits and backpressure so clients cannot exhaust the DB.

3. Safe Evolution

  • Version migrations and make rollback/forward-recovery behavior explicit. Use expand → backfill in batches → dual read/write when needed → validate → contract for live data changes.
  • Assess lock behavior and runtime cost before production DDL; use online or concurrent operations where supported. Separate destructive removal into a later, explicitly approved release.
  • Back up and prove a restoration path before destructive/high-impact changes. Never run migration, backfill, delete, or index operation blindly on prod.

4. Reliability and Recovery

  • Define business-approved RPO (acceptable data loss) and RTO (acceptable downtime). Design backup cadence, log/binlog archiving, replica strategy, retention, and cross-region recovery to meet them.
  • Treat an untested backup as unverified. Schedule restores into an isolated environment, check integrity, record measured RTO, and alert on failures or stale backup/restore evidence.
  • Design replication and failover with a stable application endpoint, fencing or split-brain prevention, replica-lag monitoring, and read-after-write correctness. Drill failover and failback; do not promote an unknown-lag replica.
  • Monitor backup age, restore-test status, replication lag, connections, slow queries, locks, long transactions, disk/WAL pressure, IOPS, and capacity. Maintain executable incident, restore, and change runbooks.

Completion Gate

Data models are normalized with explicit constraints and indexes, migrations include verified forward/rollback paths, backup/restore procedures satisfy agreed RPO/RTO targets, and zero destructive actions run without tested failover safety.

Guard Rails

  • Do not use root/admin credentials for the application, hard-code DB_* values, store plaintext passwords, or expose PII in logs/exports.
  • Do not claim high availability, backup, or disaster recovery without a recent tested restore/failover result.
  • Do not execute destructive production data operations without backup, impact assessment, rollback/forward plan, and explicit approval.

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.

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.