Implement plan

From blockscout/mcp-server · View interactive version

Implement plan is an AI agent skill from the GitHub repository blockscout/mcp-server. Use to implement a structured implementation plan (e.g. temp/impl_plans/issue-*.md) phase by phase. Trigger when the user asks to implement, execute, realize, or "do" an implementation-plan file. Orchestrates a phase-developer subagent and a plan-correspondence-verifier subagent for each phase, comm

How to use this skill

Skill file

Implement Plan

Orchestrate the implementation of a structured implementation plan — the kind under temp/impl_plans/ — phase by phase, using two subagents per phase. The plan file path is the argument to this skill ($ARGUMENTS); if none was given, ask the user which plan to implement.

Your role

You are the orchestrator. You do not implement or verify anything yourself. You parse the plan, dispatch a phase-developer subagent to each phase, dispatch a plan-correspondence-verifier subagent to check it, loop until the phase is clean, commit it, and at the end walk the Final Checklist. Keeping implementation and verification in separate subagents — and out of your own context — is what keeps each run small, focused, and traceable.

One rule above all: pass slices by reference, never paraphrase

The plan is cut into per-section files by scripts/slice_impl_plan.py (Step 1). You hand each subagent the path to the slice it needs — you never paste the content into a prompt, and you never summarize or reword it. Pasting copies the same bytes into your context once per phase and once per round, driving you toward compaction; paraphrasing can silently drop a step, and then both the developer (who won't build it) and the verifier (who won't check it) inherit the loss. The slice files on disk are the single verbatim source of truth. Your job is to route paths, capture baselines, and commit.

The two subagents

Both subagents return lean reports by design: the developer restates only its integration-test evidence and any blocker — you and the verifier reconstruct everything else from the real diff — and the verifier returns a single-line Checked summary on success. Full evidence stays in each subagent's own transcript; keeping it out of your context is what keeps the run small and traceable. When you relay the developer's integration evidence to the verifier, pass it verbatim — same rule as the slices: never summarize a subagent's output before handing it on.

The exact text to pass each one is in references/dispatch-templates.md. Read it before dispatching.

Step 0 — Preconditions

  1. Confirm the plan file exists at the path in $ARGUMENTS. If the path wasn't provided, ask which plan to implement. Do not read the whole plan into your context — Step 1 slices it into files and you dispatch by path; keeping the full plan out of your own context is the point of this design.
  2. Check the current branch (git branch --show-current). If it is main (the default branch), stop and ask the user to create and check out a working branch first — this skill commits as it goes and must not commit onto main.
  3. Check the working tree (git status). If there are unrelated uncommitted changes, surface them and confirm with the user before proceeding, so per-phase commits stay clean. (The plan slices are written under .ai/tmp/impl/, which is gitignored, so they never enter your commits.)

Step 1 — Slice the plan into per-section files

Run the slicer; it validates the plan's markers and writes one file per section. Follow the repo's environment rule (devcontainer — /.dockerenv exists: run python …; host: uv run python …):

python scripts/slice_impl_plan.py <plan-file>

It writes .ai/tmp/impl/<plan-stem>/ with preamble.md, phase-1.md … phase-N.md, and final-checklist.md, and prints a manifest (each slug, its file path, and its phase title). Branch on the exit code:

Capture the slug → title list and the slice directory; Step 2 dispatches from these files.

Step 2 — Implement each phase, in order

Phases are sequential; never start phase N+1 before phase N is committed (the plan's ordering often depends on it). For each phase:

  1. Record the baseline: git rev-parse HEAD — the ref the verifier diffs against for this phase. Capture it before dispatching the developer.
  2. Dispatch a fresh phase-developer with the first-round brief from the templates file: the paths to preamble.md and this phase's phase-<N>.md, the other-phase titles (from the manifest), and the baseline note. Its report is deliberately short — a status line, its integration-test evidence (or "none"), and anything it could not complete. Note the integration-evidence block to relay next; a "could not complete" means escalate (step 5).
  3. Dispatch a fresh plan-correspondence-verifier with its brief: the paths to preamble.md and this phase's phase-<N>.md, the baseline ref, and the developer's integration-evidence block lifted verbatim (or "none"). Read its verdict — on COMPLETE it is just two lines; the per-step detail stays in the verifier's own transcript, not your context. If this phase's deliverable is an integration test (a live test plus its skip-gate), also append the optional integration-re-run block from the templates so the verifier can confirm first-hand that the test ran rather than silently skipped.
  4. Branch on the verdict:
  1. Bound the loop. Allow at most 3 developer↔verifier rounds for a phase. If the verifier still reports gaps after the 3rd round — or if a developer reports it cannot complete a step — stop and escalate to the user: show the latest developer report and the verifier's outstanding gaps, and ask how to proceed. Never commit an unverified phase.
  2. Commit the phase on the current branch once the verdict is COMPLETE. Use a message like Phase <N>: <phase title>. Do not push and do not open a PR — leave the branch for the user to review. End the commit message with the harness Co-Authored-By trailer.
  3. For the final summary you need only the phase's title, its commit, and any "could not complete"/escalation — not verbose prose. The trimmed developer and verifier reports already give you exactly that; detailed evidence stays in each subagent's transcript.

Each phase = one commit. A fresh developer every round is intentional: all state lives in the git working tree, so a new subagent loses nothing and stays focused on exactly the open gaps.

Step 3 — Final Checklist

After all phases are committed, read the Final Checklist slice (<slice-dir>/final-checklist.md) and walk each item. Classify each:

For any runnable/inspectable item that is not satisfied, dispatch a phase-developer to fix exactly that item (brief: the failing item + the path to the most relevant slice). Because you re-run the defining check yourself, the fix developer need only report "done" or "blocked, because …" — don't rely on a verification narrative. Re-verify the item yourself, then commit the fix (Final checklist: <item>). Reuse the developer↔verifier loop and the same 3-round bound if a fix is non-trivial.

Step 4 — Final report to the user

Summarize:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.