Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Data Validation Engine

ASecurity

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".

21 stars
0 votes
0 copies
0 views
Added 2/7/2026
databasesbashsqlexpresstestinggitdatabaseperformancedocumentation

Security Analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned 2/12/2026

$npx -y skills add BbgnsurfTech/claude-skills-collection --skill data-validation-engine --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Validation Engine?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Data Validation Engine
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bbgnsurftech-data-validation-engine/badge)](https://www.skillsdirectory.com/skills/bbgnsurftech-data-validation-engine)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: validating-database-integrity
description: |
  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:*, mysql:*)
version: 1.0.0
license: MIT
---

## 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`

Attribution

BbgnsurfTechBbgnsurfTech
View sourceSee grades on GitHubMore from BbgnsurfTech →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Mysql Best Practices

MySQL development best practices for schema design, query optimization, and database administration

2481 votes

Jpa Patterns

Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。

2456590 votes

Clickhouse Io

ClickHouse数据库模式、查询优化、分析和数据工程最佳实践,适用于高性能分析工作负载。

2456590 votes

Postgres Patterns

基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。

2456590 votes

Sql Pro

Master modern SQL with cloud-native databases, OLTP/OLAP

458250 votes
View all in databases →