Skip to content
migrate logo

Migrate

migrate

Interactive cleanup of broken tests and code after a new feature lands. Use this skill when: (1) TDD is complete but the full test suite has failures, (2) the user says "migrate" or "fix broken tests", (3) preparing a branch for PR after feature work.

SKILL.md

Full skill instructions

Migrate

Interactive cleanup after TDD execution. You run the suite, surface breakage, and the user decides what to do about each failure. You execute their decisions.

Prerequisites

  • TDD execution is complete (new feature tests pass)
  • Full test suite has not been verified green yet

Process

0. Environment Setup

Activate virtual environments and verify infrastructure before running tests:

# Backend: activate venv (NEVER claim "pytest unavailable" without checking)
cd backend && source venv/​bin/​activate && python -m pytest --version

# Frontend: verify node_modules
cd frontend && ls node_modules/​.bin/​vitest

# E2E: start servers if needed for E2E tests
cd backend && source venv/​bin/​activate && uvicorn app.main:app --port 8001 &
cd frontend && npm run dev -- --port 5174 &

If venv or node_modules don't exist, install dependencies first (pip install -r requirements.txt / npm install).

1. Run Full Suite

Run all test layers (with venv activated for backend):

cd backend && source venv/​bin/​activate && python -m pytest
cd frontend && npm test -- --run
cd e2e && npx playwright test

Collect all failures.

2. Categorize Failures

Separate failures into:

CategoryMeaningAction
New feature tests failingBug in the featureFlag — TDD didn't complete cleanly
Existing tests failingCascade from new behaviorPresent to user for decision

All failures are caused by this branch — main is always green.

3. Present Each Failure

For each existing test failure caused by the new feature, use AskUserQuestion:

Present:

  • Test name and file
  • What it asserts (the old behavior)
  • Why it fails (the new behavior)
  • Relevant code diff if helpful

Options:

  • Update test — modify assertions to reflect new correct behavior
  • Remove test — this scenario no longer applies
  • This is a bug — the feature broke something it shouldn't have; needs fixing
  • Skip for now — revisit later

Group related failures by topic when possible (e.g., "These 4 tests all assert the old response format for GET /​recipes").

4. Execute Decisions

For each decision:

  • Update test: Modify the test to assert new behavior. Run it to confirm it passes.
  • Remove test: Delete the test. If it was the only test for that behavior, ask if replacement coverage is needed.
  • Bug: Create a LEARNING task noting the regression. Do not fix in migration — this goes back to the feature implementation.
  • Skip: Leave as-is, note it for later.

5. Database Migrations

Evaluate code changes in this branch for database impact:

  • Check for new/​modified models, schema changes, or new fields
  • Check for changed relationships or constraints
  • Check for renamed or removed columns/​tables

If database changes are detected, present to user via AskUserQuestion:

  • What changed (model/​field/​relationship)
  • Whether a migration is needed (new table, altered column, etc.)
  • Suggested migration approach (e.g., Alembic revision, data backfill, nullable transition)

For each migration needed:

  • Generate migration: Create the migration file, run it, verify it applies cleanly
  • Data backfill: If existing rows need default values, suggest and confirm approach
  • Destructive changes: Flag column/​table removals — confirm data loss is acceptable

If no database changes detected, skip this step.

6. Verify

After all decisions are executed:

  • Run full suite again
  • If new failures appear (from the fixes), repeat from step 3
  • Continue until suite is green or only skipped/​bug items remain

7. Summary

Present final state:

  • Tests updated: [count and list]
  • Tests removed: [count and list]
  • Migrations created: [count and list]
  • Bugs found: [count and list — these need attention]
  • Skipped: [count and list]
  • Suite status: GREEN / remaining failures

Tell the user: "Migration complete. Run /​code-review to verify against the plan before PR."

Principles

  • User decides — never update or remove a test without explicit approval
  • Group related failures — don't ask about 10 tests one at a time if they're the same issue
  • Bugs go back — if the feature broke something unintentionally, that's a bug, not a migration
  • Green suite before PR — the goal is a clean test suite

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View