Skip to content

Commit ee25fcc

Browse files
alexeyvclaude
andauthored
refactor: remove legacy YAML/XML workflow engine plumbing (#1864)
* refactor(augment): remove legacy YAML/XML workflow rules from code review guidelines All workflows have been converted to markdown. Remove workflow.yaml, workflow.xml, and config_source references from Augment review rules. Drop the entire xml_workflows section (5 rules) and the YAML-specific standard_workflow_instructions rule. * refactor: extract discover_inputs protocol from workflow.xml into co-located markdown Convert the discover_inputs XML protocol (FULL_LOAD, SELECTIVE_LOAD, INDEX_GUIDED strategies) into standalone markdown files placed alongside the two workflows that use it (create-story, code-review). Replace <invoke-protocol> tags with explicit file references. This decouples the workflows from workflow.xml, enabling its deletion in a follow-up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: delete dead YAML/XML workflow engine files Remove 5 files made obsolete by the workflow.yaml → workflow.md migration: - workflow.xml (the YAML workflow interpreter engine) - dev-story/instructions.xml (superseded by workflow.md) - 3 installer templates for YAML workflow command generation References in CLI code will be cleaned up in follow-up commits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: delete obsolete workflow handler fragments Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: remove YAML workflow code paths from CLI installer pipeline Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: remove workflow.xml references from manifests and checklists Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: remove workflow.xml references from English command docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: update fixtures to remove workflow.yaml references Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update workflow.yaml example path to workflow.md in handler-multi Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: stop tracking workflow/validate-workflow as handler attributes These handler fragments were deleted — the exec handler already covers loading .md workflow files directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: rename workflow attribute to exec in agent menu items Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address PR review findings from triage - Fix regex capture group index in module manager workflow path parsing - Remove stale workflow handler references from handler-multi.txt - Replace workflow with multi in activation-steps dispatch contract - Remove dead validate-workflow emission from compiler and xml-builder - Align commands.md wording to remove engine references - Fix relativePath anchoring in _base-ide.js recursive directory scans - Remove dead code from workflow-command-generator (unused template, generateCommandContent, writeColonArtifacts, writeDashArtifacts) - Delete unused workflow-commander.md template - Add regression test for workflow path regex --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4c470d9 commit ee25fcc

41 files changed

Lines changed: 407 additions & 1225 deletions

Some content is hidden

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

.augment/code_review_guidelines.yaml

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,13 @@ areas:
5656
- "src/**/workflows/**"
5757
rules:
5858
- id: "workflow_entry_point_required"
59-
description: "Every workflow folder must have workflow.yaml, workflow.md, or workflow.xml as entry point"
59+
description: "Every workflow folder must have workflow.md as entry point"
6060
severity: "high"
6161

6262
- id: "sharded_workflow_steps_folder"
6363
description: "Sharded workflows (using workflow.md) must have steps/ folder with numbered files (step-01-*.md, step-02-*.md)"
6464
severity: "high"
6565

66-
- id: "standard_workflow_instructions"
67-
description: "Standard workflows using workflow.yaml must include instructions.md for execution guidance"
68-
severity: "medium"
69-
7066
- id: "workflow_step_limit"
7167
description: "Workflows should have 5-10 steps maximum to prevent context loss in LLM execution"
7268
severity: "medium"
@@ -75,11 +71,9 @@ areas:
7571
# WORKFLOW ENTRY FILE RULES
7672
# ============================================
7773
workflow_definitions:
78-
description: "Workflow entry files (workflow.yaml, workflow.md, workflow.xml)"
74+
description: "Workflow entry files (workflow.md)"
7975
globs:
80-
- "src/**/workflows/**/workflow.yaml"
8176
- "src/**/workflows/**/workflow.md"
82-
- "src/**/workflows/**/workflow.xml"
8377
rules:
8478
- id: "workflow_name_required"
8579
description: "Workflow entry files must define 'name' field in frontmatter or root element"
@@ -89,10 +83,6 @@ areas:
8983
description: "Workflow entry files must include 'description' explaining the workflow's purpose"
9084
severity: "high"
9185

92-
- id: "workflow_config_source"
93-
description: "Workflows should reference config_source for variable resolution (e.g., {project-root}/_bmad/module/config.yaml)"
94-
severity: "medium"
95-
9686
- id: "workflow_installed_path"
9787
description: "Workflows should define installed_path for relative file references within the workflow"
9888
severity: "medium"
@@ -149,43 +139,13 @@ areas:
149139
description: "Steps presenting user menus ([C] Continue, [a] Advanced, etc.) must HALT and wait for response"
150140
severity: "high"
151141

152-
# ============================================
153-
# XML WORKFLOW/TASK RULES
154-
# ============================================
155-
xml_workflows:
156-
description: "XML-based workflows and tasks"
157-
globs:
158-
- "src/**/workflows/**/*.xml"
159-
- "src/**/tasks/**/*.xml"
160-
rules:
161-
- id: "xml_task_id_required"
162-
description: "XML tasks must have unique 'id' attribute on root task element"
163-
severity: "high"
164-
165-
- id: "xml_llm_instructions"
166-
description: "XML workflows should include <llm> section with critical execution instructions for the agent"
167-
severity: "medium"
168-
169-
- id: "xml_step_numbering"
170-
description: "XML steps should use n='X' attribute for sequential numbering"
171-
severity: "medium"
172-
173-
- id: "xml_action_tags"
174-
description: "Use <action> for required actions, <ask> for user input (must HALT), <goto> for jumps, <check if='...'> for conditionals"
175-
severity: "medium"
176-
177-
- id: "xml_ask_must_halt"
178-
description: "<ask> tags require agent to HALT and wait for user response before continuing"
179-
severity: "high"
180-
181142
# ============================================
182143
# WORKFLOW CONTENT QUALITY
183144
# ============================================
184145
workflow_content:
185146
description: "Content quality and consistency rules for all workflow files"
186147
globs:
187148
- "src/**/workflows/**/*.md"
188-
- "src/**/workflows/**/*.yaml"
189149
rules:
190150
- id: "communication_language_variable"
191151
description: "Workflows should use {communication_language} variable for agent output language consistency"

docs/reference/commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The installer uses templates for each skill type:
2727
| Skill type | What the generated file does |
2828
| --- | --- |
2929
| **Agent launcher** | Loads the agent persona file, activates its menu, and stays in character |
30-
| **Workflow skill** | Loads the workflow engine (`workflow.xml`) and passes the workflow config |
30+
| **Workflow skill** | Loads the workflow config and follows its steps |
3131
| **Task skill** | Loads a standalone task file and follows its instructions |
3232
| **Tool skill** | Loads a standalone tool file and follows its instructions |
3333

@@ -88,7 +88,7 @@ See [Agents](./agents.md) for the full list of default agents and their triggers
8888

8989
### Workflow Skills
9090

91-
Workflow skills run a structured, multi-step process without loading an agent persona first. They load the workflow engine and pass a specific workflow configuration.
91+
Workflow skills run a structured, multi-step process without loading an agent persona first. They load a workflow configuration and follow its steps.
9292

9393
| Example skill | Purpose |
9494
| --- | --- |

src/bmm/agents/analyst.agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ agent:
3939
description: "[CB] Create Brief: A guided experience to nail down your product idea into an executive brief"
4040

4141
- trigger: DP or fuzzy match on document-project
42-
workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md"
42+
exec: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md"
4343
description: "[DP] Document Project: Analyze an existing project to produce useful documentation for both human and LLM"

src/bmm/agents/dev.agent.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ agent:
3030

3131
menu:
3232
- trigger: DS or fuzzy match on dev-story
33-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.md"
33+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.md"
3434
description: "[DS] Dev Story: Write the next or specified stories tests and code."
3535

3636
- trigger: CR or fuzzy match on code-review
37-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md"
37+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md"
3838
description: "[CR] Code Review: Initiate a comprehensive code review across multiple quality facets. For best results, use a fresh context and a different quality LLM if available"

src/bmm/agents/pm.agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ agent:
4040
description: "[IR] Implementation Readiness: Ensure the PRD, UX, and Architecture and Epics and Stories List are all aligned"
4141

4242
- trigger: CC or fuzzy match on correct-course
43-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md"
43+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md"
4444
description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation"

src/bmm/agents/qa.agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ agent:
2929

3030
menu:
3131
- trigger: QA or fuzzy match on qa-automate
32-
workflow: "{project-root}/_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md"
32+
exec: "{project-root}/_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md"
3333
description: "[QA] Automate - Generate tests for existing features (simplified)"
3434

3535
prompts:

src/bmm/agents/quick-flow-solo-dev.agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ agent:
3232
description: "[QQ] Quick Dev New (Preview): Unified quick flow — clarify intent, plan, implement, review, present (experimental)"
3333

3434
- trigger: CR or fuzzy match on code-review
35-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md"
35+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md"
3636
description: "[CR] Code Review: Initiate a comprehensive code review across multiple quality facets. For best results, use a fresh context and a different quality LLM if available"

src/bmm/agents/sm.agent.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ agent:
2020
2121
menu:
2222
- trigger: SP or fuzzy match on sprint-planning
23-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md"
23+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md"
2424
description: "[SP] Sprint Planning: Generate or update the record that will sequence the tasks to complete the full project that the dev agent will follow"
2525

2626
- trigger: CS or fuzzy match on create-story
27-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md"
27+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md"
2828
description: "[CS] Context Story: Prepare a story with all required context for implementation for the developer agent"
2929

3030
- trigger: ER or fuzzy match on epic-retrospective
31-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/retrospective/workflow.md"
31+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/retrospective/workflow.md"
3232
data: "{project-root}/_bmad/_config/agent-manifest.csv"
3333
description: "[ER] Epic Retrospective: Party Mode review of all work completed across an epic."
3434

3535
- trigger: CC or fuzzy match on correct-course
36-
workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md"
36+
exec: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md"
3737
description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation"

src/bmm/agents/tech-writer/tech-writer.agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ agent:
2222
2323
menu:
2424
- trigger: DP or fuzzy match on document-project
25-
workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md"
25+
exec: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md"
2626
description: "[DP] Document Project: Generate comprehensive project documentation (brownfield analysis, architecture scanning)"
2727

2828
- trigger: WD or fuzzy match on write-document
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Discover Inputs Protocol
2+
3+
**Objective:** Intelligently load project files (whole or sharded) based on the workflow's Input Files configuration.
4+
5+
**Prerequisite:** Only execute this protocol if the workflow defines an Input Files section. If no input file patterns are configured, skip this entirely.
6+
7+
---
8+
9+
## Step 1: Parse Input File Patterns
10+
11+
- Read the Input Files table from the workflow configuration.
12+
- For each input group (prd, architecture, epics, ux, etc.), note the **load strategy** if specified.
13+
14+
## Step 2: Load Files Using Smart Strategies
15+
16+
For each pattern in the Input Files table, work through the following substeps in order:
17+
18+
### 2a: Try Sharded Documents First
19+
20+
If a sharded pattern exists for this input, determine the load strategy (defaults to **FULL_LOAD** if not specified), then apply the matching strategy:
21+
22+
#### FULL_LOAD Strategy
23+
24+
Load ALL files in the sharded directory. Use this for PRD, Architecture, UX, brownfield docs, or whenever the full picture is needed.
25+
26+
1. Use the glob pattern to find ALL `.md` files (e.g., `{planning_artifacts}/*architecture*/*.md`).
27+
2. Load EVERY matching file completely.
28+
3. Concatenate content in logical order: `index.md` first if it exists, then alphabetical.
29+
4. Store the combined result in a variable named `{pattern_name_content}` (e.g., `{architecture_content}`).
30+
31+
#### SELECTIVE_LOAD Strategy
32+
33+
Load a specific shard using a template variable. Example: used for epics with `{{epic_num}}`.
34+
35+
1. Check for template variables in the sharded pattern (e.g., `{{epic_num}}`).
36+
2. If the variable is undefined, ask the user for the value OR infer it from context.
37+
3. Resolve the template to a specific file path.
38+
4. Load that specific file.
39+
5. Store in variable: `{pattern_name_content}`.
40+
41+
#### INDEX_GUIDED Strategy
42+
43+
Load index.md, analyze the structure and description of each doc in the index, then intelligently load relevant docs.
44+
45+
**DO NOT BE LAZY** -- use best judgment to load documents that might have relevant information, even if there is only a 5% chance of relevance.
46+
47+
1. Load `index.md` from the sharded directory.
48+
2. Parse the table of contents, links, and section headers.
49+
3. Analyze the workflow's purpose and objective.
50+
4. Identify which linked/referenced documents are likely relevant.
51+
- *Example:* If the workflow is about authentication and the index shows "Auth Overview", "Payment Setup", "Deployment" -- load the auth docs, consider deployment docs, skip payment.
52+
5. Load all identified relevant documents.
53+
6. Store combined content in variable: `{pattern_name_content}`.
54+
55+
**When in doubt, LOAD IT** -- context is valuable, and being thorough is better than missing critical info.
56+
57+
---
58+
59+
After applying the matching strategy, mark the pattern as **RESOLVED** and move to the next pattern.
60+
61+
### 2b: Try Whole Document if No Sharded Found
62+
63+
If no sharded matches were found OR no sharded pattern exists for this input:
64+
65+
1. Attempt a glob match on the "whole" pattern (e.g., `{planning_artifacts}/*prd*.md`).
66+
2. If matches are found, load ALL matching files completely (no offset/limit).
67+
3. Store content in variable: `{pattern_name_content}` (e.g., `{prd_content}`).
68+
4. Mark pattern as **RESOLVED** and move to the next pattern.
69+
70+
### 2c: Handle Not Found
71+
72+
If no matches were found for either sharded or whole patterns:
73+
74+
1. Set `{pattern_name_content}` to empty string.
75+
2. Note in session: "No {pattern_name} files found" -- this is not an error, just unavailable. Offer the user a chance to provide the file.
76+
77+
## Step 3: Report Discovery Results
78+
79+
List all loaded content variables with file counts. Example:
80+
81+
```
82+
OK Loaded {prd_content} from 5 sharded files: prd/index.md, prd/requirements.md, ...
83+
OK Loaded {architecture_content} from 1 file: Architecture.md
84+
OK Loaded {epics_content} from selective load: epics/epic-3.md
85+
-- No ux_design files found
86+
```
87+
88+
This gives the workflow transparency into what context is available.

0 commit comments

Comments
 (0)