|
|
|
@ -41,32 +41,19 @@ Never ask extra questions if you already understand what the user intends.
|
|
|
|
1. Load context.
|
|
|
|
1. Load context.
|
|
|
|
- List files in `{planning_artifacts}` and `{implementation_artifacts}`.
|
|
|
|
- List files in `{planning_artifacts}` and `{implementation_artifacts}`.
|
|
|
|
- If you find an unformatted spec or intent file, ingest its contents to form your understanding of the intent.
|
|
|
|
- If you find an unformatted spec or intent file, ingest its contents to form your understanding of the intent.
|
|
|
|
- **Determine context strategy.** Using the intent and the artifact listing, infer whether the current work is a story from an epic. Do not rely on filename patterns or regex — reason about the intent, the listing, and any epics file content together.
|
|
|
|
- Planning artifacts are the output of BMAD phases 1-3. Typical files include:
|
|
|
|
|
|
|
|
- **PRD** (`*prd*`) — product requirements and success criteria
|
|
|
|
**A) Epic story path** — if the intent is clearly an epic story:
|
|
|
|
- **Architecture** (`*architecture*`) — technical design decisions and constraints
|
|
|
|
|
|
|
|
- **UX/Design** (`*ux*`) — user experience and interaction design
|
|
|
|
1. Identify the epic number and (if present) the story number. If you can't identify an epic number, use path B.
|
|
|
|
- **Epics** (`*epic*`) — feature breakdown into implementable stories
|
|
|
|
|
|
|
|
- **Product Brief** (`*brief*`) — project vision and scope
|
|
|
|
2. **Check for a valid cached epic context.** Look for `{implementation_artifacts}/epic-<N>-context.md` (where `<N>` is the epic number). A file is **valid** when it exists, is non-empty, starts with `# Epic <N> Context:` (with the correct epic number), and no file in `{planning_artifacts}` is newer.
|
|
|
|
- Scan the listing for files matching these patterns. If any look relevant to the current intent, load them selectively — you don't need all of them, but you need the right constraints and requirements rather than guessing from code alone.
|
|
|
|
- **If valid:** load it as the primary planning context. Do not load raw planning docs (PRD, architecture, UX, etc.). Skip to step 5.
|
|
|
|
- **Previous story continuity.** Using the intent and loaded context (especially any epics file), infer whether the current work is a story from an epic. Do not rely on filename patterns or regex — reason about the intent, the artifact listing, and epics content together. If the intent is an epic story:
|
|
|
|
- **If missing, empty, or invalid:** continue to step 3.
|
|
|
|
1. Identify the epic and story number.
|
|
|
|
|
|
|
|
2. Scan `{implementation_artifacts}` for specs from the same epic with `status: done` and a lower story number.
|
|
|
|
3. **Compile epic context.** Produce `{implementation_artifacts}/epic-<N>-context.md` by following `./compile-epic-context.md`, in order of preference:
|
|
|
|
3. Load the most recent one (highest story number below current).
|
|
|
|
- **Preferred — sub-agent:** 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`.
|
|
|
|
4. Extract its **Code Map**, **Design Notes**, **Spec Change Log**, and **task list** as continuity context for step-02 planning.
|
|
|
|
- **Fallback — inline** (for runtimes without sub-agent support, e.g. Copilot, Codex, local Ollama, older Claude): if your runtime cannot spawn sub-agents, or the spawn fails/times out, read `./compile-epic-context.md` yourself and follow its instructions to produce the same output file.
|
|
|
|
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. If the intent is not an epic story, or no previous spec exists, skip this silently.
|
|
|
|
|
|
|
|
|
|
|
|
4. **Verify.** After compilation, verify the output file exists, is non-empty, and starts with `# Epic <N> Context:`. If valid, load it. If verification fails, HALT and report the failure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5. **Previous story continuity.** Regardless of which context source succeeded above, 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:
|
|
|
|
|
|
|
|
- Planning artifacts are the output of BMAD phases 1-3. Typical files include:
|
|
|
|
|
|
|
|
- **PRD** (`*prd*`) — product requirements and success criteria
|
|
|
|
|
|
|
|
- **Architecture** (`*architecture*`) — technical design decisions and constraints
|
|
|
|
|
|
|
|
- **UX/Design** (`*ux*`) — user experience and interaction design
|
|
|
|
|
|
|
|
- **Epics** (`*epic*`) — feature breakdown into implementable stories
|
|
|
|
|
|
|
|
- **Product Brief** (`*brief*`) — project vision and scope
|
|
|
|
|
|
|
|
- Scan the listing for files matching these patterns. If any look relevant to the current intent, load them selectively — you don't need all of them, but you need the right constraints and requirements rather than guessing from code alone.
|
|
|
|
|
|
|
|
2. Clarify intent. Do not fantasize, do not leave open questions. If you must ask questions, ask them as a numbered list. When the human replies, verify that every single numbered question was answered. If any were ignored, HALT and re-ask only the missing questions before proceeding. Keep looping until intent is clear enough to implement.
|
|
|
|
2. Clarify intent. Do not fantasize, do not leave open questions. If you must ask questions, ask them as a numbered list. When the human replies, verify that every single numbered question was answered. If any were ignored, HALT and re-ask only the missing questions before proceeding. Keep looping until intent is clear enough to implement.
|
|
|
|
3. Version control sanity check. Is the working tree clean? Does the current branch make sense for this intent — considering its name and recent history? If the tree is dirty or the branch is an obvious mismatch, HALT and ask the human before proceeding. If version control is unavailable, skip this check.
|
|
|
|
3. Version control sanity check. Is the working tree clean? Does the current branch make sense for this intent — considering its name and recent history? If the tree is dirty or the branch is an obvious mismatch, HALT and ask the human before proceeding. If version control is unavailable, skip this check.
|
|
|
|
4. Multi-goal check (see SCOPE STANDARD). If the intent fails the single-goal criteria:
|
|
|
|
4. Multi-goal check (see SCOPE STANDARD). If the intent fails the single-goal criteria:
|
|
|
|
|