Skip to main content

Overview

The /gsd:execute-phase command runs all plans for a phase using wave-based parallelization. Each plan executes in a fresh 200k token context window, eliminating context rot.

What It Does

1

Discover Plans

Finds all PLAN.md files for the phase.
2

Analyze Dependencies

Builds dependency graph from plan frontmatter.
3

Group Into Waves

Independent plans → same wave (parallel) Dependent plans → later waves (sequential)
4

Execute Each Wave

Spawns executor agents for each plan in the wave. Each agent gets fresh 200k context.
5

Commit Per Plan

Atomic git commit after each plan completes.
6

Verify Phase

Checks if phase goals and requirements were achieved.

Command Usage

Runs all plans for phase 2 in optimal wave order.

Wave-Based Execution

Plans are grouped into waves based on dependencies:

Why Waves Matter

  • Independent plans → Same wave → Run simultaneously → Faster completion
  • Dependent plans → Later wave → Wait for dependencies → Correct order
  • File conflicts → Detected and serialized automatically
Design phases with vertical slices (feature end-to-end) rather than horizontal layers (all models, then all APIs). Vertical slices parallelize better.

Fresh Context Per Plan

Each executor agent starts with:
  • 200k tokens available - Full context budget
  • Zero accumulated garbage - No prior conversation history
  • Focused context - Only loads what’s needed for this plan
Context loaded per agent:
  • PROJECT.md - Project vision
  • {phase_num}-CONTEXT.md - Implementation preferences
  • {phase_num}-RESEARCH.md - Domain knowledge
  • {phase_num}-{N}-PLAN.md - The specific plan to execute
  • STATE.md - Current decisions and blockers
This is why quality stays high. No context rot, no “I’ll be more concise”, no degradation.

Atomic Git Commits

Each plan gets its own commit immediately after completion:
Commit format: type(phase-plan): description
  • feat - New functionality
  • fix - Bug fix
  • docs - Documentation or completion
  • refactor - Code restructuring
  • test - Test addition/update

Benefits

  • Git bisect finds exact failing task
  • Selective revert - Each task independently revertable
  • Clear history - Future Claude sessions understand what happened
  • Better observability - Track progress at task granularity
Atomic commits are invaluable for debugging. If something breaks, git bisect pinpoints the exact task that caused it.

Execution Flow

1

Pre-flight Checks

2

Wave 1 Execution

3

Wave 2 Execution

4

Phase Verification

5

Next Steps

Checkpoint Handling

If execution is interrupted (crash, timeout, user cancellation):
Re-running the command resumes from the last checkpoint:
  • Completed plans are skipped
  • In-progress plan restarts from beginning
  • Uncommitted work is preserved
If a plan partially completes, the executor will restart it. Ensure tasks are idempotent or use git to inspect changes before re-running.

Parallel Execution Configuration

Control parallelization via config:
Disable parallel execution if:
  • Working on a slow machine
  • Debugging execution issues
  • File conflicts occur frequently

Model Selection

Executor agents use models based on your profile: Set profile with /gsd:set-profile or configure in /gsd:settings.

Plan Summaries

After each plan completes, a SUMMARY.md is created:
Summaries provide:
  • Audit trail of what was built
  • Context for future phases
  • Debugging starting point if issues arise

Phase Verification

After all plans complete, automatic verification checks:
1

Requirements Coverage

Were all phase requirements delivered?
2

Goal Achievement

Does the codebase match the phase goal?
3

Integration Points

Do new components integrate with existing code?
4

Must-Have Validation

Are critical features present and functional?
Results saved to {phase_num}-VERIFICATION.md. If verification fails:
Automatic verification catches obvious issues. Manual verification with /gsd:verify-work tests actual user workflows.

Files Created

After execution, your .planning/ directory has:

Git Branching

If you’ve configured git branching strategy:
All commits go to current branch.
Configure branching in /gsd:settings or .planning/config.json.

Next Steps

After execution completes:

Verify Work

Manually test features through conversational UAT

Next Phase

Start discussing the next phase

Tips

Don’t interrupt execution. Let waves complete. Checkpoints work but restarting wastes tokens.
Monitor the first wave. If plans fail immediately, pause and check for missing dependencies or unclear instructions.
Review summaries. They tell you exactly what was built and reveal if the executor misunderstood something.
If multiple plans modify the same file, they’ll be serialized automatically. This can slow execution - consider splitting files or merging plans.