skills/schema-diff-analyzer/SKILL.md
Detects schema differences between environments (dev vs staging vs prod). Generates actionable migration paths instead of just diff lists.
npx skillsauth add fatih-developer/fth-skills schema-diff-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill takes two schema definitions (Source vs Target, or Environment A vs Environment B) and calculates the correct, safe delta between them. It doesn't blindly apply changes; it evaluates risk.
Core assumption: Applying standard ORM or CLI diff outputs directly to production often creates dangerous lock conditions.
Analyze the two inputs. Group identified changes into three core risk categories:
CREATE INDEX CONCURRENTLY).VARCHAR(50) to VARCHAR(100)).NOT NULL without default.DEFAULT to a huge table (depends on DB dialect).Do not provide a single monolith transaction if dangerous changes exist. Organize changes logically.
Required Outputs (Must write BOTH to docs/database-report/):
docs/database-report/schema-diff-report.md)## ⚠️ Risk Assessment
- **Safe:** Added table `audit_logs`.
- **Dangerous:** Renamed `customer_id` to `client_id` in `orders` table.
## 🛠️ Sync Execution Plan
Rather than running `prisma db push` or raw alters directly, follow this safe order:
**PHASE 1: (Pre-deployment Safe Alters)**
```sql
CREATE TABLE audit_logs (...);
ALTER TABLE orders ADD COLUMN client_id UUID;
(Delegate to migration-strategist for the backfill of client_id vs customer_id)
PHASE 2: (Post-deployment Cleanup)
ALTER TABLE orders DROP COLUMN customer_id;
2. **Machine-Readable JSON (`docs/database-report/schema-diff-output.json`)**
```json
{
"skill": "schema-diff-analyzer",
"overall_risk_level": "High",
"changes": [
{"type": "Safe", "entity": "audit_logs", "action": "CREATE TABLE"},
{"type": "Dangerous", "entity": "orders", "action": "RENAME COLUMN", "details": "customer_id to client_id"}
],
"recommended_phases": ["Phase 1 (Safe Alters)", "Backfill", "Phase 2 (Cleanup)"]
}
If the diff contains a "🔴 Dangerous" change, explicitly state that the user should engage the migration-strategist skill for that specific field to prevent downtime.
255 down to 50).ADD COLUMN ... DEFAULT instantly, whereas older engines rewrite the table.tools
Create, optimize, critique, and structure prompts for AI systems. Use this skill whenever the user is designing or improving a prompt, system prompt, coding prompt, image prompt, evaluation rubric, agent prompt, workflow prompt, or MCP-oriented prompt package. Also use it when the user asks to turn vague AI behavior into a precise instruction set, tool policy, agent spec, or prompt architecture.
testing
Assumption-first architecture review skill to stress-test project plans and expose hidden risks.
testing
Enforce and manage DESIGN.md specifications, extract design systems from URLs, and combine design reasoning with token roles to prevent drift.
testing
Forces the agent to act with a Claude-like product mindset, prioritizing user journey, UX states, and visual quality before coding.