Help us improve
Share bugs, ideas, or general feedback.
From plan-workflow
Creates verified implementation plans using an 8-phase workflow with 3 human approval gates. Invoked when changes touch >3 files, cross layers, or require /compact context.
npx claudepluginhub minhthang1009/dotclaude --plugin plan-workflowHow this skill is triggered — by the user, by Claude, or both
Slash command
/plan-workflow:plan-refactorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Universal 8-phase process for creating verified, implementation-ready plans. Applicable to any plan type: feature addition, bug fix, refactoring, rename, migration, security hardening.
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
Universal 8-phase process for creating verified, implementation-ready plans. Applicable to any plan type: feature addition, bug fix, refactoring, rename, migration, security hardening.
Eight principles govern every decision in this workflow. Full descriptions with failure mode mappings are in references/principles.md. Summary:
**FINAL DECISION: [reason]**. Do not reopen it.Create a plan when any of these is true:
If none of these apply: make the change directly, run tests, done.
Identify the plan type from the user's request, then read the corresponding appendix for type-specific audit criteria, risk ordering, and verification steps:
references/appendix-rename.mdreferences/appendix-bugfix.mdreferences/appendix-feature.mdPhase 0 PRE-FLIGHT → test baseline + git clean + behavioral baseline (P4)
↓
Phase 1 EXPLORE → ground truth inventory (P2)
↓
Phase 2 AUDIT ×2 → two independent agents, max 2 rounds (P3)
↓
Phase 3 CONSOLIDATE → verify every finding; scope freeze (P2, P6)
↓ ★ HUMAN GATE 1: approve findings + scope
Phase 4 DRAFT PLAN → self-contained contract document (P1)
↓
Phase 5 VERIFY PLAN → fresh agent, adversarial — use /verify-plan (P3)
↓ ★ HUMAN GATE 2: approve plan before first edit
Phase 6 IMPLEMENT → one phase at a time; test gate after each (P4)
↓
Phase 7 POST-IMPL → cascade + schema + docs — use /audit-dead (P5)
↓ ★ HUMAN GATE 3: review findings before sign-off
Phase 8 FINAL VERIFY → test = BASELINE, 0 stale references (P4)
Spawn an Explore subagent to produce a ground truth inventory. The prompt must answer three questions:
src/)Non-negotiable: The inventory must include test files and documentation files (**/*.md). These are missed in every first-pass inventory — enumerate them explicitly in the subagent prompt. Identify the test file naming pattern for this codebase (*.test.js / *_test.py / *.spec.ts / etc.).
Do not proceed to Phase 2 until the inventory has been verified by spot-checking locations directly (P2). Read at least 3 locations yourself to confirm the subagent reported correctly.
Spawn two agents in parallel, each reading the codebase independently with no shared context:
Agent A — structural audit: Is the current structure correct? Look for code in the wrong place (wrong file, wrong layer, wrong abstraction level), names that don't reflect actual behavior, ordering that conflicts with execution flow, and contracts inconsistent with how callers use them.
Agent B — correctness audit: Is anything broken, unused, or inconsistent? Look for dead imports, dead parameters, dead variables, schema gaps between parallel execution paths (e.g., main path returns stockQuantity but fallback path does not), and broken assumptions the proposed change will invalidate.
Rules:
For each finding from Phase 2:
**FINAL DECISION: [reason]** (P7).Scope freeze (P6): Any finding outside the original scope → log in a separate backlog file. Do not expand the plan. Scope creep is how plans fail.
Common false positives to filter out:
★ HUMAN GATE 1: Present the confirmed findings list and proposed scope to the user. State what is IN scope and what was explicitly moved to backlog. Wait for explicit approval before drafting the plan. Do not proceed to Phase 4 without it.
Risk ordering: Phase the changes lowest-risk first, highest-risk last. Lower risk = fewer callers affected, easier to revert, no behavioral change visible to users. Higher risk = shared interfaces, public APIs, data migrations, user-visible behavior. For type-specific risk ordering, read the appropriate appendix.
For each phase in the plan: Include specific changes with verified locations (use grep-confirmed locations, not line numbers — line numbers go stale after prior-phase edits), a verification method describing how to confirm the change is correct, and a test gate: [test command] → BASELINE pass.
Required plan sections:
## What Does NOT Change
[Things explicitly reviewed and decided to leave as-is, with reasons.
Prevents re-litigation of settled decisions across sessions. (P1, P7)]
## Implementation Phases
[ordered by risk; each phase has: changes + locations + verification + test gate]
## Files Touched — Complete List
[production files + test files (with codebase-specific pattern) + *.md documentation — all three]
## Post-Implementation Checks
[what specifically to audit after all phases complete — type-specific, see appendix]
## Context Files to Re-read After /compact
[paths to CLAUDE.md files and other context lost after compaction (P1)]
The plan is ready for Phase 5 when: all locations are verified against actual files (not estimated), "What Does NOT Change" table is complete (no open questions remain), and the file list explicitly includes test files and documentation files.
Invoke /verify-plan or spawn a fresh agent with the plan document only — no context from the planning session (P3).
The agent checks: all stated file paths exist, all stated locations are current (re-reads the file at each location), no file with relevant content is missing from the touched list (test files and documentation files checked explicitly), and "What Does NOT Change" entries correctly identify what should be excluded.
When blockers found: Return to Phase 4. Fix the specific claim (re-grep, re-read the file). Re-run Phase 5. When warnings found: Fix inline if obvious; otherwise escalate to the user.
★ HUMAN GATE 2: Present the verified plan to the user. State: "Plan verified — 0 blockers. Ready to implement Phase 1. Proceed?" Wait for explicit approval before making any code change. This is the last moment to revise the plan without touching code.
Rollback protocol: Commit to git before starting each phase. If a phase needs to be undone: git revert <phase-commit>. Never start a new phase with uncommitted changes from the prior one.
For each phase in the plan:
If tests fail: Test references old behavior → update the test. Functional regression → git revert the phase commit; find root cause before re-applying. Unrelated flaky → re-run once; if still failing, investigate and fix before proceeding.
Anti-bias (P3): After a risk-bearing edit batch (shared/logic-bearing changes, or too many to track — >5 edits is one signal), dispatch a fresh agent to review the changes before reporting done.
New issues found during implementation: Note them, continue the current phase, add to Phase 7 list (P6). Do not stop to replan.
Invoke /audit-dead or execute checks manually. Universal checks that apply to all plan types: cascade effects (did this change make something else unused, unreachable, or incorrect?), consistency across parallel paths (all paths returning the same type still have the same fields?), documentation staleness (search explicitly for stale references), and YAGNI params ("reserved for future use" = remove and trace cascade).
For type-specific checks, read the appendix.
★ HUMAN GATE 3: Present findings to the user before signing off. Report: (1) what the plan said would change and is now done, (2) what Phase 7 found that was NOT in the plan, (3) current test count vs BASELINE. The user decides whether Phase 7 findings require additional action before sign-off.
Search for stale references in source files (use this codebase's extension), documentation files (*.md), and test files (use this codebase's test pattern) → all searches must return 0 results. Run test suite → must equal BASELINE exactly. Log any items deferred to backlog.
Sign off: BASELINE: N. Final: N. Delta: 0.
For detailed guidance beyond the core workflow, consult:
references/principles.md — Full P1–P8 descriptions with consequences and failure mode mappingsreferences/appendix-rename.md — Symbol renaming and structural refactoring: occurrence counts, DO NOT RENAME list, mass rename scripts, dead parameter cascade, MISPLACED_FUNCTIONreferences/appendix-bugfix.md — Bug fix plans: reproduction, root cause, failing test first, regression testreferences/appendix-feature.md — Feature addition plans: interface-first design, integration points, edge case verification