From f7b5f0380089c36a1d8bdb657505e58830ad309d Mon Sep 17 00:00:00 2001 From: Davor Racic Date: Fri, 6 Feb 2026 14:28:09 +0100 Subject: [PATCH] refactor: consolidate OpenCode templates and add support for tasks, tools, and workflows (#1556) - Move opencode/body.md to combined/opencode-agent.md with frontmatter - Add combined templates for tasks, tools, and workflows (both .md and .yaml) - Replace hardcoded _bmad path with {{bmadFolderName}} variable - Remove split/opencode/ templates (header.md, body.md) - Add .gitkeep to preserve empty split/ directory --- .../body.md => combined/opencode-agent.md} | 7 ++++++- .../lib/ide/templates/combined/opencode-task.md | 12 ++++++++++++ .../lib/ide/templates/combined/opencode-tool.md | 12 ++++++++++++ .../templates/combined/opencode-workflow-yaml.md | 15 +++++++++++++++ .../ide/templates/combined/opencode-workflow.md | 15 +++++++++++++++ .../installers/lib/ide/templates/split/.gitkeep | 0 .../lib/ide/templates/split/opencode/header.md | 4 ---- 7 files changed, 60 insertions(+), 5 deletions(-) rename tools/cli/installers/lib/ide/templates/{split/opencode/body.md => combined/opencode-agent.md} (78%) create mode 100644 tools/cli/installers/lib/ide/templates/combined/opencode-task.md create mode 100644 tools/cli/installers/lib/ide/templates/combined/opencode-tool.md create mode 100644 tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md create mode 100644 tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md create mode 100644 tools/cli/installers/lib/ide/templates/split/.gitkeep delete mode 100644 tools/cli/installers/lib/ide/templates/split/opencode/header.md diff --git a/tools/cli/installers/lib/ide/templates/split/opencode/body.md b/tools/cli/installers/lib/ide/templates/combined/opencode-agent.md similarity index 78% rename from tools/cli/installers/lib/ide/templates/split/opencode/body.md rename to tools/cli/installers/lib/ide/templates/combined/opencode-agent.md index b20f6651..1102aa8a 100644 --- a/tools/cli/installers/lib/ide/templates/split/opencode/body.md +++ b/tools/cli/installers/lib/ide/templates/combined/opencode-agent.md @@ -1,7 +1,12 @@ +--- +mode: primary +description: '{{description}}' +--- + You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command. -1. LOAD the FULL agent file from {project-root}/_bmad/{{path}} +1. LOAD the FULL agent file from {project-root}/{{bmadFolderName}}/{{path}} 2. READ its entire contents - this contains the complete agent persona, menu, and instructions 3. FOLLOW every step in the section precisely 4. DISPLAY the welcome/greeting as instructed diff --git a/tools/cli/installers/lib/ide/templates/combined/opencode-task.md b/tools/cli/installers/lib/ide/templates/combined/opencode-task.md new file mode 100644 index 00000000..155c135c --- /dev/null +++ b/tools/cli/installers/lib/ide/templates/combined/opencode-task.md @@ -0,0 +1,12 @@ +--- +description: '{{description}}' +--- + +Execute the BMAD '{{name}}' task. + +TASK INSTRUCTIONS: +1. LOAD the task file from {project-root}/{{bmadFolderName}}/{{path}} +2. READ its entire contents +3. FOLLOW every instruction precisely as specified + +TASK FILE: {project-root}/{{bmadFolderName}}/{{path}} diff --git a/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md b/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md new file mode 100644 index 00000000..50544525 --- /dev/null +++ b/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md @@ -0,0 +1,12 @@ +--- +description: '{{description}}' +--- + +Execute the BMAD '{{name}}' tool. + +TOOL INSTRUCTIONS: +1. LOAD the tool file from {project-root}/{{bmadFolderName}}/{{path}} +2. READ its entire contents +3. FOLLOW every instruction precisely as specified + +TOOL FILE: {project-root}/{{bmadFolderName}}/{{path}} diff --git a/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md b/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md new file mode 100644 index 00000000..d1e2b0af --- /dev/null +++ b/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md @@ -0,0 +1,15 @@ +--- +description: '{{description}}' +--- + +Execute the BMAD '{{name}}' workflow. + +CRITICAL: You must load and follow the workflow definition exactly. + +WORKFLOW INSTRUCTIONS: +1. LOAD the workflow file from {project-root}/{{bmadFolderName}}/{{path}} +2. READ its entire contents +3. FOLLOW every step precisely as specified +4. DO NOT skip or modify any steps + +WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{path}} diff --git a/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md b/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md new file mode 100644 index 00000000..d1e2b0af --- /dev/null +++ b/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md @@ -0,0 +1,15 @@ +--- +description: '{{description}}' +--- + +Execute the BMAD '{{name}}' workflow. + +CRITICAL: You must load and follow the workflow definition exactly. + +WORKFLOW INSTRUCTIONS: +1. LOAD the workflow file from {project-root}/{{bmadFolderName}}/{{path}} +2. READ its entire contents +3. FOLLOW every step precisely as specified +4. DO NOT skip or modify any steps + +WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{path}} diff --git a/tools/cli/installers/lib/ide/templates/split/.gitkeep b/tools/cli/installers/lib/ide/templates/split/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tools/cli/installers/lib/ide/templates/split/opencode/header.md b/tools/cli/installers/lib/ide/templates/split/opencode/header.md deleted file mode 100644 index a384374c..00000000 --- a/tools/cli/installers/lib/ide/templates/split/opencode/header.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -name: '{{name}}' -description: '{{description}}' ----