.codex/skills/plan-phase/SKILL.md
Create execution plan for a phase. Creates ./.gtd/<task_name>/{phase}/PLAN.md. User manually trigger, do not auto invoke this.
npx skillsauth add Hoang604/get-thing-done plan-phaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Core responsibilities:
PLAN.md with atomic tasksDefault flow: Research (if needed) → Plan → Targeted Review (if needed) → Verify → Write </objective>
<context> **Phase number:** `$ARGUMENTS` (optional; auto-detect the next unplanned phase if missing)Flags:
--research — Force new research even if RESEARCH.md already exists--test — Make Task 1 a TDD "Create Failing Test" taskRequired files:
./.gtd/<task_name>/SPEC.md — Must be FINALIZED/UPDATED./.gtd/<task_name>/ROADMAP.md — Must define phasesOutput:
./.gtd/<task_name>/{phase}/PLAN.md./.gtd/<task_name>/{phase}/RESEARCH.md when research is performedUse specialist agents selectively.
Rules:
review_plan is conditional, not automatic for every phasereview_plan only if there is at least one Medium or High complexity taskreview_planPreferred specialists:
correctness -> state transitions, ordering, dedupe, parsing, money, semantic invariantsreliability -> retries, queues, timeouts, external I/O, idempotency, crash recoveryarchitecture -> cross-module changes, ownership shifts, seam changes, migration ordering<decision_logic>
<discovery_levels>
| Level | When | Action |
| ------------ | --------------------------------------- | ---------------------------- |
| 0 - Skip | Pure internal work, no new dependencies | No research |
| 1 - Quick | Single known library, low risk, related to some files | Quick search, no RESEARCH.md |
| 2 - Deep | 2-3 options, new integration, multiple components, Architectural decision, high risk | Research via spawn_agent and tell the agent to create RESEARCH.md |
</discovery_levels>
<complexity_rubric> | Level | Guide (ISO 15288:6.3.4 Risk Management) | Action | | :--------- | :-------------------------------------------------------------------------------------- | :--------------------------------- | | Low | Boilerplate, CRUD, wiring, config. No shared state or timing concerns. | Standard flow | | Medium | Multiple components, edge cases, or contract changes. | Standard flow, detailed tasks | | High | Concurrency, state machines, ordering, data integrity, or dynamic env. | MANDATORY CHECKPOINT |
Rule for High Complexity:
checkpoint:human-verify immediately after the risky task.<task_types>
| Type | Use For | Autonomy |
| ------------------------- | ------------------------------------- | ---------------- |
| auto | Work the agent can complete independently | Fully autonomous |
| checkpoint:human-verify | Visual/functional verification | Pauses for user |
| checkpoint:decision | Implementation choice | Pauses for user |
</task_types>
</decision_logic>
<core_principles>
SPEC.md.<critical_rules>
<requirement> for EARS behavior and <action> for exact execution steps.--test is active, Task 1 MUST be <!-- TDD_STRATEGY_SLOT -->.
</critical_rules>Confirm ./.gtd/<task_name>/ROADMAP.md exists.
Extract from $ARGUMENTS when available:
--research--testIf no phase number is provided, detect the next unplanned phase from ROADMAP.md.
Find Phase $PHASE in ./.gtd/<task_name>/ROADMAP.md.
Ensure ./.gtd/<task_name>/$PHASE/ exists.
Use the phase objective and <discovery_levels> to classify research needs.
RESEARCH.md.--research:
./.gtd/<task_name>/$PHASE/RESEARCH.md already exists.--research is not set, reuse it.If deep research is needed, summarize first:
From ROADMAP.md: phase name, objective, dependencies
From SPEC.md: relevant Must Have and Nice To Have requirements, Constraints, and Invariants & Must Preserve
Scope boundaries: in-scope vs out-of-scope files/modules Then run:
Call spawn_agent(...) with agent_type: "worker" and this message:
spawn_agent({ agent_type: "worker", message: "
<objective>
Research Phase {N}: {phase_name} well enough to support writing PLAN.md.
</objective>
<context>
Task: <task_name>
Phase directory: ./.gtd/<task_name>/$PHASE/
Authoritative inputs:
- ./.gtd/<task_name>/SPEC.md
- ./.gtd/<task_name>/ROADMAP.md
Relevant phase details:
- Objective: {phase_objective}
- Dependencies: {phase_dependencies}
- Relevant Must Haves: {must_have_requirements}
- Relevant Nice To Haves: {nice_to_have_requirements}
- Scope boundaries: {in_scope_and_out_of_scope}
</context>
<deliverable>
Write your findings to:
./.gtd/<task_name>/$PHASE/RESEARCH.md
</deliverable>
<research_questions>
1. Which files/modules are most relevant to this phase?
2. What existing patterns or abstractions should be reused?
3. What constraints, edge cases, or risks could affect planning?
4. What testing seams or dependency boundaries are available?
5. What file-level scope should PLAN.md reference explicitly?
6. What must remain true while this phase is being implemented?
</research_questions>
<rules>
- Do not modify source code.
- Do not write PLAN.md.
- Keep findings concrete and planning-focused.
- If something is uncertain, state the uncertainty clearly.
</rules>
<return_to_caller>
Return only a short summary with:
- key modules
- major constraints
- main risks
- recommended file scope for the plan
</return_to_caller>
"})
wait({ ids: [<returned_agent_id>], timeout_ms: 3600000 }).wait(...) returns a final status, call close_agent({ id: <returned_agent_id> }).Display:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GTD ► PLANNING PHASE {N}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Read SPEC.md, ROADMAP.md, and RESEARCH.md (if present). Use them to define scope, constraints, and requirement coverage for
this phase.
Extract explicitly:
Before writing tasks, define:
Use this to shape the tasks rather than writing V&V as an afterthought.
Calibrate each task
Break the phase into atomic tasks
Add safety brakes where needed
checkpoint:human-verify task immediately after it."STOP. Review the implementation of {file} for {specific_risk}."Map the phase to spec requirements
SPEC.md covered by this phase.Preserve invariants
Write to ./.gtd/<task_name>/$PHASE/PLAN.md using this template:
phase: { N }
created: { date }
is_tdd: { true/false }
---
# Plan: Phase {N} - {Name}
## Objective
{What this phase delivers and why}
## V&V Strategy (Verification & Validation)
{How will we verify this phase meets requirements}
## Spec Requirements (Traceability)
<!-- List the specific requirements from SPEC.md that this phase addresses -->
- [ ] Must Have: {Requirement 1}
- [ ] Nice To Have: {Requirement 2}
## Context
- ./.gtd/<task_name>/SPEC.md
- ./.gtd/<task_name>/ROADMAP.md
- {relevant source files}
## Architecture Constraints
- **Single Source:** {Where is the authoritative data?}
- **Invariants:** {What must ALWAYS be true?}
- **Decision Rationale:** {Why this architectural choice was made}
- **Testability:** {What needs to be injected/mocked (Design Seams)}
- **Non-Goals:** {What this phase must not expand into}
## Tasks
<!-- All tasks and 'done' criteria MUST use EARS keywords where applicable -->
<!-- If --test flag IS SET, inject the slot. If NOT set, use standard Task 1 -->
{{#if test_flag}}
<task id="1" type="auto" complexity="Null">
<!-- TDD_STRATEGY_SLOT -->
</task>
{{else}}
<task id="1" type="auto" complexity="Low/Medium/High">
<name>{Task name}</name>
<risk>{One sentence rationale if complexity > Low}</risk>
<files>{exact related file paths}</files>
<requirement>
**When** {Trigger}, the {System} shall {Action}.
</requirement>
<action>
{Exact sequence of agent tool calls / code edits}
- Modify {file} to implement {logic}
</action>
<done>{How we know this task is complete}</done>
</task>
{{/if}}
<task id="2" type="checkpoint:human-verify">
<name>STOP. Review the implementation of {file} for {specific_risk}</name>
<risk>{One sentence rationale if complexity > Low}</risk>
<files>{exact related file paths}</files>
<action>
{Specific review instructions}
</action>
<done>{How we know this task is complete}</done>
</task>
<task id="3" type="auto">
...
</task>
## Success Criteria
- [ ] {Measurable outcome 1}
- [ ] {Measurable outcome 2}
Check:
<critical_rules>If issues found: Fix before finishing.
If --test flag is active:
Display:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GTD ► DESIGNING TDD STRATEGY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Use a subagent for test strategy:
spawn_agent({ agent_type: "test_strategist", message: "
<objective>
Design a comprehensive TDD strategy for Phase {N}: {phase_name}.
Replace Task 1 in PLAN.md with rigorous specification-based tests.
</objective>
<context>
<plan_file>./.gtd/<task_name>/{N}/PLAN.md</plan_file>
<spec_file>./.gtd/<task_name>/SPEC.md</spec_file>
<roadmap_file>./.gtd/<task_name>/ROADMAP.md</roadmap_file>
<research_file>./.gtd/<task_name>/{N}/RESEARCH.md</research_file>
</context>
<focus>
1. Verify SPEC.md requirements are covered.
2. Ensure strict separation of Logic (Unit) vs I/O (Integration).
3. Identify and attack fragile logic paths.
</focus>
"})
Then:
wait({ ids: [<returned_agent_id>], timeout_ms: 3600000 }).wait(...) returns a final status, call close_agent({ id: <returned_agent_id> }).Apply the returned strategy into PLAN.md.
If there is at least one task with complexity = Medium or High, you SHOULD review the draft plan before finalizing it.
Use a review subagent:
spawn_agent({ agent_type: "review_plan", message: "
<scope>./.gtd/<task_name>/{N}/PLAN.md</scope>
<objective>
Review for security, performance, logic flaws, and design risks before execution
</objective>
<context>
## Phase Context
Phase {N}: {phase_name}
Goal: {phase objective}
## Tasks to Review (Medium/High Complexity)
- Task {id}: {name} - Complexity: {level}
Risk: {why this needs review}
## Architecture Constraints
- {key constraints from SPEC that apply}
</context>
<focus_areas>security, performance, logic, design</focus_areas>
<output_format>Status: BLOCK | CAUTION | PROCEED, plus findings</output_format>
"})
Then:
wait({ ids: [<returned_agent_id>], timeout_ms: 3600000 }).wait(...) returns a final status, call close_agent({ id: <returned_agent_id> }).If STATUS: BLOCK → Revise plan before proceeding. If STATUS: CAUTION → Note risks in plan, proceed with awareness. If STATUS: PROCEED → Continue to offer next step.
If ALL tasks are Low complexity: Skip review, proceed directly.
Use at most one additional specialist if the phase has a clear dominant risk:
correctness for semantic logic, ordering, or invariant-heavy phasesreliability for retries, queues, external I/O, timeout, or crash-recovery phasesarchitecture for seam, ownership, or migration-sensitive phasesRun it only if the phase risk is materially sharper than the generic review_plan lens.
Expected output:
Apply only the high-signal findings back into the draft plan. Do not turn the plan into an audit dump.
</process><offer_next>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GTD ► PHASE {N} PLANNED ✓
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Plan written to ./.gtd/<task_name>/{phase}/PLAN.md
{X} tasks defined
| Task | Name |
|------|------|
| 1 | {name} |
| 2 | {name} |
─────────────────────────────────────────────────────
▶ Next Up
$execute {N} — run this plan
─────────────────────────────────────────────────────
Also available:
$discuss-plan {N} — review plan before executing
─────────────────────────────────────────────────────
</offer_next>
<forced_stop> STOP. The workflow is complete. Do NOT automatically run the next command. Wait for the user. </forced_stop>
testing
manual trigger by user, do not auto invoke
tools
manual trigger by user, do not auto invoke
development
Trace execution paths and document how code actually behaves. Use when you need to understand how features work, walk through code flows, explain component behavior, trace where data comes from, understand relationships between components, or audit for orphaned events and dead code.
testing
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.