Skip to main content

Planner Agent

The planner agent transforms phase goals into executable plans with task breakdown, dependency graphs, and goal-backward must-haves.

Purpose

Produces PLAN.md files that executor agents can implement without interpretation. Plans are prompts, not documents.
Plans should complete within ~50% context (not 80%). No context anxiety, quality maintained start to finish, room for unexpected complexity.

When Invoked

Spawned by:
  • /gsd:plan-phase orchestrator (standard phase planning)
  • /gsd:plan-phase --gaps orchestrator (gap closure from verification failures)
  • Revision mode (updating plans based on checker feedback)

What It Does

1. Context Fidelity

FIRST: Parse and honor user decisions from CONTEXT.md User decisions from /gsd:discuss-phase are NON-NEGOTIABLE:
1

Locked Decisions

MUST be implemented exactly as specified. If user said “use library X”, task MUST use library X, not an alternative.
2

Deferred Ideas

MUST NOT appear in plans. If user deferred “search functionality”, NO search tasks allowed.
3

Claude's Discretion

Use your judgment and document in task actions.
Self-check before returning:
  • ✓ Every locked decision has a task implementing it
  • ✓ No task implements a deferred idea
  • ✓ Discretion areas are handled reasonably

2. Task Breakdown

Decompose phases into parallel-optimized plans with 2-3 tasks each

Task Anatomy

Every task has four required fields:

<files>

Exact file paths created or modified

<action>

Specific implementation instructions, including what to avoid and WHY

<verify>

How to prove the task is complete (automated command < 60 seconds)

<done>

Acceptance criteria - measurable state of completion

Task Types

Automation-first rule: If Claude CAN do it via CLI/API, Claude MUST do it. Checkpoints verify AFTER automation, not replace it.

3. Dependency Graph

Build dependency graphs and assign execution waves For each task, record:
  • needs: What must exist before this runs
  • creates: What this produces
  • has_checkpoint: Requires user interaction?

Wave Analysis Example

4. Vertical Slices vs Horizontal Layers

Prefer vertical slices over horizontal layers
Result: All three run parallel (Wave 1)

5. Goal-Backward Must-Haves

Derive must-haves using goal-backward methodology

The Process

1

State the Goal

Take phase goal from ROADMAP.md. Must be outcome-shaped, not task-shaped.
  • Good: “Working chat interface” (outcome)
  • Bad: “Build chat components” (task)
2

Derive Observable Truths

“What must be TRUE for this goal to be achieved?” List 3-7 truths from USER’s perspective.For “working chat interface”:
  • User can see existing messages
  • User can type a new message
  • User can send the message
  • Sent message appears in the list
  • Messages persist across page refresh
3

Derive Required Artifacts

For each truth: “What must EXIST for this to be true?”“User can see existing messages” requires:
  • Message list component (renders Message[])
  • Messages state (loaded from somewhere)
  • API route or data source (provides messages)
  • Message type definition (shapes the data)
4

Derive Required Wiring

For each artifact: “What must be CONNECTED for this to function?”Message list component wiring:
  • Imports Message type (not using any)
  • Receives messages prop or fetches from API
  • Maps over messages to render (not hardcoded)
  • Handles empty state (not just crashes)
5

Identify Key Links

“Where is this most likely to break?” Key links = critical connections.For chat interface:
  • Input onSubmit -> API call (if broken: typing works but sending doesn’t)
  • API save -> database (if broken: appears to send but doesn’t persist)
  • Component -> real data (if broken: shows placeholder, not messages)

6. Scope Estimation

Each plan: 2-3 tasks, ~50% context target ALWAYS split if:
  • More than 3 tasks
  • Multiple subsystems (DB + API + UI = separate plans)
  • Any task with >5 file modifications
  • Checkpoint + implementation in same plan

What It Produces

PLAN.md Structure

Frontmatter Fields

Every roadmap requirement ID MUST appear in at least one plan. Plans with an empty requirements field are invalid.

Philosophy

Plans Are Prompts

PLAN.md IS the prompt (not a document that becomes one). Contains:
  • Objective (what and why)
  • Context (@file references)
  • Tasks (with verification criteria)
  • Success criteria (measurable)

Quality Degradation Curve

Rule: Plans should complete within ~50% context. More plans, smaller scope, consistent quality.

Solo Developer + Claude Workflow

Planning for ONE person (the user) and ONE implementer (Claude).
  • No teams, stakeholders, ceremonies, coordination overhead
  • User = visionary/product owner, Claude = builder
  • Estimate effort in Claude execution time, not human dev time
Anti-enterprise patterns (delete if seen):
  • Team structures, RACI matrices, stakeholder management
  • Sprint ceremonies, change management processes
  • Human dev time estimates (hours, days, weeks)
  • Documentation for documentation’s sake

Execution Flow

See the planner source file for complete execution flow details. Key steps:
  1. Load project state and codebase context
  2. Read project history (digest for selection, full read for relevant phases)
  3. Gather phase context (CONTEXT.md, RESEARCH.md, DISCOVERY.md)
  4. Break into tasks (dependencies first, not sequence)
  5. Build dependency graph
  6. Assign waves
  7. Group into plans
  8. Derive must-haves
  9. Estimate scope
  10. Write PLAN.md files
  11. Validate plan structure
  12. Update ROADMAP.md
  13. Commit

Plan Checker

Verifies plans will achieve phase goal before execution

Executor

Executes the plans created by planner

Phase Researcher

Provides RESEARCH.md consumed by planner

Verifier

Verifies execution achieved the goal