Skip to content

Commit ffdd9bc

Browse files
authored
feat(skills): add TOML workflow customization to 17 bmm-skills (#2287)
* feat(skills): add TOML workflow customization to 17 bmm-skills Flattens each skill's workflow.md into SKILL.md and adds a customize.toml surface with a 6-step activation block (resolve_customization, prepend, persistent_facts, config, greet, append). Core-skills and developer execution skills (dev-story, code-review, sprint-planning, sprint-status, quick-dev, checkpoint-preview) are intentionally excluded. Customized: document-project, prfaq, domain/market/technical-research, create-prd, create-ux-design, edit-prd, validate-prd, check-implementation-readiness, create-architecture, create-epics-and-stories, generate-project-context, correct-course, create-story, qa-generate-e2e-tests, retrospective. * fix(skills): address PR review findings on workflow customization - bmad-create-story: drop stale {project_context} variable reference from step 2 note; content is already loaded via persistent_facts - research skills (market/domain/technical): derive research_topic_slug before writing output filename to prevent path injection and invalid filesystem characters - bmad-correct-course: reconcile step 1 verify list and HALT with the "Missing documents" rule — Architecture and UI/UX are optional, HALT only fires when PRD or Epics are missing - fix grammar in Micro-file Design bullets across 5 migrated skills (self contained → self-contained, adhere too 1 file → adhere to one file at a time) - docs/how-to/customize-bmad.md: document workflow activation order and frame the baseline fields as a stable initial pass with targeted per-workflow customization points coming later
1 parent 1251458 commit ffdd9bc

51 files changed

Lines changed: 3738 additions & 2854 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/how-to/customize-bmad.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,27 @@ on_complete = "Summarize the brief in three bullets and offer to email it via th
258258

259259
The same field conventions cross the agent/workflow boundary: `activation_steps_prepend`/`activation_steps_append`, `persistent_facts` (with `file:` refs), and menu-style `[[…]]` tables with `code`/`id` for keyed merge. The resolver applies the same four structural rules regardless of the top-level key. SKILL.md references follow the namespace: `{workflow.activation_steps_prepend}`, `{workflow.persistent_facts}`, `{workflow.on_complete}`. Any additional fields a workflow exposes (output paths, toggles, review settings, stage flags) follow the same shape-based merge rules. Read the workflow's `customize.toml` to see what's customizable.
260260

261+
### Activation Order
262+
263+
Customizable workflows run their activation in a fixed sequence so you know exactly when your hooks fire:
264+
265+
1. Resolve the `[workflow]` block (base → team → user merge)
266+
2. Execute `activation_steps_prepend` in order
267+
3. Load `persistent_facts` as foundational context for the run
268+
4. Load config (`_bmad/bmm/config.yaml`) and resolve standard variables (project name, languages, paths, date)
269+
5. Greet the user
270+
6. Execute `activation_steps_append` in order
271+
272+
After step 6 the workflow body begins. Use `activation_steps_prepend` when you need context loaded before the greeting can be personalized; use `activation_steps_append` when the setup is heavy and you'd rather the user sees the greeting first.
273+
274+
### Scope of This Initial Pass
275+
276+
Customization is rolling out incrementally. The fields documented above — `activation_steps_prepend`, `activation_steps_append`, `persistent_facts`, `on_complete` — are the **baseline surface** that every customizable workflow exposes, and they will remain stable across versions. They give you broad-stroke control today: inject pre/post steps, pin foundational context, trigger follow-up actions.
277+
278+
Over time, individual workflows will expose **more targeted customization points** tailored to what that workflow actually does — things like step-specific toggles, stage flags, output template paths, or review gates. When those arrive, they stack on top of the baseline fields rather than replacing them, so customizations you author today keep working.
279+
280+
If you need a fine-grained knob that isn't exposed yet, either use `activation_steps_*` and `persistent_facts` to steer behavior, or open an issue describing the specific customization point you want — those requests are what drive which targeted fields get added next.
281+
261282
## Central Configuration
262283

263284
Per-skill `customize.toml` covers **deep behavior** (hooks, menus, persistent_facts, persona overrides for a single agent or workflow). A separate surface covers **cross-cutting state** — install answers and the agent roster that external skills like `bmad-party-mode`, `bmad-retrospective`, and `bmad-advanced-elicitation` consume. That surface lives in four TOML files at project root:

src/bmm-skills/1-analysis/bmad-document-project/SKILL.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,60 @@ name: bmad-document-project
33
description: 'Document brownfield projects for AI context. Use when the user says "document this project" or "generate project docs"'
44
---
55

6-
Follow the instructions in ./workflow.md.
6+
# Document Project Workflow
7+
8+
**Goal:** Document brownfield projects for AI context.
9+
10+
**Your Role:** Project documentation specialist.
11+
12+
## Conventions
13+
14+
- Bare paths (e.g. `instructions.md`) resolve from the skill root.
15+
- `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
16+
- `{project-root}`-prefixed paths resolve from the project working directory.
17+
- `{skill-name}` resolves to the skill directory's basename.
18+
19+
## On Activation
20+
21+
### Step 1: Resolve the Workflow Block
22+
23+
Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
24+
25+
**If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
26+
27+
1. `{skill-root}/customize.toml` — defaults
28+
2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
29+
3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
30+
31+
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
32+
33+
### Step 2: Execute Prepend Steps
34+
35+
Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
36+
37+
### Step 3: Load Persistent Facts
38+
39+
Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
40+
41+
### Step 4: Load Config
42+
43+
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
44+
- Use `{user_name}` for greeting
45+
- Use `{communication_language}` for all communications
46+
- Use `{document_output_language}` for output documents
47+
- Use `{planning_artifacts}` for output location and artifact scanning
48+
- Use `{project_knowledge}` for additional context scanning
49+
50+
### Step 5: Greet the User
51+
52+
Greet `{user_name}` (if you have not already), speaking in `{communication_language}`.
53+
54+
### Step 6: Execute Append Steps
55+
56+
Execute each entry in `{workflow.activation_steps_append}` in order.
57+
58+
Activation is complete. Begin the workflow below.
59+
60+
## Execution
61+
62+
Read fully and follow: `./instructions.md`
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# DO NOT EDIT -- overwritten on every update.
2+
#
3+
# Workflow customization surface for bmad-document-project. Mirrors the
4+
# agent customization shape under the [workflow] namespace.
5+
6+
[workflow]
7+
8+
# --- Configurable below. Overrides merge per BMad structural rules: ---
9+
# scalars: override wins • arrays (persistent_facts, activation_steps_*): append
10+
# arrays-of-tables with `code`/`id`: replace matching items, append new ones.
11+
12+
# Steps to run before the standard activation (config load, greet).
13+
# Overrides append. Use for pre-flight loads, compliance checks, etc.
14+
15+
activation_steps_prepend = []
16+
17+
# Steps to run after greet but before the workflow begins.
18+
# Overrides append. Use for context-heavy setup that should happen
19+
# once the user has been acknowledged.
20+
21+
activation_steps_append = []
22+
23+
# Persistent facts the workflow keeps in mind for the whole run
24+
# (standards, compliance constraints, stylistic guardrails).
25+
# Distinct from the runtime memory sidecar — these are static context
26+
# loaded on activation. Overrides append.
27+
#
28+
# Each entry is either:
29+
# - a literal sentence, e.g. "All briefs must include a regulatory-risk section."
30+
# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/standards.md"
31+
# (glob patterns are supported; the file's contents are loaded and treated as facts).
32+
33+
persistent_facts = [
34+
"file:{project-root}/**/project-context.md",
35+
]
36+
37+
# Scalar: executed when the workflow reaches its terminal stage, after
38+
# the main output has been delivered. Override wins. Leave empty for
39+
# no custom post-completion behavior.
40+
41+
on_complete = ""

src/bmm-skills/1-analysis/bmad-document-project/workflow.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/bmm-skills/1-analysis/bmad-prfaq/SKILL.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,59 @@ The PRFAQ forces customer-first clarity: write the press release announcing the
1919

2020
**Research-grounded.** All competitive, market, and feasibility claims in the output must be verified against current real-world data. Proactively research to fill knowledge gaps — the user deserves a PRFAQ informed by today's landscape, not yesterday's assumptions.
2121

22+
## Conventions
23+
24+
- Bare paths (e.g. `references/press-release.md`) resolve from the skill root.
25+
- `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
26+
- `{project-root}`-prefixed paths resolve from the project working directory.
27+
- `{skill-name}` resolves to the skill directory's basename.
28+
2229
## On Activation
2330

24-
1. Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve::
25-
- Use `{user_name}` for greeting
26-
- Use `{communication_language}` for all communications
27-
- Use `{document_output_language}` for output documents
28-
- Use `{planning_artifacts}` for output location and artifact scanning
29-
- Use `{project_knowledge}` for additional context scanning
31+
### Step 1: Resolve the Workflow Block
32+
33+
Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
34+
35+
**If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
36+
37+
1. `{skill-root}/customize.toml` — defaults
38+
2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
39+
3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
40+
41+
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
42+
43+
### Step 2: Execute Prepend Steps
44+
45+
Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
46+
47+
### Step 3: Load Persistent Facts
48+
49+
Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
50+
51+
### Step 4: Load Config
52+
53+
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
54+
- Use `{user_name}` for greeting
55+
- Use `{communication_language}` for all communications
56+
- Use `{document_output_language}` for output documents
57+
- Use `{planning_artifacts}` for output location and artifact scanning
58+
- Use `{project_knowledge}` for additional context scanning
59+
60+
### Step 5: Greet the User
61+
62+
Greet `{user_name}`, speaking in `{communication_language}`. Be warm but efficient — dream builder energy.
63+
64+
### Step 6: Execute Append Steps
65+
66+
Execute each entry in `{workflow.activation_steps_append}` in order.
67+
68+
Activation is complete. Continue below.
3069

31-
2. **Greet user** as `{user_name}`, speaking in `{communication_language}`. Be warm but efficient — dream builder energy.
70+
## Pre-workflow Setup
3271

33-
3. **Resume detection:** Check if `{planning_artifacts}/prfaq-{project_name}.md` already exists. If it does, read only the first 20 lines to extract the frontmatter `stage` field and offer to resume from the next stage. Do not read the full document. If the user confirms, route directly to that stage's reference file.
72+
1. **Resume detection:** Check if `{planning_artifacts}/prfaq-{project_name}.md` already exists. If it does, read only the first 20 lines to extract the frontmatter `stage` field and offer to resume from the next stage. Do not read the full document. If the user confirms, route directly to that stage's reference file.
3473

35-
4. **Mode detection:**
74+
2. **Mode detection:**
3675
- `--headless` / `-H`: Produce complete first-draft PRFAQ from provided inputs without interaction. Validate the input schema only (customer, problem, stakes, solution concept present and non-vague) — do not read any referenced files or documents yourself. If required fields are missing or too vague, return an error with specific guidance on what's needed. Fan out artifact analyzer and web researcher subagents in parallel (see Contextual Gathering below) to process all referenced materials, then create the output document at `{planning_artifacts}/prfaq-{project_name}.md` using `./assets/prfaq-template.md` and route to `./references/press-release.md`.
3776
- Default: Full interactive coaching — the gauntlet.
3877

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# DO NOT EDIT -- overwritten on every update.
2+
#
3+
# Workflow customization surface for bmad-prfaq. Mirrors the
4+
# agent customization shape under the [workflow] namespace.
5+
6+
[workflow]
7+
8+
# --- Configurable below. Overrides merge per BMad structural rules: ---
9+
# scalars: override wins • arrays (persistent_facts, activation_steps_*): append
10+
# arrays-of-tables with `code`/`id`: replace matching items, append new ones.
11+
12+
activation_steps_prepend = []
13+
activation_steps_append = []
14+
15+
persistent_facts = [
16+
"file:{project-root}/**/project-context.md",
17+
]
18+
19+
on_complete = ""

src/bmm-skills/1-analysis/research/bmad-domain-research/SKILL.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,94 @@ name: bmad-domain-research
33
description: 'Conduct domain and industry research. Use when the user says wants to do domain research for a topic or industry'
44
---
55

6-
Follow the instructions in ./workflow.md.
6+
# Domain Research Workflow
7+
8+
**Goal:** Conduct comprehensive domain/industry research using current web data and verified sources to produce complete research documents with compelling narratives and proper citations.
9+
10+
**Your Role:** You are a domain research facilitator working with an expert partner. This is a collaboration where you bring research methodology and web search capabilities, while your partner brings domain knowledge and research direction.
11+
12+
## Conventions
13+
14+
- Bare paths (e.g. `domain-steps/step-01-init.md`) resolve from the skill root.
15+
- `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
16+
- `{project-root}`-prefixed paths resolve from the project working directory.
17+
- `{skill-name}` resolves to the skill directory's basename.
18+
19+
## PREREQUISITE
20+
21+
**⛔ Web search required.** If unavailable, abort and tell the user.
22+
23+
## On Activation
24+
25+
### Step 1: Resolve the Workflow Block
26+
27+
Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
28+
29+
**If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
30+
31+
1. `{skill-root}/customize.toml` — defaults
32+
2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
33+
3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
34+
35+
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
36+
37+
### Step 2: Execute Prepend Steps
38+
39+
Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
40+
41+
### Step 3: Load Persistent Facts
42+
43+
Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
44+
45+
### Step 4: Load Config
46+
47+
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
48+
- Use `{user_name}` for greeting
49+
- Use `{communication_language}` for all communications
50+
- Use `{document_output_language}` for output documents
51+
- Use `{planning_artifacts}` for output location and artifact scanning
52+
- Use `{project_knowledge}` for additional context scanning
53+
54+
### Step 5: Greet the User
55+
56+
Greet `{user_name}`, speaking in `{communication_language}`.
57+
58+
### Step 6: Execute Append Steps
59+
60+
Execute each entry in `{workflow.activation_steps_append}` in order.
61+
62+
Activation is complete. Begin the workflow below.
63+
64+
## QUICK TOPIC DISCOVERY
65+
66+
"Welcome {{user_name}}! Let's get started with your **domain/industry research**.
67+
68+
**What domain, industry, or sector do you want to research?**
69+
70+
For example:
71+
- 'The healthcare technology industry'
72+
- 'Sustainable packaging regulations in Europe'
73+
- 'Construction and building materials sector'
74+
- 'Or any other domain you have in mind...'"
75+
76+
### Topic Clarification
77+
78+
Based on the user's topic, briefly clarify:
79+
1. **Core Domain**: "What specific aspect of [domain] are you most interested in?"
80+
2. **Research Goals**: "What do you hope to achieve with this research?"
81+
3. **Scope**: "Should we focus broadly or dive deep into specific aspects?"
82+
83+
## ROUTE TO DOMAIN RESEARCH STEPS
84+
85+
After gathering the topic and goals:
86+
87+
1. Set `research_type = "domain"`
88+
2. Set `research_topic = [discovered topic from discussion]`
89+
3. Set `research_goals = [discovered goals from discussion]`
90+
4. Derive `research_topic_slug` from `{{research_topic}}`: lowercase, trim, replace whitespace with `-`, strip path separators (`/`, `\`), `..`, and any character that is not alphanumeric, `-`, or `_`. Collapse repeated `-` and strip leading/trailing `-`. If the result is empty, use `untitled`.
91+
5. Create the starter output file: `{planning_artifacts}/research/domain-{{research_topic_slug}}-research-{{date}}.md` with exact copy of the `./research.template.md` contents
92+
6. Load: `./domain-steps/step-01-init.md` with topic context
93+
94+
**Note:** The discovered topic from the discussion should be passed to the initialization step, so it doesn't need to ask "What do you want to research?" again - it can focus on refining the scope for domain research.
95+
96+
**✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# DO NOT EDIT -- overwritten on every update.
2+
#
3+
# Workflow customization surface for bmad-domain-research. Mirrors the
4+
# agent customization shape under the [workflow] namespace.
5+
6+
[workflow]
7+
8+
# --- Configurable below. Overrides merge per BMad structural rules: ---
9+
# scalars: override wins • arrays (persistent_facts, activation_steps_*): append
10+
# arrays-of-tables with `code`/`id`: replace matching items, append new ones.
11+
12+
activation_steps_prepend = []
13+
activation_steps_append = []
14+
15+
persistent_facts = [
16+
"file:{project-root}/**/project-context.md",
17+
]
18+
19+
on_complete = ""

0 commit comments

Comments
 (0)