data-integrity-auditor

Audit and rectify database integrity issues using SQL and Prisma ORM.

1|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/zinohome/CozyChat --skill data-integrity-auditor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-integrity-auditor
Source: https://github.com/zinohome/CozyChat/tree/main/.claude/skills/data-integrity-auditor
Command: npx skills add https://github.com/zinohome/CozyChat --skill data-integrity-auditor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires prisma, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automatically detects and helps fix critical data integrity issues within your database, preventing data corruption and ensuring reliable information.

Core Features & Use Cases

  • Orphaned Record Detection: Identifies records that reference non-existent parent records (e.g., orders without users).
  • Broken Foreign Key Checks: Finds instances where relationships between tables are violated.
  • Constraint Violation Audits: Detects issues like duplicate unique fields or invalid data ranges (e.g., negative prices).
  • Missing Field Identification: Flags records that lack essential data.
  • Automated Fix Scripts: Provides scripts to resolve common integrity problems.
  • Prevention Guidance: Offers SQL examples for adding database constraints to prevent future issues.
  • Use Case: Run a comprehensive audit to find all orders with invalid user IDs, products with negative prices, and duplicate email addresses, then use the provided scripts to clean them up.

Quick Start

Run the data integrity audit script to check for and report on any data inconsistencies.

Frequently Asked Questions about data-integrity-auditor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find orphaned records and broken foreign key relationships in my SQL database?

To find orphaned records and broken foreign key relationships, run a database audit using SQL queries. This identifies records referencing non-existent parents, such as orders without valid users, and reports them for remediation.

How do I detect missing required fields and constraint violations using Prisma ORM?

Detect missing required fields and constraint violations using Prisma ORM by running TypeScript audit scripts. These scripts query the database to flag duplicate unique fields, invalid data ranges, and records lacking essential data.

What is the best way to fix data integrity issues like negative prices or duplicate emails?

The best way to fix data integrity issues like negative prices or duplicate emails is to use automated remediation scripts. These scripts clean up identified records and apply constraints to prevent future data corruption.

Can I add SQL constraints to prevent future data quality issues after an audit?

Yes, you can add SQL constraints to prevent future data quality issues after an audit. Prevention guidance provides SQL examples for adding database constraints directly, ensuring long-term data accuracy and reliability.

Does this data cleaning approach work with TypeScript and Prisma?

Yes, this data cleaning approach works with TypeScript and Prisma. It utilizes TypeScript scripts integrated with the Prisma ORM to execute SQL queries for detecting and automatically rectifying database integrity problems.