schema-consistency-auditlisted
Install: claude install-skill adnanmokhtar/refract
# Skill: schema-consistency-audit
## Purpose
Detect drift across the project's database schema + migration history so /polish can unify it. The skill operates on the live schema (introspection) + migration history + the project's conventions (`_extracted-idioms.md § Schema conventions` or `ai/schema-conventions.md`).
## When to use
- Dispatched by `/polish` on `data-*` stacks (or `backend-*` stacks with significant schema scope).
- Dispatched by `/db-audit` for read-only audit.
- Standalone: `/polish --diagnose-only --stack=data` writes the artifact, no fixes.
- NOT for adding new tables (use `/add-migration`) or query optimisation (use `/optimize-query`).
## Inputs (precise contract)
| Input | Source | Required |
|---|---|---|
| Codebase root | Orchestrator | YES |
| `PROJECT_KIND` | `_extracted-codebase.md § Gold standards` | YES (`data-*` or `backend-*` with schema scope) |
| Schema conventions | `_extracted-idioms.md § Schema conventions` OR `ai/schema-conventions.md` | YES (without it, drift is undefined — halt) |
| Schema introspection access | DB connection OR migration history dump | YES (one of the two) |
| Scope filter (optional) | Caller flag (e.g., `--scope=analytics`) | NO (default: all tables) |
## Outputs (precise contract)
```yaml
class: schema-consistency
subclass: <one of: nullable-drift | type-drift | timezone-drift | charset-drift |
collation-drift | soft-delete-drift | audit-field-drift |
timestamp-column-drif