agentleFS
ArcanEdge-AIArcanEdge-AI/coding-agent-playbook-claude-code/skills/production-database-integrity/SKILL.md

production-database-integrity

Skill0 starsChanged 4 months agoMITView on GitHub

Review database schema, migrations, constraints, indexes, transactions, rollback safety, data integrity, retention, soft deletes, seed data, PII handling, and persistence-layer risks during a production-readiness pass. Use when reducing data loss, migration, consistency, or rollback risk before release.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    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:

    Do not create destructive migrations without explicit approval.

    line 47
  2. Distinctive:

    Do not drop columns, tables, indexes, or data unless explicitly approved.

    line 49
  3. Distinctive:

    Treat data loss risk as a Blocker.

    line 53
  4. Distinctive:

    Do not assume production data shape.

    line 81
  5. Distinctive:

    Do not run destructive commands.

    line 82
  6. Distinctive:

    Do not create migrations that cannot be rolled back or explained.

    line 83
  7. Distinctive:

    Do not hide data integrity risks as normal cleanup.

    line 84
  8. Distinctive:

    Prefer explicit constraints over implicit assumptions.

    line 85
  9. Distinctive:

    Do not expose PII in reports or logs.

    line 86

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

Production Database Integrity

Core purpose

Identify data integrity risks and improve schema, migration, and persistence safety without destructive changes.

Use this skill when

  • The production pass needs database or persistence review.
  • The repository uses a database, ORM, migrations, persistent storage, or data models.
  • The user wants to reduce data loss, migration, consistency, or rollback risk.

Do not use this skill when

  • The application has no persistence layer.
  • The task is only frontend polish.
  • The user asks for destructive data changes without explicit approval.

Check for

  • Schema consistency
  • Unsafe migrations
  • Missing constraints
  • Missing indexes
  • Weak validation
  • Race conditions
  • Transaction safety
  • Backup assumptions
  • Rollback risks
  • Soft delete behavior
  • Data retention concerns
  • Personally identifiable information handling
  • Seed data safety
  • Migration ordering
  • Orphaned records
  • Inconsistent application-level versus database-level rules
  • Unsafe default values
  • Missing uniqueness guarantees

Destructive-change rule

Do not create destructive migrations without explicit approval.

Do not drop columns, tables, indexes, or data unless explicitly approved.

Any migration must include rollback notes.

Treat data loss risk as a Blocker.

Default workflow

Resolve the task mode first: assessment-only work reports findings without source, test, or repository-document edits; authorized remediation applies only in-scope fixes. Release, production, and destructive operations retain their separate authority requirements.

  1. Identify database technology, ORM, schema files, migration files, seed files, and data access layer.
  2. Inspect schema and migration history.
  3. Review critical write paths for transaction safety.
  4. Identify data integrity assumptions that only exist in application code.
  5. Classify findings as Blocker, High, Medium, or Low.
  6. Recommend constraints, indexes, or migration changes.
  7. In authorized remediation, implement only safe non-destructive changes. For an assessment, report proposed changes without modifying source, schema, or data.
  8. For authorized data-integrity behavior changes, add or update E2E tests through supported entry points with the real persistence layer; any unit test created along the way is temporary; once passing E2E coverage carries its still-required assertions, remove it and the support code only it used (see the production-testing-qa skill). Report missing coverage during an assessment.
  9. Report rollback and deployment implications; update project notes only for authorized changes or requested artifacts.

Severity guidance

Classify as Blocker when there is data loss risk, unsafe migration risk, or broken persistence for critical flows.

Classify as High when data correctness, rollback, or consistency risks are serious but not immediately destructive.

Classify as Medium when database improvements are important but not release-blocking.

Classify as Low for cleanup or future schema polish.

Guardrails

  • Do not assume production data shape.
  • Do not run destructive commands.
  • Do not create migrations that cannot be rolled back or explained.
  • Do not hide data integrity risks as normal cleanup.
  • Prefer explicit constraints over implicit assumptions.
  • Do not expose PII in reports or logs.

Deliverables

Include the following in the requested assessment response or report. Update repository readiness files only when those artifacts are requested or part of authorized remediation:

  • Database risk summary
  • Migration safety notes
  • Safe schema or validation changes
  • Rollback considerations
  • Remaining data risks
  • Files changed and reasons

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.