---
phase: 14-parallel-phase-execution
plan: 06
type: execute
wave: 4
depends_on: ["14-04", "14-05"]
files_modified:
  - src/cli/commands/phase.ts
  - src/cli/index.ts
autonomous: true
---

<objective>
Add CLI commands for phase dependency and dispatch operations.

Purpose: Enable user to manage phase dependencies and parallel execution from command line.
Output: CLI commands for dependencies, queue, and dispatch.
</objective>

<execution_context>
@~/.claude/get-shit-done/workflows/execute-plan.md
@~/.claude/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/14-parallel-phase-execution/14-04-SUMMARY.md
@.planning/phases/14-parallel-phase-execution/14-05-SUMMARY.md

# Reference implementations:
@src/cli/commands/task.ts
@src/cli/commands/initiative.ts
</context>

<tasks>

<task type="auto">
  <name>Task 1: Add phase dependency commands</name>
  <files>src/cli/commands/phase.ts</files>
  <action>
If phase.ts doesn't exist, create it. If exists, extend it.

Add commands under phase group:

cw phase add-dependency --phase <id> --depends-on <id>
- Calls createPhaseDependency procedure
- Output: "Added dependency: phase {phaseId} depends on {dependsOnPhaseId}"

cw phase dependencies <phaseId>
- Calls getPhaseDependencies procedure
- Output: Lists dependency phase IDs or "No dependencies"

cw phase queue <phaseId>
- Calls queuePhase procedure
- Output: "Phase {phaseId} queued for execution"

cw phase dispatch
- Calls dispatchNextPhase procedure
- Output: Success message with phaseId or failure reason

cw phase queue-status
- Calls getPhaseQueueState procedure
- Output: Formatted list of queued, ready, and blocked phases

Follow existing CLI patterns for error handling and output formatting.
  </action>
  <verify>npx tsc --noEmit passes</verify>
  <done>Phase dependency and dispatch CLI commands implemented</done>
</task>

<task type="auto">
  <name>Task 2: Register phase commands in CLI</name>
  <files>src/cli/index.ts</files>
  <action>
Import and register phase commands if not already registered.
Follow pattern from other command modules (task, initiative, agent).
  </action>
  <verify>npx tsc --noEmit passes; cw phase --help shows new commands</verify>
  <done>Phase commands available in CLI</done>
</task>

</tasks>

<verification>
Before declaring plan complete:
- [ ] `npm run build` succeeds without errors
- [ ] `npm test` passes all tests
- [ ] `cw phase --help` shows dependency and dispatch commands
</verification>

<success_criteria>

- All tasks completed
- All verification checks pass
- Commands follow existing CLI patterns
- Help text is clear and concise
</success_criteria>

<output>
After completion, create `.planning/phases/14-parallel-phase-execution/14-06-SUMMARY.md`
</output>
