feat(skills): add customization surface to bmad-product-brief workflow

First workflow to adopt the customize.yaml + three-layer merge pattern
that was previously agent-only. Proves the resolver works for workflow
skills and exercises the deep-merge fix from the previous commit.

Standard workflow customization surface:
  additional_resources: []     # files for the workflow to reference
  inject:
    before: ""                 # prompt injected before workflow begins
    after: ""                  # prompt injected after workflow completes

SKILL.md now:
  - Adds a Conventions block defining {skill-root}, {project-root}, {skill-name}
  - Resolves customization as step 1 of On Activation and applies
    inject.before + notes additional_resources
  - Resolves inject.after in a new Post-Workflow Customization section
    that fires after Stage 5 (Finalize) completes

Verified end-to-end:
  - Defaults resolve cleanly (empty strings, empty array)
  - Team override of inject.before preserves inject.after default
    (the deep-merge behavior docs promise)
  - User layer adds inject.after on top of team's inject.before
  - Dotted --key inject.after extraction works for the post-workflow call
This commit is contained in:
Brian Madison 2026-04-18 20:47:43 -05:00
parent d4466cc341
commit 8cd157864e
2 changed files with 47 additions and 3 deletions

View File

@ -5,6 +5,13 @@ description: Create or update product briefs through guided or autonomous discov
# Create Product Brief # Create Product Brief
## Conventions
- Bare paths (e.g. `prompts/finalize.md`) resolve from the skill root.
- `{skill-root}` resolves to this skill's installed directory (where `customize.yaml` lives).
- `{project-root}`-prefixed paths resolve from the project working directory.
- `{skill-name}` resolves to the skill directory's basename.
## Overview ## Overview
This skill helps you create compelling product briefs through collaborative discovery, intelligent artifact analysis, and web research. Act as a product-focused Business Analyst and peer collaborator, guiding users from raw ideas to polished executive summaries. Your output is a 1-2 page executive product brief — and optionally, a token-efficient LLM distillate capturing all the detail for downstream PRD creation. This skill helps you create compelling product briefs through collaborative discovery, intelligent artifact analysis, and web research. Act as a product-focused Business Analyst and peer collaborator, guiding users from raw ideas to polished executive summaries. Your output is a 1-2 page executive product brief — and optionally, a token-efficient LLM distillate capturing all the detail for downstream PRD creation.
@ -30,16 +37,25 @@ Check activation context immediately:
## On Activation ## On Activation
1. Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:: 1. **Resolve customization**
Run: `uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key inject --key additional_resources`
**If the script fails**, resolve yourself from `customize.yaml`, with `{project-root}/_bmad/custom/{skill-name}.yaml` overriding, and `{skill-name}.user.yaml` overriding both (any missing file is skipped).
- **Inject before** — If `inject.before` resolved to a non-empty value, prepend it to your active instructions and follow it.
- **Available resources** — Note the `additional_resources` list. Do not read these files now; they are available for subsequent prompts to reference when needed.
2. Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve::
- Use `{user_name}` for greeting - Use `{user_name}` for greeting
- Use `{communication_language}` for all communications - Use `{communication_language}` for all communications
- Use `{document_output_language}` for output documents - Use `{document_output_language}` for output documents
- Use `{planning_artifacts}` for output location and artifact scanning - Use `{planning_artifacts}` for output location and artifact scanning
- Use `{project_knowledge}` for additional context scanning - Use `{project_knowledge}` for additional context scanning
2. **Greet user** as `{user_name}`, speaking in `{communication_language}`. 3. **Greet user** as `{user_name}`, speaking in `{communication_language}`.
3. **Stage 1: Understand Intent** (handled here in SKILL.md) 4. **Stage 1: Understand Intent** (handled here in SKILL.md)
### Stage 1: Understand Intent ### Stage 1: Understand Intent
@ -80,3 +96,11 @@ Check activation context immediately:
| 3 | Guided Elicitation | Fill gaps through smart questioning | `prompts/guided-elicitation.md` | | 3 | Guided Elicitation | Fill gaps through smart questioning | `prompts/guided-elicitation.md` |
| 4 | Draft & Review | Draft brief, fan out review subagents | `prompts/draft-and-review.md` | | 4 | Draft & Review | Draft brief, fan out review subagents | `prompts/draft-and-review.md` |
| 5 | Finalize | Polish, output, offer distillate | `prompts/finalize.md` | | 5 | Finalize | Polish, output, offer distillate | `prompts/finalize.md` |
## Post-Workflow Customization
After Stage 5 (Finalize) completes and before declaring the workflow done, resolve `inject.after`:
Run: `uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key inject.after`
If resolved `inject.after` is non-empty, append it to your active instructions and follow it.

View File

@ -0,0 +1,20 @@
# Customization surface for bmad-product-brief.
# DO NOT EDIT -- overwritten on every update.
#
# To customize, create one of the following and include only the fields
# you want to change (unmentioned fields inherit from this file):
# {project-root}/_bmad/custom/bmad-product-brief.yaml (team, committed)
# {project-root}/_bmad/custom/bmad-product-brief.user.yaml (personal, gitignored)
# Additional resource files loaded into workflow context on activation.
# Paths may use {project-root}. Agent notes the list on activation
# but does not preload the files; subsequent prompts reference them as needed.
# Arrays replace atomically -- include the full list you want.
additional_resources: []
# Injected prompts woven into the workflow's context.
# before: loaded before the workflow begins
# after: loaded after the workflow completes (pre-finalize)
inject:
before: ""
after: ""