data-access-and-migrations
Skill198 starsChanged 4 days agoMITView on GitHub
Define safe persistence access, transaction boundaries, concurrency behavior, and database schema migration practices across technology stacks.
In this repository20 other files it gives its agents.
- api-designSkill
- application-securitySkill
- apply-renovate-prsSkill
- architecture-guidelinesSkill
- authentication-authorizationSkill
- configuration-and-secretsSkill
- database-designSkill
- deployment-and-deliverySkill
- external-integrations-and-messagingSkill
- java-code-reviewSkill
- jspecify-skillSkill
- observabilitySkill
- pair-programmingSkill
- progenSkill
- reliability-and-performanceSkill
- spec-writerSkill
- spring-boot-skillSkill
- spring-modulith-verifierSkill
- technical-decision-makingSkill
- testing-strategySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 17 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
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
- Distinctive: line 9
Keep persistence behavior correct, efficient, secure, and evolvable regardless of database or application framework.
- Distinctive: line 12
Use when implementing data access, multi-step writes, transactions, concurrent updates, background jobs, or schema changes.
- Distinctive: line 15
Keep persistence concerns behind clear application boundaries.
- Distinctive: line 16
Use parameterized queries or safe query APIs.
- Distinctive: line 20
Keep transactions short; avoid network calls or long-running work while holding locks.
- Distinctive: line 23
Do not assume a transaction spans multiple databases or remote services.
- Distinctive: line 24
Treat caches as derived state with explicit invalidation or freshness rules.
- Distinctive: line 27
Treat schema changes as versioned, reviewed application changes.
- Distinctive: line 28
Never rely on an undocumented manual production database edit.
- Distinctive: line 29
Prefer small, deterministic, forward-only migrations unless rollback is demonstrably safe.
- Distinctive: line 30
Do not rewrite migrations that may already have been applied in shared or production environments.
- Distinctive: line 31
Use expand-and-contract for changes that must coexist with old and new application versions.
- Distinctive: line 33
Test migrations against realistic prior schema states and representative data.
- Distinctive: line 39
Check compatibility with currently running and rolling-deployment versions.
- Distinctive: line 40
Add compatible structures first (expand).
- Distinctive: line 44
Remove obsolete structures only after compatibility is confirmed (contract).
- Distinctive: line 45
Verify constraints, row counts, application behavior, and rollback/recovery options.
≈ “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.
Files
Data Access and Migrations
Purpose
Keep persistence behavior correct, efficient, secure, and evolvable regardless of database or application framework.
When to use
Use when implementing data access, multi-step writes, transactions, concurrent updates, background jobs, or schema changes.
Data access principles
- Keep persistence concerns behind clear application boundaries; do not leak storage-specific details throughout the domain.
- Use parameterized queries or safe query APIs.
- Fetch only the data needed; avoid unbounded reads and accidental N+1 access patterns.
- Paginate potentially large result sets and define stable ordering.
- Make transaction boundaries explicit around business operations that require atomicity.
- Keep transactions short; avoid network calls or long-running work while holding locks.
- Understand isolation level, locking, optimistic concurrency, and lost-update risks.
- Make retry behavior safe; a retried operation must not accidentally duplicate side effects.
- Do not assume a transaction spans multiple databases or remote services.
- Treat caches as derived state with explicit invalidation or freshness rules.
Migration principles
- Treat schema changes as versioned, reviewed application changes.
- Never rely on an undocumented manual production database edit.
- Prefer small, deterministic, forward-only migrations unless rollback is demonstrably safe.
- Do not rewrite migrations that may already have been applied in shared or production environments.
- Use expand-and-contract for changes that must coexist with old and new application versions.
- Separate large data backfills from schema changes when that improves safety and operability.
- Test migrations against realistic prior schema states and representative data.
- Define backup and recovery expectations for high-risk changes.
Safe migration workflow
- Inspect the current schema, migration history, data volume, and deployed application versions.
- Describe the intended schema and data transformation.
- Check compatibility with currently running and rolling-deployment versions.
- Add compatible structures first (expand).
- Deploy code that can work with both old and new structures where needed.
- Backfill in bounded, observable, restartable batches.
- Switch reads/writes to the new representation.
- Remove obsolete structures only after compatibility is confirmed (contract).
- Verify constraints, row counts, application behavior, and rollback/recovery options.
Review checklist
- Are queries safe, bounded, and aligned with indexes?
- Are transaction boundaries correct?
- Can concurrent requests corrupt or overwrite state?
- Are retries idempotent?
- Can the migration run safely with existing data?
- Is it compatible with rolling deployments?
- Is the backfill restartable and observable?
- Is recovery possible if the migration fails?
For destructive or irreversible operations, require explicit risk communication and a tested recovery plan.
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
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.

