Files
Codewalkers/.planning/phases/12-phase-task-decomposition/12-06-PLAN.md
Lukas May 41f868294b docs(12): create phase plan
Phase 12: Phase-Task Decomposition
- 8 plans in 4 waves
- 4 parallel, 4 sequential
- Ready for execution
2026-01-31 21:03:07 +01:00

4.5 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous
phase plan type wave depends_on files_modified autonomous
12-phase-task-decomposition 06 execute 3
12-04
12-05
src/cli/index.ts
true
Add CLI commands for plan management and architect decompose workflow.

Purpose: Enable users to list plans, create plans, and spawn architect agents to decompose plans into tasks via the CLI.

Output: CLI commands for cw plan and cw architect decompose.

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

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md

Depends on Plans 04, 05

@.planning/phases/12-phase-task-decomposition/12-04-SUMMARY.md @.planning/phases/12-phase-task-decomposition/12-05-SUMMARY.md

Pattern reference from Phase 11 (CLI commands)

@.planning/phases/11-architect-agent/11-06-SUMMARY.md

CLI reference

@src/cli/index.ts

Task 1: Add plan CLI commands src/cli/index.ts Add plan command group following pattern of initiative commands:
const plan = program.command('plan').description('Plan management');

plan
  .command('list')
  .description('List plans in a phase')
  .requiredOption('--phase <id>', 'Phase ID')
  .action(async (options) => {
    const client = createTRPCClient();
    const plans = await client.listPlans.query({ phaseId: options.phase });
    console.table(plans.map(p => ({
      id: p.id,
      number: p.number,
      name: p.name,
      status: p.status,
    })));
  });

plan
  .command('create')
  .description('Create a plan in a phase')
  .requiredOption('--phase <id>', 'Phase ID')
  .requiredOption('--name <name>', 'Plan name')
  .option('--description <desc>', 'Plan description')
  .action(async (options) => {
    const client = createTRPCClient();
    const plan = await client.createPlan.mutate({
      phaseId: options.phase,
      name: options.name,
      description: options.description,
    });
    console.log(`Created plan: ${plan.id} (${plan.name})`);
  });

plan
  .command('get')
  .description('Get plan details')
  .argument('<id>', 'Plan ID')
  .action(async (id) => {
    const client = createTRPCClient();
    const plan = await client.getPlan.query({ id });
    console.log(JSON.stringify(plan, null, 2));
  });

plan
  .command('tasks')
  .description('List tasks in a plan')
  .argument('<id>', 'Plan ID')
  .action(async (id) => {
    const client = createTRPCClient();
    const tasks = await client.listTasks.query({ planId: id });
    console.table(tasks.map(t => ({
      id: t.id,
      order: t.order,
      name: t.name,
      type: t.type,
      status: t.status,
    })));
  });
npm run build passes, cw plan --help shows commands Plan CLI commands: list, create, get, tasks Task 2: Add architect decompose command src/cli/index.ts Add decompose command to architect command group:
architect
  .command('decompose')
  .description('Spawn architect to decompose plan into tasks')
  .requiredOption('--name <name>', 'Agent name')
  .requiredOption('--plan <id>', 'Plan ID to decompose')
  .option('--context <text>', 'Additional context for decomposition')
  .action(async (options) => {
    const client = createTRPCClient();
    const result = await client.spawnArchitectDecompose.mutate({
      name: options.name,
      planId: options.plan,
      context: options.context,
    });
    console.log(`Spawned decompose agent: ${result.name} (${result.id})`);
    console.log(`Working on plan: ${options.plan}`);
    console.log(`Mode: decompose`);
  });

This follows the pattern of architect discuss and architect breakdown commands. npm run build passes, cw architect decompose --help shows options cw architect decompose command spawns agent in decompose mode

Before declaring plan complete: - [ ] npm run build succeeds - [ ] cw plan --help shows: list, create, get, tasks - [ ] cw architect --help shows: discuss, breakdown, decompose - [ ] Commands follow existing CLI patterns (error handling, output format)

<success_criteria>

  • All tasks completed
  • All verification checks pass
  • No errors or warnings introduced
  • Full CLI for plan management and decompose workflow </success_criteria>
After completion, create `.planning/phases/12-phase-task-decomposition/12-06-SUMMARY.md`