data-integrity-guardian

Review database migrations, data models, and persistent data code for integrity and compliance.

Updated Jun 28, 2022
One-click install
npx skills add https://github.com/pcasaretto/nix-home --skill data-integrity-guardian-pcasaretto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-integrity-guardian
Source: https://github.com/pcasaretto/nix-home/tree/main/home-manager/modules/common/pi/compound-engineering/skills/data-integrity-guardian
Command: npx skills add https://github.com/pcasaretto/nix-home --skill data-integrity-guardian-pcasaretto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill safeguards data integrity by meticulously reviewing database migrations, data models, and persistent data code for potential safety, privacy, and compliance issues.

Core Features & Use Cases

  • Database Migration Review: Ensures migrations are safe, reversible, idempotent, and do not cause data loss or performance degradation.
  • Data Constraint Validation: Verifies the presence and correctness of data validations, uniqueness constraints, and foreign key relationships.
  • Transaction Boundary Analysis: Assesses the proper use of transactions for atomic operations, isolation levels, and deadlock prevention.
  • Referential Integrity Checks: Guarantees that relationships between data are maintained, preventing orphaned records and dangling references.
  • Privacy Compliance: Identifies and checks for the proper handling of Personally Identifiable Information (PII), encryption, and data retention policies.
  • Use Case: Review a new database migration script to ensure it safely adds a new column to a critical table without impacting existing data or causing downtime.

Quick Start

Use the data-integrity-guardian skill to review the attached database migration script for safety and compliance.

Frequently Asked Questions about data-integrity-guardian

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

FAQPage Schema
How do I review database migrations for data loss and reversibility?

Reviewing database migrations for data loss involves analyzing migration scripts for reversibility, idempotency, and safe NULL value handling. This process ensures schema changes do not cause data loss, performance degradation, or unintended downtime during execution.

What is transaction atomicity and how does it prevent deadlocks in SQL?

Transaction atomicity ensures database operations execute as a single indivisible unit, maintaining ACID properties. Analyzing transaction boundaries, isolation levels, and deadlock potential prevents concurrent execution conflicts and guarantees consistent database state.

How do I check referential integrity and foreign key constraints in a data model?

Checking referential integrity validates foreign key relationships to prevent orphaned records and dangling references. It verifies that uniqueness constraints and data validations are correctly implemented to maintain consistent relationships across database tables.

How do I identify PII and enforce encryption for privacy compliance in a database?

Identifying PII and enforcing encryption for privacy compliance involves scanning persistent data code to locate sensitive information. It validates proper encryption implementation and checks data retention policies against governance standards to ensure regulatory compliance.

Can I use automated SQL review to ensure ACID properties in persistent data code?

Yes, automated SQL review can assess persistent data code for ACID properties by validating constraint rules, transaction boundaries, and isolation levels. It systematically identifies potential integrity violations before deployment to production environments.

What are the limitations of reviewing data models without checking migration scripts?

Reviewing data models without checking migration scripts misses execution-time risks like data loss, performance degradation, and non-reversible schema changes. Complete data integrity analysis requires evaluating both the target schema and the migration path.