From 20737aff91b5c994d62529d2edd673f62a352f34 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Tue, 7 Apr 2026 13:35:58 -0700 Subject: [PATCH] fix(quick-dev): tighten epic context loading per PR review - Validate cached epic--context.md is non-empty and starts with the expected header before loading; treat invalid cache as missing. - Replace inline {N} placeholders with so the skill validator does not flag them as unresolved workflow variables. - Replace ambiguous "fall back to path B" with an explicit instruction to scan/load planning artifacts using path B's procedure, with a note not to re-evaluate path B's gating clause. Addresses CodeRabbit and Augment review comments on PR #2218. --- .../bmad-quick-dev/step-01-clarify-and-route.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md b/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md index 7be46d8e0..159980125 100644 --- a/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md +++ b/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md @@ -45,9 +45,9 @@ Never ask extra questions if you already understand what the user intends. **A) Epic story path** — if the intent is an epic story: 1. Identify the epic number and story number. - 2. Check if `{implementation_artifacts}/epic-{N}-context.md` exists (where N is the epic number). - - **If it exists**: load it. This is the compiled planning context for the epic — do not load raw planning docs (PRD, architecture, UX, etc.). - - **If it does not exist**: spawn a sub-agent with `./compile-epic-context.md` as its prompt. Pass it the epic number, the epics file path, the `{planning_artifacts}` directory, and the output path `{implementation_artifacts}/epic-{N}-context.md`. When the sub-agent completes, verify the output file exists and is non-empty. If the file is missing, empty, or the sub-agent errored, fall back to path B. Otherwise load the compiled file. + 2. Check if `{implementation_artifacts}/epic--context.md` exists (where `` is the epic number). + - **If it exists**: verify it is non-empty and starts with a `# Epic Context` header. If valid, load it — this is the compiled planning context for the epic, do not load raw planning docs (PRD, architecture, UX, etc.). If invalid (empty, truncated, or wrong header), treat it as missing and fall through to the compilation step below. + - **If it does not exist**: spawn a sub-agent with `./compile-epic-context.md` as its prompt. Pass it the epic number, the epics file path, the `{planning_artifacts}` directory, and the output path `{implementation_artifacts}/epic--context.md`. When the sub-agent completes, verify the output file exists and is non-empty. If the file is missing, empty, or the sub-agent errored, fall back to loading raw planning artifacts using path B's loading procedure below (scan `{planning_artifacts}` for PRD, architecture, UX, and epics files and load selectively) — apply this fallback even though the intent is an epic story; do not re-evaluate path B's gating clause. Otherwise load the compiled file. 3. **Previous story continuity.** Scan `{implementation_artifacts}` for specs from the same epic with `status: done` and a lower story number. Load the most recent one (highest story number below current). Extract its **Code Map**, **Design Notes**, **Spec Change Log**, and **task list** as continuity context for step-02 planning. If no `done` spec is found but an `in-review` spec exists for the same epic with a lower story number, note it to the user and ask whether to load it. **B) Freeform path** — if the intent is not an epic story: