Skip to content
Skills Library
Data & analytics · Testing

validating-database-integrity

/validating-database-integrity

Process use when you need to ensure database integrity through comprehensive data validation. This skill validates data types, ranges, formats, referential integrity, and business rules. Trigger with phrases like "validate database data", "implement data validation rules", "enforce data integrity constraints", or "validate data formats".

Repository
agent ↗
Licence
MIT
Last repository change
14.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 14.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Process use when you need to ensure database integrity through comprehensive data validation. This skill validates data types, ranges, formats, referential integrity, and business rules. Trigger with phrases like "validate database data", "implement data validation rules", "enforce data integrity constraints", or "validate data formats".

Triggers from the description

validate database dataimplement data validation rulesenforce data integrity constraintsvalidate data formats
Original author description

Process use when you need to ensure database integrity through comprehensive data validation. This skill validates data types, ranges, formats, referential integrity, and business rules. Trigger with phrases like "validate database data", "implement data validation rules", "enforce data integrity constraints", or "validate data formats".

How it works

  1. Prerequisites
  2. Instructions
  3. Output
  4. Error Handling
  5. Resources
  6. Overview
  7. Examples
Original SKILL.md headings · 114 lines, 568 words
SKILL.md preview
---
name: validating-database-integrity
description: |
  Process use when you need to ensure database integrity through comprehensive data validation.
  This skill validates data types, ranges, formats, referential integrity, and business rules.
  Trigger with phrases like "validate database data", "implement data validation rules",
  "enforce data integrity constraints", or "validate data formats".
  
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*)
version: 1.0.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
license: MIT
---
# Data Validation Engine

This skill provides automated assistance for data validation engine tasks.

## Prerequisites

Before using this skill, ensure:
- Database connection credentials are available
- Appropriate database permissions for schema modifications
- Backup of production databases before applying constraints
- Understanding of existing data that may violate new constraints
- Access to database documentation for column specifications

## Instructions

### Step 1: Analyze Validation Requirements
1. Review database schema and identify columns requiring validation
2. Determine validation types needed (data type, range, format, referential)
3. Document existing data patterns that may conflict with new rules
4. Prioritize validation rules by business criticality

### Step 2: Define Validation Rules
1. Create validation rule definitions for each column
2. Specify data types, constraints, and acceptable ranges
3. Define regular expressions for format validation
4. Map foreign key relationships for referential integrity
5. Document business rule logic for complex validations

### Step 3: Implement Database Constraints
1. Generate SQL constraints for data type validation
2. Add CHECK constraints for range and format validation
3. Create foreign key constraints for referential integrity
4. Implement triggers for complex business rule validation
5. Test constraints with valid and invalid sample data

### Step 4: Validate Existing Data
1. Query existing data to identify constraint violations
2. Generate reports of data that would fail new constraints
3. Create data cleanup scripts to fix violations
4. Execute cleanup scripts in staging environment first
5. Re-validate cleaned data before applying constraints

### Step 5: Apply Validation Rules
1. Apply constraints to staging database first
2. Monitor for any application errors or failures
3. Validate that legitimate operations still function
4. Apply constraints to production database during maintenance window
5. Monitor database logs for constraint violation attempts

## Output

This skill produces:

**Database Constraints**: SQL DDL statements with CHECK, FOREIGN KEY, and NOT NULL constraints

**Validation Reports**: Analysis of existing data showing constraint violations with counts and examples

**Data Cleanup Scripts**: SQL UPDATE/DELETE statements to fix existing data that violates new constraints

**Test Results**: Documentation of constraint testing with valid/invalid data samples and outcomes

**Implementation Log**: Timestamped record of constraint application with success/failure status

## Error Handling

**Constraint Violation Errors**:
- Review existing data that violates the constraint
- Create data cleanup scripts to fix violations
- Re-run constraint application after cleanup
- Document exceptions that require manual review

**Permission Errors**:
- Verify database user has ALTER TABLE privileges
- Request elevated permissions from database administrator
- Use separate admin connection for schema changes
- Document permission requirements for future deployments

**Circular Dependency Errors**:
- Map all foreign key relationships before implementation
- Apply constraints in dependency order (referenced tables first)
- Use ALTER TABLE ADD CONSTRAINT for deferred constraint creation
- Consider disabling foreign key checks temporarily during bulk operations

**Performance Degradation**:
- Analyze constraint checking overhead with EXPLAIN ANALYZE
- Add appropriate indexes to support constraint validation
- Consider batch validation for large data updates
- Monitor query performance after constraint implementation

## Resources

**Database-Specific Constraint Syntax**:
- PostgreSQL: `{baseDir}/docs/postgresql-constraints.md`
- MySQL: `{baseDir}/docs/mysql-constraints.md`
- SQL Server: `{baseDir}/docs/sqlserver-constraints.md`

**Validation Rule Templates**: `{baseDir}/templates/validation-rules/`
- Email format validation
- Phone number validation
- Date range validation
- Numeric range validation
- Custom business rules

**Testing Guidelines**: `{baseDir}/docs/validation-testing.md`
**Constraint Performance Analysis**: `{baseDir}/docs/constraint-performance.md`
**Data Cleanup Procedures**: `{baseDir}/docs/data-cleanup-procedures.md`

## Overview

This skill provides automated assistance for the described functionality.

## Examples

Example usage patterns will be demonstrated in context.

Versions

RepositoryScoreLicence
This page · HelixDevelopment/agent100MIT
jeremylongshore/tons-of-skills-marketplace100MIT

Database snapshot: 13.11.2026 · package version 762ea2a19825 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100database-testing
    Database schema validation, data integrity testing, migration testing, transaction isolation, and query performance. Use when testing data persistence, ensuring referential integrity, or validating database migrations.
  • 100qe-database-testing
    Database schema validation, data integrity testing, migration testing, transaction isolation, and query performance. Use when testing data persistence, ensuring referential integrity, or validating database migrations.
  • 100managing-database-tests
    Test database testing including fixtures, transactions, and rollback management. Use when performing specialized testing. Trigger with phrases like "test the database", "run database tests", or "validate data integrity".
  • 100managing-database-tests
    Test database testing including fixtures, transactions, and rollback management. Use when performing specialized testing. Trigger with phrases like "test the database", "run database tests", or "validate data integrity".
  • 90data-quality-audit
    Comprehensive data quality assessment against business rules, schema constraints, and freshness expectations. Activate when validating data pipeline outputs before production use, auditing a dataset against defined business rules, or producing a quality scorecard for a data asset.
  • 85resonance-engineering-database
    Database Architect Specialist. Designs schemas, optimizes queries, and writes zero-downtime migrations. Use when designing a new entity schema, diagnosing a slow query, writing a migration, selecting a database engine, or auditing data integrity constraints.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.