schema-audit

Audit database schemas for redundant indexes, missing foreign keys, and migration safety.

2|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/hamzaPixl/pixl-ai --skill schema-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-audit
Source: https://github.com/hamzaPixl/pixl-ai/tree/main/packages/crew/skills/schema-audit
Command: npx skills add https://github.com/hamzaPixl/pixl-ai --skill schema-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Developers and DBAs often miss hidden issues in database schemas such as redundant indexes, missing foreign keys, naming inconsistencies, N+1 query risks, and unsafe migrations, leading to performance degradation and data integrity problems.

Core Features & Use Cases

  • Discovery: Auto‑detects Prisma, SQLAlchemy, raw SQL, or SQLite schemas and migration history.
  • Index Audit: Identifies missing, redundant, or poorly named indexes.
  • Constraint Audit: Finds absent foreign keys, NOT NULL constraints, and uniqueness gaps.
  • Naming Audit: Enforces consistent table and column naming conventions.
  • N+1 Risk Analysis: Detects eager‑loading gaps and query patterns that cause N+1 problems.
  • Migration Safety: Flags dangerous operations, missing rollbacks, and data‑integrity risks.
  • Scorecard: Generates a prioritized report with severity ratings and remediation suggestions.

Quick Start

Run the schema-audit skill on the project’s database schema directory to receive a detailed audit report.

Frequently Asked Questions about schema-audit

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

FAQPage Schema
How do I audit my database schema for redundant indexes and missing foreign keys?

To audit database schema for redundant indexes and missing foreign keys, run a schema audit on your schema directory to generate a prioritized scorecard with severity ratings and remediation suggestions.

Can I detect N+1 query risks in a Prisma or SQLAlchemy schema?

Yes, you can detect N+1 query risks in Prisma or SQLAlchemy schemas by analyzing eager-loading gaps and query patterns that cause N+1 problems, receiving a detailed risk report.

What's the best way to check database migration safety before deploying?

Check database migration safety by auditing migration history to flag dangerous operations, missing rollbacks, and data-integrity risks before deployment, ensuring safe schema evolution.

Does the schema audit work with raw SQL and SQLite schemas?

Yes, the schema audit works with raw SQL and SQLite schemas, auto-detecting schema files and migration history to analyze constraints, indexes, and naming conventions.

How do I enforce consistent table and column naming conventions in my database?

Enforce consistent table and column naming conventions by running a naming audit that detects inconsistencies across your schema files and provides remediation guidance.

Why does my database schema audit report show missing NOT NULL constraints?

Your database schema audit report shows missing NOT NULL constraints because the constraint audit detects absent NOT NULL declarations, uniqueness gaps, and missing foreign keys, highlighting data integrity vulnerabilities.