Plan the execution — read spec artifacts, review from multiple perspectives, then generate tasks.md.
Before writing any files: you MUST invoke superpowers:using-git-worktrees.
You MUST invoke superpowers:writing-plans to generate tasks. Do NOT write tasks inline.
writing-plans IS the task creation process. This applies regardless of change complexity or time pressure.
You MUST have at least one spec artifact done (gherkin or proposal) before proceeding.
Do NOT create tasks from a description alone — spec artifacts are the input.
When the multi-role review rejects an alternative with a load-bearing reason
that would otherwise have to be re-litigated by future reviewers: you MUST
run the three-condition ADR gate (see references/adr-format.md) and offer
to record an ADR. User may decline.
If a prerequisite skill is unavailable (not installed), continue with fallback — but NEVER skip
because you judged it unnecessary.
If a superpower is unavailable (skill not installed), skip and continue.
-
Select the change
If no name provided:
- Look for
beat/changes/ directories (excluding archive/)
- If only one exists, use it (announce: "Using change: ")
- If multiple exist, use AskUserQuestion tool to let user select
-
Ensure worktree isolation
Invoke using-git-worktrees before reading or writing any files. If already in a worktree (e.g., from design), it detects and continues.
-
Read spec artifacts and verify readiness
Read status.yaml (schema: references/status-schema.md).
Check that either:
gherkin has status: done → Gherkin-driven
gherkin has status: skipped AND proposal has status: done → Proposal-driven
If neither condition is met: "Spec artifacts are required before task breakdown. Run /beat:design first." STOP.
If status.yaml has source: distill: warn — "This is a distill change; it describes current behavior, so there is nothing to plan. The intended flow is /beat:verify → /beat:archive." Use AskUserQuestion tool to confirm before proceeding.
If tasks already has status: done: "Tasks already exist. Re-running will regenerate tasks.md." Confirm with user before proceeding.
Read all available artifacts:
proposal.md (if exists)
features/*.feature (all files, if gherkin is done)
design.md (if exists)
Read beat/config.yaml if it exists (schema: references/config-schema.md). Use language for output language, inject context, and apply rules.tasks as additional constraints.
-
Assess change complexity and suggest review roles
Evaluate complexity based on:
- Number of feature files and scenarios
- Number of components/services mentioned in design.md
- Whether
@e2e scenarios exist (implies integration surface)
- Whether design.md mentions external dependencies, DB changes, or API changes
Suggest review roles based on complexity:
Use AskUserQuestion tool:
"Based on the spec artifacts, I suggest the following review perspectives:
[dynamically selected roles with rationale]
Adjust, add, remove, or confirm?"
Role selection guidance:
| Signal | Suggested role |
|---|
| Always included | Test coverage: Are all scenarios covered? Any gaps? |
@e2e scenarios present | Integration: Are integration boundaries identified? |
| design.md mentions API/DB changes | Architecture: Is the design consistent with existing patterns? |
| proposal.md mentions user-facing changes | User experience: Does the plan match user expectations? |
| design.md mentions auth/data/external APIs | Security: Are there security considerations? |
| High scenario count (>5) or multiple features | Scope: Is the decomposition granular enough? |
Test coverage is always included. Other roles are suggested dynamically.
The user can add custom roles (e.g., "performance", "accessibility") or remove suggested ones.
-
Generate initial tasks via writing-plans
Invoke superpowers:writing-plans. Pass the completed artifacts (proposal, gherkin, design) as context.
The output of writing-plans becomes the initial tasks.md — do NOT generate tasks.md yourself.
If writing-plans is unavailable (not installed), create tasks.md as fallback with notice:
<!-- Generated without writing-plans. Consider re-running with superpowers plugin. -->
Task Decomposition Principles — if writing-plans output violates any principle, decompose further before saving tasks.md:
- Single concern: one component, service, or API endpoint per task. "Build X and integrate into Y" = two tasks.
- ~200 LOC cap: each task produces ~200 lines of new code (excluding tests). More = too many responsibilities.
- 2-3 files max: each task touches at most 2-3 source files. More = crossing concern boundaries.
- Independently verifiable: can run tests after completing without depending on later tasks.
- "And then" test: if a task description needs "and then", split it.
- Exception: project initialization/scaffolding tasks may exceed file limits while maintaining single concern.
Quality Principles header — insert the following block between the tasks.md header and the first ### Task:
## Quality Principles
**Testing:** Tests verify behavior (return values, state changes, responses), not wiring.
If the main assertion is `toHaveBeenCalledWith`, rewrite to assert on the function's output.
**Code:** No single new file exceeds ~300 lines. If it grows past that, split into focused sub-modules.
Save the initial tasks.md to beat/changes/<name>/tasks.md.
-
Dispatch review agents
Read review-subagent-prompt.md for the subagent prompt template.
Dispatch strategy based on confirmed role count:
- 1–2 roles: Single Agent (subagent_type:
Explore) with all confirmed roles. Build one prompt containing all roles and their focus areas.
- 3+ roles: One Agent (subagent_type:
Explore) per role, dispatched in parallel. Each agent receives ONLY its own role and focus area — no knowledge of other roles.
Every agent receives:
- All spec artifacts (proposal, gherkin, design)
- The initial tasks.md
Do NOT pass conversation history or session context to any agent.
Why parallel at 3+: A single agent reviewing from many perspectives simultaneously loses depth and independence — findings from one role bias another. Independent agents give genuine blind-spot coverage. At 1–2 roles the overhead isn't worth the split.
Fallback: If any agent fails or returns empty, proceed with findings from the others. If ALL fail, use initial tasks.md as-is. Show notice: "Review could not be completed — tasks.md was not reviewed. Consider re-running /beat:plan."
-
Merge findings and update tasks.md
Collect findings from all review agents. If parallel agents were used:
- Deduplicate findings that identify the same issue from different roles
- When findings conflict, prefer the more conservative recommendation
ADR gate on rejected alternatives — scan the review output for cases
where an alternative approach was considered and rejected with a
load-bearing reason (i.e. a reason a future reviewer would want to know
about to avoid re-suggesting the same thing). For each, run the three
conditions from references/adr-format.md:
- Hard to reverse?
- Surprising without context?
- Result of a real trade-off?
If all three hold, use AskUserQuestion tool: "Review rejected '' because '' — record as ADR?" On Yes, write the ADR under docs/adr/, increment numbering, cross-reference from tasks.md or design.md as appropriate. On No, continue.
Read beat/changes/<name>/tasks.md, then use the Edit tool to apply:
- Add missing tasks or steps identified by the review
- Split tasks that the review flagged as too broad
- Add test coverage notes where the review found gaps
- Reorder tasks if the review identified dependency issues
Show the user a brief summary of what changed:
## Review Applied
- [Role]: <what was changed>
- [Role]: <what was changed>
...
Update status.yaml: set tasks to { status: done } and phase to tasks.
-
Commit and advance phase
Commit tasks.md and updated status.yaml: git add beat/changes/<name>/ && git commit
Use a descriptive message, e.g. "plan(): add task breakdown".
Update phase to implement in status.yaml (advancing from tasks → implement).
## Plan Complete: <change-name>
Tasks: N tasks in tasks.md
Review: [list of roles that reviewed]
Changes from review: [count of modifications]
Ready for implementation! Run `/beat:apply` to start.