Skip to content

feat(quick-dev): add epic context compilation to step-01#2218

Open
alexeyv wants to merge 4 commits intomainfrom
feat/epic-context-compilation
Open

feat(quick-dev): add epic context compilation to step-01#2218
alexeyv wants to merge 4 commits intomainfrom
feat/epic-context-compilation

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Apr 5, 2026

Summary

  • Forks step-01 context loading into two paths: epic stories get a sub-agent that compiles planning docs into a cached epic-{N}-context.md, freeform intents keep the lightweight directory-listing approach
  • Adds compile-epic-context.md as a static sub-agent prompt shipped with the skill
  • Preserves previous story continuity and freeform path unchanged

Test plan

  • Run quick-dev with an epic story intent -- verify sub-agent compiles context and the file is created
  • Run quick-dev again for a second story in the same epic -- verify cached file is loaded without re-compilation
  • Run quick-dev with a freeform intent (bug fix) -- verify behavior is unchanged
  • Run npm run validate:skills -- passes with new file included

Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

📝 Walkthrough

Walkthrough

This PR adds a new documentation file defining a context-compilation agent workflow for extracting epic-relevant constraints and decisions from planning artifacts, and refactors step-01's routing logic to implement an explicit two-branch strategy: epic stories load precompiled or freshly compiled epic context, while non-epic intents follow an existing freeform path with selective planning artifact loading.

Changes

Cohort / File(s) Summary
New Epic Context Compilation Workflow
src/bmm-skills/4-implementation/bmad-quick-dev/compile-epic-context.md
Added comprehensive instruction document specifying how to load epic definitions, scan planning artifacts for standard BMAD doc types (PRD, Architecture, UX/Design, Brief), and compile epic-relevant constraints, decisions, and patterns into a single markdown context output. Defines required output structure, error handling for missing epics, scoping rules, and content constraints.
Epic vs. Freeform Routing Logic
src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md
Refactored routing to branch between epic and non-epic paths. Epic path loads precompiled context from {implementation_artifacts}/epic-{N}-context.md or spawns compilation workflow if missing; validates output and falls back to non-epic path on failure. Integrated previous story continuity within epic path. Non-epic path retained selective BMAD phase 1–3 artifact loading under freeform branch.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • pbean
  • muratkeremozcan
  • cecil-the-coder
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding epic context compilation to step-01, which aligns directly with the primary changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the fork into two paths, the new sub-agent prompt file, and preserved behavior, with a concrete test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/epic-context-compilation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md`:
- Around line 49-51: The cached epic context load step must validate file
integrity before trusting it: when checking
`{implementation_artifacts}/epic-{N}-context.md` ensure the file both exists and
is non-empty and passes a basic sanity check (e.g., minimum byte/line length and
presence of expected markers like a title or frontmatter token). If the file is
missing, zero-length, below the minimum threshold, or fails the sanity check, do
not load it; instead trigger the `./compile-epic-context.md` sub-agent passing
the epic number, epics file path, `{planning_artifacts}` and the intended output
`{implementation_artifacts}/epic-{N}-context.md`, then verify the produced file
again for existence and integrity before loading; if it still fails, fall back
to path B. Ensure the same validation is applied after sub-agent completion and
that any validation failure causes recompilation or fallback rather than
silently accepting a bad cache.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c322946b-4b5a-4706-937f-1fade57a5e7d

📥 Commits

Reviewing files that changed from the base of the PR and between 28aa522 and 92378cd.

📒 Files selected for processing (2)
  • src/bmm-skills/4-implementation/bmad-quick-dev/compile-epic-context.md
  • src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md

Fork step-01 context loading: epic stories get a sub-agent that
compiles planning docs into a cached epic-{N}-context.md, while
freeform intents keep the lightweight directory-listing path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexeyv alexeyv force-pushed the feat/epic-context-compilation branch from 92378cd to 6446b68 Compare April 6, 2026 14:55
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 6, 2026

🤖 Augment PR Summary

Summary: This PR adds an “epic story” context-loading path to the bmad-quick-dev workflow.

Changes:

  • Introduces compile-epic-context.md, a sub-agent prompt that distills planning artifacts into a single epic-scoped context document.
  • Updates step-01 routing to detect epic-story intents and prefer a cached epic-{N}-context.md in {implementation_artifacts}.
  • If the cached epic context is missing, instructs quick-dev to spawn a sub-agent to generate it, then load the compiled output.
  • Keeps the existing “freeform” intent path that selectively loads raw planning artifacts (PRD/architecture/UX/epics/brief).

Technical Notes: Epic context is intended to be regenerated only when missing, providing a lightweight cache for subsequent stories in the same epic.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

- Validate cached epic-<N>-context.md is non-empty and starts with the
  expected header before loading; treat invalid cache as missing.
- Replace inline {N} placeholders with <N> 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.
@alexeyv
Copy link
Copy Markdown
Collaborator Author

alexeyv commented Apr 8, 2026

Triage complete — 4 findings

ID Src Sev Title Decision
F1 CodeRabbit Major Validate cached epic context before trusting it FIX
F2 Augment High {N} looks like undefined workflow variable FIX
F3 Augment Medium "fall back to path B" contradiction FIX
F4 Augment Low Cached file loaded by existence only DISMISS (duplicate of F1)

Totals: FIX=3, DISMISS=1, DEFER=0

Applied in commit 565167a:

  • Cached epic-<N>-context.md is now verified non-empty and starts with the expected # Epic <N> Context header before loading; invalid cache falls through to compilation. (F1 + F4)
  • {N} placeholders replaced with <N> to avoid skill-validator REF-01 unresolved-variable flagging. (F2)
  • Ambiguous "fall back to path B" replaced with an explicit instruction to use path B's loading procedure (scan PRD/architecture/UX/epics, load selectively), with a note not to re-evaluate path B's gating clause. (F3)

alexeyv added 2 commits April 8, 2026 10:02
- Restructure with Task/Steps opening and Exact Output Format section.
- Switch Stories template to bullet form for clarity.
- Add "no hallucination" and explicit "omit empty sections except Goal
  and Stories" rules.
- Use <N> instead of {N} in the filename for consistency with step-01.
Reshape path A of step-01 into five explicit numbered steps and add an
inline-compilation fallback for runtimes that cannot spawn sub-agents
(Copilot, Codex, local Ollama, older Claude).

- Pull cache validity, compilation, verification, and continuity into
  separate numbered steps instead of nested paragraphs.
- Define "valid cached context" upfront: non-empty and starts with
  `# Epic <N> Context:`.
- Add inline-compilation fallback: runtimes without sub-agent support
  read compile-epic-context.md and follow it directly.
- Make previous-story continuity run regardless of which context source
  succeeded (cache hit, fresh compilation, or path-B raw fallback).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant