Skip to content

refactor(bmm): streamline bmad-product-brief into lean facilitator#2370

Merged
bmadcode merged 6 commits intomainfrom
brief-evo2
May 9, 2026
Merged

refactor(bmm): streamline bmad-product-brief into lean facilitator#2370
bmadcode merged 6 commits intomainfrom
brief-evo2

Conversation

@bmadcode
Copy link
Copy Markdown
Collaborator

@bmadcode bmadcode commented May 9, 2026

Summary

Rewrites bmad-product-brief as an outcome-driven facilitator with three first-class intents: Create, Update, Validate. Replaces the scripted five-stage workflow and its subagent fan-outs with a single concise SKILL.md that trusts the model and names only the constraints, hooks, and contracts it cannot infer.

Changes

  • SKILL.md rewritten (117 → ~60 lines): role and honest-output paragraphs; standard six-step activation block; three intent paragraphs (Create / Update / Validate); short Headless, Discovery, Constraints, Finalize sections.
  • assets/brief-template.md added — lean, adapt-aggressively guidance. Old resources/brief-template.md removed (canonical folder name is assets/).
  • customize.toml updated: keeps activation_steps_prepend, activation_steps_append, persistent_facts, on_complete, brief_template; adds output_dir, output_folder_name, and doc_standards (defaults, applied in order: bmad-editorial-review-structure, bmad-editorial-review-prose).
  • Removed agents/ (artifact-analyzer, web-researcher, skeptic-reviewer, opportunity-reviewer) and prompts/ (contextual-discovery, guided-elicitation, draft-and-review, finalize). Discovery, elicitation, and review now happen inline through the role and intent prompts rather than scripted handoffs.
  • Removed bmad-manifest.json — no longer load-bearing.

Behavior

  • Create. Conversational draft to a fresh {doc_workspace} at {output_dir}/{output_folder_name}/: brief.md (frontmatter: title, status, created, updated), decision-log.md working-memory sidecar, optional addendum.md, optional distillate.md.
  • Update. Reconciles an existing brief against a change signal, surfaces conflicts with prior decisions, offers Create when the change is fundamental.
  • Validate. Inline critique against the brief's own purpose, no rewrite. Offers to roll findings into Update.
  • Headless. No conversation; ends with a JSON response listing status, intent, and artifact paths. Halts with a blocked status when intent cannot be inferred.
  • Finalize. Decision-log audit (with addendum if earned) → standards via {workflow.doc_standards} → optional distillate via bmad-distillator → completion message and bmad-help for next steps → on_complete if set.

Test plan

  • npm test passes
  • Run bmad-product-brief end-to-end on a sample idea, verify Create / Update / Validate intent routing
  • Confirm customize.toml overrides change output_dir, doc_standards, and brief_template
  • Headless invocation produces a JSON exit with artifact paths

Rewrites bmad-product-brief as an outcome-driven, intent-routed
facilitator with a configurable reviewer panel.

- Replace scripted prompt files with a concise SKILL.md
- Add brief-shape detection and intent routing
- Make the reviewer panel config-driven via customize.toml
- Harden the required-reviewer gate
- Add helper scripts and tests for panel resolution
- Replace embedded resources with a single brief-template asset
- Register skill metadata in module.yaml
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

The PR refactors bmad-product-brief from a five-stage prompt-driven architecture to a templated skill with declarative operating modes and integrated agent support. SKILL.md now specifies metadata, activation flow, headless/interactive modes, and content guidance. Workflow configuration centralizes template paths and polish steps. Legacy stage prompts and agent definitions are removed. New agents are registered in the module roster.

Changes

Product Brief Skill Refactor

Layer / File(s) Summary
Skill Definition & Metadata
src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md
Frontmatter added/updated with name and expanded description. Core behavior rules rewritten for coaching-style facilitation. On Activation procedure now uses templated execution (resolve customization, load config, apply persistent facts).
Operating Modes & Activation
src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md
Explicit intent-driven operating modes (Create/Update/Validate) replace stage-based routing. Headless mode support added requiring JSON response with status and artifact paths.
Content Guidance & Constraints
src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md
Discovery focused on user context; constraints enforce right-sizing and decision-log persistence; finalize pipeline adds polish steps, optional distillation, and readiness confirmation.
Workflow Configuration
src/bmm-skills/1-analysis/bmad-product-brief/customize.toml
Template path updated to assets/brief-template.md; output controls added (output_dir, output_folder_name); polish_skills sequence defined for finalization.
Template Assets
src/bmm-skills/1-analysis/bmad-product-brief/assets/brief-template.md
New reusable product brief template with sections (Executive Summary, Problem, Solution, Differentiators, Success Criteria, Scope, Vision) and writing guidance.
Agent Registry
src/bmm-skills/module.yaml
Four new agents added: bmad-agent-research-librarian (Iris), bmad-agent-field-researcher (Diego), bmad-agent-skeptic (Octavia), bmad-agent-growth-strategist (Naomi).
Legacy Prompt Removal
src/bmm-skills/1-analysis/bmad-product-brief/prompts/*, agents/*, resources/brief-template.md, bmad-manifest.json
Stage-based prompts (contextual-discovery, guided-elicitation, draft-and-review, finalize), agent prompt definitions, old template file, and capability manifest removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main refactoring effort: streamlining the bmad-product-brief skill into a lean facilitator-based architecture, which is the core change across the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly outlines the refactoring of bmad-product-brief from a scripted five-stage workflow to a concise, outcome-driven facilitator. It details changes to SKILL.md, removal of agents/prompts directories, addition of assets/brief-template.md, updates to customize.toml, and behavioral changes across Create/Update/Validate intents.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brief-evo2

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/bmm-skills/1-analysis/bmad-product-brief/customize.toml`:
- Around line 35-51: Add a docs page (or update the existing config docs)
describing the new brief customization knobs: brief_template, output_dir,
output_folder_name, and polish_skills; explain their purpose, defaults (e.g.,
brief_template = "assets/brief-template.md", output_dir =
"{planning_artifacts}/briefs", output_folder_name =
"brief-{project_name}-{date}"), how to override them in team/user TOML, and the
semantics/ordering of polish_skills (that skills run sequentially and can be
overridden). Reference the exact symbols brief_template, output_dir,
output_folder_name, and polish_skills and include examples of common overrides
and any caveats (parallel runs collide on inline edits) so users can apply the
new workflow knobs correctly.

In `@src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md`:
- Line 20: Update the skill doc to remove the contradiction between the
greeting/clarify step ("Greet `{user_name}` in `{communication_language}`.
Detect intent (create / update / validate); ask if unclear.") and the later
prohibition on asking in headless mode by specifying deterministic headless
fallback behavior: when running in headless mode, first attempt to infer intent
from available artifacts (e.g., product_brief, existing metadata,
previous_actions), if a single high-confidence intent is inferred proceed with
that intent, otherwise do not prompt the user and instead return/emit an
explicit failure status such as "INTENT_UNDETERMINED" or "NEED_USER_INPUT" (and
include reasons), and update references to "headless" and the intent-resolution
step in SKILL.md so the contract clearly states these fallback rules.
🪄 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: 7d366abd-23d6-45a3-9ffb-6e1380ecba66

📥 Commits

Reviewing files that changed from the base of the PR and between e36f219 and bc7714a.

📒 Files selected for processing (14)
  • src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/artifact-analyzer.md
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/opportunity-reviewer.md
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/skeptic-reviewer.md
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/web-researcher.md
  • src/bmm-skills/1-analysis/bmad-product-brief/assets/brief-template.md
  • src/bmm-skills/1-analysis/bmad-product-brief/bmad-manifest.json
  • src/bmm-skills/1-analysis/bmad-product-brief/customize.toml
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/contextual-discovery.md
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/draft-and-review.md
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/finalize.md
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/guided-elicitation.md
  • src/bmm-skills/1-analysis/bmad-product-brief/resources/brief-template.md
  • src/bmm-skills/module.yaml
💤 Files with no reviewable changes (10)
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/opportunity-reviewer.md
  • src/bmm-skills/1-analysis/bmad-product-brief/resources/brief-template.md
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/artifact-analyzer.md
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/contextual-discovery.md
  • src/bmm-skills/1-analysis/bmad-product-brief/bmad-manifest.json
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/finalize.md
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/web-researcher.md
  • src/bmm-skills/1-analysis/bmad-product-brief/agents/skeptic-reviewer.md
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/draft-and-review.md
  • src/bmm-skills/1-analysis/bmad-product-brief/prompts/guided-elicitation.md

Comment thread src/bmm-skills/1-analysis/bmad-product-brief/customize.toml
Comment thread src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md Outdated
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 9, 2026

🤖 Augment PR Summary

Summary: Refactors bmad-product-brief into a lean, intent-driven facilitator.

Changes:

  • Rewrites SKILL.md to focus on create/update/validate intent and conversational facilitation.
  • Removes legacy scripted stage prompts and subagent prompt files (agents/, prompts/), shifting guidance into the main skill doc.
  • Introduces a single brief structure asset: assets/brief-template.md (replacing the former resources/brief-template.md).
  • Expands customize.toml to be more config-driven (template path, output folder settings, polish skills, on-complete hook).
  • Drops the skill’s legacy bmad-manifest.json sidecar in favor of repo-wide discovery via SKILL.md.
  • Adds new named-agent entries in src/bmm-skills/module.yaml (research/skeptic/growth personas) for roster-based use.

Notes: The new flow relies heavily on variable resolution and runtime conventions (config paths, run-folder naming), so validator compatibility and consistent config loading are important.

🤖 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. 6 suggestions posted.

Fix All in Augment

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

Comment thread src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md Outdated
Comment thread src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md Outdated
Comment thread src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md Outdated
Comment thread src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md
Comment thread src/bmm-skills/1-analysis/bmad-product-brief/customize.toml
Comment thread src/bmm-skills/1-analysis/bmad-product-brief/customize.toml
bmadcode added 5 commits May 9, 2026 08:44
- Discovery now invites a brain dump and source material upfront,
  followed by "anything else?" before drilling
- Create and Update modes explicitly invoke Discovery before drafting
- Calibrate "make them sweat" to ease as the brief firms up
- Update mode regenerates distillate.md when changes apply
- Replace polish_skills with polish_passes: polymorphic entries
  (skill:/file:/plain-text), parallel subagents, applied automatically
  so the user sees a polished draft, not a polish review
- Default persistent_facts to empty with opt-in examples instead of an
  unbounded project-context.md glob
- Remove research-librarian, field-researcher, and skeptic agents no
  longer needed with this rework
…rief

- Replace "Hold a working memory" with "Persistence is real-time": the
  workspace exists on disk and the user knows the path the moment Create
  intent is confirmed; decision-log.md is canonical memory so walk-away
  leaves nothing in the conversation
- Add "Continuity across sessions": prior in-progress drafts for this
  project surface a resume offer
Adds an eval suite for bmad-product-brief following the Anthropic skill-creator
schema, plus a new "Extract, don't ingest" constraint on the skill itself.

Skill change:
- New constraint: source artifacts (user-provided or run-discovered) enter the
  parent conversation as relevance-filtered extracts via subagents, not loaded
  wholesale. Keeps the parent context lean against transcripts, brainstorms,
  research reports, code, web results, and prior briefs.

Evals (evals/bmm-skills/bmad-product-brief/):
- evals.json: 8 artifact/behavioral evals covering Create one-shot,
  source-memo ingest, Update with contradiction surfacing, Validate inline,
  Headless mode, brainstorm filtering, research-report filtering, persona
  filtering. All scenarios use fictional entities (InsuLens, Branfield CC,
  Forkbird Kitchen, Mossridge Library, Sproutkeeper, Hatchet & Loop Studio,
  Brightway, Pantry Bridge).
- triggers.json: 15 description-firing checks (7 should-fire, 8 should-not-fire)
  to catch under-triggering and adjacent-skill poaching.
- files/: realistic fixtures including a brainstorm with the relevant idea
  buried at the end, a 3000-word market research report with the relevant
  section in the middle, and customer interviews with the target persona in
  position 3 of 4 — each shaped to test that filtering happens against the
  user's stated focus regardless of where the relevant material sits.

Eval directory placement: top-level evals/ outside src/, matching the convention
in anthropics/skills (zero of 17 production skills include an evals/ subdir;
their skill-creator places dev workspaces as siblings to skill folders). Keeps
evals out of any installer or marketplace.json distribution path.
- polish_passes -> doc_standards (TOML key + SKILL.md reference). Name
  generalizes for every doc-producing skill: encodes standards applied at
  finalize, not options.
- {run_folder} -> {doc_workspace}. Bound in Create to
  {workflow.output_dir}/{workflow.output_folder_name}/; reused by Update,
  Validate, Headless, and Finalize as the active brief's folder.
- On Activation Step 4 now resolves {date} explicitly (used by
  output_folder_name default).
- Headless Mode: ambiguous-intent fallback is a `blocked` JSON status with
  a `reason` field, no prompting. Resolves the activation/headless
  contradiction flagged in review.
Refactor evals from 8 numbered single-shot tests into 16 typed evals:
- Pattern A (A1-A8): artifact-correctness tests with headless prompts and
  precise, falsifiable expectations (no invented facts, right-sized output,
  file boundary enforcement)
- Pattern B (B1-B8): process-discipline tests verifying decision-log fidelity,
  polish phase ordering, contradiction detection, and distillate generation
- Pattern C (C1): config-compliance test for custom output paths and
  document_output_language

Also tighten SKILL.md: add dependencies frontmatter, clarify headless override
autonomy in Update (proceed when intent is clear; block when ambiguous), and
make distillate skip explicit when bmad-distillator is not installed.
@bmadcode bmadcode merged commit 1c1abaa into main May 9, 2026
5 checks passed
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