From 27d07a35d74a4dd48f862136b7fd24e6491a241a Mon Sep 17 00:00:00 2001 From: deseltrus <101901449+deseltrus@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:55:07 +0100 Subject: [PATCH] fix(discuss): enforce depends_on frontmatter in multi-milestone CONTEXT.md (#507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The multi-milestone discussion flow writes CONTEXT.md files for each milestone but never adds depends_on YAML frontmatter. The QUEUE.md documents the dependency chain, but the auto-mode state machine reads dependencies from CONTEXT.md frontmatter only — not from QUEUE.md. Without frontmatter, milestones execute in filesystem order regardless of their actual dependency chain, causing out-of-order execution. Fix: Added MANDATORY depends_on documentation to both discuss.md (Phase 2, after primary milestone) and queue.md (output section). Instructs the LLM to write frontmatter with the exact milestone IDs from the dependency chain confirmed during the milestone split gate. Co-authored-by: Claude Opus 4.6 (1M context) Co-authored-by: TÂCHES --- src/resources/extensions/gsd/prompts/discuss.md | 14 ++++++++++++++ src/resources/extensions/gsd/prompts/queue.md | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/resources/extensions/gsd/prompts/discuss.md b/src/resources/extensions/gsd/prompts/discuss.md index fef9176b8..e6f4ff3c4 100644 --- a/src/resources/extensions/gsd/prompts/discuss.md +++ b/src/resources/extensions/gsd/prompts/discuss.md @@ -215,6 +215,20 @@ Once the user confirms the milestone split: 5. Write a full `CONTEXT.md` for the primary milestone (the one discussed in depth). 6. Write a `ROADMAP.md` for **only the primary milestone** — detail-planning later milestones now is waste because the codebase will change. Include requirement coverage and a milestone definition of done. +#### MANDATORY: depends_on Frontmatter in CONTEXT.md + +Every CONTEXT.md for a milestone that depends on other milestones MUST have YAML frontmatter with `depends_on`. The auto-mode state machine reads this field to determine execution order — without it, milestones may execute out of order or in parallel when they shouldn't. + +```yaml +--- +depends_on: [M001, M002] +--- + +# M003: Title +``` + +If a milestone has no dependencies, omit the frontmatter. The dependency chain from the milestone confirmation gate MUST be reflected in each CONTEXT.md frontmatter. Do NOT rely on QUEUE.md or PROJECT.md for dependency tracking — the state machine only reads CONTEXT.md frontmatter. + #### Phase 3: Sequential readiness gate for remaining milestones For each remaining milestone **one at a time, in sequence**, use `ask_user_questions` to assess readiness. Present three options: diff --git a/src/resources/extensions/gsd/prompts/queue.md b/src/resources/extensions/gsd/prompts/queue.md index f53f11078..08bf5b4c6 100644 --- a/src/resources/extensions/gsd/prompts/queue.md +++ b/src/resources/extensions/gsd/prompts/queue.md @@ -82,7 +82,13 @@ Determine where the new milestones should go in the overall sequence. Consider d Once the user is satisfied, in a single pass for **each** new milestone (starting from {{nextId}}): 1. `mkdir -p .gsd/milestones//slices` -2. Write `.gsd/milestones//-CONTEXT.md` — use the **Context** output template below. Capture intent, scope, risks, constraints, integration points, and relevant requirements. Mark the status as "Queued — pending auto-mode execution." +2. Write `.gsd/milestones//-CONTEXT.md` — use the **Context** output template below. Capture intent, scope, risks, constraints, integration points, and relevant requirements. Mark the status as "Queued — pending auto-mode execution." **If this milestone depends on other milestones, add YAML frontmatter with `depends_on`:** + ```yaml + --- + depends_on: [M001, M002] + --- + ``` + The auto-mode state machine reads this field to enforce execution order. Without it, milestones may execute out of order. List the exact milestone IDs (including any suffix like `-0zjrg0`) from the dependency chain discussed with the user. Then, after all milestone directories and context files are written: