feat(opencode): add JSON-only integration and compact AGENTS.md generator (#570)

* feat: add OpenCode integration implementation plan for BMAD-METHOD

* installer(opencode): add OpenCode target metadata in install.config.yaml

* chore(deps): add comment-json for JSONC parsing in OpenCode integration

* feat(installer/opencode): implement setupOpenCode with minimal instructions merge and BMAD-managed agents/commands

* feat(installer): add OpenCode (SST) to IDE selector and CLI --ide help

* fix(opencode): align generated opencode.json(c) with schema (instructions as strings; agent.prompt; command.template; remove unsupported fields)

* feat(installer): enhance OpenCode setup with agent selection and prefix options

* fix: update configuration file references from `bmad-core/core-config.yaml` to `.bmad-core/core-config.yaml` across multiple agent and task files for consistency and clarity.

* refactor: streamline OpenCode configuration prompts and normalize instruction paths for agents and tasks

* feat: add tools property to agent definitions for enhanced functionality. Otherwise opencode consders the subagents as readonly

* feat: add extraction of 'whenToUse'  from agents markdown files for improved agent configuration in opencode

* feat: enhance task purpose extraction from markdown files with improved parsing and cleanup logic

* feat: add collision warnings for non-BMAD-managed agent and command keys during setup

* feat: generate and update AGENTS.md for OpenCode integration with agent and task details

* feat: add compact AGENTS.md generator and JSON-only integration for OpenCode

* chore(docs): remove completed OpenCode integration implementation plans

* feat: enable default prefixes for agent and command keys to avoid collisions

* fix: remove unnecessary line breaks in 'whenToUse' descriptions for QA agents to mathc the rest of the agents definitions and improve programatic parsing of whenToUse prop

* fix: update OpenCode references to remove 'SST' for consistency across documentation and configuration

* fix: update agent mode from 'subagent' to 'all' for consistency in agent definitions

* fix: consolidate 'whenToUse' description format for clarity and consistent parsing
This commit is contained in:
Javier Gomez
2025-09-12 00:44:41 +02:00
committed by GitHub
parent 2b247ea385
commit f09e282d72
38 changed files with 915 additions and 96 deletions

View File

@@ -2230,7 +2230,7 @@ npx bmad-method install
## Core Configuration (core-config.yaml)
**New in V4**: The `bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
**New in V4**: The `.bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
### What is core-config.yaml?

View File

@@ -7970,7 +7970,7 @@ npx bmad-method install
## Core Configuration (core-config.yaml)
**New in V4**: The `bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
**New in V4**: The `.bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
### What is core-config.yaml?

View File

@@ -653,7 +653,7 @@ npx bmad-method install
## Core Configuration (core-config.yaml)
**New in V4**: The `bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
**New in V4**: The `.bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
### What is core-config.yaml?

8
dist/agents/dev.txt vendored
View File

@@ -110,8 +110,8 @@ Implement fixes based on QA results (gate and assessments) for a specific story.
```yaml
required:
- story_id: '{epic}.{story}' # e.g., "2.2"
- qa_root: from `bmad-core/core-config.yaml` key `qa.qaLocation` (e.g., `docs/project/qa`)
- story_root: from `bmad-core/core-config.yaml` key `devStoryLocation` (e.g., `docs/project/stories`)
- qa_root: from `.bmad-core/core-config.yaml` key `qa.qaLocation` (e.g., `docs/project/qa`)
- story_root: from `.bmad-core/core-config.yaml` key `devStoryLocation` (e.g., `docs/project/stories`)
optional:
- story_title: '{title}' # derive from story H1 if missing
@@ -139,7 +139,7 @@ optional:
### 0) Load Core Config & Locate Story
- Read `bmad-core/core-config.yaml` and resolve `qa_root` and `story_root`
- Read `.bmad-core/core-config.yaml` and resolve `qa_root` and `story_root`
- Locate story file in `{story_root}/{epic}.{story}.*.md`
- HALT if missing and ask for correct story id/path
@@ -207,7 +207,7 @@ Status Rule:
## Blocking Conditions
- Missing `bmad-core/core-config.yaml`
- Missing `.bmad-core/core-config.yaml`
- Story file not found for `story_id`
- No QA artifacts found (neither gate nor assessments)
- HALT and request QA to generate at least a gate file (or proceed only with clear developer-provided fix list)

15
dist/agents/qa.txt vendored
View File

@@ -55,8 +55,7 @@ agent:
id: qa
title: Test Architect & Quality Advisor
icon: 🧪
whenToUse: |
Use for comprehensive test architecture review, quality gate decisions,
whenToUse: Use for comprehensive test architecture review, quality gate decisions,
and code improvement. Provides thorough analysis including requirements
traceability, risk assessment, and test strategy.
Advisory only - teams choose their quality bar.
@@ -121,11 +120,11 @@ Quick NFR validation focused on the core four: security, performance, reliabilit
```yaml
required:
- story_id: '{epic}.{story}' # e.g., "1.3"
- story_path: `bmad-core/core-config.yaml` for the `devStoryLocation`
- story_path: `.bmad-core/core-config.yaml` for the `devStoryLocation`
optional:
- architecture_refs: `bmad-core/core-config.yaml` for the `architecture.architectureFile`
- technical_preferences: `bmad-core/core-config.yaml` for the `technicalPreferences`
- architecture_refs: `.bmad-core/core-config.yaml` for the `architecture.architectureFile`
- technical_preferences: `.bmad-core/core-config.yaml` for the `technicalPreferences`
- acceptance_criteria: From story file
```
@@ -475,7 +474,7 @@ Generate a standalone quality gate file that provides a clear pass/fail decision
## Gate File Location
**ALWAYS** check the `bmad-core/core-config.yaml` for the `qa.qaLocation/gates`
**ALWAYS** check the `.bmad-core/core-config.yaml` for the `qa.qaLocation/gates`
Slug rules:
@@ -585,7 +584,7 @@ waiver:
## Output Requirements
1. **ALWAYS** create gate file at: `qa.qaLocation/gates` from `bmad-core/core-config.yaml`
1. **ALWAYS** create gate file at: `qa.qaLocation/gates` from `.bmad-core/core-config.yaml`
2. **ALWAYS** append this exact format to story's QA Results section:
```text
@@ -810,7 +809,7 @@ NFR assessment: qa.qaLocation/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
**Template and Directory:**
- Render from `../templates/qa-gate-tmpl.yaml`
- Create directory defined in `qa.qaLocation/gates` (see `bmad-core/core-config.yaml`) if missing
- Create directory defined in `qa.qaLocation/gates` (see `.bmad-core/core-config.yaml`) if missing
- Save to: `qa.qaLocation/gates/{epic}.{story}-{slug}.yml`
Gate file structure:

View File

@@ -286,7 +286,7 @@ optional:
### 0) Load Core Config & Locate Story
- Read `bmad-core/core-config.yaml` and resolve `qa_root`, `story_root`, and `project_root`
- Read `.bmad-core/core-config.yaml` and resolve `qa_root`, `story_root`, and `project_root`
- Locate story file in `{story_root}/{epic}.{story}.*.md`
- HALT if missing and ask for correct story id/path
@@ -386,7 +386,7 @@ Status Rule:
## Blocking Conditions
- Missing `bmad-core/core-config.yaml`
- Missing `.bmad-core/core-config.yaml`
- Story file not found for `story_id`
- No QA artifacts found (neither gate nor assessments)
- HALT and request QA to generate at least a gate file (or proceed only with clear developer-provided fix list)

View File

@@ -55,8 +55,7 @@ agent:
id: game-qa
title: Game Test Architect & TDD Enforcer (Godot)
icon: 🎮🧪
whenToUse: |
Use for Godot game testing architecture, test-driven development enforcement,
whenToUse: Use for Godot game testing architecture, test-driven development enforcement,
performance validation, and gameplay quality assurance. Ensures all code is
test-first, performance targets are met, and player experience is validated.
Enforces GUT for GDScript and GoDotTest/GodotTestDriver for C# with TDD practices.

View File

@@ -558,8 +558,7 @@ agent:
id: game-qa
title: Game Test Architect & TDD Enforcer (Godot)
icon: 🎮🧪
whenToUse: |
Use for Godot game testing architecture, test-driven development enforcement,
whenToUse: Use for Godot game testing architecture, test-driven development enforcement,
performance validation, and gameplay quality assurance. Ensures all code is
test-first, performance targets are met, and player experience is validated.
Enforces GUT for GDScript and GoDotTest/GodotTestDriver for C# with TDD practices.
@@ -8943,7 +8942,7 @@ optional:
### 0) Load Core Config & Locate Story
- Read `bmad-core/core-config.yaml` and resolve `qa_root`, `story_root`, and `project_root`
- Read `.bmad-core/core-config.yaml` and resolve `qa_root`, `story_root`, and `project_root`
- Locate story file in `{story_root}/{epic}.{story}.*.md`
- HALT if missing and ask for correct story id/path
@@ -9043,7 +9042,7 @@ Status Rule:
## Blocking Conditions
- Missing `bmad-core/core-config.yaml`
- Missing `.bmad-core/core-config.yaml`
- Story file not found for `story_id`
- No QA artifacts found (neither gate nor assessments)
- HALT and request QA to generate at least a gate file (or proceed only with clear developer-provided fix list)
@@ -19903,7 +19902,7 @@ optional:
### 0) Load Core Config & Locate Story
- Read `bmad-core/core-config.yaml` and resolve `qa_root`, `story_root`, and `project_root`
- Read `.bmad-core/core-config.yaml` and resolve `qa_root`, `story_root`, and `project_root`
- Locate story file in `{story_root}/{epic}.{story}.*.md`
- HALT if missing and ask for correct story id/path
@@ -20003,7 +20002,7 @@ Status Rule:
## Blocking Conditions
- Missing `bmad-core/core-config.yaml`
- Missing `.bmad-core/core-config.yaml`
- Story file not found for `story_id`
- No QA artifacts found (neither gate nor assessments)
- HALT and request QA to generate at least a gate file (or proceed only with clear developer-provided fix list)

View File

@@ -505,8 +505,7 @@ agent:
id: qa
title: Test Architect & Quality Advisor
icon: 🧪
whenToUse: |
Use for comprehensive test architecture review, quality gate decisions,
whenToUse: Use for comprehensive test architecture review, quality gate decisions,
and code improvement. Provides thorough analysis including requirements
traceability, risk assessment, and test strategy.
Advisory only - teams choose their quality bar.
@@ -1141,7 +1140,7 @@ npx bmad-method install
## Core Configuration (core-config.yaml)
**New in V4**: The `bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
**New in V4**: The `.bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
### What is core-config.yaml?
@@ -6499,8 +6498,8 @@ Implement fixes based on QA results (gate and assessments) for a specific story.
```yaml
required:
- story_id: '{epic}.{story}' # e.g., "2.2"
- qa_root: from `bmad-core/core-config.yaml` key `qa.qaLocation` (e.g., `docs/project/qa`)
- story_root: from `bmad-core/core-config.yaml` key `devStoryLocation` (e.g., `docs/project/stories`)
- qa_root: from `.bmad-core/core-config.yaml` key `qa.qaLocation` (e.g., `docs/project/qa`)
- story_root: from `.bmad-core/core-config.yaml` key `devStoryLocation` (e.g., `docs/project/stories`)
optional:
- story_title: '{title}' # derive from story H1 if missing
@@ -6528,7 +6527,7 @@ optional:
### 0) Load Core Config & Locate Story
- Read `bmad-core/core-config.yaml` and resolve `qa_root` and `story_root`
- Read `.bmad-core/core-config.yaml` and resolve `qa_root` and `story_root`
- Locate story file in `{story_root}/{epic}.{story}.*.md`
- HALT if missing and ask for correct story id/path
@@ -6596,7 +6595,7 @@ Status Rule:
## Blocking Conditions
- Missing `bmad-core/core-config.yaml`
- Missing `.bmad-core/core-config.yaml`
- Story file not found for `story_id`
- No QA artifacts found (neither gate nor assessments)
- HALT and request QA to generate at least a gate file (or proceed only with clear developer-provided fix list)
@@ -9085,11 +9084,11 @@ Quick NFR validation focused on the core four: security, performance, reliabilit
```yaml
required:
- story_id: '{epic}.{story}' # e.g., "1.3"
- story_path: `bmad-core/core-config.yaml` for the `devStoryLocation`
- story_path: `.bmad-core/core-config.yaml` for the `devStoryLocation`
optional:
- architecture_refs: `bmad-core/core-config.yaml` for the `architecture.architectureFile`
- technical_preferences: `bmad-core/core-config.yaml` for the `technicalPreferences`
- architecture_refs: `.bmad-core/core-config.yaml` for the `architecture.architectureFile`
- technical_preferences: `.bmad-core/core-config.yaml` for the `technicalPreferences`
- acceptance_criteria: From story file
```
@@ -9439,7 +9438,7 @@ Generate a standalone quality gate file that provides a clear pass/fail decision
## Gate File Location
**ALWAYS** check the `bmad-core/core-config.yaml` for the `qa.qaLocation/gates`
**ALWAYS** check the `.bmad-core/core-config.yaml` for the `qa.qaLocation/gates`
Slug rules:
@@ -9549,7 +9548,7 @@ waiver:
## Output Requirements
1. **ALWAYS** create gate file at: `qa.qaLocation/gates` from `bmad-core/core-config.yaml`
1. **ALWAYS** create gate file at: `qa.qaLocation/gates` from `.bmad-core/core-config.yaml`
2. **ALWAYS** append this exact format to story's QA Results section:
```text
@@ -9774,7 +9773,7 @@ NFR assessment: qa.qaLocation/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
**Template and Directory:**
- Render from `../templates/qa-gate-tmpl.yaml`
- Create directory defined in `qa.qaLocation/gates` (see `bmad-core/core-config.yaml`) if missing
- Create directory defined in `qa.qaLocation/gates` (see `.bmad-core/core-config.yaml`) if missing
- Save to: `qa.qaLocation/gates/{epic}.{story}-{slug}.yml`
Gate file structure:

View File

@@ -976,7 +976,7 @@ npx bmad-method install
## Core Configuration (core-config.yaml)
**New in V4**: The `bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
**New in V4**: The `.bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
### What is core-config.yaml?

View File

@@ -353,8 +353,7 @@ agent:
id: qa
title: Test Architect & Quality Advisor
icon: 🧪
whenToUse: |
Use for comprehensive test architecture review, quality gate decisions,
whenToUse: Use for comprehensive test architecture review, quality gate decisions,
and code improvement. Provides thorough analysis including requirements
traceability, risk assessment, and test strategy.
Advisory only - teams choose their quality bar.
@@ -895,7 +894,7 @@ npx bmad-method install
## Core Configuration (core-config.yaml)
**New in V4**: The `bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
**New in V4**: The `.bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
### What is core-config.yaml?
@@ -3299,8 +3298,8 @@ Implement fixes based on QA results (gate and assessments) for a specific story.
```yaml
required:
- story_id: '{epic}.{story}' # e.g., "2.2"
- qa_root: from `bmad-core/core-config.yaml` key `qa.qaLocation` (e.g., `docs/project/qa`)
- story_root: from `bmad-core/core-config.yaml` key `devStoryLocation` (e.g., `docs/project/stories`)
- qa_root: from `.bmad-core/core-config.yaml` key `qa.qaLocation` (e.g., `docs/project/qa`)
- story_root: from `.bmad-core/core-config.yaml` key `devStoryLocation` (e.g., `docs/project/stories`)
optional:
- story_title: '{title}' # derive from story H1 if missing
@@ -3328,7 +3327,7 @@ optional:
### 0) Load Core Config & Locate Story
- Read `bmad-core/core-config.yaml` and resolve `qa_root` and `story_root`
- Read `.bmad-core/core-config.yaml` and resolve `qa_root` and `story_root`
- Locate story file in `{story_root}/{epic}.{story}.*.md`
- HALT if missing and ask for correct story id/path
@@ -3396,7 +3395,7 @@ Status Rule:
## Blocking Conditions
- Missing `bmad-core/core-config.yaml`
- Missing `.bmad-core/core-config.yaml`
- Story file not found for `story_id`
- No QA artifacts found (neither gate nor assessments)
- HALT and request QA to generate at least a gate file (or proceed only with clear developer-provided fix list)
@@ -3542,11 +3541,11 @@ Quick NFR validation focused on the core four: security, performance, reliabilit
```yaml
required:
- story_id: '{epic}.{story}' # e.g., "1.3"
- story_path: `bmad-core/core-config.yaml` for the `devStoryLocation`
- story_path: `.bmad-core/core-config.yaml` for the `devStoryLocation`
optional:
- architecture_refs: `bmad-core/core-config.yaml` for the `architecture.architectureFile`
- technical_preferences: `bmad-core/core-config.yaml` for the `technicalPreferences`
- architecture_refs: `.bmad-core/core-config.yaml` for the `architecture.architectureFile`
- technical_preferences: `.bmad-core/core-config.yaml` for the `technicalPreferences`
- acceptance_criteria: From story file
```
@@ -3896,7 +3895,7 @@ Generate a standalone quality gate file that provides a clear pass/fail decision
## Gate File Location
**ALWAYS** check the `bmad-core/core-config.yaml` for the `qa.qaLocation/gates`
**ALWAYS** check the `.bmad-core/core-config.yaml` for the `qa.qaLocation/gates`
Slug rules:
@@ -4006,7 +4005,7 @@ waiver:
## Output Requirements
1. **ALWAYS** create gate file at: `qa.qaLocation/gates` from `bmad-core/core-config.yaml`
1. **ALWAYS** create gate file at: `qa.qaLocation/gates` from `.bmad-core/core-config.yaml`
2. **ALWAYS** append this exact format to story's QA Results section:
```text
@@ -4231,7 +4230,7 @@ NFR assessment: qa.qaLocation/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
**Template and Directory:**
- Render from `../templates/qa-gate-tmpl.yaml`
- Create directory defined in `qa.qaLocation/gates` (see `bmad-core/core-config.yaml`) if missing
- Create directory defined in `qa.qaLocation/gates` (see `.bmad-core/core-config.yaml`) if missing
- Save to: `qa.qaLocation/gates/{epic}.{story}-{slug}.yml`
Gate file structure:

View File

@@ -922,7 +922,7 @@ npx bmad-method install
## Core Configuration (core-config.yaml)
**New in V4**: The `bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
**New in V4**: The `.bmad-core/core-config.yaml` file is a critical innovation that enables BMad to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
### What is core-config.yaml?