Plan Phase
Fill in the implementation detail for one phase of tasks/roadmap.md. Invoked just-in-time — either manually, by /roadmap (to seed Phase 1), or by /ship (exec-loop pack) and /exec (exec-loop pack) when a new phase begins. Implementation detail is generated when a phase starts, not upfront, because context from earlier phases informs later decisions.
Prerequisites
tasks/roadmap.md must exist. If it does not, stop and tell the user to run /roadmap (or /research-roadmap (research-admin pack) → /roadmap if no spec exists).
- The target phase must already have a Goal, Scope, and Acceptance Criteria in the roadmap.
Input
Read $ARGUMENTS:
- If
$ARGUMENTS is a phase number (e.g., 2), plan that phase.
- If
$ARGUMENTS is empty, plan the first phase that has acceptance criteria but no implementation steps (no ### Tests First or ### Implementation section yet).
- If
$ARGUMENTS contains --no-tdd, use tests-after for this phase regardless of other signals.
Read:
tasks/roadmap.md for the target phase's Goal, Scope, and Acceptance Criteria.
specs/ (or spec.md) for the detailed requirements referenced by the phase's scope.
prototypes/*/consolidated/ when present as a visual reference alongside written specs.
- The codebase as needed to understand existing code, patterns, and which files to modify.
- The roadmap phase's
Parallelization and Coordination Notes fields, if present.
Planning Process
Determine Test Strategy
Check in order:
- If
$ARGUMENTS contains --no-tdd, use tests-after.
- If
CLAUDE.md has a ## Test Strategy section, follow the project default.
- Otherwise, classify the phase:
tdd: stable interfaces, APIs, data models, business logic with known contracts, payment/auth flows
tests-after: UI components, prototyping, exploratory features, design-in-flux work
none: pure config, docs, scaffolding, infra setup, CI/CD changes
Annotate the phase with > Test strategy: tdd|tests-after|none.
Determine Execution Profile
Expand the roadmap's strategic parallelization mode into a concrete execution profile for this phase. If the roadmap has no Parallelization field, default to serial.
Use these modes:
serial: one main agent does the work; use when ownership is coupled or unclear.
research-only: read-only subagents may gather context before implementation; main agent implements.
review-only: main agent implements; subagents review before final validation.
implementation-safe: write subagents may work only on disjoint owned paths; main agent integrates.
agent-team: work is too broad or cross-cutting for one shared local tree; write lanes must use separate GitHub branches and a consolidation/PR review gate before final integration.
Downgrade implementation-safe to research-only or serial if path ownership overlaps, shared chokepoints dominate, or the likely integration surface is unclear.
Add this section before implementation steps:
### Execution Profile
**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team
**Integration owner:** main agent
**Conflict risk:** low | medium | high
**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none
**Subagent lanes:**
- Lane: [lane-name]
- Agent: explore | general-purpose
- Role: explorer | implementer | reviewer | docs-researcher | test-reviewer
- Mode: read-only | write | review
- Scope: [bounded task]
- Owns: `path/or/glob` (write lanes only)
- Must not edit: `path/or/glob` (write lanes only)
- Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)
- Depends on: [lane, step, or none]
- Deliverable: [findings, patch summary, changed paths, tests, branch + commit SHA + PR URL, or review report]
For serial, use **Subagent lanes:** none. For research-only and review-only, lanes must not have write mode. For implementation-safe, every write lane must have non-overlapping Owns paths and explicit Must not edit boundaries.
For agent-team profiles, every lane must have Mode: and Depends on: filled in with concrete values (not placeholders). Write lanes must have disjoint Owns: paths, explicit Must not edit: boundaries, and deterministic Branch: values that are not main or master — /exec (exec-loop pack) auto-dispatches agent-team lanes via isolated worktrees and uses those fields to build the lane DAG, push lane branches, open PRs, and enforce write-boundary integration. The phase steps must include a consolidation/PR review step after all write lanes complete and before final validation or shipping. If GitHub branch push or PR review is unavailable, downgrade to implementation-safe, research-only, or serial, or stop and document the blocker.
Break the Phase into Steps
Define ordered steps beneath the existing Goal/Scope/Acceptance Criteria. The structure depends on the test strategy:
For tdd phases:
## Phase N: [Title]
> Test strategy: tdd
### Execution Profile
**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team
**Integration owner:** main agent
**Conflict risk:** low | medium | high
**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none
**Subagent lanes:**
- Lane: [lane-name or none]
- Agent: explore | general-purpose
- Role: explorer | implementer | reviewer | docs-researcher | test-reviewer
- Mode: read-only | write | review
- Scope: [bounded task]
- Owns: `path/or/glob` (write lanes only)
- Must not edit: `path/or/glob` (write lanes only)
- Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)
- Depends on: [lane, step, or none]
- Deliverable: [expected output, including branch + commit SHA + PR URL for agent-team write lanes]
### Tests First
- Step N.1: Write failing tests for this phase's acceptance criteria
- List specific test cases to write
- Tests should cover happy path, edge cases, and error cases
- Tests MUST fail at this point (red)
### Implementation
- Step N.2: [First implementation task]
- Files: create `path/to/new.ts`, modify `path/to/existing.ts`
- Step N.3: [Next implementation task]
- Files: modify `path/to/file.ts`
- ...
### Green
- Step N.X: Run tests, verify all pass, and perform only concrete cleanup found by validation
### Milestone: [Phase N Milestone Name]
**Acceptance Criteria:** (preserve from roadmap — do not rewrite)
- [ ] [criterion 1]
- [ ] All phase tests pass
- [ ] No regressions in previous phase tests
For tests-after phases:
## Phase N: [Title]
> Test strategy: tests-after
### Execution Profile
**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team
**Integration owner:** main agent
**Conflict risk:** low | medium | high
**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none
**Subagent lanes:**
- Lane: [lane-name or none]
- Agent: explore | general-purpose
- Role: explorer | implementer | reviewer | docs-researcher | test-reviewer
- Mode: read-only | write | review
- Scope: [bounded task]
- Owns: `path/or/glob` (write lanes only)
- Must not edit: `path/or/glob` (write lanes only)
- Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)
- Depends on: [lane, step, or none]
- Deliverable: [expected output, including branch + commit SHA + PR URL for agent-team write lanes]
### Implementation
- Step N.1: [First implementation task]
- Files: create `path/to/new.ts`, modify `path/to/existing.ts`
- ...
### Green
- Step N.X: Write regression tests covering acceptance criteria
- Step N.Y: Run all tests, verify they pass, and perform only concrete cleanup found by validation
### Milestone: [Phase N Milestone Name]
**Acceptance Criteria:** (preserve from roadmap)
- [ ] [criterion 1]
- [ ] All phase tests pass
- [ ] No regressions in previous phase tests
For none phases:
## Phase N: [Title]
> Test strategy: none
### Execution Profile
**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team
**Integration owner:** main agent
**Conflict risk:** low | medium | high
**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none
**Subagent lanes:**
- Lane: [lane-name or none]
- Agent: explore | general-purpose
- Role: explorer | implementer | reviewer | docs-researcher | test-reviewer
- Mode: read-only | write | review
- Scope: [bounded task]
- Owns: `path/or/glob` (write lanes only)
- Must not edit: `path/or/glob` (write lanes only)
- Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)
- Depends on: [lane, step, or none]
- Deliverable: [expected output, including branch + commit SHA + PR URL for agent-team write lanes]
### Implementation
- Step N.1: [First implementation task]
- Files: create `path/to/new.ts`, modify `path/to/existing.ts`
- ...
### Milestone: [Phase N Milestone Name]
**Acceptance Criteria:** (preserve from roadmap)
- [ ] [criterion 1]
On Completion (fill in when phase is done — all strategies):
- Deviations from plan: [none, or describe]
- Tech debt / follow-ups: [none, or list]
- Ready for next phase: yes/no
Test Requirements
tdd phases: start with writing tests BEFORE implementation. Tests tied to acceptance criteria. Include test file paths.
tests-after phases: implementation comes first. The Green step writes regression tests covering the acceptance criteria.
none phases: no test steps. Milestone omits "All phase tests pass".
- All
tdd and tests-after milestones must include "All phase tests pass" and "No regressions in previous phase tests".
- If the project has no test framework yet, the first phase's first step should set it up.
File-Level Granularity
- Every implementation step lists the specific files to create, modify, or delete.
- This gives the executing agent clear scope and prevents steps from becoming unbounded.
- Write-capable subagent lanes must have disjoint owned paths. If they do not, keep implementation serial and use research or review lanes only.
- Agent-team phases must include a final automated consolidation/PR review step that inspects each lane's branch/PR, verifies changed paths against
Owns and Must not edit, records blocker/advisory findings, integrates only approved lane work, and then runs the phase validation gate.
Task Classification
Classify each step or follow-up as exactly one of:
- automated — Claude executes it as implementation or verification work in
tasks/todo.md.
- manual — a human-only external action tied to an automated step in
tasks/manual-todo.md.
- record — a one-time, non-blocking record or measurement that should happen only after a condition becomes true in
tasks/record-todo.md.
- recurring — cadence-based operational, research, or maintenance work in
tasks/recurring-todo.md.
Use the narrowest classification that can execute without losing context:
- If Claude can do it by editing repo files, running local commands, using an approved CLI/MCP/API integration, or writing a script with already-available credentials, classify it as automated.
- If the work is blocked only because a secret, account, payment method, approval, hardware device, or human judgment/evidence is missing, classify only that missing prerequisite as manual.
- If one item mixes human and automatable work, split it: the human-gated prerequisite goes to
tasks/manual-todo.md; the repo/code/config/test follow-up stays in tasks/todo.md.
Manual tasks include only human-gated work such as:
- DNS configuration, domain setup, SSL certificates
- Browser/device testing or visual QA that requires a real account, real device, production environment, or subjective human sign-off
- OAuth/API credential setup with third-party services when no authenticated CLI/API path is available
- Deployment approvals, paid environment provisioning, quota/billing approval, or account ownership decisions
- Signing up for services, billing setup
- Any step requiring a GUI, physical device, or human judgment that cannot be scripted
Do not classify these as manual:
- Editing source, docs,
.env.example, config templates, or task docs
- Installing or wiring SDKs/packages, creating adapters, writing scripts, or updating metadata contracts
- Running builds, unit tests, local smoke tests, Lighthouse, Playwright, linters, or repo audits
- Setting local environment variables when the required non-secret values are known or the user has already provided the secret values
- Running provider CLIs or API calls when authentication is already present or can be requested through the normal approval flow
Manual tasks MUST NOT appear in tasks/todo.md. They go in tasks/manual-todo.md.
Agent-executable tasks MUST NOT appear in tasks/manual-todo.md. If found there, promote them to tasks/todo.md or route a reconciliation fix.
Record tasks MUST NOT appear in tasks/todo.md unless they are launch gates or current execution work. They go in tasks/record-todo.md with source, condition, non-blocking reason, required data/access, measurement/query, target note, revisit cadence/date, completion evidence, and promotion rule.
Recurring tasks MUST NOT appear in tasks/todo.md unless the current run is explicitly in scope for this phase. They go in tasks/recurring-todo.md with task, cadence, owner/agent, scope, trigger, last run, next due, command/skill, evidence/output path, and escalation conditions.
Output
Update tasks/roadmap.md — insert the implementation structure (Tests First / Implementation / Green / Milestone, per strategy) into the target phase, beneath the existing Goal/Scope/Acceptance Criteria. Do NOT modify other phases. Do NOT rewrite the Goal, Scope, or Acceptance Criteria.
Write tasks/todo.md — extract the target phase as a standalone working document, including the ### Execution Profile. Include enough context (project name, current phase number, total phases) so a fresh session can orient itself without reading tasks/roadmap.md. If tasks/todo.md already has in-progress work for a different phase, ask the user before overwriting.
Write tasks/manual-todo.md (only if this phase has manual tasks):
# Manual Tasks — [Project Name]
> Phase: N — [Phase Title]
> These tasks require human-only external action. Do not put repo edits, local commands, CLI/API work, tests, audits, or implementation follow-ups here.
> Check them off as you complete them.
## Pre-Phase / Setup
- [ ] [task] _(blocks: Step N.X)_
## During Phase
- [ ] [task] _(after: Step N.X)_
## Post-Phase / Verification
- [ ] [task]
_(blocks: Step N.X)_ = must be done before that automated step
_(after: Step N.X)_ = should be done after that automated step
- No annotation = do anytime during the phase
- Only create this file when manual tasks exist — no empty files.
Write tasks/record-todo.md (only if this phase identifies non-blocking condition-gated records):
# Record Tasks — [Project Name]
> These tasks are non-blocking records or measurements. Do not execute them through `/exec` (exec-loop pack) unless promoted to `tasks/todo.md`.
- [ ] [task]
- Source: [phase/spec/criterion]
- Condition: [when this becomes eligible]
- Non-blocking reason: [why this is not a launch gate or current step]
- Required data/access: [data, portal, aggregate, credential, or user-provided output]
- Measurement/query: [how to collect evidence]
- Target/acceptance note: [threshold or expected record]
- Revisit: [date or cadence]
- Completion evidence: [where to record the result]
- Promotion rule: [when to move this into `tasks/todo.md`]
Write tasks/recurring-todo.md (only if this phase identifies recurring obligations):
# Recurring Tasks — [Project Name]
> These tasks recur on a cadence. Do not execute them through `/exec` (exec-loop pack) unless a due run is promoted to `tasks/todo.md`.
- [ ] [task]
- Cadence: [daily/weekly/monthly/quarterly/on release/etc.]
- Owner/agent: [human, `/skill`, or agent role]
- Scope: [project/app/area]
- Trigger: [time, release, data threshold, user request]
- Last run: [date or never]
- Next due: [date or rule]
- Command/skill: [command or skill to run]
- Evidence/output path: [where results are recorded]
- Escalation conditions: [when it becomes executable or blocking work]
Next-Step Routing
Before handing back, identify the next concrete work item from project state, then recommend the executor and invocation.
Output exactly two lines beyond the normal report:
- Next work: <specific first step, manual blocker, or verification gap for the planned phase>
- Recommended next command:
Rules:
- Make the next work item primary. Derive it from the first executable step in
tasks/todo.md, any matching blocker in tasks/manual-todo.md, or the phase's verification/setup gap. Do not use agent mode itself as the next work item.
- Use
./scripts/agent-mode.sh only to choose command text. If it is missing, unset, or non-zero, infer routing from the current invocation and task type instead of asking the user to select a mode by default.
- Inference defaults:
- Hybrid execution handoff → check
.agents/project.json.enabled_packs for agent-bridge — if agent-bridge is not enabled, recommend npx skillpacks install agent-bridge from the project shell, first; if agent-bridge is enabled, recommend /delegate $exec.
- Claude-only or orchestration-heavy work → check
.agents/project.json.enabled_packs for exec-loop — if exec-loop is not enabled, recommend npx skillpacks install exec-loop from the project shell, first; if exec-loop is enabled, recommend /exec.
- Codex-only execution → recommend
$exec.
- External human-only manual work (browser/auth/DNS/service dashboard work with no reliable authenticated CLI/API path, paid account setup, real-device checks, or production smoke-test work needing human sign-off) → check
.agents/project.json.enabled_packs for guided-walkthrough — if guided-walkthrough is not enabled, recommend npx skillpacks install guided-walkthrough from the project shell, first; if guided-walkthrough is enabled, recommend /guide — or a Claude-guided manual step rather than /exec.
- Agent-executable work misfiled in
tasks/manual-todo.md, task-doc bookkeeping, stale tasks/manual-todo.md cleanup, or reconciliation against repo/history reality → check .agents/project.json.enabled_packs for docs-health — if docs-health is not enabled, recommend npx skillpacks install docs-health from the project shell, first; if docs-health is enabled, recommend /reconcile-dev-docs fix tasks — promotion to tasks/todo.md, or a direct dev-doc audit, not /guide.
- Only present multiple commands when the ambiguity materially changes execution safety or there are equally valid next work items. Otherwise choose the best route and mention degraded mode lookup inline.
Constraints
- When recommending a skill from another pack, verify the pack is installed via
.agents/project.json enabled_packs. If not installed, include npx skillpacks install <pack-name> from the project shell, as the install prerequisite before the recommendation.
- One phase per invocation. Do not decompose multiple phases ahead of time.
- Require
tasks/roadmap.md. If it's missing, stop and direct the user to /roadmap.
- Preserve the roadmap's Goal, Scope, and Acceptance Criteria exactly. Those are
/roadmap's decisions. Only add implementation detail beneath them.
- Phase headers must use
## Phase N: [Title] format and steps must use - Step N.X: format — this is required by /exec (exec-loop pack) and /ship (exec-loop pack).
- Every milestone must have specific, checkable acceptance criteria — not vague statements like "works correctly" but concrete conditions like "POST /api/items returns 201 with valid payload and persists to database."
- Every
tdd phase must start with writing failing tests. tests-after phases write tests in the Green step.
- Do not generate standalone cleanup/refactor steps that are conditional on validation finding drift. Fold those checks into the Green validation step and only create a separate follow-up when there is known concrete remediation work.
- Do not include implementation code — describe what to build and what to test.
- Note what already exists in the codebase vs. what needs to be created.
- The
### Execution Profile must be decision-complete enough for /exec (exec-loop pack) to decide whether to use serial execution, read-only subagents, review subagents, or disjoint write subagents after the normal approval gate.
- Subagents must not own task docs, roadmap/history updates, shipping, or deploy steps. Those stay with the main agent.
- Agent-team write lanes must not target
main or master; each lane gets its own GitHub branch and must return branch, commit SHA, validation evidence, and PR URL before consolidation.
- Manual tasks MUST NOT appear in
tasks/todo.md — they go in tasks/manual-todo.md only.
- Agent-executable work MUST NOT appear in
tasks/manual-todo.md — it goes in tasks/todo.md or an implementation skill.
- Non-blocking record tasks MUST NOT appear in
tasks/todo.md — they go in tasks/record-todo.md unless explicitly promoted.
- Recurring obligations MUST NOT appear in
tasks/todo.md by default — they go in tasks/recurring-todo.md unless a due run is current execution work.
- Do NOT put plans in
CLAUDE.md or docs/plan.md.
Alignment Page
By default, this skill reports results inline and writes only its normal durable artifacts (for example tasks/*.md, reports, queues, benchmark notes, status docs, or other skill-specific files). Do not build an alignment page automatically. Create alignment/plan-phase-{topic}.html only when the user explicitly requests an alignment page or when you explicitly identify a concrete clarification/review need that cannot be handled cleanly inline; when you create one, follow ALIGNMENT-PAGE.md in this skill's directory.
Default Shipping Contract
Follow the shared shipping contract convention in CLAUDE.md.
1---2name: plan-phase-133description: Decompose a single roadmap phase into implementation steps, tests, and file-level detail4type: planning5version: v0.46argument-hint: "[phase-number] [--no-tdd]"7invocation: sub-skill8parent: exec9metadata:10 source: https://skillmd.com/skills/georgeqle/plan-phase-1311---1213# Plan Phase1415Fill in the implementation detail for **one** phase of `tasks/roadmap.md`. Invoked just-in-time — either manually, by `/roadmap` (to seed Phase 1), or by `/ship` (exec-loop pack) and `/exec` (exec-loop pack) when a new phase begins. Implementation detail is generated when a phase starts, not upfront, because context from earlier phases informs later decisions.1617## Prerequisites1819- `tasks/roadmap.md` must exist. If it does not, stop and tell the user to run `/roadmap` (or `/research-roadmap` (research-admin pack) → `/roadmap` if no spec exists).20- The target phase must already have a Goal, Scope, and Acceptance Criteria in the roadmap.2122## Input2324Read `$ARGUMENTS`:2526- If `$ARGUMENTS` is a phase number (e.g., `2`), plan that phase.27- If `$ARGUMENTS` is empty, plan the **first phase that has acceptance criteria but no implementation steps** (no `### Tests First` or `### Implementation` section yet).28- If `$ARGUMENTS` contains `--no-tdd`, use `tests-after` for this phase regardless of other signals.2930Read:3132- `tasks/roadmap.md` for the target phase's Goal, Scope, and Acceptance Criteria.33- `specs/` (or `spec.md`) for the detailed requirements referenced by the phase's scope.34- `prototypes/*/consolidated/` when present as a visual reference alongside written specs.35- The codebase as needed to understand existing code, patterns, and which files to modify.36- The roadmap phase's `Parallelization` and `Coordination Notes` fields, if present.3738## Planning Process3940### Determine Test Strategy4142Check in order:43441. If `$ARGUMENTS` contains `--no-tdd`, use `tests-after`.452. If `CLAUDE.md` has a `## Test Strategy` section, follow the project default.463. Otherwise, classify the phase:47 - **`tdd`**: stable interfaces, APIs, data models, business logic with known contracts, payment/auth flows48 - **`tests-after`**: UI components, prototyping, exploratory features, design-in-flux work49 - **`none`**: pure config, docs, scaffolding, infra setup, CI/CD changes5051Annotate the phase with `> Test strategy: tdd|tests-after|none`.5253### Determine Execution Profile5455Expand the roadmap's strategic parallelization mode into a concrete execution profile for this phase. If the roadmap has no `Parallelization` field, default to `serial`.5657Use these modes:5859- **`serial`**: one main agent does the work; use when ownership is coupled or unclear.60- **`research-only`**: read-only subagents may gather context before implementation; main agent implements.61- **`review-only`**: main agent implements; subagents review before final validation.62- **`implementation-safe`**: write subagents may work only on disjoint owned paths; main agent integrates.63- **`agent-team`**: work is too broad or cross-cutting for one shared local tree; write lanes must use separate GitHub branches and a consolidation/PR review gate before final integration.6465Downgrade `implementation-safe` to `research-only` or `serial` if path ownership overlaps, shared chokepoints dominate, or the likely integration surface is unclear.6667Add this section before implementation steps:6869```markdown70### Execution Profile71**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team72**Integration owner:** main agent73**Conflict risk:** low | medium | high74**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none7576**Subagent lanes:**77- Lane: [lane-name]78 - Agent: explore | general-purpose79 - Role: explorer | implementer | reviewer | docs-researcher | test-reviewer80 - Mode: read-only | write | review81 - Scope: [bounded task]82 - Owns: `path/or/glob` (write lanes only)83 - Must not edit: `path/or/glob` (write lanes only)84 - Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)85 - Depends on: [lane, step, or none]86 - Deliverable: [findings, patch summary, changed paths, tests, branch + commit SHA + PR URL, or review report]87```8889For `serial`, use `**Subagent lanes:** none`. For `research-only` and `review-only`, lanes must not have write mode. For `implementation-safe`, every write lane must have non-overlapping `Owns` paths and explicit `Must not edit` boundaries.9091For `agent-team` profiles, every lane **must** have `Mode:` and `Depends on:` filled in with concrete values (not placeholders). Write lanes must have disjoint `Owns:` paths, explicit `Must not edit:` boundaries, and deterministic `Branch:` values that are not `main` or `master` — `/exec` (exec-loop pack) auto-dispatches agent-team lanes via isolated worktrees and uses those fields to build the lane DAG, push lane branches, open PRs, and enforce write-boundary integration. The phase steps must include a consolidation/PR review step after all write lanes complete and before final validation or shipping. If GitHub branch push or PR review is unavailable, downgrade to `implementation-safe`, `research-only`, or `serial`, or stop and document the blocker.9293### Break the Phase into Steps9495Define ordered steps beneath the existing Goal/Scope/Acceptance Criteria. The structure depends on the test strategy:9697**For `tdd` phases:**98```99## Phase N: [Title]100> Test strategy: tdd101102### Execution Profile103**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team104**Integration owner:** main agent105**Conflict risk:** low | medium | high106**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none107108**Subagent lanes:**109- Lane: [lane-name or none]110 - Agent: explore | general-purpose111 - Role: explorer | implementer | reviewer | docs-researcher | test-reviewer112 - Mode: read-only | write | review113 - Scope: [bounded task]114 - Owns: `path/or/glob` (write lanes only)115 - Must not edit: `path/or/glob` (write lanes only)116 - Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)117 - Depends on: [lane, step, or none]118 - Deliverable: [expected output, including branch + commit SHA + PR URL for agent-team write lanes]119120### Tests First121- Step N.1: Write failing tests for this phase's acceptance criteria122 - List specific test cases to write123 - Tests should cover happy path, edge cases, and error cases124 - Tests MUST fail at this point (red)125126### Implementation127- Step N.2: [First implementation task]128 - Files: create `path/to/new.ts`, modify `path/to/existing.ts`129- Step N.3: [Next implementation task]130 - Files: modify `path/to/file.ts`131- ...132133### Green134- Step N.X: Run tests, verify all pass, and perform only concrete cleanup found by validation135136### Milestone: [Phase N Milestone Name]137**Acceptance Criteria:** (preserve from roadmap — do not rewrite)138- [ ] [criterion 1]139- [ ] All phase tests pass140- [ ] No regressions in previous phase tests141```142143**For `tests-after` phases:**144```145## Phase N: [Title]146> Test strategy: tests-after147148### Execution Profile149**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team150**Integration owner:** main agent151**Conflict risk:** low | medium | high152**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none153154**Subagent lanes:**155- Lane: [lane-name or none]156 - Agent: explore | general-purpose157 - Role: explorer | implementer | reviewer | docs-researcher | test-reviewer158 - Mode: read-only | write | review159 - Scope: [bounded task]160 - Owns: `path/or/glob` (write lanes only)161 - Must not edit: `path/or/glob` (write lanes only)162 - Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)163 - Depends on: [lane, step, or none]164 - Deliverable: [expected output, including branch + commit SHA + PR URL for agent-team write lanes]165166### Implementation167- Step N.1: [First implementation task]168 - Files: create `path/to/new.ts`, modify `path/to/existing.ts`169- ...170171### Green172- Step N.X: Write regression tests covering acceptance criteria173- Step N.Y: Run all tests, verify they pass, and perform only concrete cleanup found by validation174175### Milestone: [Phase N Milestone Name]176**Acceptance Criteria:** (preserve from roadmap)177- [ ] [criterion 1]178- [ ] All phase tests pass179- [ ] No regressions in previous phase tests180```181182**For `none` phases:**183```184## Phase N: [Title]185> Test strategy: none186187### Execution Profile188**Parallel mode:** serial | research-only | review-only | implementation-safe | agent-team189**Integration owner:** main agent190**Conflict risk:** low | medium | high191**Review gates:** correctness, tests, security, performance, docs/API conformance, UX, or none192193**Subagent lanes:**194- Lane: [lane-name or none]195 - Agent: explore | general-purpose196 - Role: explorer | implementer | reviewer | docs-researcher | test-reviewer197 - Mode: read-only | write | review198 - Scope: [bounded task]199 - Owns: `path/or/glob` (write lanes only)200 - Must not edit: `path/or/glob` (write lanes only)201 - Branch: `agent-team/phase-N-lane-name` (agent-team write lanes only)202 - Depends on: [lane, step, or none]203 - Deliverable: [expected output, including branch + commit SHA + PR URL for agent-team write lanes]204205### Implementation206- Step N.1: [First implementation task]207 - Files: create `path/to/new.ts`, modify `path/to/existing.ts`208- ...209210### Milestone: [Phase N Milestone Name]211**Acceptance Criteria:** (preserve from roadmap)212- [ ] [criterion 1]213```214215**On Completion** (fill in when phase is done — all strategies):216- Deviations from plan: [none, or describe]217- Tech debt / follow-ups: [none, or list]218- Ready for next phase: yes/no219220### Test Requirements221222- **`tdd` phases**: start with writing tests BEFORE implementation. Tests tied to acceptance criteria. Include test file paths.223- **`tests-after` phases**: implementation comes first. The Green step writes regression tests covering the acceptance criteria.224- **`none` phases**: no test steps. Milestone omits "All phase tests pass".225- All `tdd` and `tests-after` milestones must include "All phase tests pass" and "No regressions in previous phase tests".226- If the project has no test framework yet, the first phase's first step should set it up.227228### File-Level Granularity229230- Every implementation step lists the specific files to create, modify, or delete.231- This gives the executing agent clear scope and prevents steps from becoming unbounded.232- Write-capable subagent lanes must have disjoint owned paths. If they do not, keep implementation serial and use research or review lanes only.233- Agent-team phases must include a final automated consolidation/PR review step that inspects each lane's branch/PR, verifies changed paths against `Owns` and `Must not edit`, records blocker/advisory findings, integrates only approved lane work, and then runs the phase validation gate.234235### Task Classification236237Classify each step or follow-up as exactly one of:238239- **automated** — Claude executes it as implementation or verification work in `tasks/todo.md`.240- **manual** — a human-only external action tied to an automated step in `tasks/manual-todo.md`.241- **record** — a one-time, non-blocking record or measurement that should happen only after a condition becomes true in `tasks/record-todo.md`.242- **recurring** — cadence-based operational, research, or maintenance work in `tasks/recurring-todo.md`.243244Use the narrowest classification that can execute without losing context:245246- If Claude can do it by editing repo files, running local commands, using an approved CLI/MCP/API integration, or writing a script with already-available credentials, classify it as **automated**.247- If the work is blocked only because a secret, account, payment method, approval, hardware device, or human judgment/evidence is missing, classify only that missing prerequisite as **manual**.248- If one item mixes human and automatable work, split it: the human-gated prerequisite goes to `tasks/manual-todo.md`; the repo/code/config/test follow-up stays in `tasks/todo.md`.249250Manual tasks include only human-gated work such as:251252- DNS configuration, domain setup, SSL certificates253- Browser/device testing or visual QA that requires a real account, real device, production environment, or subjective human sign-off254- OAuth/API credential setup with third-party services when no authenticated CLI/API path is available255- Deployment approvals, paid environment provisioning, quota/billing approval, or account ownership decisions256- Signing up for services, billing setup257- Any step requiring a GUI, physical device, or human judgment that cannot be scripted258259Do not classify these as manual:260261- Editing source, docs, `.env.example`, config templates, or task docs262- Installing or wiring SDKs/packages, creating adapters, writing scripts, or updating metadata contracts263- Running builds, unit tests, local smoke tests, Lighthouse, Playwright, linters, or repo audits264- Setting local environment variables when the required non-secret values are known or the user has already provided the secret values265- Running provider CLIs or API calls when authentication is already present or can be requested through the normal approval flow266267Manual tasks MUST NOT appear in `tasks/todo.md`. They go in `tasks/manual-todo.md`.268Agent-executable tasks MUST NOT appear in `tasks/manual-todo.md`. If found there, promote them to `tasks/todo.md` or route a reconciliation fix.269270Record tasks MUST NOT appear in `tasks/todo.md` unless they are launch gates or current execution work. They go in `tasks/record-todo.md` with source, condition, non-blocking reason, required data/access, measurement/query, target note, revisit cadence/date, completion evidence, and promotion rule.271272Recurring tasks MUST NOT appear in `tasks/todo.md` unless the current run is explicitly in scope for this phase. They go in `tasks/recurring-todo.md` with task, cadence, owner/agent, scope, trigger, last run, next due, command/skill, evidence/output path, and escalation conditions.273274## Output2752761. **Update `tasks/roadmap.md`** — insert the implementation structure (Tests First / Implementation / Green / Milestone, per strategy) into the target phase, beneath the existing Goal/Scope/Acceptance Criteria. Do NOT modify other phases. Do NOT rewrite the Goal, Scope, or Acceptance Criteria.2772782. **Write `tasks/todo.md`** — extract the target phase as a standalone working document, including the `### Execution Profile`. Include enough context (project name, current phase number, total phases) so a fresh session can orient itself without reading `tasks/roadmap.md`. If `tasks/todo.md` already has in-progress work for a different phase, ask the user before overwriting.2792803. **Write `tasks/manual-todo.md`** (only if this phase has manual tasks):281 ```markdown282 # Manual Tasks — [Project Name]283284 > Phase: N — [Phase Title]285 > These tasks require human-only external action. Do not put repo edits, local commands, CLI/API work, tests, audits, or implementation follow-ups here.286 > Check them off as you complete them.287288 ## Pre-Phase / Setup289 - [ ] [task] _(blocks: Step N.X)_290291 ## During Phase292 - [ ] [task] _(after: Step N.X)_293294 ## Post-Phase / Verification295 - [ ] [task]296 ```297 - `_(blocks: Step N.X)_` = must be done before that automated step298 - `_(after: Step N.X)_` = should be done after that automated step299 - No annotation = do anytime during the phase300 - Only create this file when manual tasks exist — no empty files.3013024. **Write `tasks/record-todo.md`** (only if this phase identifies non-blocking condition-gated records):303 ```markdown304 # Record Tasks — [Project Name]305306 > These tasks are non-blocking records or measurements. Do not execute them through `/exec` (exec-loop pack) unless promoted to `tasks/todo.md`.307308 - [ ] [task]309 - Source: [phase/spec/criterion]310 - Condition: [when this becomes eligible]311 - Non-blocking reason: [why this is not a launch gate or current step]312 - Required data/access: [data, portal, aggregate, credential, or user-provided output]313 - Measurement/query: [how to collect evidence]314 - Target/acceptance note: [threshold or expected record]315 - Revisit: [date or cadence]316 - Completion evidence: [where to record the result]317 - Promotion rule: [when to move this into `tasks/todo.md`]318 ```3193205. **Write `tasks/recurring-todo.md`** (only if this phase identifies recurring obligations):321 ```markdown322 # Recurring Tasks — [Project Name]323324 > These tasks recur on a cadence. Do not execute them through `/exec` (exec-loop pack) unless a due run is promoted to `tasks/todo.md`.325326 - [ ] [task]327 - Cadence: [daily/weekly/monthly/quarterly/on release/etc.]328 - Owner/agent: [human, `/skill`, or agent role]329 - Scope: [project/app/area]330 - Trigger: [time, release, data threshold, user request]331 - Last run: [date or never]332 - Next due: [date or rule]333 - Command/skill: [command or skill to run]334 - Evidence/output path: [where results are recorded]335 - Escalation conditions: [when it becomes executable or blocking work]336 ```337338## Next-Step Routing339340Before handing back, identify the next concrete work item from project state, then recommend the executor and invocation.341342Output exactly two lines beyond the normal report:343344- **Next work:** <specific first step, manual blocker, or verification gap for the planned phase>345- **Recommended next command:** <one command or route>346347Rules:348349- Make the next work item primary. Derive it from the first executable step in `tasks/todo.md`, any matching blocker in `tasks/manual-todo.md`, or the phase's verification/setup gap. Do not use agent mode itself as the next work item.350- Use `./scripts/agent-mode.sh` only to choose command text. If it is missing, unset, or non-zero, infer routing from the current invocation and task type instead of asking the user to select a mode by default.351- Inference defaults:352 - Hybrid execution handoff → check `.agents/project.json.enabled_packs` for `agent-bridge` — if `agent-bridge` is not enabled, recommend `npx skillpacks install agent-bridge` from the project shell, first; if `agent-bridge` is enabled, recommend `/delegate $exec`.353 - Claude-only or orchestration-heavy work → check `.agents/project.json.enabled_packs` for `exec-loop` — if `exec-loop` is not enabled, recommend `npx skillpacks install exec-loop` from the project shell, first; if `exec-loop` is enabled, recommend `/exec`.354 - Codex-only execution → recommend `$exec`.355 - External human-only manual work (browser/auth/DNS/service dashboard work with no reliable authenticated CLI/API path, paid account setup, real-device checks, or production smoke-test work needing human sign-off) → check `.agents/project.json.enabled_packs` for `guided-walkthrough` — if `guided-walkthrough` is not enabled, recommend `npx skillpacks install guided-walkthrough` from the project shell, first; if `guided-walkthrough` is enabled, recommend `/guide` — or a Claude-guided manual step rather than `/exec`.356 - Agent-executable work misfiled in `tasks/manual-todo.md`, task-doc bookkeeping, stale `tasks/manual-todo.md` cleanup, or reconciliation against repo/history reality → check `.agents/project.json.enabled_packs` for `docs-health` — if `docs-health` is not enabled, recommend `npx skillpacks install docs-health` from the project shell, first; if `docs-health` is enabled, recommend `/reconcile-dev-docs fix tasks` — promotion to `tasks/todo.md`, or a direct dev-doc audit, not `/guide`.357- Only present multiple commands when the ambiguity materially changes execution safety or there are equally valid next work items. Otherwise choose the best route and mention degraded mode lookup inline.358359## Constraints360361- When recommending a skill from another pack, verify the pack is installed via `.agents/project.json` `enabled_packs`. If not installed, include `npx skillpacks install <pack-name>` from the project shell, as the install prerequisite before the recommendation.362- **One phase per invocation.** Do not decompose multiple phases ahead of time.363- **Require `tasks/roadmap.md`.** If it's missing, stop and direct the user to `/roadmap`.364- **Preserve the roadmap's Goal, Scope, and Acceptance Criteria exactly.** Those are `/roadmap`'s decisions. Only add implementation detail beneath them.365- **Phase headers must use `## Phase N: [Title]` format** and steps must use `- Step N.X:` format — this is required by `/exec` (exec-loop pack) and `/ship` (exec-loop pack).366- Every milestone must have specific, checkable acceptance criteria — not vague statements like "works correctly" but concrete conditions like "POST /api/items returns 201 with valid payload and persists to database."367- Every `tdd` phase must start with writing failing tests. `tests-after` phases write tests in the Green step.368- Do not generate standalone cleanup/refactor steps that are conditional on validation finding drift. Fold those checks into the Green validation step and only create a separate follow-up when there is known concrete remediation work.369- Do not include implementation code — describe what to build and what to test.370- Note what already exists in the codebase vs. what needs to be created.371- The `### Execution Profile` must be decision-complete enough for `/exec` (exec-loop pack) to decide whether to use serial execution, read-only subagents, review subagents, or disjoint write subagents after the normal approval gate.372- Subagents must not own task docs, roadmap/history updates, shipping, or deploy steps. Those stay with the main agent.373- Agent-team write lanes must not target `main` or `master`; each lane gets its own GitHub branch and must return branch, commit SHA, validation evidence, and PR URL before consolidation.374- Manual tasks MUST NOT appear in `tasks/todo.md` — they go in `tasks/manual-todo.md` only.375- Agent-executable work MUST NOT appear in `tasks/manual-todo.md` — it goes in `tasks/todo.md` or an implementation skill.376- Non-blocking record tasks MUST NOT appear in `tasks/todo.md` — they go in `tasks/record-todo.md` unless explicitly promoted.377- Recurring obligations MUST NOT appear in `tasks/todo.md` by default — they go in `tasks/recurring-todo.md` unless a due run is current execution work.378- Do NOT put plans in `CLAUDE.md` or `docs/plan.md`.379380## Alignment Page381382By default, this skill reports results inline and writes only its normal durable artifacts (for example `tasks/*.md`, reports, queues, benchmark notes, status docs, or other skill-specific files). Do not build an alignment page automatically. Create `alignment/plan-phase-{topic}.html` only when the user explicitly requests an alignment page or when you explicitly identify a concrete clarification/review need that cannot be handled cleanly inline; when you create one, follow `ALIGNMENT-PAGE.md` in this skill's directory.383384## Default Shipping Contract385386Follow the shared shipping contract convention in CLAUDE.md.