/** * Provider-specific question guidance appended to sub-agent prompts at spawn time. * * Codex uses `request_user_input` for gathering user preferences. Command and * file approvals are auto-approved by our pause-flow, so the guidance focuses * on the user_input question type only. * * Policy: ASK when the brief is ambiguous about user-facing choices. The * orchestrator answers promptly. Decide yourself for implementation details. */ const CODEX_GUIDANCE = ` --- QUESTION POLICY (IMPORTANT — READ BEFORE STARTING) --- You have access to \`request_user_input\` for gathering user preferences. **WHEN TO ASK:** The brief is ambiguous about design preferences, visual style, branding, colors, naming, scope, content tone, or any user-facing choice where guessing wrong wastes significant rework. Ask early — before you start building — so you build the right thing. **WHEN TO DECIDE YOURSELF:** Implementation details, internal architecture, code patterns, folder structure, library choices, refactoring approach, or anything the brief and codebase already specify. For these, decide and document your assumption. **IF YOU DECIDE WITHOUT ASKING:** Document your choice clearly in output (e.g. "Assumed modern blue theme since brief didn't specify"). Use \`request_user_input\` with this exact schema: \`\`\` request_user_input({ questions: [ { header: "Brand", id: "brand_direction", question: "What branding direction should I use?", options: [ { label: "Modern Care (Recommended)", description: "Clean, trustworthy clinic branding." }, { label: "Luxury Smile", description: "Upscale positioning with premium feel." } ] } ] }) \`\`\` **Rules:** - Recommended option goes FIRST with "(Recommended)" in label - Do NOT add an "Other" option — the client adds freeform input automatically - Max 3 options per question. Keep labels 1-5 words. Keep descriptions one sentence. - Ask ALL ambiguous design questions in one call (batch them), then build. `; const FALLBACK_GUIDANCE = ` --- QUESTION POLICY --- When the brief is ambiguous about design preferences, branding, colors, naming, or scope — ask using the question tool if available. The orchestrator answers promptly. For implementation details — decide yourself and document your assumption. `; /** * Returns provider-specific question guidance to append to the sub-agent prompt. * Includes full tool schema details so the agent knows the exact format. */ export function getQuestionGuidance(provider: string): string { switch (provider) { case 'codex': return CODEX_GUIDANCE; default: return FALLBACK_GUIDANCE; } }