Data Integrity Patterns
Constraints, triggers, audit trails, referential integrity, and data validation.
Install
/plugin marketplace add sethdford/claude-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add sethdford/claude-skills --skill data-integrity-patternsgit clone --depth 1 https://github.com/sethdford/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/engineer/database-engineering/skills/data-integrity-patterns ~/.claude/skills/data-integrity-patternsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Data Integrity Patterns Maintaining data correctness through database constraints and patterns. ## Context You are ensuring data stays correct. Use database constraints, not just application validation. ## Domain Context - **Constraints**: NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK - **Triggers**: Automatic actions on data changes; use sparingly - **Audit Trail**: Record of what changed and when - **Referential Integrity**: Foreign keys prevent orphaned records - **Validation**: Business rules enforced at database level ## Instructions 1. **NOT NULL**: Columns that must have values 2. **UNIQUE**: Columns/combinations that must be unique 3. **FOREIGN KEYS**: References to other tables; prevent orphans 4. **CHECK**: Business rules (price > 0, status IN (values)) 5. **Triggers**: Rarely; keep business logic in application 6. **Audit Trail**: Timestamp, user columns; or trigger for history table 7. **Enforcement**: Database enforces; application can't bypass ## Anti-Patterns - No constraints; trust application to validate (it won't) - Over-reliance on triggers; hard to test, understand - Audit table with triggers; complex and slow - CHECK constraints that are wrong; don't trust them until tested - Not testing constraint enforcement ## Further Reading - PostgreSQL constraints documentation - Data Vault 2.0 (for audit trail patterns) - Event sourcing for audit trails (alternative)
Details
- Skill name
data-integrity-patterns- Repository
- sethdford/claude-skills
- Path
engineer/database-engineering/skills/data-integrity-patterns/SKILL.md- License
- MIT
- Repo updated
- 11 March 2026
FAQ
What does the Data Integrity Patterns skill do?
Constraints, triggers, audit trails, referential integrity, and data validation.
How do I install the Data Integrity Patterns skill?
Claude Code plugin: /plugin marketplace add sethdford/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Data Integrity Patterns popular?
It lives in sethdford/claude-skills, which has 48 GitHub stars and 10 forks.
Related skills
A B Test Design
48sethdford/claude-skills
Design rigorous A/B tests with hypotheses, variants, metrics, and sample size calculations.
A B Test Design Pm
48sethdford/claude-skills
Analytics and experimentation skill for product managers.
Abuse Case Design
48sethdford/claude-skills
Design abuse cases (negative use cases) showing how attackers misuse system features. Use when identifying attacks that exploit intended functionality or business logic flaws.
Data Structure Selection
48sethdford/claude-skills
Choosing optimal data structures based on access patterns and performance requirements.
Dark Mode Design
48sethdford/claude-skills
Design effective dark mode interfaces with proper color adaptation, contrast, and elevation.
Defect Analysis
48sethdford/claude-skills
Expert approach to defect-analysis in quality measurement. Use when working with .
Browse the most popular Claude skills, all other skills, or write your own with the skills generator.