diff --git a/src/resources/extensions/gsd/guided-flow.ts b/src/resources/extensions/gsd/guided-flow.ts index d0f400448..016f5335b 100644 --- a/src/resources/extensions/gsd/guided-flow.ts +++ b/src/resources/extensions/gsd/guided-flow.ts @@ -480,7 +480,7 @@ async function buildDiscussSlicePrompt( sid: string, sTitle: string, base: string, - options?: { rediscuss?: boolean }, + options?: { rediscuss?: boolean; structuredQuestionsAvailable?: string }, ): Promise { const inlined: string[] = []; @@ -560,6 +560,7 @@ async function buildDiscussSlicePrompt( contextPath: sliceContextPath, projectRoot: base, inlinedTemplates, + structuredQuestionsAvailable: options?.structuredQuestionsAvailable ?? "false", commitInstruction: buildDocsCommitInstruction(`docs(${mid}/${sid}): slice context from discuss`), }); } @@ -801,7 +802,8 @@ export async function showDiscuss( if (confirm !== "rediscuss") continue; } - const prompt = await buildDiscussSlicePrompt(mid, chosen.id, chosen.title, basePath, { rediscuss: isRediscuss }); + const sqAvail = pi.getActiveTools().includes("ask_user_questions") ? "true" : "false"; + const prompt = await buildDiscussSlicePrompt(mid, chosen.id, chosen.title, basePath, { rediscuss: isRediscuss, structuredQuestionsAvailable: sqAvail }); await dispatchWorkflow(pi, prompt, "gsd-discuss", ctx, "discuss-slice"); // Wait for the discuss session to finish, then loop back to the picker @@ -1514,7 +1516,8 @@ export async function showSmartEntry( }), }), "gsd-run", ctx, "plan-slice"); } else if (choice === "discuss") { - await dispatchWorkflow(pi, await buildDiscussSlicePrompt(milestoneId, sliceId, sliceTitle, basePath, { rediscuss: hasContext }), "gsd-run", ctx, "discuss-slice"); + const sqAvail = pi.getActiveTools().includes("ask_user_questions") ? "true" : "false"; + await dispatchWorkflow(pi, await buildDiscussSlicePrompt(milestoneId, sliceId, sliceTitle, basePath, { rediscuss: hasContext, structuredQuestionsAvailable: sqAvail }), "gsd-run", ctx, "discuss-slice"); } else if (choice === "research") { const researchTemplates = inlineTemplate("research", "Research"); await dispatchWorkflow(pi, loadPrompt("guided-research-slice", { diff --git a/src/resources/extensions/gsd/prompts/guided-discuss-slice.md b/src/resources/extensions/gsd/prompts/guided-discuss-slice.md index 2fb94d2a8..ec68478b0 100644 --- a/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +++ b/src/resources/extensions/gsd/prompts/guided-discuss-slice.md @@ -22,7 +22,9 @@ Do **not** go deep — just enough that your questions reflect what's actually t ### Question rounds -Ask **1–3 questions per round** using `ask_user_questions`. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.** Keep each question focused on one of: +**If `{{structuredQuestionsAvailable}}` is `true`:** Ask **1–3 questions per round** using `ask_user_questions`. **Call `ask_user_questions` exactly once per turn — never make multiple calls with the same or overlapping questions. Wait for the user's response before asking the next round.** +**If `{{structuredQuestionsAvailable}}` is `false`:** Ask **1–3 questions per round** in plain text. Number them and wait for the user's response before asking the next round. +Keep each question focused on one of: - **UX and user-facing behaviour** — what does the user see, click, trigger, or experience? - **Edge cases and failure states** — what happens when things go wrong or are in unusual states? - **Scope boundaries** — what is explicitly in vs out for this slice? What deferred to later? @@ -36,9 +38,7 @@ After each round of answers, decide whether you already have enough signal to wr - If not, investigate any new unknowns and continue to the next round immediately. Do **not** ask a meta "ready to wrap up?" question after every round. - Ask a single wrap-up question only when you genuinely believe the slice is well understood or the user signals they want to stop. -- When you do ask it, use `ask_user_questions` with: - - "Write the context file" *(recommended when the slice is well understood)* - - "One more pass" +- When you do ask it, offer two choices: "Write the context file" *(recommended when the slice is well understood)* or "One more pass". Use `ask_user_questions` if available, otherwise ask in plain text. ---