Files
Codewalkers/.planning/phases/10-multi-question-schema/10-01-PLAN.md
Lukas May 9dd0e46060 docs(10): create phase plan
Phase 10: Multi-Question Schema
- 4 plans in 3 waves
- Wave 1: Schema & types (01)
- Wave 2: Manager implementations + unit tests (02, 03 parallel)
- Wave 3: E2E tests (04)
- Ready for execution
2026-01-31 17:51:18 +01:00

4.2 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous
phase plan type wave depends_on files_modified autonomous
10-multi-question-schema 01 execute 1
src/agent/schema.ts
src/agent/types.ts
src/events/types.ts
true
Extend agent output schema to return array of questions; update types throughout.

Purpose: Enable agents to ask multiple questions in one pause, reducing round-trips. Output: Updated Zod schema, TypeScript types, and event payloads supporting questions array.

<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 @.planning/phases/08.1-agent-output-schema/08.1-01-SUMMARY.md

@src/agent/schema.ts @src/agent/types.ts @src/events/types.ts

Task 1: Update agent output schema to questions array src/agent/schema.ts Change `question` status variant from single question to array:

Before:

z.object({
  status: z.literal('question'),
  question: z.string(),
  options: z.array(optionSchema).optional(),
  multiSelect: z.boolean().optional(),
})

After:

z.object({
  status: z.literal('questions'),  // plural
  questions: z.array(z.object({
    id: z.string(),  // unique identifier for matching answers
    question: z.string(),
    options: z.array(optionSchema).optional(),
    multiSelect: z.boolean().optional(),
  })),
})

Update agentOutputJsonSchema to match the Zod schema.

Key points:

  • Rename status from 'question' to 'questions' (plural) for clarity
  • Each question has an id field so answers can be matched
  • Single question case: questions: [{ id: "q1", question: "..." }] npm run typecheck passes Schema exports updated AgentOutput type with questions array
Task 2: Update PendingQuestion type to PendingQuestions src/agent/types.ts Rename and restructure PendingQuestion:

Before:

export interface PendingQuestion {
  question: string;
  options?: Array<{ label: string; description?: string }>;
  multiSelect?: boolean;
}

After:

export interface QuestionItem {
  id: string;
  question: string;
  options?: Array<{ label: string; description?: string }>;
  multiSelect?: boolean;
}

export interface PendingQuestions {
  questions: QuestionItem[];
}

Update AgentManager interface:

  • Rename getPendingQuestion to getPendingQuestions
  • Return type: Promise<PendingQuestions | null> npm run typecheck passes Types updated to array-based questions
Task 3: Update AgentWaitingEvent payload src/events/types.ts Update AgentWaitingEvent payload to use questions array:

Before:

export interface AgentWaitingEvent extends DomainEvent {
  type: 'agent:waiting';
  payload: {
    agentId: string;
    name: string;
    taskId: string;
    sessionId: string;
    question: string;
    options?: Array<{ label: string; description?: string }>;
    multiSelect?: boolean;
  };
}

After:

export interface AgentWaitingEvent extends DomainEvent {
  type: 'agent:waiting';
  payload: {
    agentId: string;
    name: string;
    taskId: string;
    sessionId: string;
    questions: Array<{
      id: string;
      question: string;
      options?: Array<{ label: string; description?: string }>;
      multiSelect?: boolean;
    }>;
  };
}
npm run typecheck passes Event payload uses questions array Before declaring plan complete: - [ ] `npm run typecheck` passes - [ ] `npm run build` succeeds - [ ] Schema changes are consistent across all three files

<success_criteria>

  • All tasks completed
  • Agent output schema uses questions array (not single question)
  • PendingQuestions type uses array
  • AgentWaitingEvent payload uses questions array
  • Each question has id field for answer matching </success_criteria>
After completion, create `.planning/phases/10-multi-question-schema/10-01-SUMMARY.md`