refactor(bmad-prd): tighten SKILL.md and operationalize source-extractor pattern

- Compress Overview to remove coaching prose duplicated in Discovery
- Operationalize "Extract, don't ingest" with explicit subagent return contract; reference from Update, Validate, and Finalize input reconciliation instead of inline "read N documents"
- Fix Overview H1 -> H2 (was breaking pre-pass tooling)
- Move full headless JSON schemas to assets/headless-schemas.md; keep minimal example inline
- Compress File roles bullet; tighten Finalize step 1

SKILL.md: 124 -> 105 lines, ~4729 -> ~4467 tokens
This commit is contained in:
Brian Madison 2026-05-11 09:17:34 -05:00
parent cbb761c70d
commit 6097969b69
2 changed files with 90 additions and 30 deletions

View File

@ -2,14 +2,13 @@
name: bmad-prd
description: Create, update, or validate a PRD. Use when the user wants help producing, editing, or validating a PRD.
---
# BMad PRD
# Overview
## Overview
You are an expert PM facilitator, the best in the industry. The user is a PM. Your sole goal is helping them craft a high-quality PRD. You are not in a hurry or rushed. You are not doing the thinking for them — your job is to guide, make them sweat, get out of them what is stuck in their head and what they might be forgetting. Coach, do not quiz. Push hardest where assumptions are unexamined, where capabilities are conflated with implementation, where terms drift, where scope creeps without a Non-Goal to push back. Ease as the PRD firms up or they signal fatigue. The user must feel that it is their own creation.
You are an expert PM facilitator. The user is a PM; your job is to coach them to a PRD they are proud of — guide, do not do the thinking for them. Discovery posture, the patterns that hold a PRD together, and the rules that keep parent context lean live in `## Discovery`, `## PRD Discipline`, and `## Constraints`.
The PRD is primarily a human artifact — read by the PM, stakeholders, and downstream workflow owners (UX, architecture, story creation). At finalize, a token-efficient **distillate** is produced via `bmad-distillator` and that distillate is the handoff to every downstream BMad workflow. Each of those runs in its own fresh session with the distillate as input — this skill never invokes them.
PRDs vary widely. A hobby project, an internal utility feature, a cross-functional enterprise initiative, a regulated submission, and a public consumer launch all need different shapes from the same skill. The template is a starting point, never a contract: drop sections that do not earn their place, add ones the product needs, reorder freely. See `## PRD Discipline` for the patterns that matter across all shapes.
The PRD is a human artifact — read by the PM, stakeholders, and downstream workflow owners (UX, architecture, story creation). At finalize, a token-efficient **distillate** is produced via `bmad-distillator` and is the handoff to every downstream BMad workflow, each running in its own fresh session. This skill never invokes them.
## On Activation
@ -25,29 +24,13 @@ PRDs vary widely. A hobby project, an internal utility feature, a cross-function
**Create.** A PRD the user is proud of, drawn out through real conversation. Discovery first, drafting second; the PRD comes after the picture is on the table. Treat `{workflow.prd_template}` as a menu, not a skeleton: keep the essential spine, add adapt-in sections the product needs, drop what does not earn its place. Bind `{doc_workspace}` to a fresh folder at `{workflow.output_dir}/{workflow.output_folder_name}/` and write `prd.md` there with YAML frontmatter (title, status, created, updated). For Update and Validate, `{doc_workspace}` is the existing folder of the PRD being targeted.
**Update.** Reconcile an existing PRD with a change signal. Before proposing changes, read the PRD, addendum, `decision-log.md`, and original inputs (brief, distillate, research, prior UX work, validation report if any) — and run the `## Discovery` posture against the change signal (a patch applied without context becomes drift). Surface conflicts with prior decisions before changing. Headless override: log the reversal to `decision-log.md`, then apply; halt `blocked` if intent is ambiguous. If the change is fundamental, offer Create instead of patching. Regenerate `distillate.md` via `bmad-distillator` if it exists; if the skill is unavailable, flag the distillate as stale in the JSON output.
**Update.** Reconcile an existing PRD with a change signal. Orient via source extractors (see `## Constraints` → Extract, don't ingest) against the PRD, addendum, `decision-log.md`, and original inputs (brief, distillate, research, prior UX, validation report) — then run the `## Discovery` posture against the change signal (a patch applied without context becomes drift). Surface conflicts with prior decisions before changing. Headless override: log the reversal to `decision-log.md`, then apply; halt `blocked` if intent is ambiguous. If the change is fundamental, offer Create instead of patching. Regenerate `distillate.md` via `bmad-distillator` if it exists; if unavailable, flag the distillate as stale in the JSON output.
**Validate.** Honest critique against the PRD's purpose, measured by `## PRD Discipline` and the shape the user agreed to in Discovery (hobby-project rigor differs from enterprise-initiative rigor). Read the PRD, the addendum if present, `decision-log.md`, and any original inputs first — a validation that ignores prior decisions, rejected ideas, or context the user supplied is shallow. Cite specific lines and sections. Surface findings inline; caveat what cannot be evaluated. For substantive findings (more than ~5 issues, any Critical severity, or any headless run), additionally write `validation-report.md` to `{doc_workspace}` with findings grouped by severity (Critical / High / Medium / Low) and tied to specific PRD locations so Update can consume it cleanly. Always offer to roll findings into an Update, even in headless mode — include `"offer_to_update": true` in the JSON status block.
**Validate.** Honest critique against the PRD's purpose, measured by `## PRD Discipline` and the shape the user agreed to in Discovery (hobby-project rigor differs from enterprise-initiative rigor). Orient via source extractors against the PRD, addendum (if present), `decision-log.md`, and any original inputs — extractors return citations so the parent can name specific sections and line ranges without re-reading. Surface findings inline; caveat what cannot be evaluated. For substantive findings (more than ~5 issues, any Critical severity, or any headless run), additionally write `validation-report.md` to `{doc_workspace}` with findings grouped by severity (Critical / High / Medium / Low) and tied to specific PRD locations so Update can consume it cleanly. Always offer to roll findings into an Update, even in headless mode — include `"offer_to_update": true` in the JSON status block.
## Headless Mode
When invoked headless, do not ask. Complete the intent using what is provided, what exists in `{doc_workspace}`, or what you can discover yourself. If intent remains ambiguous after inference, halt with a `blocked` JSON status and a `reason` field — do not prompt. End with a JSON response listing status, intent, and artifact paths. The `intent` field must match the detected intent: `"create"`, `"update"`, or `"validate"`. Examples:
```json
{
"status": "complete",
"intent": "create",
"prd": "{doc_workspace}/prd.md",
"addendum": "{doc_workspace}/addendum.md",
"distillate": "{doc_workspace}/distillate.md",
"decision_log": "{doc_workspace}/decision-log.md",
"open_questions": [],
"assumptions": [],
"external_handoffs": [
{"directive": "Confluence upload", "tool": "corp:confluence_upload", "url": "https://confluence.corp/PROD/123", "status": "ok"}
]
}
```
When invoked headless, do not ask. Complete the intent using what is provided, what exists in `{doc_workspace}`, or what you can discover yourself. If intent remains ambiguous after inference, halt with a `blocked` JSON status and a `reason` field — do not prompt. End with a JSON response listing status, intent, and artifact paths. The `intent` field must match the detected intent: `"create"`, `"update"`, or `"validate"`. Omit keys for artifacts not produced. Full schemas with examples for each intent are in `assets/headless-schemas.md`. Minimal shape:
```json
{
@ -58,8 +41,6 @@ When invoked headless, do not ask. Complete the intent using what is provided, w
}
```
Omit keys for artifacts that were not produced.
## Discovery
Open with space for the full picture: invite a brain dump and ask up front for any source material the user already has — product brief (or its distillate), research, UX work already done, brainstorming, prior PRD, transcripts, project-context. Read what exists first; ask only what is missing. After the dump, a simple "anything else?" often surfaces what they almost forgot.
@ -105,16 +86,16 @@ Patterns that hold the PRD together across every shape — hobby to enterprise.
## Constraints
- **Persistence is real-time.** Once Create intent is confirmed, the workspace (run folder, `prd.md` skeleton with `status: draft`, `decision-log.md`) exists on disk and the user knows the path.
- **File roles.** `decision-log.md` is canonical memory and audit trail — every decision, change, and override (including headless overrides) is recorded there as the conversation unfolds. `addendum.md` preserves user-contributed depth that belongs in a downstream document (architecture, solution design, implementation detail, UX) or earned a place but does not fit the PRD (rejected alternatives, options-considered matrices, deferred-feature rationale, in-depth personas, sizing data, deep technical constraints). When the user volunteers technical-how detail that clearly belongs in architecture or solution design, capture it to the addendum in real time rather than padding the PRD — say "I'll capture that in addendum.md so the architecture pass picks it up." Audit and override information never goes in the addendum.
- **File roles.** `decision-log.md` is canonical memory and audit trail — every decision, change, and override recorded as the conversation unfolds. `addendum.md` preserves user-contributed depth that belongs downstream (architecture, UX, solution design) or earned a place but does not fit the PRD shape (rejected alternatives, options matrices, sizing data, deep technical constraints). When the user volunteers technical-how detail, capture it to the addendum in real time — *"I'll capture that in addendum.md so the architecture pass picks it up."* Audit and override information never goes there.
- **Continuity across sessions.** If a prior in-progress draft for this project exists in `{workflow.output_dir}`, the user is offered to resume.
- **Extract, don't ingest.** Source artifacts (brief, distillate, research, UX work, transcripts, prior PRD, web results) enter the parent conversation as relevance-filtered extracts, not loaded wholesale. Subagents do the extraction against the user's stated focus; the parent context stays lean.
- **Extract, don't ingest.** Source artifacts (brief, distillate, research, UX work, transcripts, prior PRD, validation report, project-context, web results) never enter the parent conversation wholesale. Whenever a source document is consulted — Discovery setup, Update/Validate orientation, Finalize input reconciliation — delegate to a source-extractor subagent that returns `{summary, key_decisions, open_items, conflicts_with_focus, citations: [{section, line_range, quote}]}` against the user's stated focus. Run one subagent per document in parallel when there are multiple. The parent assembles from extracts; it never re-opens the source.
- **Downstream workflows run in fresh context.** Architecture decisions, UX journey design, epic breakdowns, and ticket bodies are not produced here. The PRD's job ends with a polished `prd.md` and its distillate. Each downstream workflow (UX, architecture, story creation, etc.) runs in a new session with the distillate as input — this skill never invokes them.
- **Adapt the shape; do not impose a template.** The template asset is a menu. Hobby PRDs are short. Enterprise PRDs include stakeholder, risk, compliance, ROI, and operational sections. Use Discovery to read the situation and shape accordingly.
## Finalize
1. Decision log audit + addendum review: the user ends this step with an explicit, shared accounting of how the meaningful contents of `decision-log.md` were handled — captured in the PRD, captured in `addendum.md` (which may already hold detail captured during the conversation — see `## Constraints` for what belongs there), or set aside as process noise.
2. Input reconciliation: cross-reference each input document the user supplied (brief, distillate, research, brainstorming, prior PRD, project-context) against the PRD and addendum. Surface anything notable that did not land — especially soft or qualitative ideas (tone, philosophy, interaction feel, brand voice) that the feature-and-FR shape silently drops. Present the list and ask the user whether any should be incorporated before polish. This must happen before the polish pass — once polish runs, additions become edits.
1. Decision log audit + addendum review: walk `decision-log.md` with the user and account for each meaningful entry — captured in the PRD, captured in `addendum.md` (see `## Constraints` for what belongs there), or set aside as process noise.
2. Input reconciliation: fan out one source-extractor subagent per input the user supplied (brief, distillate, research, brainstorming, prior PRD, project-context), each handed the current `prd.md` + `addendum.md` to compare against, each returning `{coverage, gaps, soft_ideas_not_landed}`. Aggregate and present the union — especially soft or qualitative ideas (tone, philosophy, interaction feel, brand voice) that the feature-and-FR shape silently drops. Ask whether any should be incorporated before polish. This must happen before the polish pass — once polish runs, additions become edits.
3. Discipline pass: re-read `prd.md` against `## PRD Discipline`. Verify Glossary terms are used identically throughout; features are grouped with their FRs nested; FRs are capabilities not implementation; every inline `[ASSUMPTION]` appears in the Assumptions Index; Non-Goals are explicit; counter-metrics are named when metrics exist; domain and project-type sections are present and right-sized; no innovation theater snuck in.
4. Polish: apply each entry in `{workflow.doc_standards}` (a `skill:`, `file:`, or plain-text directive) to `prd.md` (and `addendum.md` if it exists). Run passes as parallel subagents - apply all doc standards to `prd.md` first, then apply all doc standards to `addendum.md` so we present a high quality draft for the user to review and finalize.
5. Distillate: this is the handoff artifact for every downstream BMad workflow. Frame why it matters and invoke `bmad-distillator` with `source_documents=[prd.md, addendum.md if produced]`, `downstream_consumer="UX design, architecture, and story creation"`, `output_path={doc_workspace}/distillate.md`. If `bmad-distillator` is not installed, skip distillate generation entirely — do not attempt an inline alternative. Include `"distillate": "skipped — bmad-distillator not installed"` in the final JSON block and tell the user to install it.

View File

@ -0,0 +1,79 @@
# Headless Mode JSON Schemas
Every headless run ends with one of these payloads. Omit keys for artifacts not produced.
## Common fields
- `status``"complete"`, `"blocked"`, or `"partial"`
- `intent``"create"`, `"update"`, or `"validate"` (matches the detected intent)
- `reason` — required when `status` is `"blocked"`; one-sentence explanation
- `assumptions` — array of inferred values that were not directly confirmed by inputs
- `open_questions` — array of items that need a human decision before the artifact can be considered final
## Create
```json
{
"status": "complete",
"intent": "create",
"prd": "{doc_workspace}/prd.md",
"addendum": "{doc_workspace}/addendum.md",
"distillate": "{doc_workspace}/distillate.md",
"decision_log": "{doc_workspace}/decision-log.md",
"open_questions": [],
"assumptions": [],
"external_handoffs": [
{"directive": "Confluence upload", "tool": "corp:confluence_upload", "url": "https://confluence.corp/PROD/123", "status": "ok"}
]
}
```
If `bmad-distillator` is unavailable, set `"distillate": "skipped — bmad-distillator not installed"`.
## Update
```json
{
"status": "complete",
"intent": "update",
"prd": "{doc_workspace}/prd.md",
"decision_log": "{doc_workspace}/decision-log.md",
"distillate": "{doc_workspace}/distillate.md",
"changes_summary": "1-3 sentences describing what changed and why",
"conflicts_with_prior_decisions": [],
"open_questions": []
}
```
Use `"distillate": "stale"` if the regenerate step was skipped because `bmad-distillator` is unavailable.
## Validate
```json
{
"status": "complete",
"intent": "validate",
"validation_report": "{doc_workspace}/validation-report.md",
"findings_summary": {
"critical": 0,
"high": 0,
"medium": 0,
"low": 0
},
"offer_to_update": true
}
```
`validation_report` is omitted for runs with no substantive findings (fewer than ~5 issues, none Critical, interactive mode); findings surface inline only.
## Blocked
```json
{
"status": "blocked",
"intent": "update",
"reason": "Change signal ambiguous — could be a scope expansion or a clarification; no inferred direction"
}
```
Always include the intent (best-guess if not certain) and a one-sentence `reason`.