From cbb761c70d4958c1a979d2cf3ca7e5f917fc4072 Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Sun, 10 May 2026 23:46:04 -0500 Subject: [PATCH] feat(bmm): add bmad-prd skill and extend product-brief with external integrations Consolidates the legacy create-prd/edit-prd/validate-prd trio into a single lean facilitator with create/update/validate intent modes, following the bmad-product-brief pattern. Both skills gain external_sources and external_handoffs customize.toml fields for routing through corporate MCP tools (Confluence, Jira, etc.) with graceful degradation, plus a File roles constraint clarifying decision-log (audit trail) vs addendum (preserved depth for downstream docs). --- .../1-analysis/bmad-product-brief/SKILL.md | 31 ++-- .../bmad-product-brief/customize.toml | 30 ++++ .../2-plan-workflows/bmad-prd/SKILL.md | 123 ++++++++++++++ .../bmad-prd/assets/prd-template.md | 159 ++++++++++++++++++ .../2-plan-workflows/bmad-prd/customize.toml | 101 +++++++++++ 5 files changed, 429 insertions(+), 15 deletions(-) create mode 100644 src/bmm-skills/2-plan-workflows/bmad-prd/SKILL.md create mode 100644 src/bmm-skills/2-plan-workflows/bmad-prd/assets/prd-template.md create mode 100644 src/bmm-skills/2-plan-workflows/bmad-prd/customize.toml diff --git a/src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md b/src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md index 0d26145af..7fd7ba006 100644 --- a/src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md +++ b/src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md @@ -1,11 +1,6 @@ --- name: bmad-product-brief description: Create, update, or validate a product brief. Use when the user wants help producing, editing, or validating a brief. -dependencies: - - bmad-distillator - - bmad-editorial-review-structure - - bmad-editorial-review-prose - - bmad-help --- # Overview @@ -21,15 +16,16 @@ Briefs produced here are honest, right-sized to purpose, and built for what come 1. Resolve customization: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`. On failure, surface the diagnostic and halt. 2. Execute each entry in `{workflow.activation_steps_prepend}` in order. 3. Treat every entry in `{workflow.persistent_facts}` as foundational context for the rest of the run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim. -4. Load `{project-root}/_bmad/bmm/config.yaml` (and `config.user.yaml` if present). Resolve `{user_name}`, `{communication_language}`, `{document_output_language}`, `{planning_artifacts}`, `{project_name}`, `{date}`. -5. Greet `{user_name}` in `{communication_language}`. Detect intent (create / update / validate). If interactive and intent is unclear, ask; for headless behavior see `## Headless Mode`. -6. Execute each entry in `{workflow.activation_steps_append}` in order. +4. Note `{workflow.external_sources}` as a registry of external systems available for consultation when the conversation surfaces a relevant need — knowledge bases, internal MCP tools, reference systems. Do not query preemptively; consult each only when its directive matches the moment. If a named tool is unavailable at runtime, fall back to standard behavior and note the gap when relevant. +5. Load `{project-root}/_bmad/bmm/config.yaml` (and `config.user.yaml` if present). Resolve `{user_name}`, `{communication_language}`, `{document_output_language}`, `{planning_artifacts}`, `{project_name}`, `{date}`. +6. Greet `{user_name}` in `{communication_language}`. Detect intent (create / update / validate). If interactive and intent is unclear, ask; for headless behavior see `## Headless Mode`. +7. Execute each entry in `{workflow.activation_steps_append}` in order. ## Intent Operating Modes **Create.** A brief the user is proud of, that meets their needs, drawn out through real conversation — do not assume: instead converse and understand, and then help craft the best product brief for their needs. Begin in `## Discovery` before drafting; the brief comes after the picture is on the table. Shape follows the product and need. Treat `{workflow.brief_template}` as a starting structure, not a contract: drop sections that do not earn their place, add sections the product needs, reorder freely - create sections for specialized domains or concerns also as needed. The brief serves the product's story, not the template's shape. Bind `{doc_workspace}` to a fresh folder at `{workflow.output_dir}/{workflow.output_folder_name}/` and write `brief.md` there with YAML frontmatter (title, status, created, updated). For Update and Validate, `{doc_workspace}` is the existing folder of the brief being targeted. -**Update.** Reconcile an existing brief with a change signal (edit request, downstream artifact, anything). Read the brief, the addendum if present, `decision-log.md`, and any original inputs first — past decisions and rejected ideas matter. Then run the `## Discovery` posture against the change signal before proposing changes. Identify what is now stale or wrong, propose changes, apply on agreement, bump `updated`, and write a new `decision-log.md` entry recording what changed and why — every update, clean or override, must be logged. If the change signal contradicts prior decisions, surface the conflict before changing anything. In headless mode, if the prompt clearly signals intent to override the contradicted decision, write the full audit trail first, then apply the change — you must: (1) add a new entry to `decision-log.md` naming the decision being reversed and its rationale, (2) add an override section to `addendum.md` (creating it if absent). Both are mandatory before modifying `brief.md`; do not wait for user confirmation. If intent to override is ambiguous, halt with `blocked` status naming the specific conflict. If the change is fundamental, name it as a re-draft and offer Create instead. If `distillate.md` exists, you must regenerate it after changes are applied by invoking `bmad-distillator`; this step is required, not optional. If `bmad-distillator` is unavailable, flag the distillate as stale in the JSON output. +**Update.** Reconcile an existing brief with a change signal. Before proposing changes, read the brief, addendum, `decision-log.md`, and original inputs — 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. **Validate.** Honest critique against the brief's own purpose. Read the brief, 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. Caveat what cannot be evaluated. Return inline — no separate file unless asked. Always offer to roll findings into an Update, even in headless mode — include `"offer_to_update": true` in the JSON status block. @@ -45,7 +41,10 @@ When invoked headless, do not ask. Complete the intent using what is provided, w "addendum": "{doc_workspace}/addendum.md", "distillate": "{doc_workspace}/distillate.md", "decision_log": "{doc_workspace}/decision-log.md", - "open_questions": [] + "open_questions": [], + "external_handoffs": [ + {"directive": "Confluence upload", "tool": "corp:confluence_upload", "url": "https://confluence.corp/PROD/123", "status": "ok"} + ] } ``` @@ -66,15 +65,17 @@ Conversationally surface what the user brings, why this brief exists, and the do ## Constraints - **Right-size to purpose.** A passion project does not need investor-grade rigor. A VC pitch input does. Read the room. -- **Persistence is real-time.** Once Create intent is confirmed, the workspace (run folder, `brief.md` skeleton with `status: draft`, `decision-log.md`) exists on disk and the user knows the path. The decision log is canonical memory — what the user has shared is preserved on disk, not stored in the conversation. +- **Persistence is real-time.** Once Create intent is confirmed, the workspace (run folder, `brief.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 (PRD, architecture, solution design) or earned a place but does not fit the brief (rejected-alternative rationale, options-considered matrices, parked-roadmap context, technical constraints, in-depth personas, sizing data). Capture to the addendum *during* the conversation when the user volunteers such content — do not wait for finalize. Audit and override information never goes in the addendum. - **Continuity across sessions.** If a prior in-progress draft for this project exists, the user is offered to resume. - **Extract, don't ingest.** Source artifacts (provided by the user or discovered during the run — transcripts, brainstorms, research reports, code, web results, prior briefs) 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. - **Length and coherence.** Aim for 1-2 pages — if it is longer, the detail belongs in the addendum or distillate. Structure in service of the product; downstream consumers (PRD workflow, etc.) read this, so coherent shape matters. ## Finalize -1. Decision log audit + addendum: the user ends this step with an explicit, shared accounting of how the meaningful contents of `decision-log.md` were handled — captured in the brief, captured in `addendum.md` (rejected-alternative rationale, options-considered matrices, parked-roadmap context, technical constraints, sizing data, in-depth personas), or set aside as process noise. `addendum.md` exists if anything earned its place there. -2. Polish: apply each entry in `{workflow.doc_standards}` (a `skill:`, `file:`, or plain-text directive) to `brief.md` (and `addendum.md` if it exists). Run passes as parallel subagents. The user sees a polished draft, not a polish review. +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 brief, 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. Polish: apply each entry in `{workflow.doc_standards}` (a `skill:`, `file:`, or plain-text directive) to `brief.md` (and `addendum.md` if it exists). Run passes as parallel subagents - apply all doc standards to `brief.md` first, then `addendum.md` so we present a high quality draft for the user to review and finalize. 3. Distillate: offer the user a lean, token-efficient distillate of the brief — frame why it matters (it becomes the primary input when downstream BMad workflows like PRD creation pull this brief in). If they want it, invoke `bmad-distillator` with `source_documents=[brief.md, addendum.md if produced]`, `downstream_consumer="PRD 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. -4. Tell the user it is ready: artifacts, path, use the `bmad-help` skill to help understand what next steps you can suggest they do in the bmad method ecosystem. -5. Run `{workflow.on_complete}` if non-empty. Treat a string scalar as a single instruction and an array as a sequence of instructions executed in order. +4. External handoffs: execute each entry in `{workflow.external_handoffs}` to route artifacts beyond local files (Confluence, Notion, ticket systems, etc.) — each directive names the MCP tool and the fields it needs. Invoke the tool, capture any URLs or IDs returned, and surface them in the user message. If a named tool is unavailable, skip that handoff and flag it (graceful degradation, same pattern as missing `bmad-distillator`); local files always exist regardless. +5. Tell the user it is ready: local paths, external destinations (URLs returned from handoffs), distillate path. Use the `bmad-help` skill to suggest what next steps make sense in the bmad method ecosystem. +6. Run `{workflow.on_complete}` if non-empty. Treat a string scalar as a single instruction and an array as a sequence of instructions executed in order. diff --git a/src/bmm-skills/1-analysis/bmad-product-brief/customize.toml b/src/bmm-skills/1-analysis/bmad-product-brief/customize.toml index 9fd6008d4..555f661a4 100644 --- a/src/bmm-skills/1-analysis/bmad-product-brief/customize.toml +++ b/src/bmm-skills/1-analysis/bmad-product-brief/customize.toml @@ -64,3 +64,33 @@ doc_standards = [ "skill:bmad-editorial-review-structure", "skill:bmad-editorial-review-prose", ] + +# External-source registry. Natural-language directives describing knowledge +# bases, MCP tools, or internal systems the LLM may consult during the workflow +# when a relevant need surfaces. The LLM does NOT query these preemptively — +# it consults them on demand (during Discovery, validation, drafting, etc.). +# Each entry names the tool, the conditions for using it, and any fields the +# tool needs. If a named MCP tool is unavailable at runtime, the LLM falls +# back to standard behavior and notes the gap. Empty by default. +# +# Examples (set in team/user override TOML): +# "When researching internal product context, consult corp:kb_search (database='product-docs') before web search." +# "For voice-of-customer signal during Discovery, query corp:feedback_search with project={project_name}." +# "When validating domain-compliance claims for a healthcare brief, cross-check against corp:hipaa_reference." +external_sources = [] + +# External-handoff routing. Natural-language directives the LLM applies at +# Finalize to route outputs beyond local files (Confluence, Notion, Google +# Drive, ticket systems, etc.). Each entry names the MCP tool, the destination, +# and the fields the tool needs. Handoffs run after the artifact is polished +# and before the final user-facing message. URLs or IDs returned by the +# destination are captured and surfaced to the user. If a named tool is +# unavailable at runtime, the handoff is skipped and flagged in the JSON +# status; local files always exist regardless. Fires automatically — users +# can opt out in their prompt for a specific run. Empty by default. +# +# Examples (set in team/user override TOML): +# "After finalize, upload brief.md and addendum.md to Confluence via corp:confluence_upload (space_key='PROD', parent_page='Product Briefs', label='brief', author={user_name})." +# "Mirror the distillate to Notion via notion:create_page (database_id='abc123', title='Brief: '+{project_name})." +# "Post a ready-for-review ping to Slack via corp:slack_post (channel='#product', text='New brief: '+{confluence_url})." +external_handoffs = [] diff --git a/src/bmm-skills/2-plan-workflows/bmad-prd/SKILL.md b/src/bmm-skills/2-plan-workflows/bmad-prd/SKILL.md new file mode 100644 index 000000000..dc163ff00 --- /dev/null +++ b/src/bmm-skills/2-plan-workflows/bmad-prd/SKILL.md @@ -0,0 +1,123 @@ +--- +name: bmad-prd +description: Create, update, or validate a PRD. Use when the user wants help producing, editing, or validating a PRD. +--- + +# 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. + +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. + +## On Activation + +1. Resolve customization: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`. On failure, surface the diagnostic and halt. +2. Execute each entry in `{workflow.activation_steps_prepend}` in order. +3. Treat every entry in `{workflow.persistent_facts}` as foundational context for the rest of the run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim. +4. Note `{workflow.external_sources}` as a registry of external systems available for consultation when the conversation surfaces a relevant need — knowledge bases, internal MCP tools, reference systems. Do not query preemptively; consult each only when its directive matches the moment. If a named tool is unavailable at runtime, fall back to standard behavior and note the gap when relevant. +5. Load `{project-root}/_bmad/bmm/config.yaml` (and `config.user.yaml` if present). Resolve `{user_name}`, `{communication_language}`, `{document_output_language}`, `{planning_artifacts}`, `{project_name}`, `{date}`. +6. Greet `{user_name}` in `{communication_language}`. Detect intent (create / update / validate). If interactive and intent is unclear, ask; for headless behavior see `## Headless Mode`. +7. Execute each entry in `{workflow.activation_steps_append}` in order. + +## Intent Operating Modes + +**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. + +**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. + +## 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"} + ] +} +``` + +```json +{ + "status": "complete", + "intent": "validate", + "validation_report": "{doc_workspace}/validation-report.md", + "offer_to_update": true +} +``` + +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. + +Before drafting, read the situation across four dimensions — they determine the PRD's shape: + +- **Stakes.** Hobby project, internal utility feature, team initiative, enterprise program, regulated submission, public launch. Calibrates rigor, section depth, and which adapt-in clusters apply. +- **Audience.** Just the user, their team, cross-functional stakeholders, executive committee, regulators, external customers. Drives tone, evidence requirements, and approval sections. +- **Existing inputs.** A brief? Research? UX work already done with user journeys? Architectural constraints from an infra team? Existing artifacts mean those parts of the PRD reference, not relitigate. If UX exists and describes journeys, the PRD points at it; it does not duplicate. When project-context, prior PRDs, or existing UX/architecture are present, this is brownfield territory — frame Discovery around what is new or changing, not around what the product already is. +- **Downstream depth.** Is this PRD the whole spec for a small build, or the top of a chain through UX → architecture → epics → stories? The chain length affects how much the PRD encodes vs. what it defers to downstream skills. + +**Right-skill check.** Once the situation is read, honestly sanity-check that PRD is the best tool for what the user actually needs. Three cases where it isn't: + +- **Games** (mechanic-driven, player-experience-focused) → suggest the `bmad-gds` (game-dev-studio) module for Game Design Document (GDD) and game planning. PRD shape is wrong for games. +- **Small scope + user wants a captured artifact** (1-2 stories of change to an existing codebase, a small feature, a focused tweak — and the user wants a single doc to point at) → stay here and produce an *all-inclusive document*: lean §1-§6 plus inline Stories via the adapt-in Stories cluster. One or two pages, single source of truth, replaces a separate story-workflow run for tiny work. +- **Express implementation** (small scope or clear idea, user just wants to build now — no planning chain or captured artifact needed) → suggest `bmad-quick-dev` — takes idea or intent input and implements right away. True express track, no PRD/UX/architecture stages. + +Surface these honestly and let the user choose. If they prefer this skill anyway (for posterity, clarity, single-source-of-truth artifact), proceed with the right-sized version. + +Coach, do not quiz. Push hardest where assumptions are unexamined, where capabilities are conflated with implementation, where terms drift across the PRD, where scope creeps without a Non-Goal to push back, where a downstream reader would have to guess. Drill into specifics only after the broad shape is on the table; premature granular questions interrupt the dump and miss the room. Suggest research (web, competitive, market, domain compliance) only when the stakes warrant it. + +## PRD Discipline + +Patterns that hold the PRD together across every shape — hobby to enterprise. + +- **Information density.** Every sentence carries weight. Cut filler. Direct over hedged. Density scales with stakes — a hobby PRD can breathe more; an enterprise PRD must be tight. +- **Glossary-anchored vocabulary.** Every domain noun is defined once and used identically thereafter. Synonyms produce drift — downstream workflows, agents, and future-you all suffer when the same thing is called by two names. +- **Self-contained sections.** Any section should make sense pulled out alone. Cross-references go through Glossary terms, not "see above" prose. +- **Features grouped, FRs nested.** §5 organizes by feature, not by a flat FR list. Each feature has a behavioral description, then its Functional Requirements listed under it (numbered globally so downstream artifacts have stable IDs), then any feature-specific NFRs and notes. Cross-cutting NFRs live in their own section. +- **Capabilities, not implementation.** FRs describe what users (or systems) can do, not how. No technology names, library choices, or architecture decisions. "Users can reset their password via email link" — yes. "System sends JWT via SendGrid and validates with Postgres" — no. +- **No innovation theater.** Do not fabricate differentiation or novelty language where the product is a competent execution of existing patterns. "This is a well-known shape done well" is honest and better than invented novelty. Only add an Innovation or Differentiation section when Discovery surfaced genuinely novel aspects worth naming. +- **Measurable where it sharpens the requirement.** Replace subjective adjectives (fast, easy, scalable, intuitive) with measurable criteria where the measurement matters. No SMART scoring ceremony, no per-FR 1-5 ratings — judgment, not ritual. +- **Traceability where the chain matters.** When an FR exists *because of* a specific success criterion or a specific user journey, name the link inline. Skip full traceability matrices. +- **Domain awareness.** When the domain is regulated, compliance requirements appear in the PRD — not deferred to architecture. Healthcare → HIPAA. Fintech → PCI-DSS, AML/KYC, SOX. Govtech → NIST, Section 508 / WCAG 2.1 AA, FedRAMP. E-commerce → PCI-DSS for payments. Detect at Discovery, enforce at Finalize. +- **Project-type awareness.** Different products need different sections. API/service → API contracts, versioning, performance budgets. Mobile → device permissions, offline behavior, OS targets. Web → accessibility, browser support. Embedded → hardware constraints, deployment topology. Library → public surface, dependency policy. The template's adapt-in menu lists these clusters. +- **Non-Goals explicit.** A short Non-Goals (Explicit) section does outsized work for downstream readers and workflows. It prevents the "let me also add this nearby thing" failure mode. Inline `[NON-GOAL for MVP]` and `[v2 — out of MVP]` callouts where they would otherwise be silently assumed. +- **Never silently de-scope.** Requirements the user explicitly included in input documents (brief, research, prior PRD) do not drop out of scope without an explicit ask. When deferral seems warranted, surface it: *"I'd recommend deferring X because [reason]. Keep it in, or move it out?"* Same gate for phasing the user did not request — propose, do not impose. +- **Counter-metrics named.** Metrics not to optimize are as load-bearing as the ones to optimize. Name them when Success Metrics is in the PRD. +- **Assumptions visible.** Inferences made without direct user confirmation are tagged `[ASSUMPTION: ...]` inline and indexed at the end so downstream readers can flag them rather than absorbing them as fact. +- **`[NOTE FOR PM]` callouts** at decision points the user deferred or left tension on — surface them so the next session or the next reviewer can revisit. +- **Right-size to purpose.** A hobby project does not need investor-grade rigor. A regulated submission does. Length, depth, and which adapt-in clusters apply all scale with stakes. + +## 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. +- **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. +- **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. +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. +6. External handoffs: execute each entry in `{workflow.external_handoffs}` to route artifacts beyond local files (Confluence, Notion, ticket systems, etc.) — each directive names the MCP tool and the fields it needs. Invoke the tool, capture any URLs or IDs returned, and surface them in the user message. If a named tool is unavailable, skip that handoff and flag it (graceful degradation, same pattern as missing `bmad-distillator`); local files always exist regardless. +7. Tell the user it is ready. Invoke the `bmad-help` skill to surface what next steps you can suggest they do in the bmad method ecosystem based on what they have set up and available, and share the paths to the PRD, addendum, distillate, decision log, any external destinations (URLs returned from handoffs), and any validation report. +8. Run `{workflow.on_complete}` if non-empty. Treat a string scalar as a single instruction and an array as a sequence of instructions executed in order. diff --git a/src/bmm-skills/2-plan-workflows/bmad-prd/assets/prd-template.md b/src/bmm-skills/2-plan-workflows/bmad-prd/assets/prd-template.md new file mode 100644 index 000000000..cfb52e144 --- /dev/null +++ b/src/bmm-skills/2-plan-workflows/bmad-prd/assets/prd-template.md @@ -0,0 +1,159 @@ +# PRD Template — A Menu, Not a Skeleton + +This is a menu of sections the facilitator picks from based on what the product, the stakes, the audience, and the existing inputs actually need. Hobby projects use the essential spine and stop. Enterprise initiatives, regulated submissions, and consumer launches add clusters from the adapt-in menu below. **Never include a section just because it appears here.** Drop, reorder, rename, combine — whatever the PRD needs. + +--- + +## Essential Spine *(almost always present)* + +```markdown +--- +title: {Product Name} +status: draft +created: {YYYY-MM-DD} +updated: {YYYY-MM-DD} +--- + +# PRD: {Product Name} +*Working title — confirm.* + +## 0. Document Purpose +[1 paragraph: who this PRD is for (PM, stakeholders, downstream workflow owners), how it's structured (Glossary-anchored vocabulary, features grouped with FRs nested, assumptions tagged inline and indexed). If UX work or other inputs already exist, name them here and reference where they live — this PRD builds on them, it does not duplicate.] + +## 1. Vision +[2-3 paragraphs: what this is, what it does for the user, why it matters. Compelling enough to stand alone.] + +## 2. Target User + +### 2.1 Primary Persona +[Vivid but tight. Who they are, how this product fits their context.] + +### 2.2 Jobs To Be Done +[Bulleted. Emotional, social, functional, contextual — whichever apply. Even "this is for me as the builder" is a valid persona for a hobby project.] + +### 2.3 Non-Users (v1) *(add when the audience boundary is non-obvious)* +[Who this is explicitly not for in v1.] + +### 2.4 Key User Journeys +*Named flows the product enables — one line each, numbered globally as UJ-1 through UJ-N for downstream traceability. Detailed flow design (steps, screens, edge flows) is the job of the UX workflow, not this PRD. Features in §4 may reference journeys by ID inline ("realizes UJ-3").* + +- **UJ-1** — [Named flow, one line: who does what, to what end.] +- **UJ-2** — ... + +[For hobby/utility projects, 1-3 journeys may be enough. For complex multi-feature products (onboarding, checkout, multi-step approvals), expand. For libraries/CLIs with minimal flow, reduce to a single line or collapse into §2.2 JTBD.] + +## 3. Glossary +*Downstream workflows and readers must use these terms exactly.* + +- **Term** — Definition. Relationships to other Glossary terms. Cardinality where relevant. +- **Term** — ... + +[Every domain noun the rest of the document uses. Defined once. No synonyms anywhere else in the PRD.] + +## 4. Features +*Each subsection is a coherent feature: behavioral description first, FRs nested under it, optional feature-specific NFRs and notes. FRs are numbered globally (FR-1 through FR-N) so downstream artifacts have stable references even if features get reorganized. Reference user journeys by ID inline ("realizes UJ-2") where the chain matters.* + +### 4.1 {Feature Name} +**Description:** [Behavioral narrative — how this feature works, who uses it, the user experience, edge cases. Use Glossary terms exactly. Embed inline `[ASSUMPTION: ...]` tags where you inferred without confirmation.] + +**Functional Requirements:** +- **FR-1** — [Actor] can [capability] [under conditions / with measurement]. +- **FR-2** — ... + +**Feature-specific NFRs:** *(only if any apply uniquely to this feature)* +- Performance / security / accessibility / etc. specific to this feature. + +**Notes:** *(optional — open questions specific to this feature, `[NOTE FOR PM]` callouts)* + +### 4.2 {Feature Name} +... + +## 5. Non-Goals (Explicit) +[Bulleted. What this product is *not* and what it will *not* do in v1. Does outsized work for downstream readers and workflows — prevents the "let me also add this nearby thing" failure mode at every level (epic, ticket, code). Inline `[NON-GOAL for MVP]` callouts within §4 Features cover deferred items within features; this section captures the broader "we are not building X / we are not becoming Y" statements.] + +## 6. MVP Scope + +### 6.1 In Scope +[Bulleted, crisp.] + +### 6.2 Out of Scope for MVP +[Bulleted. Each item with a one-line reason if the reason matters. Mark items deferred to v2/v3 explicitly. Add `[NOTE FOR PM]` callouts where a deferred item is emotionally load-bearing — flags it for revisit if timeline permits.] + +## 7. Success Metrics + +**Primary** +- Metric — definition, target. + +**Secondary** +- Metric — definition, target. + +**Counter-metrics (do not optimize)** +- Metric — why this should *not* be optimized. + +[Length scales with stakes. Hobby/utility PRD: a single sentence may be enough ("Success: I use this weekly and don't abandon it after a month"). Public launch / enterprise: full quantitative breakdown with measurement methods. Counter-metrics are as load-bearing as primary metrics — they prevent the architect from optimizing the wrong thing and the dev from gaming the wrong target.] + +## 8. Open Questions +[Numbered. Things still unknown — they become future tickets or follow-up research, not silent gaps.] + +## 9. Assumptions Index +*Every `[ASSUMPTION]` from the document, surfaced for explicit confirmation:* +- Inline assumption from §X.Y — short description. +- ... +``` + +--- + +## Adapt-In Menu *(add the clusters the product calls for)* + +### Cross-cutting quality and shape *(most non-trivial PRDs)* +- **Cross-Cutting NFRs** — system-wide non-functional requirements not tied to a single feature (performance, security, reliability, observability). Add when system-wide quality attributes are meaningful. +- **Constraints and Guardrails** — Safety, Privacy, Cost. Subsection per cluster. Add when any of these are real concerns. +- **Why Now** — add when timing is load-bearing (a market shift, a technology enabler, a regulatory deadline). Drop when timing is incidental. + +### Consumer / branded products +- **Aesthetic and Tone** — visual references, anti-references, voice/tone for any product-generated text. +- **Information Architecture** — top-level surfaces, navigation, screens. +- **Monetization** — free vs. paid, pricing assumptions, ads policy. +- **Platform** — web, mobile, PWA, native, v1 vs. v2+. + +### Enterprise initiatives +- **Stakeholders and Approvals** — who must sign off, at what stage. +- **Risk and Mitigations** — operational, security, business, reputational risk register. +- **ROI / Business Case** — quantified benefit, cost, payback period. +- **Operational Requirements** — SLAs, RTO/RPO, support tier, on-call expectations. +- **Integration and Dependencies** — SSO, existing enterprise systems, data sources, downstream consumers. +- **Rollout and Change Management** — phased rollout plan, training, internal communication. +- **Data Governance** — residency, sovereignty, classification, retention. +- **Audit Trail / Decision Provenance** — formal documentation requirements for regulated environments. + +### Regulated domains +- **Compliance and Regulatory** — HIPAA, PCI-DSS, GDPR, SOX, SOC 2, Section 508 / WCAG 2.1 AA, FedRAMP, etc. — whichever apply. If any item needs depth, add a `[NOTE FOR PM]` callout to revisit or move to an addendum. + +### Developer products (libraries, APIs, CLIs, SDKs) +- **API Contracts / Public Surface** — endpoint shapes, breaking change policy. +- **Versioning and Deprecation Policy**. +- **Performance Budgets** — latency, throughput, resource use. +- **Language / Runtime Targets and Dependency Policy**. + +### Embedded / hardware +- **Hardware Constraints** — memory, power, form factor. +- **Deployment and Update Mechanism** — OTA, manual, image-based. +- **Environmental and Reliability Requirements**. + +### Small-scope all-inclusive *(use when scope is 1-2 stories' worth and the user wants a single captured artifact — chosen during the Right-skill check in Discovery)* +- **Stories** — story-level specs listed inline at the end of the doc. Each story: *"As a [persona], I can [action] [under conditions]. Acceptance: [testable criteria]."* Numbered Story-1, Story-2, ... for reference. Pair with very lean §1 Vision, §2 Target User (often just JTBD + one UJ), §3 Glossary (handful of terms), §4 Features (often a single feature), §6 MVP Scope (in/out very tight). The whole doc fits on a page or two and captures intent + implementable stories in one place. If the user doesn't want the captured artifact at all, `bmad-quick-dev` is the better path — this cluster is only for "I want a doc *and* the stories." + +--- + +## Notes for the facilitator + +- **The essential spine is the floor, not the ceiling.** A hobby PRD might keep all ten sections short. An enterprise PRD layers many clusters from the adapt-in menu. +- **§3 Glossary before §4 Features.** Mechanics never introduce a new domain noun without adding it to the Glossary in the same pass. Persona, JTBD, and Journeys may use Glossary terms before §3 formally defines them — context is inferable; the Glossary is for downstream anchoring. +- **§2.4 Key User Journeys are brief.** One line each. Numbered globally (UJ-1 through UJ-N) so architecture, epics, stories, and tickets can reference them by stable ID. Detailed flow design happens in the UX workflow — not here. +- **§4 Features pattern at every scale.** Description → FRs nested → optional NFRs → optional notes. Hobby PRD: one short paragraph and three FRs per feature. Enterprise feature: multi-paragraph description, fifteen FRs, several feature-specific NFRs, open questions. Same shape, different depth. +- **`[ASSUMPTION]`, `[NON-GOAL]`, `[v2 — out of MVP]`, `[NOTE FOR PM]` callouts are first-class.** They signal to downstream readers and the next session of work. Every `[ASSUMPTION]` lands in §9 Assumptions Index. +- **When UX is *input* to the PRD** (journeys already designed elsewhere): §2.4 names the journeys by ID and points to the existing UX doc. Reference, do not duplicate. +- **When UX is *output* of the PRD** (no UX work yet — downstream `bmad-create-ux-design` will produce it): §2.4 captures the PM's intent on which journeys exist; UX elaborates them into detailed flows downstream. +- **§7 Success Metrics scales with stakes** but is always present. Counter-metrics matter as much as primary metrics — they shape what NOT to optimize. +- **Small-scope all-inclusive option.** When scope is genuinely 1-2 stories and the user wants a single artifact instead of running a separate `bmad-create-story` workflow, add the adapt-in *Stories* cluster: lean §1-§6 plus inline §Stories at the end. The whole doc fits on a page or two. This is a valid PRD shape for tiny work — don't apologize for it. +- **Adapt the section numbering.** The spine uses 0-9; adapt-in additions slot in wherever they read best (e.g., Aesthetic & Tone before §3 if branding is foundational, Compliance after §5 Non-Goals, Constraints & Guardrails between Features and Non-Goals, Stories at the very end after Assumptions Index). diff --git a/src/bmm-skills/2-plan-workflows/bmad-prd/customize.toml b/src/bmm-skills/2-plan-workflows/bmad-prd/customize.toml new file mode 100644 index 000000000..b922d1e3f --- /dev/null +++ b/src/bmm-skills/2-plan-workflows/bmad-prd/customize.toml @@ -0,0 +1,101 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-prd. +# +# Override files (not edited here): +# {project-root}/_bmad/custom/bmad-prd.toml (team) +# {project-root}/_bmad/custom/bmad-prd.user.toml (personal) + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays: append + +# Steps to run before the standard activation (config load, greet). +# Use for pre-flight loads, compliance checks, etc. +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Use for context-heavy setup that should happen once the user has been acknowledged. +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (standards, compliance constraints, stylistic guardrails). +# Each entry is either a literal sentence, a skill prefixed with `skill:`, or a `file:`-prefixed path/glob +# whose contents are loaded as facts. +# +# Default loads project-context.md if bmad-generate-project-context has produced one — this gives +# the facilitator persistent awareness of the project's tech, domain, and constraints without +# re-asking. Common opt-ins (set in team/user override TOML): +# "skill:acme-co:terms-and-conditions" # a skill that contains some relevant info +# "Investor PRDs must include a market sizing section." # generic agent instruction +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Executed when the workflow completes (after the user has been told the +# PRD is ready). Accepts either a string scalar (single instruction) +# or an array of instructions executed in order. Empty for none. +on_complete = "" + +# Default PRD structure. Treated as a starting point — the LLM adapts it +# to the product, project type, and domain. Override the path in team/user TOML +# to enforce a different structure (e.g. regulated-industry, internal-tool, investor-input). +prd_template = "assets/prd-template.md" + +# Run folder location. The PRD, optional addendum, optional distillate, +# decision log, and optional validation report all land inside +# `{output_dir}/{output_folder_name}/`. +output_dir = "{planning_artifacts}/prds" +output_folder_name = "prd-{project_name}-{date}" + +# Document standards applied to human-consumed docs at finalize. Each entry is +# a `skill:`, `file:`, or plain-text directive; the parent LLM applies the +# findings before the user sees the draft. Encodes standards, not options. +# +# Examples: +# "skill:bmad-editorial-review-prose" +# "file:{project-root}/_bmad/style-guides/company-voice.md" +# "Convert all dates to ISO 8601 format." +# +# Suggested order (broader passes first, narrower last): +# 1. Structural (cuts, reorganization, section sizing) +# 2. Content/voice/conventions (org standards, tone, terminology, compliance) +# 3. Prose mechanics (grammar, clarity, typos) +# +# Override the array in team/user TOML to add additional standards. Append-only: +# base entries cannot be removed or replaced (resolver has no removal mechanism). +doc_standards = [ + "skill:bmad-editorial-review-structure", + "skill:bmad-editorial-review-prose", +] + +# External-source registry. Natural-language directives describing knowledge +# bases, MCP tools, or internal systems the LLM may consult during the workflow +# when a relevant need surfaces. The LLM does NOT query these preemptively — +# it consults them on demand (during Discovery, validation, drafting, etc.). +# Each entry names the tool, the conditions for using it, and any fields the +# tool needs. If a named MCP tool is unavailable at runtime, the LLM falls +# back to standard behavior and notes the gap. Empty by default. +# +# Examples (set in team/user override TOML): +# "When researching internal product context, consult corp:kb_search (database='product-docs') before web search." +# "For competitive landscape during Discovery, query corp:competitive_db with category={project_name}." +# "When validating domain-compliance claims, cross-check against corp:hipaa_reference for healthcare or corp:pci_reference for fintech." +external_sources = [] + +# External-handoff routing. Natural-language directives the LLM applies at +# Finalize to route outputs beyond local files (Confluence, Notion, Google +# Drive, ticket systems, etc.). Each entry names the MCP tool, the destination, +# and the fields the tool needs. Handoffs run after the artifact is polished +# and before the final user-facing message. URLs or IDs returned by the +# destination are captured and surfaced to the user. If a named tool is +# unavailable at runtime, the handoff is skipped and flagged in the JSON +# status; local files always exist regardless. Fires automatically — users +# can opt out in their prompt for a specific run. Empty by default. +# +# Examples (set in team/user override TOML): +# "After finalize, upload prd.md and addendum.md to Confluence via corp:confluence_upload (space_key='PROD', parent_page='PRDs', label='prd', author={user_name})." +# "Mirror the distillate to Notion via notion:create_page (database_id='abc123', title='PRD: '+{project_name})." +# "When the PRD references a parent initiative, link via corp:jira_link on the epic key in frontmatter." +external_handoffs = []