agentleFS
nassaj2011nassaj2011/claude-skills-for-chatgpt/skills/database-transaction-integrity/SKILL.md

database-transaction-integrity

Skill0 starsChanged 24 days agoMITView on GitHub

Safeguard SQL schemas, transactions, migrations, concurrent updates, payments, event consistency and audit ledgers. Use for persistent-state changes.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Read the actual database dialect, schema, migrations, data access layer and callers.

    line 8
  2. Distinctive:

    Add concurrency and failure-injection tests plus queries that detect invariant violations.

    line 14
  3. Distinctive:

    Never run destructive SQL on production without explicit permission.

    line 18

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

Database and transactional integrity

  1. Read the actual database dialect, schema, migrations, data access layer and callers. Never assume ORM definitions exactly match deployed schema.
  2. Define business invariants: uniqueness, legal state transitions, ownership, referential integrity, monetary precision and conservation.
  3. Model adversarial timing: duplicate requests, simultaneous updates, callback replay, out-of-order events, crash before/after commit and partial failures.
  4. Choose enforcement layers: database UNIQUE/CHECK/FK, atomic conditional writes, locks, isolation, idempotency keys and durable outbox where warranted.
  5. For money, use explicit minor units/precision, immutable or traceable ledger entries and a reconciliation strategy; prohibit silent balancing adjustments.
  6. For migrations, detail expand/backfill/validate/contract, mixed-version compatibility, index/lock cost and rollback limitations.
  7. Add concurrency and failure-injection tests plus queries that detect invariant violations; distinguish dry-run from production execution.
  8. Gate risky migrations on verified backups, privileges, monitoring and an approved rollback strategy.

Output: invariant table (rule, enforcement, test), race/failure matrix, migration sequence and safe/conditional/blocked verdict. Never run destructive SQL on production without explicit permission.

Local executable verification

The public source checkout includes examples/reference-platform/booking.py and nine database tests. On an authorized local checkout run python -m unittest discover -s examples/reference-platform/tests -v. Review its README for limits: SQLite semantics and an injected verified flag are not production payment-provider authentication. The negative tests include six-client contention, duplicate provider receipt, mismatched amount and ownership denial. Never generalize passing local tests to production DB migrations.

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.