database-integrity
Skill1 starsChanged 54 days agoMITView on GitHub
Schema design, migrations, transactions, indexes, query behavior, backfills, and tenant isolation or RLS. Treats every schema or migration change as high risk because deployed data already exists. Use for SQL, ORMs, data models, migration strategy, query performance, or data-integrity questions.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- AL-JANEF/janef-forgeword for word, first seen Sep 19, 2026
Other versions1 project uses a version of this.
Word for word · 1
- AL-JANEF/janef-forge★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- janefSkill
- forgeSkill
- accessibility-qualitySkill
- api-contractsSkill
- architecture-integritySkill
- context-efficiencySkill
- delegation-disciplineSkill
- devops-reliabilitySkill
- documentation-integritySkill
- frontend-design-qualitySkill
- git-disciplineSkill
- implementation-qualitySkill
- performance-scalabilitySkill
- review-defect-firstSkill
- root-cause-debuggingSkill
- testing-verificationSkill
- ui-ux-qualitySkill
- auth-hardeningSkill
- secrets-guardSkill
- security-auditSkill
- security-loggingSkill
- skill-security-auditSkill
- threat-modelSkill
- variant-huntSkill
- vuln-auditSkill
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
- Distinctive: line 25
Keep transactions short; define isolation needs and lock ordering for concurrent writes.
- Distinctive: line 26
Avoid N+1 access and unbounded reads.
- Distinctive: line 39
Test constraints, concurrent edge cases, upgrade and rollback/forward-fix paths.
≈ “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.
Files
Database Integrity
Schema and migration changes are high risk because deployed data already exists and cannot be re-run. Put durable invariants in constraints when the database can enforce them.
Model and invariants
- Choose types, nullability, defaults, keys, and uniqueness from domain meaning, not sample data.
- Preserve constraints, foreign keys, uniqueness, nullability semantics, transactions, and least privilege.
- Make tenant or ownership boundaries explicit in every access path. In multi-tenant systems a missing tenant scope is a critical finding; where RLS exists, never bypass it with a privileged role to make a query work.
Queries and transactions
- Parameterize every query. Treat ORM convenience as syntax, not proof of correct query count or transaction behavior.
- Inspect plans with representative cardinality before adding indexes; account for write amplification and maintenance cost.
- Keep transactions short; define isolation needs and lock ordering for concurrent writes.
- Avoid N+1 access and unbounded reads; paginate with stable ordering.
Migrations
- Design expand → migrate → contract phases for mixed application versions.
- Separate schema change, backfill, validation, and cleanup when locks or data volume matter. Backfills need batching, idempotent retries, progress tracking, and production-load awareness.
- Make migrations deploy-compatible, observable, and recoverable; define rollback or forward-fix.
- Destructive migrations (drop, truncate, type narrowing, data deletion) require explicit authorization and staging. Never claim one is safe without backup and restore evidence appropriate to the environment.
- Audit-log sensitive data changes (
security-logging).
Verification
- Apply the migration from zero and against representative data; run representative queries afterwards.
- Test constraints, concurrent edge cases, upgrade and rollback/forward-fix paths.
- Confirm explain plans and lock impact for performance-sensitive production queries.
- For RLS, tenant scoping, or privilege changes: run a real database check that a cross-tenant or unprivileged access is denied, and show that removing the control makes that test fail.
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.

