From 61fe92a129339d99073115dd001a757eff9a9940 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 15:47:38 -0600 Subject: [PATCH] refactor: rename workflow attribute to exec in agent menu items Co-Authored-By: Claude Opus 4.6 --- src/bmm/agents/analyst.agent.yaml | 2 +- src/bmm/agents/dev.agent.yaml | 4 ++-- src/bmm/agents/pm.agent.yaml | 2 +- src/bmm/agents/qa.agent.yaml | 2 +- src/bmm/agents/quick-flow-solo-dev.agent.yaml | 2 +- src/bmm/agents/sm.agent.yaml | 8 ++++---- .../agents/tech-writer/tech-writer.agent.yaml | 2 +- .../menu-commands/all-command-types.agent.yaml | 2 +- .../menu-commands/multiple-commands.agent.yaml | 3 +-- .../valid/menu/multiple-menu-items.agent.yaml | 2 +- tools/cli/installers/lib/modules/manager.js | 2 +- tools/cli/lib/agent/compiler.js | 3 --- tools/cli/lib/yaml-xml-builder.js | 18 +----------------- tools/schema/agent.js | 4 +--- 14 files changed, 17 insertions(+), 39 deletions(-) diff --git a/src/bmm/agents/analyst.agent.yaml b/src/bmm/agents/analyst.agent.yaml index 7814ee609..4767dadfa 100644 --- a/src/bmm/agents/analyst.agent.yaml +++ b/src/bmm/agents/analyst.agent.yaml @@ -39,5 +39,5 @@ agent: description: "[CB] Create Brief: A guided experience to nail down your product idea into an executive brief" - trigger: DP or fuzzy match on document-project - workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" description: "[DP] Document Project: Analyze an existing project to produce useful documentation for both human and LLM" diff --git a/src/bmm/agents/dev.agent.yaml b/src/bmm/agents/dev.agent.yaml index 6de3d2c97..6818dc968 100644 --- a/src/bmm/agents/dev.agent.yaml +++ b/src/bmm/agents/dev.agent.yaml @@ -30,9 +30,9 @@ agent: menu: - trigger: DS or fuzzy match on dev-story - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.md" description: "[DS] Dev Story: Write the next or specified stories tests and code." - trigger: CR or fuzzy match on code-review - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" 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" diff --git a/src/bmm/agents/pm.agent.yaml b/src/bmm/agents/pm.agent.yaml index 267797053..bf104246a 100644 --- a/src/bmm/agents/pm.agent.yaml +++ b/src/bmm/agents/pm.agent.yaml @@ -40,5 +40,5 @@ agent: description: "[IR] Implementation Readiness: Ensure the PRD, UX, and Architecture and Epics and Stories List are all aligned" - trigger: CC or fuzzy match on correct-course - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation" diff --git a/src/bmm/agents/qa.agent.yaml b/src/bmm/agents/qa.agent.yaml index 71ff83930..65b0711b2 100644 --- a/src/bmm/agents/qa.agent.yaml +++ b/src/bmm/agents/qa.agent.yaml @@ -29,7 +29,7 @@ agent: menu: - trigger: QA or fuzzy match on qa-automate - workflow: "{project-root}/_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md" description: "[QA] Automate - Generate tests for existing features (simplified)" prompts: diff --git a/src/bmm/agents/quick-flow-solo-dev.agent.yaml b/src/bmm/agents/quick-flow-solo-dev.agent.yaml index 72f861e8e..acaab975b 100644 --- a/src/bmm/agents/quick-flow-solo-dev.agent.yaml +++ b/src/bmm/agents/quick-flow-solo-dev.agent.yaml @@ -32,5 +32,5 @@ agent: description: "[QQ] Quick Dev New (Preview): Unified quick flow — clarify intent, plan, implement, review, present (experimental)" - trigger: CR or fuzzy match on code-review - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" 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" diff --git a/src/bmm/agents/sm.agent.yaml b/src/bmm/agents/sm.agent.yaml index 11716df24..19506fae1 100644 --- a/src/bmm/agents/sm.agent.yaml +++ b/src/bmm/agents/sm.agent.yaml @@ -20,18 +20,18 @@ agent: menu: - trigger: SP or fuzzy match on sprint-planning - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md" 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" - trigger: CS or fuzzy match on create-story - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md" description: "[CS] Context Story: Prepare a story with all required context for implementation for the developer agent" - trigger: ER or fuzzy match on epic-retrospective - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/retrospective/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/retrospective/workflow.md" data: "{project-root}/_bmad/_config/agent-manifest.csv" description: "[ER] Epic Retrospective: Party Mode review of all work completed across an epic." - trigger: CC or fuzzy match on correct-course - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation" diff --git a/src/bmm/agents/tech-writer/tech-writer.agent.yaml b/src/bmm/agents/tech-writer/tech-writer.agent.yaml index da3fe9c91..25f0aca06 100644 --- a/src/bmm/agents/tech-writer/tech-writer.agent.yaml +++ b/src/bmm/agents/tech-writer/tech-writer.agent.yaml @@ -22,7 +22,7 @@ agent: menu: - trigger: DP or fuzzy match on document-project - workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" description: "[DP] Document Project: Generate comprehensive project documentation (brownfield analysis, architecture scanning)" - trigger: WD or fuzzy match on write-document diff --git a/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml b/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml index 959085cb7..22ae9886d 100644 --- a/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml +++ b/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml @@ -19,7 +19,7 @@ agent: menu: - trigger: workflow-test description: Test workflow command - workflow: path/to/workflow + exec: path/to/workflow - trigger: validate-test description: Test validate-workflow command validate-workflow: path/to/validation diff --git a/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml b/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml index 945722b5b..9133b02de 100644 --- a/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml +++ b/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml @@ -19,6 +19,5 @@ agent: menu: - trigger: multi-command description: Menu item with multiple command targets - workflow: path/to/workflow - exec: npm test + exec: path/to/workflow action: perform_action diff --git a/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml b/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml index c8a23a9d5..c95025025 100644 --- a/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml +++ b/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml @@ -22,7 +22,7 @@ agent: action: display_help - trigger: start-workflow description: Start a workflow - workflow: path/to/workflow + exec: path/to/workflow - trigger: execute description: Execute command exec: npm test diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index 8b97b1737..b2d288af7 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -1073,7 +1073,7 @@ class ModuleManager { await prompts.log.message(` Processing: ${agentFile}`); for (const item of workflowInstallItems) { - const sourceWorkflowPath = item.workflow; // Where to copy FROM + const sourceWorkflowPath = item.exec; // Where to copy FROM const installWorkflowPath = item['workflow-install']; // Where to copy TO // Parse SOURCE workflow path diff --git a/tools/cli/lib/agent/compiler.js b/tools/cli/lib/agent/compiler.js index 0411fed89..3e72c6674 100644 --- a/tools/cli/lib/agent/compiler.js +++ b/tools/cli/lib/agent/compiler.js @@ -147,7 +147,6 @@ function buildMenuXml(menuItems) { const attrs = [`cmd="${trigger}"`]; // Add handler attributes - if (item.workflow) attrs.push(`workflow="${item.workflow}"`); if (item.exec) attrs.push(`exec="${item.exec}"`); if (item.tmpl) attrs.push(`tmpl="${item.tmpl}"`); if (item.data) attrs.push(`data="${item.data}"`); @@ -187,7 +186,6 @@ function buildNestedHandlers(triggers) { // Add handler attributes based on exec data if (execData.route) attrs.push(`exec="${execData.route}"`); - if (execData.workflow) attrs.push(`workflow="${execData.workflow}"`); if (execData['validate-workflow']) attrs.push(`validate-workflow="${execData['validate-workflow']}"`); if (execData.action) attrs.push(`action="${execData.action}"`); if (execData.data) attrs.push(`data="${execData.data}"`); @@ -212,7 +210,6 @@ function processExecArray(execArray) { const result = { description: '', route: null, - workflow: null, data: null, action: null, type: null, diff --git a/tools/cli/lib/yaml-xml-builder.js b/tools/cli/lib/yaml-xml-builder.js index ac140814f..43af99f15 100644 --- a/tools/cli/lib/yaml-xml-builder.js +++ b/tools/cli/lib/yaml-xml-builder.js @@ -367,15 +367,6 @@ class YamlXmlBuilder { const attrs = [`cmd="${trigger}"`]; // Add handler attributes - // If workflow-install exists, use its value for workflow attribute (vendoring) - // workflow-install is build-time metadata - tells installer where to copy workflows - // The final XML should only have workflow pointing to the install location - if (item['workflow-install']) { - attrs.push(`workflow="${item['workflow-install']}"`); - } else if (item.workflow) { - attrs.push(`workflow="${item.workflow}"`); - } - if (item['validate-workflow']) attrs.push(`validate-workflow="${item['validate-workflow']}"`); if (item.exec) attrs.push(`exec="${item.exec}"`); if (item.tmpl) attrs.push(`tmpl="${item.tmpl}"`); @@ -417,7 +408,6 @@ class YamlXmlBuilder { // Add handler attributes based on exec data if (execData.route) attrs.push(`exec="${execData.route}"`); - if (execData.workflow) attrs.push(`workflow="${execData.workflow}"`); if (execData['validate-workflow']) attrs.push(`validate-workflow="${execData['validate-workflow']}"`); if (execData.action) attrs.push(`action="${execData.action}"`); if (execData.data) attrs.push(`data="${execData.data}"`); @@ -442,7 +432,6 @@ class YamlXmlBuilder { const result = { description: '', route: null, - workflow: null, data: null, action: null, type: null, @@ -459,12 +448,7 @@ class YamlXmlBuilder { } if (exec.route) { - // Determine if it's a workflow or exec based on file extension or context - if (exec.route.endsWith('.yaml') || exec.route.endsWith('.yml')) { - result.workflow = exec.route; - } else { - result.route = exec.route; - } + result.route = exec.route; } if (exec.data !== null && exec.data !== undefined) { diff --git a/tools/schema/agent.js b/tools/schema/agent.js index 93ced7c6e..dfec1322f 100644 --- a/tools/schema/agent.js +++ b/tools/schema/agent.js @@ -2,7 +2,7 @@ const assert = require('node:assert'); const { z } = require('zod'); -const COMMAND_TARGET_KEYS = ['workflow', 'validate-workflow', 'exec', 'action', 'tmpl', 'data']; +const COMMAND_TARGET_KEYS = ['validate-workflow', 'exec', 'action', 'tmpl', 'data']; const TRIGGER_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/; const COMPOUND_TRIGGER_PATTERN = /^([A-Z]{1,3}) or fuzzy match on ([a-z0-9]+(?:-[a-z0-9]+)*)$/; @@ -273,8 +273,6 @@ function buildMenuItemSchema() { .object({ trigger: createNonEmptyString('agent.menu[].trigger'), description: createNonEmptyString('agent.menu[].description'), - workflow: createNonEmptyString('agent.menu[].workflow').optional(), - 'workflow-install': createNonEmptyString('agent.menu[].workflow-install').optional(), 'validate-workflow': createNonEmptyString('agent.menu[].validate-workflow').optional(), exec: createNonEmptyString('agent.menu[].exec').optional(), action: createNonEmptyString('agent.menu[].action').optional(),