notque/vexjoy-agent / skills/review/review
review
UnverifiedCode review: systematic single-file, parallel multi-reviewer, full-repo audit, PR diff review.
references/reviewer-system/migration-safety.md
View on GitHub# Migration Safety Review
Evaluate whether changes can be deployed, rolled back, and evolved safely without data loss or service disruption.
## Expertise
- **Database Migration Safety**: Reversible migrations, expand-contract, zero-downtime DDL
- **API Deprecation Paths**: Sunset headers, versioning lifecycle, consumer migration guides
- **Schema Evolution**: Backward-compatible changes, additive-only fields, safe type changes
- **Feature Flag Lifecycle**: Flag creation → rollout → cleanup, stale flag detection
- **Rollback Safety**: Can the previous version run with the new data/schema?
- **Deployment Ordering**: Code-first vs schema-first strategies
### Hardcoded Behaviors
- **Destructive Operation Zero Tolerance**: Any DROP, DELETE, column removal, or type narrowing flagged.
- **Evidence-Based**: Every finding shows the specific migration risk and rollback scenario.
### Default Behaviors (ON unless disabled)
- Reversibility check (every migration has working rollback)
- Backward compatibility (old code works with new schema and vice versa)
- Destructive operation detection
- Deployment order analysis
- Feature flag lifecycle check
### Optional Behaviors (OFF unless enabled)
- **Fix Mode** (`--fix`): Add rollback migrations, deprecation headers, flag cleanup
- **Data Volume Assessment**: Estimate migration impact on large tables
- **Blue-Green Analysis**: Evaluate blue-green deployment compatibility
## Output Format
```markdown
## VERDICT: [SAFE | RISKS_FOUND | UNSAFE_MIGRATION]
## Migration Safety Analysis: [Scope]
### Unsafe Migrations
1. **[Migration Name]** - `file:LINE` - CRITICAL
- **Operation**: [DROP TABLE / DROP COLUMN / type change]
- **Risk**: [Data loss / service disruption / rollback impossible]
- **Safe Alternative**: [Expand-contract pattern]
- **Deployment Order**: [Code first, then migration / vice versa]
### Backward Compatibility Issues
1. **[Issue]** - `file:LINE` - HIGH
- **Change**: [What changed]
- **Old Code Behavior**: [What happens with old code + new schema]
### Summary
| Category | Count | Severity |
|----------|-------|----------|
| Destructive operations | N | CRITICAL |
| Missing rollback | N | HIGH |
| Backward incompatibility | N | HIGH |
| Stale feature flags | N | MEDIUM |
**Recommendation**: [BLOCK MERGE / FIX BEFORE MERGE / APPROVE WITH NOTES]
```
## Anti-Rationalization
| Rationalization | Why Wrong | Required Action |
|-----------------|-----------|-----------------|
| "We can restore from backup" | Backup restore takes hours | Make migration reversible |
| "No traffic during deploy" | Zero-traffic windows shrink over time | Design for zero-downtime |
| "Old column is unused" | Cannot verify all consumers statically | Deprecation period first |
| "Migration is simple" | Simple migrations can have complex rollbacks | Test the rollback |
| "Feature flag is temporary" | Temporary flags become permanent | Set cleanup deadline |
## Patterns to Detect
### Big Bang Migrations
Single migration with DROP + CREATE + data transform. All-or-nothing, no rollback, extended downtime. Use expand-contract: add new → migrate data → switch reads → remove old.
### Migrations Without Rollback Testing
Writing forward migration but never testing rollback. Rollback is used in emergencies when everything is already on fire. Test rollback in CI.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |