agentleFS
adymireadymire/CraftLayer/skills/database-engineering/SKILL.md

database-engineering

Skill0 starsChanged 3 days agoMITView on GitHub

Evolve data models and queries safely with explicit constraints, indexes, migrations, and recovery planning.

6 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

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 9

    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:

    Use for schema, query, indexing, transaction, migration, or data-retention changes.

    line 10
  2. Distinctive:

    Do not choose or replace a database without workload and operational evidence.

    line 15
  3. Distinctive:

    Use transactions for multi-step invariants and bound long-running work.

    line 32
  4. Distinctive:

    Test against representative data and query plans.

    line 33
  5. Distinctive:

    Document retention, deletion, and backup implications.

    line 34
  6. Distinctive:

    Never assume a migration is reversible merely because a down script exists.

    line 38
  7. Distinctive:

    Avoid locking table rewrites during critical traffic without analysis.

    line 40
  8. Distinctive:

    Do not log sensitive records for debugging.

    line 42
  9. Distinctive:

    Test migration on representative data, correctness and constraints, query performance, deployment compatibility, backups, and recovery.

    line 58

“Common” is measured: kept by at least 6 in 10 of the 4 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

Database Engineering

When to use

Use for schema, query, indexing, transaction, migration, or data-retention changes.

When not to use

Do not choose or replace a database without workload and operational evidence. Do not perform destructive data changes without explicit approval.

Inputs and assumptions

Inspect the current database, data volume, ownership, query patterns, consistency needs, migration tooling, backups, and deployment process.

Workflow

  1. Model entities, invariants, ownership, nullability, and lifecycle.
  2. Define constraints in the database as well as application validation where appropriate.
  3. Inspect real query patterns before adding indexes; consider write and storage cost.
  4. Plan an additive migration, backfill, compatibility window, verification, and rollback or forward-recovery strategy.
  5. Use transactions for multi-step invariants and bound long-running work.
  6. Test against representative data and query plans.
  7. Document retention, deletion, and backup implications.

Decision rules

  • Never assume a migration is reversible merely because a down script exists.
  • Avoid locking table rewrites during critical traffic without analysis.
  • Scope queries by tenant/owner where data is isolated.
  • Do not log sensitive records for debugging.

Example

For a required column, add it nullable, deploy code that writes it, backfill and verify values, then enforce non-null in a later migration if the database and deployment topology require staged rollout.

Common failures

  • Applying a schema change incompatible with the currently running app.
  • Adding indexes without checking query plans or write load.
  • Deleting records before retention and recovery requirements are known.

Validation

Test migration on representative data, correctness and constraints, query performance, deployment compatibility, backups, and recovery.

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.