oc-migration-ops — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited oc-migration-ops (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
On first invocation, read `references/orchestrator.md` and follow its welcome protocol.
The "change the engine mid-flight" skill. Fills the gap between oc-reverse-spec ("what I have") and oc-app-architect ("what I want") when the answer is "transform one into the other" — without downtime, without data loss, and with a rollback at every step.
This is inherently multi-session work. A database migration plan might span 3–4 conversations. Checkpoint protocol adoption is critical from day one.
MIGRATION OPS COMMANDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PLAN
/oc-migrate Show this menu
/oc-migrate assess Inventory current state + classify migration type
/oc-migrate plan Generate incremental migration plan with rollback points
/oc-migrate impact Blast radius analysis — what breaks during each step
EXECUTE
/oc-migrate execute Start or resume execution from migration plan
/oc-migrate step [N] Execute a specific step (with pre/post verification)
/oc-migrate verify Run verification suite against current state
/oc-migrate rollback Revert to last verified checkpoint
OBSERVE
/oc-migrate status Current migration state from checkpoint
/oc-migrate diff Compare current state vs. target state
/oc-migrate history Show completed steps with pass/fail and timing
UTILITIES
/oc-migrate dry-run Simulate the next step without applying changes
/oc-migrate ecosystem Bulk-update opchain skills (format, protocol, oc-orchestrator)
/oc-migrate abandon Abandon an in-progress migration (archive checkpoint)
/checkpoint Show checkpoint status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Type any command, or describe what you want to migrate.EXISTING SYSTEM (documented or not)
│
├──► oc-reverse-spec (if undocumented → produces baseline specs)
│
▼
┌──────────────┐
│ MIGRATION-OPS│ current state → migration plan → incremental execution → target state
│ │ Reads: oc-reverse-spec, oc-stack-forge, oc-app-architect, oc-code-auditor
│ │ Chains to: oc-code-auditor (post-migration verify), oc-deploy-ops (cutover)
└──────┬───────┘
│
├──► oc-code-auditor /oc-audit (post-migration quality gate)
├──► oc-deploy-ops /oc-deploy (cutover deployment)
└──► oc-app-architect (if migration reveals spec updates needed)Migration-ops sits between "what exists" and "what should exist" — it's the transformation engine. It does NOT build new features (oc-app-architect) or document existing code (oc-reverse-spec). It transforms running systems from state A to state B.
Every migration request is classified into one of these types. The type determines which reference playbook to load and which verification strategy to use.
| Type | Examples | Risk | Key Concern |
|---|---|---|---|
| Database | D1 → Postgres, schema overhaul, ORM swap | HIGH | Data integrity, zero data loss |
| Framework | Hono v3→v4, React 18→19, Next.js pages→app router | MEDIUM | Breaking API changes, dependency conflicts |
| Auth | Passkeys → Supabase Auth, Auth0 → Clerk, session → JWT | HIGH | Auth gap = security gap, user lockout |
| Platform | Workers → Vercel, Supabase → raw Postgres, Heroku → Fly.io | HIGH | DNS cutover, cold start behavior, binding changes |
| Structural | Monorepo restructure, module extraction, package split | MEDIUM | Import path breakage, CI pipeline updates |
| Dependency | Major version bumps, library swap (Axios → fetch, Moment → date-fns) | LOW-MED | API surface changes, bundle impact |
| Ecosystem | Opchain skill format changes, checkpoint protocol upgrades, oc-orchestrator rewrites, bulk SKILL.md updates | LOW-MED | Consistency across N skills, no skill left behind |
When the user describes a migration without explicitly classifying it, infer the type:
If ambiguous, ask ONE clarifying question using ask_user_input.
/oc-migrate assess)Before planning anything, understand the current state and the target state. This is the most important phase — a bad assessment produces a bad plan.
Check for existing documentation in this order:
first. For aidops-core apps, also read wrangler.toml for bindings (D1, KV, secrets), routes, and compatibility dates.
Read context_primer.key_decisions and generated_files for architecture, schema, and stack info. Skip redundant scanning.
for the documented architecture.
layer being migrated (not a full oc-reverse-spec).
The user describes where they want to end up. Capture:
Compare current state → target state. For each gap:
| Gap | Current | Target | Effort | Risk | Dependencies |
|---|---|---|---|---|---|
| Database engine | D1 (SQLite) | Supabase Postgres | L | HIGH | Schema translation, ORM swap |
| Auth provider | WebAuthn passkeys | Supabase Auth | M | HIGH | Session migration, credential mapping |
| Query patterns | Drizzle + D1 | Drizzle + Postgres | S | LOW | Connection string change, dialect swap |
Rate the overall migration:
| Risk Level | Criteria | Planning Depth |
|---|---|---|
| LOW | Dependency swap, no data, no auth, no platform change | Lightweight plan, 2-3 steps |
| MEDIUM | Framework upgrade, structural refactor, minor schema changes | Standard plan, 5-10 steps |
| HIGH | Database engine change, auth swap, platform move | Full plan with rollback at every step, verification gates |
| CRITICAL | Production data migration + auth change + platform move simultaneously | Break into sequential migrations, never do all at once |
Critical migration rule: If the assessment reveals a CRITICAL-risk migration, recommend breaking it into 2-3 sequential migrations (e.g., migrate database first, then swap auth, then move platform). Each sequential migration gets its own plan. Never execute multiple HIGH-risk changes simultaneously.
# Migration Assessment — [project]
## Classification
- **Type:** [Database | Framework | Auth | Platform | Structural | Dependency | Ecosystem]
- **Risk:** [LOW | MEDIUM | HIGH | CRITICAL]
- **Estimated steps:** [N]
- **Estimated sessions:** [N]
## Current State
[Dense summary from checkpoint reads or code scan]
## Target State
[What the user wants to achieve]
## Gap Analysis
| Gap | Current | Target | Effort | Risk |
|---|---|---|---|---|
## Dependencies
[What must be true before migration starts — tests passing, backups, etc.]
## Recommendation
[Proceed with single migration plan | Break into sequential migrations | Defer — prerequisites missing]Write checkpoint: phase "assessed".
/oc-migrate plan)Generate an incremental migration plan. Every step has a verification gate and a rollback procedure. The plan follows the expand-migrate-contract pattern where applicable.
Before generating any plan, web search for the migration path. Frameworks publish migration guides, databases have export/import docs, and platforms document cutover procedures. Search for [source] to [target] migration guide [year] and read the official docs before writing a single step. The official guide overrides generic patterns — if Hono v5 has a codemod, use it instead of manual find-and-replace.
For most non-trivial migrations, the safest approach is:
new column alongside old). Both systems work simultaneously.
of no return — keep rollback available until this step.
Not every migration needs this pattern. Dependency swaps and minor framework upgrades can often be done in-place. The assessment's risk level determines the approach:
| Risk | Approach |
|---|---|
| LOW | In-place upgrade with tests |
| MEDIUM | Feature-flagged rollout or branch-based |
| HIGH | Full expand-migrate-contract |
| CRITICAL | Break into sequential HIGH migrations, each with expand-migrate-contract |
Every step in the plan follows this structure:
## Step [N]: [Short title]
### Owner
CLAUDE | USER | CLAUDE+USER
(CLAUDE = autonomous execution. USER = only a human can do this — create accounts,
fill .env, DNS changes. CLAUDE+USER = Claude drafts, user reviews/confirms.)
### What Changes
[Specific files, configs, schemas, or infrastructure being modified]
### Pre-Conditions
[What must be true before this step runs — prior steps passed, tests green, etc.]
### Procedure
[Numbered instructions. Concrete commands, not vague descriptions.]
### Verification
[How to prove this step succeeded. Specific checks:]
- [ ] [Testable condition — command to run, expected output]
- [ ] [Another condition]
### Rollback
[How to undo this step if verification fails. Specific commands.]
- [ ] [Rollback step 1]
- [ ] [Rollback step 2]
- [ ] [Verify rollback succeeded]
### Point of No Return?
[YES/NO. If YES, explain why and what must be confirmed before proceeding.]
### Estimated Time
CLAUDE: [time] | USER: [time]Read references/migration-playbooks.md for type-specific step templates. General ordering principles:
Database migrations:
Framework upgrades:
[framework] [version] migration guide — read breaking changesAuth provider swaps:
Platform moves:
Present the complete plan. User reviews every step, rollback procedure, and point of no return. Do NOT proceed until explicitly approved.
Write checkpoint: phase "planned".
/oc-migrate execute)Execute the migration plan step by step. Each step is a mini-cycle: pre-check (block on missing preconditions) → execute (rollback on error) → verify (retry / manual fix / rollback on fail) → checkpoint (save progress + verification).
verification before the next begins.
without errors. It's done when the verification checks pass.
session knows exactly where to resume.
point the user must explicitly confirm they want to proceed.
change without applying it.
After each step:
## Step [N] — Execution Report
### Status: PASSED | FAILED | ROLLED BACK
### Procedure Output
[Key output from the commands run]
### Verification Results
- [x] [Check 1] — PASSED [evidence]
- [ ] [Check 2] — FAILED [what went wrong]
### Duration
CLAUDE: [X min] | USER: [Y min]
### Next
[What happens next — next step, or remediation needed]/oc-migrate verify)Run the full verification suite against the current state. This can be invoked:
| Layer | What to Check | Tools |
|---|---|---|
| Schema | Target schema matches expected (tables, columns, types, indexes) | SQL inspection, ORM schema dump |
| Data | Row counts match, checksums match, no orphaned records | COUNT queries, spot-check samples |
| API | All endpoints respond correctly with new backend | Smoke test suite, contract tests |
| Auth | Users can authenticate, sessions valid, permissions correct | Auth flow test, token validation |
| Performance | No regression in response times | Baseline comparison, p95 latency |
| Integration | External services still connected and functional | Integration health checks |
| CI/CD | Pipeline passes with new configuration | Full CI run |
# Migration Verification — [project]
## Migration: [description]
## Steps Completed: [X] of [Y]
## Verification Results
| Layer | Status | Evidence | Notes |
|---|---|---|---|
| Schema | ✅ PASS | 12 tables, all indexes present | — |
| Data | ✅ PASS | Row counts match ±0, checksums verified | — |
| API | ⚠️ PARTIAL | 18/20 endpoints pass, 2 timeout | See findings |
| Auth | ✅ PASS | Both users authenticated successfully | — |
| Performance | ✅ PASS | p95 42ms (baseline: 45ms) | Slight improvement |
## Open Issues
1. [Issue with details and remediation plan]
## Verdict: MIGRATION COMPLETE | ISSUES REMAINING/oc-migrate rollback)Revert to the last verified state. Rollback granularity depends on migration progress:
| Scenario | Strategy |
|---|---|
| Step N failed, steps 1-(N-1) verified | Roll back step N only |
| Multiple steps failed | Roll back to last verified step |
| Full migration needs reversal | Execute rollback procedures in reverse order |
| Post-cutover rollback (platform move) | DNS revert + traffic switch |
| Data migration rollback | Restore from backup taken at step 1 |
After rollback, run the same verification suite against the original state:
Migrations are the most checkpoint-dependent skill in the ecosystem. A database migration might span 4+ sessions:
At the end of each session (or when context is getting long):
On resume, oc-migration-ops:
/oc-migrate impact)Before executing, analyze blast radius — what could break at each step and who's affected.
## Impact Analysis — [migration description]
### Service Dependencies
[Which services/users/integrations depend on the system being migrated]
### Per-Step Impact
| Step | What Changes | Who's Affected | Downtime | Rollback Time |
|---|---|---|---|---|
| 1. Backup | Nothing visible | Nobody | 0 | N/A |
| 2. Schema | Nothing visible | Nobody | 0 | < 1 min |
| 3. Dual-write | Write latency +10ms | All users | 0 | < 5 min |
| 4. Data migration | Read latency +20ms | All users | 0 | 30 min (restore backup) |
| 5. Read switchover | ★ CRITICAL — brief read gap | All users | ~30s | < 5 min |
### Risk Mitigation
| Risk | Likelihood | Mitigation |
|---|---|---|
| Data loss during migration | LOW | Backup verified at step 1, checksums per batch |
| Auth gap during switchover | MEDIUM | Feature flag, gradual rollout (10% → 50% → 100%) |
| Performance regression | LOW | Baseline metrics captured, alert if p95 > 2x |
### Recommended Timing
[When to run this migration — low-traffic window, maintenance window, or safe anytime]| Skill | Relationship |
|---|---|
| oc-reverse-spec | Upstream. Reads oc-reverse-spec output for current state documentation. If no oc-reverse-spec exists, runs a targeted scan of the migration-relevant layers only. |
| oc-stack-forge | Upstream. Reads stack decisions. For platform moves, invokes oc-stack-forge to validate the target stack before planning. |
| oc-app-architect | Peer. If migration reveals spec updates needed (new architecture after database change), chains to oc-app-architect to update spec files. |
| oc-code-auditor | Downstream. After migration completes, invokes /oc-audit full on the migrated code to catch quality regressions. |
| oc-deploy-ops | Downstream. For platform moves and cutover deploys, chains to oc-deploy-ops for the deployment steps. |
| oc-security-auditor | Downstream. Auth migrations always trigger a security posture check afterward. |
| oc-scale-ops | Peer. Platform moves may change scaling characteristics. Reads oc-scale-ops for performance baselines. |
| oc-git-ops | Downstream. After migration steps that produce code changes, suggests oc-git-ops commit. |
| oc-monitoring-ops | Downstream. Platform moves and database migrations change health check URLs, connection targets, and alert thresholds. Invoke /oc-monitor setup to update monitoring config after cutover. |
| Trigger | Action |
|---|---|
| Assessment needs current state docs | Check oc-reverse-spec checkpoint → if missing, run targeted scan |
| Platform move planned | Invoke oc-stack-forge to validate target stack |
| Migration complete | Invoke oc-code-auditor /oc-audit full |
| Auth migration complete | Invoke oc-security-auditor /oc-security posture |
| Code changes from migration steps | Suggest oc-git-ops /oc-git-sync |
| Cutover deployment needed | Invoke oc-deploy-ops /oc-deploy staging then /oc-deploy prod |
| Platform or database migration complete | Invoke oc-monitoring-ops /oc-monitor setup to update health checks and alert targets |
Checkpoint: {project-dir}/.checkpoints/oc-migration-ops.checkpoint.json
When any /oc-migrate command is invoked:
One active migration per project. If a checkpoint exists with status: in_progress, block any new /oc-migrate assess or /oc-migrate plan until the current migration is completed, rolled back, or explicitly abandoned via /oc-migrate abandon. This prevents half-finished migrations from being orphaned by a new one starting on top.
/oc-migrate abandon archives the checkpoint (.bak) and warns: "Abandoning mid-migration may leave the system in a partial state. Run /oc-migrate verify to check current health."
[
{ "id": "assessment", "label": "Assessment + classification", "status": "not_started" },
{ "id": "plan", "label": "Migration plan generation", "status": "not_started" },
{ "id": "plan-gate", "label": "★ Plan approval", "status": "not_started" },
{ "id": "step-1", "label": "Step 1: [title]", "status": "not_started" },
{ "id": "step-2", "label": "Step 2: [title]", "status": "not_started" },
{ "id": "step-3", "label": "Step 3: [title]", "status": "not_started" },
{ "id": "verification", "label": "Final verification", "status": "not_started" },
{ "id": "cleanup", "label": "Cleanup + decommission", "status": "not_started" }
]The skill_state shape varies by migration type. Common fields are always present; type-specific fields are included only when relevant.
{
"migration_type": "database",
"risk_level": "HIGH",
"source": "D1 (SQLite)",
"target": "Supabase Postgres",
"total_steps": 9,
"current_step": 4,
"steps_verified": [1, 2, 3],
"step_failures": [
{ "step": 4, "attempt": 1, "error": "brief description", "rollback": "succeeded" }
],
"rollback_available": true,
"point_of_no_return_reached": false,
"_type_specific_fields_below": "shape depends on migration_type",
"backup_location": "d1-backup-20260423.sql",
"dual_write_active": true,
"primary_database": "d1"
}Type-specific fields by migration type:
| migration_type | Additional fields |
|---|---|
| database | backup_location, dual_write_active, primary_database, tables_migrated |
| framework | source_version, target_version, breaking_changes_fixed |
| auth | old_provider, new_provider, feature_flag_state, users_migrated |
| platform | old_platform, new_platform, dns_ttl, cutover_timestamp |
| structural | files_moved, imports_updated, configs_updated |
| dependency | packages_upgraded, breaking_changes_count |
| ecosystem | skills_updated, skills_remaining, protocol_version_from, protocol_version_to |
| Event | What to Save |
|---|---|
| Assessment complete | Migration type, risk, source/target, gap analysis |
| Plan generated | Step count, step titles, rollback procedures |
| Plan approved | Gate passed, plan finalized |
| Each step executed | Step result, verification outcome, timing |
| Each step verified | Verification results, pass/fail per check |
| Rollback executed | What was rolled back, verification of clean state |
| Migration complete | Final verification results, total timing |
| Manual task assigned | What the user needs to do before next session |
| Reads from | Why |
|---|---|
| oc-reverse-spec | Current state documentation — architecture, schema, stack |
| oc-app-architect | Spec files — data model, API design, auth spec |
| oc-stack-forge | Stack decisions — platform capabilities, limitations |
| oc-code-auditor | Pre-existing findings — don't introduce new issues |
| oc-scale-ops | Performance baselines — detect regression after migration |
| oc-deploy-ops | Deployment config — environments, URLs, health checks |
| Read by | Why |
|---|---|
| oc-deploy-ops | Migration status → deploy confidence, cutover readiness |
| oc-code-auditor | Post-migration findings → quality gate |
| oc-app-architect | Spec updates needed → architecture doc refresh |
| oc-orchestrator | Migration progress → pipeline status, blockers |
/oc-migrate diff) and History (/oc-migrate history)/oc-migrate diff compares current system state against target state, showing per-area progress (Schema / Data / API / Auth / Config) with completion percentages, current dual-write posture, and the next step.
/oc-migrate history reads steps_verified and step_failures from the checkpoint and lists each completed step with outcome (✅/❌→✅ retry/❌ failed), duration, and session number. Both views are read-only summaries — execution happens via /oc-migrate execute.
For the full output formats and example renders, see references/migration-playbooks.md.
project-dir/
├── .checkpoints/
│ └── oc-migration-ops.checkpoint.json
├── migrations/
│ ├── assessment.md # Assessment report
│ ├── migration-plan.md # Full plan with all steps
│ ├── impact-analysis.md # Blast radius report
│ ├── steps/
│ │ ├── step-01-report.md # Execution report per step
│ │ ├── step-02-report.md
│ │ └── ...
│ └── verification/
│ ├── pre-migration.md # Baseline state snapshot
│ ├── step-03-verify.md # Per-step verification
│ └── final-verify.md # Final verification reportMigrations are multi-week, multi-step, multi-engineer. They are also genuinely scary — the kind of work where everyone in the org wants to know the current state. v1.2 makes that state legible in the PM tool the team already lives in. See oc-integrations-engineer for the canonical PM-MCP patterns.
When /oc-migrate plan produces the migration plan:
Migration: {from-engine} → {to-engine}chore or epic from .opchain/pm.yaml (use epicmapping if available — migrations are exactly the kind of work epics exist for).
duration + abort criteria + the rollback strategy.
migration, area:<from-engine>, area:<to-engine>,risk:<low/med/high>.
Step {NN}: {step-name}Todo initially.oc-migration-ops.checkpoint.json so the executor knows which ticket to update at each step.
The plan is the source of truth; the PM tool reflects it.
plan-pending Step is in the plan, not yet started
in_progress /oc-migrate execute picked it up
verified /oc-migrate verify passed
blocked Verification failed; rollback in progress
rolled-back Step was undone; back to plan-pending or aborted
done Verified + signed off; safe to advanceState transitions on the PM ticket happen at the same instants the checkpoint is updated. The PM comment thread carries the verifier output; the checkpoint carries the canonical machine-readable record.
Every state transition emits a comment on the step ticket:
{state-from} → {state-to} at {timestamp}
Verifier: {pass-summary OR failure-detail}
Next: {next-action OR blocker}
Checkpoint: .checkpoints/oc-migration-ops.checkpoint.jsonIf the step touches a separately-tracked feature ticket (e.g. the migration is happening to unblock PLAT-4471), comment back on that ticket too: Migration step N completed; PLAT-4471 unblocked.
Aborts are big enough that they get their own visibility:
MIGRATION ABORTED at step {N}. Rollback in progress.
rolled-back with the abort reason.For long-running migrations (multi-week), oc-monitoring-ops and oc-deploy-ops will write into the same parent ticket via their own PM-MCP integrations — deploy tickets parent-link to the migration parent, incident tickets back-reference if any incident is traced to a migration step. The parent ticket becomes the project homepage.
intended transition; user can /oc-migrate sync-pm to flush.
parent → phase tickets (≤6) → step tickets per phase. Avoids a flat list of 50 children that nobody can navigate.
ticket using the PM tool's @mentions (or labelled assignment if mentions aren't available).
discover blockers mid-migration. Skip planning and you'll have no rollback.
can't be undone, it's a point of no return that requires explicit user confirmation.
data migration step. Fast migrations that lose data are failures.
simultaneously before cutting over. The expand-migrate-contract pattern exists because big-bang cutovers fail.
Every completed step, every verification result, every manual task — checkpoint it.
at the same time is how outages happen. Sequential, not simultaneous.
versions. Read them before planning — the breaking changes are documented.
file before changing any of them. The file you forgot to update is the one that breaks trigger routing next Tuesday.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.