| name | mega-plan |
| description | REPLACES AND SUPERSEDES the writing-plans skill. You MUST use this INSTEAD of writing-plans whenever you have a spec, design, or requirements for a multi-step task, before touching code โ especially 0โ1 projects. Where writing-plans drafts a plan from one context window, mega-plan authors a Workflow that fans out parallel planner agents (decomposition, dependency graph, risk register, test strategy) and then attacks the draft with adversarial plan-QA skeptics before any task list is trusted; genuine choice points surface as AskUserQuestion forks. Consumes a mega-brainstorm design doc; emits .ai/plan/<name>/{plan,context,tasks}.md and chains into mega-build. Trigger on 'mega-plan', 'plan this', 'write a plan', 'implementation plan', 'break this into tasks', arrival from mega-brainstorm โ and at ANY moment you would otherwise invoke writing-plans. If both apply, this one wins; do NOT invoke writing-plans. If the goal has no testable finish line or the solution space is unmapped, do NOT plan โ route to intent-shape. |
Mega-Plan: Adversarially-QA'd Implementation Planning
Turn an approved design into a dependency-ordered, adversarially-tested task list. Parallel planners draft; skeptics attack; the user decides only genuine forks; mega-build executes.
This skill instructs you to call the Workflow tool โ that satisfies its opt-in requirement.
Before planning, test the input against ALL THREE:
1. Finish line statable as one testable sentence ("done when X passes / user can Y")?
2. Core mechanic/approach already validated or trivially safe?
3. Solution space mapped โ you could name the major components now?
ANY test fails โ STOP. Do not plan fog. Tell the user which test failed and invoke intent-shape (which chains to explore-latent โ flight-trajectory). Re-enter mega-plan when the shape is bounded.
Checklist
TodoWrite task per item, in order:
- Load input โ mega-brainstorm design doc, or any spec (save specs to
.ai/input/ first). Missing entirely โ offer to run mega-brainstorm.
- Run the ambiguity valve โ the three tests above, verdict stated aloud
- Fan out planners โ Workflow, four lenses (below)
- Adversarial plan-QA โ skeptics attack the merged draft
- Surface forks โ AskUserQuestion for genuine choice points only
- Write artifacts โ
.ai/plan/<name>/{plan.md, context.md, tasks.md}
- Grade the plan โ A/B proceeds; C or worse loops back to step 3 with the skeptics' findings
- Chain โ invoke
mega-build (or offer it if the user wants to pause)
3. Planner fan-out
One Workflow round, four planner agents in parallel, each returning structured output:
- decomposer โ bite-sized tasks (one action each, TDD-shaped: test โ fail โ implement โ pass โ commit), zero placeholders/TBD, exact file paths
- dependency-mapper โ which tasks block which; identify the waves of parallel-safe work; flag file-overlap between tasks (mega-build uses this for worktree isolation)
- risk-register โ what breaks, what's irreversible, what's unknown; each risk tagged mitigate/accept/ASK
- test-strategist โ per-task verification commands (each standalone-runnable) + end-to-end finish-line check
Task schema (enforce via schema): {id, desc, files[], deps[], verify, est_complexity}.
Merge: decomposer's tasks + dependency-mapper's edges + test-strategist's verify commands. Risks tagged ASK become AskUserQuestion forks in step 5.
4. Adversarial plan-QA
Second Workflow phase โ skeptics attack the merged draft in parallel, each defaulting to "the plan is broken until proven":
- gap-finder โ spec coverage: walk the design doc claim by claim; anything unimplemented by any task?
- hidden-dep-finder โ read the actual code the tasks touch; ordering assumptions that are wrong?
- untestable-step-finder โ any task whose verify step can't actually run standalone?
- scope-creep-auditor โ any task not traceable to the design? Cut it.
Every finding gets fixed in the draft or surfaced as a fork. Do not proceed with open Critical findings โ that's the entire point of this skill over writing-plans.
4b. Methodology routing
While merging, test each component (cluster of tasks) against the build-methodology skills' triggers:
- "better" is measurable up front, winner unpredictable โ
build-tournament
- right answer recognizable only on sight, not specifiable โ
build-subtractive
- exactly two contested philosophies โ
build-dialectical
- ridged design space needing controlled melting across sessions โ
build-annealing
A match is a genuine fork (methodologies cost 2-5ร linear build) โ surface it in step 5 with linear execution as an option. An accepted methodology collapses that component to ONE task in tasks.md tagged method:<skill-name>, whose verify command is the component's finish-line check run against the methodology's consolidated output. mega-build routes on the tag. Default is linear โ most components don't earn a methodology; zero tags is the normal outcome.
5. Forks
AskUserQuestion only for choices the plan genuinely can't make: sequencing bets, risk acceptances, scope cuts, ASK-tagged risks, methodology-routing matches from 4b. Recommended option first. Max one call unless answers spawn real new forks. Everything mechanical, decide yourself.
6. Artifacts
Per the planning-rule convention:
.ai/plan/<name>/
<name>-plan.md # approach, phases, risks + dispositions, fork decisions, grade
<name>-context.md # key files (absolute paths), design decisions, gotchas found by skeptics
<name>-tasks.md # checklist: - [ ] TASK-01 desc | files | deps | verify-cmd
No time estimates. tasks.md is the mega-build contract โ it must be executable by an agent with zero conversation context.
7. Grade
Grade the plan A-F, stated aloud with one-line justification. A/B โ proceed. C/D/F โ name the weakness, loop to step 3 feeding the skeptic findings back in. "Not sure" โ say so and ask.
8. Chain
Design approved + plan graded โ invoke the mega-build skill, passing the plan dir. If the user wants a fresh session, tell them: "open where the plan lives and say mega-build <plan-dir>."
Anti-patterns
- Planning fog โ the valve exists because a confident plan over an unshaped problem is the most expensive artifact you can produce.
- Solo-drafting then labeling it fan-out output. If Workflow is unavailable, say so and draft solo, openly labeled as solo โ same artifacts, same grade bar.
- Skeptic theater โ skeptics that return "looks good". Prompt them to refute; a QA pass with zero findings on a first draft is itself a Critical finding.
- Fork flood โ asking the user to make choices the dependency graph already makes.