diff --git a/src/resources/extensions/gsd/guided-flow.ts b/src/resources/extensions/gsd/guided-flow.ts index c3140ef3c..7d12b75ef 100644 --- a/src/resources/extensions/gsd/guided-flow.ts +++ b/src/resources/extensions/gsd/guided-flow.ts @@ -50,9 +50,11 @@ export function checkAutoStartAfterDiscuss(): boolean { const { ctx, pi, basePath, milestoneId, step } = pendingAutoStart; - // Gate 1: Primary milestone must have CONTEXT.md + // Gate 1: Primary milestone must have CONTEXT.md or ROADMAP.md + // The "discuss" path creates CONTEXT.md; the "plan" path creates ROADMAP.md. const contextFile = resolveMilestoneFile(basePath, milestoneId, "CONTEXT"); - if (!contextFile) return false; // no context yet — keep waiting + const roadmapFile = resolveMilestoneFile(basePath, milestoneId, "ROADMAP"); + if (!contextFile && !roadmapFile) return false; // neither artifact yet — keep waiting // Gate 2: STATE.md must exist — written as the last step in the discuss // output phase. This prevents auto-start from firing during Phase 3 @@ -943,6 +945,7 @@ export async function showSmartEntry( }); if (choice === "plan") { + pendingAutoStart = { ctx, pi, basePath, milestoneId, step: stepMode }; const planMilestoneTemplates = [ inlineTemplate("roadmap", "Roadmap"), inlineTemplate("plan", "Slice Plan"), diff --git a/src/resources/extensions/gsd/prompts/guided-plan-milestone.md b/src/resources/extensions/gsd/prompts/guided-plan-milestone.md index 8f1b1dcc6..c16ae5c38 100644 --- a/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +++ b/src/resources/extensions/gsd/prompts/guided-plan-milestone.md @@ -26,4 +26,6 @@ Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.gsd/DECISIONS.md` After writing the roadmap, analyze the slices and their boundary maps for external service dependencies (third-party APIs, SaaS platforms, cloud providers, databases requiring credentials, OAuth providers, etc.). If this milestone requires any external API keys or secrets, use the **Secrets Manifest** output template below for the expected format and write `{{secretsOutputPath}}` listing every predicted secret as an H3 section with the Service name, a direct Dashboard URL to the console page where the key is created, a Format hint showing what the key looks like, Status set to `pending`, and Destination (`dotenv`, `vercel`, or `convex`). Include numbered step-by-step guidance for obtaining each key. If this milestone does not require any external API keys or secrets, skip this step entirely — do not create an empty manifest. +**You MUST update `.gsd/STATE.md`** after writing the roadmap (and secrets manifest if applicable). This is required for auto-mode to continue. + {{inlinedTemplates}}