---
name: migration-execute
description: Execute a migration implementation plan from docs/migration/NNN-implementation-<component>.md — working through its TODO commit checklist task by task. Use this whenever the user wants to implement/carry out/run a migration plan, do the next migration commit, or turn a docs/migration plan into code (any legacy component: WCF service, ASP.NET MVC/WebForms front-end, Web API, Windows service, library, etc.). Code is always written by a subagent and every change is verified against the plan by a separate subagent.
---

# migration-execute

Drives a migration **implementation plan** to completion. The plan lives at
`docs/migration/NNN-implementation-<component>.md` and ends with a **TODO commit
checklist**. This skill walks that checklist one task at a time. It works for any
legacy component being migrated (back-end service, front-end, API, library, …).

This skill is an **orchestrator**: it does not write production code itself. It
delegates, verifies, and commits.

## Non-negotiable rules

1. **Implementation is always done by a subagent.** Never edit production code in the
   main thread. Spawn one implementer subagent per checklist task.
2. **Verification is always done by a separate subagent.** After each task, a different
   subagent checks the change against the plan + tests. The implementer never grades itself.
3. **Minimum viable change.** Implement only what the task requires — the simplest code
   that migrates the behaviour. No speculative features, no new design patterns, no
   frameworks the plan didn't ask for. **KISS, DRY, YAGNI, Single Responsibility.**
4. **Surgical, atomic commits, after a passing review.** A task is committed only once its
   verifier subagent returns `pass`. One checklist item → one commit, using the **exact**
   commit message from the plan's checklist and the branch the plan names, with the repo's
   commit footer convention (see `CLAUDE.md`).
5. **Mark progress in the same commit.** Flip this item from `- [ ]` to `- [x]` in the plan
   file's `## TODO (commit checklist)` / `## TODO (lista commitów = checklista)` section
   **before** committing, and **stage the plan file together with the code** so the checklist
   tick lands in the *same* atomic commit as the task. The plan file is the single source of
   truth for what is done — never leave the checklist edit uncommitted in the working tree.
6. **Stay faithful to the plan.** If reality contradicts the plan, stop and surface it to
   the user — don't improvise scope.

## Procedure

1. **Load context.** Read the `NNN-implementation-<component>.md` (plan + TODO checklist)
   and, for context, the matching `NNN-research-*` and `NNN-tests-*`. Confirm/create the
   branch the plan specifies.
2. **For each unchecked TODO item, in order:**
   a. **Implement (subagent).** Spawn an implementer subagent scoped to that single task.
      Give it: the task, the relevant plan section, the tests it must satisfy, the files
      it may touch, and the **Implementer principles** below. It returns the diff/changed files.
   b. **Verify (separate subagent).** Spawn a verifier subagent with the plan's acceptance
      criterion for that task and the test plan. It must run/inspect the change and return a
      clear pass/fail with evidence (build result, test result, plan-conformance notes).
   c. **Loop until verified.** On fail, feed the verifier's findings back to a fresh
      implementer subagent and repeat. Goal-driven: stop only when the success criterion is met.
   d. **Tick the checklist (after `pass`, before commit).** In the plan file's
      `## TODO (commit checklist)` / `## TODO (lista commitów = checklista)` section, change
      this item's `- [ ]` to `- [x]`.
   e. **Commit.** Stage the code changes **and the updated plan file** and make one atomic
      commit with the checklist's exact message (+ repo commit footer). The checklist tick
      ships inside the same commit — nothing about this task is left uncommitted.
3. **Pause at milestones** the plan marks for human review (e.g. first local run), and
   report progress.
4. **Finish** when the checklist is complete; report what was built and how it was verified.

## Implementer principles (pass these to every implementer subagent)

- **Think Before Coding** — Don't assume. Don't hide confusion. Surface tradeoffs.
- **Simplicity First** — Minimum code that solves the problem. Nothing speculative.
- **Surgical Changes** — Touch only what you must. Clean up only your own mess.
- **Goal-Driven Execution** — Define success criteria. Loop until verified.

Plus: simplest code that migrates the behaviour, no new design patterns, KISS/DRY/YAGNI/SRP.

## Verifier brief (pass to every verifier subagent)

- Check the change against the plan's acceptance criterion for this task **and** the
  relevant tests — not against your own taste.
- Confirm scope: nothing beyond the task was changed (surgical).
- Build/run or execute tests where applicable; report concrete evidence.
- Return `pass` only if the success criterion is objectively met; otherwise `fail` with
  specific, actionable findings.
