bmad-opencode-converter 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +275 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +73 -0
- package/dist/cli.js.map +1 -0
- package/dist/converter.d.ts +8 -0
- package/dist/converter.d.ts.map +1 -0
- package/dist/converter.js +211 -0
- package/dist/converter.js.map +1 -0
- package/dist/converters/agent-converter.d.ts +11 -0
- package/dist/converters/agent-converter.d.ts.map +1 -0
- package/dist/converters/agent-converter.js +157 -0
- package/dist/converters/agent-converter.js.map +1 -0
- package/dist/converters/index.d.ts +4 -0
- package/dist/converters/index.d.ts.map +1 -0
- package/dist/converters/index.js +4 -0
- package/dist/converters/index.js.map +1 -0
- package/dist/converters/task-converter.d.ts +5 -0
- package/dist/converters/task-converter.d.ts.map +1 -0
- package/dist/converters/task-converter.js +71 -0
- package/dist/converters/task-converter.js.map +1 -0
- package/dist/converters/workflow-converter.d.ts +5 -0
- package/dist/converters/workflow-converter.d.ts.map +1 -0
- package/dist/converters/workflow-converter.js +90 -0
- package/dist/converters/workflow-converter.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/agent-parser.d.ts +3 -0
- package/dist/parsers/agent-parser.d.ts.map +1 -0
- package/dist/parsers/agent-parser.js +143 -0
- package/dist/parsers/agent-parser.js.map +1 -0
- package/dist/parsers/csv-parser.d.ts +5 -0
- package/dist/parsers/csv-parser.d.ts.map +1 -0
- package/dist/parsers/csv-parser.js +49 -0
- package/dist/parsers/csv-parser.js.map +1 -0
- package/dist/parsers/index.d.ts +5 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +5 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/workflow-parser.d.ts +3 -0
- package/dist/parsers/workflow-parser.d.ts.map +1 -0
- package/dist/parsers/workflow-parser.js +88 -0
- package/dist/parsers/workflow-parser.js.map +1 -0
- package/dist/parsers/yaml-parser.d.ts +5 -0
- package/dist/parsers/yaml-parser.d.ts.map +1 -0
- package/dist/parsers/yaml-parser.js +65 -0
- package/dist/parsers/yaml-parser.js.map +1 -0
- package/dist/types/bmad.d.ts +148 -0
- package/dist/types/bmad.d.ts.map +1 -0
- package/dist/types/bmad.js +6 -0
- package/dist/types/bmad.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/opencode.d.ts +92 -0
- package/dist/types/opencode.d.ts.map +1 -0
- package/dist/types/opencode.js +2 -0
- package/dist/types/opencode.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# BMAD to OpenCode Converter
|
|
2
|
+
|
|
3
|
+
Convert [BMAD-METHOD](https://github.com/bmad-code-org/BMAD-METHOD) modules to [OpenCode](https://opencode.ai) plugins.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx bmad-opencode-converter --source <bmad-dir> --output <output-dir>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or install globally:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g bmad-opencode-converter
|
|
15
|
+
bmad-convert --source <bmad-dir> --output <output-dir>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Convert BMAD to OpenCode
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Convert from _bmad directory to current project
|
|
24
|
+
npx bmad-opencode-converter --source ./_bmad --output ./ --verbose
|
|
25
|
+
|
|
26
|
+
# Convert to a specific output directory
|
|
27
|
+
npx bmad-opencode-converter -s ./_bmad -o ./my-opencode-project -v
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Options
|
|
31
|
+
|
|
32
|
+
| Option | Short | Description |
|
|
33
|
+
|--------|-------|-------------|
|
|
34
|
+
| `--source` | `-s` | Path to BMAD `_bmad` directory |
|
|
35
|
+
| `--output` | `-o` | Output directory for OpenCode files |
|
|
36
|
+
| `--verbose` | `-v` | Show detailed conversion progress |
|
|
37
|
+
| `--help` | `-h` | Show help message |
|
|
38
|
+
|
|
39
|
+
## Conversion Mapping
|
|
40
|
+
|
|
41
|
+
| BMAD Component | OpenCode Output |
|
|
42
|
+
|----------------|-----------------|
|
|
43
|
+
| Agent (persona, menu, rules) | `.opencode/agents/*.md` + `.opencode/skills/*/SKILL.md` |
|
|
44
|
+
| Workflow (yaml + instructions) | `.opencode/skills/*/SKILL.md` |
|
|
45
|
+
| Task (standalone instructions) | `.opencode/skills/*/SKILL.md` |
|
|
46
|
+
|
|
47
|
+
## Output Structure
|
|
48
|
+
|
|
49
|
+
After conversion, your project will have:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
your-project/
|
|
53
|
+
├── .opencode/
|
|
54
|
+
│ ├── agents/ # OpenCode agent definitions
|
|
55
|
+
│ │ ├── bmm-dev.md
|
|
56
|
+
│ │ ├── bmm-pm.md
|
|
57
|
+
│ │ ├── cis-storyteller.md
|
|
58
|
+
│ │ └── ...
|
|
59
|
+
│ └── skills/ # OpenCode skill definitions
|
|
60
|
+
│ ├── bmad-bmm-dev-story/
|
|
61
|
+
│ │ └── SKILL.md
|
|
62
|
+
│ ├── bmad-bmm-create-prd/
|
|
63
|
+
│ │ └── SKILL.md
|
|
64
|
+
│ ├── bmad-cis-storytelling/
|
|
65
|
+
│ │ └── SKILL.md
|
|
66
|
+
│ └── ...
|
|
67
|
+
└── ...
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## After Conversion: Using OpenCode Plugins
|
|
73
|
+
|
|
74
|
+
### 1. Verify Generated Files
|
|
75
|
+
|
|
76
|
+
Check that the conversion created the expected files:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
ls .opencode/agents/ # Should list agent .md files
|
|
80
|
+
ls .opencode/skills/ # Should list skill directories
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 2. Using Converted Agents
|
|
84
|
+
|
|
85
|
+
Converted BMAD agents are available as OpenCode subagents. You can:
|
|
86
|
+
|
|
87
|
+
**Switch to an agent** using Tab or your configured `switch_agent` keybind.
|
|
88
|
+
|
|
89
|
+
**Invoke via @ mention** in your message:
|
|
90
|
+
```
|
|
91
|
+
@bmm-dev implement the user authentication feature
|
|
92
|
+
@cis-storyteller help me craft a product narrative
|
|
93
|
+
@bmm-architect review the system design
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Available agents include:**
|
|
97
|
+
- `bmm-dev` - Developer Agent (Amelia)
|
|
98
|
+
- `bmm-pm` - Product Manager (John)
|
|
99
|
+
- `bmm-architect` - System Architect (Winston)
|
|
100
|
+
- `bmm-analyst` - Business Analyst (Mary)
|
|
101
|
+
- `bmm-qa` - QA Engineer (Quinn)
|
|
102
|
+
- `cis-storyteller` - Master Storyteller (Sophia)
|
|
103
|
+
- `tea-tea` - Test Architect (Murat)
|
|
104
|
+
- And more...
|
|
105
|
+
|
|
106
|
+
### 3. Using Converted Skills
|
|
107
|
+
|
|
108
|
+
Skills are loaded on-demand. OpenCode agents can invoke them automatically, or you can request them explicitly:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Load the bmad-bmm-create-prd skill and help me create a PRD
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Workflow skills include:**
|
|
115
|
+
- `bmad-bmm-create-prd` - Create Product Requirements Document
|
|
116
|
+
- `bmad-bmm-create-architecture` - Design system architecture
|
|
117
|
+
- `bmad-bmm-dev-story` - Implement user stories
|
|
118
|
+
- `bmad-bmm-code-review` - Adversarial code review
|
|
119
|
+
- `bmad-cis-storytelling` - Craft compelling narratives
|
|
120
|
+
- `bmad-tea-testarch-automate` - Generate test automation
|
|
121
|
+
|
|
122
|
+
### 4. Configuring Permissions
|
|
123
|
+
|
|
124
|
+
Edit `opencode.json` to control agent/skill access:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"$schema": "https://opencode.ai/config.json",
|
|
129
|
+
"permission": {
|
|
130
|
+
"skill": {
|
|
131
|
+
"*": "allow",
|
|
132
|
+
"bmad-*": "allow"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"agent": {
|
|
136
|
+
"bmm-dev": {
|
|
137
|
+
"permission": {
|
|
138
|
+
"bash": "allow",
|
|
139
|
+
"edit": "allow"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 5. Customizing Converted Agents
|
|
147
|
+
|
|
148
|
+
Edit the generated agent files to customize behavior:
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
---
|
|
152
|
+
description: "Developer Agent"
|
|
153
|
+
mode: subagent
|
|
154
|
+
model: anthropic/claude-sonnet-4-20250514 # Add custom model
|
|
155
|
+
temperature: 0.2 # Adjust temperature
|
|
156
|
+
tools:
|
|
157
|
+
write: true
|
|
158
|
+
edit: true
|
|
159
|
+
bash: true
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
Your customized prompt here...
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 6. Adding to npm Package (Optional)
|
|
166
|
+
|
|
167
|
+
To distribute as an npm package, add to your `opencode.json`:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"plugin": ["your-bmad-opencode-plugin"]
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Example: Full Workflow
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# 1. Install BMAD to your project
|
|
181
|
+
npx bmad-method install
|
|
182
|
+
|
|
183
|
+
# 2. Convert to OpenCode format
|
|
184
|
+
npx bmad-opencode-converter --source ./_bmad --output ./ --verbose
|
|
185
|
+
|
|
186
|
+
# 3. Start OpenCode
|
|
187
|
+
opencode
|
|
188
|
+
|
|
189
|
+
# 4. Use converted agents
|
|
190
|
+
# Type: @bmm-pm help me define the product requirements
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Conversion Details
|
|
196
|
+
|
|
197
|
+
### Agent Conversion
|
|
198
|
+
|
|
199
|
+
Each BMAD agent produces:
|
|
200
|
+
|
|
201
|
+
1. **OpenCode Agent** (`.opencode/agents/{module}-{name}.md`)
|
|
202
|
+
- Persona as system prompt
|
|
203
|
+
- Mode set to `subagent`
|
|
204
|
+
- Full tool access enabled
|
|
205
|
+
|
|
206
|
+
2. **OpenCode Skill** (`.opencode/skills/bmad-{module}-{name}/SKILL.md`)
|
|
207
|
+
- Activation steps preserved
|
|
208
|
+
- Menu commands documented
|
|
209
|
+
- Workflow references included
|
|
210
|
+
|
|
211
|
+
### Workflow Conversion
|
|
212
|
+
|
|
213
|
+
Each BMAD workflow produces a skill with:
|
|
214
|
+
- Step-by-step instructions
|
|
215
|
+
- Questions to ask at each step
|
|
216
|
+
- Output template (if defined)
|
|
217
|
+
- Supporting data file references
|
|
218
|
+
|
|
219
|
+
### Task Conversion
|
|
220
|
+
|
|
221
|
+
Each BMAD task produces a skill with:
|
|
222
|
+
- Task instructions (cleaned from XML)
|
|
223
|
+
- Standalone execution guidance
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Troubleshooting
|
|
228
|
+
|
|
229
|
+
### "No manifest files found"
|
|
230
|
+
|
|
231
|
+
Ensure you're pointing to the correct `_bmad` directory:
|
|
232
|
+
```bash
|
|
233
|
+
# Check manifest exists
|
|
234
|
+
ls ./_bmad/_config/agent-manifest.csv
|
|
235
|
+
|
|
236
|
+
# Run with correct path
|
|
237
|
+
npx bmad-opencode-converter --source ./_bmad --output ./
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Agent names look wrong
|
|
241
|
+
|
|
242
|
+
Agent IDs are extracted from BMAD paths. Some duplication (e.g., `storyteller-storyteller`) comes from nested directory structures in BMAD.
|
|
243
|
+
|
|
244
|
+
### Skills not loading
|
|
245
|
+
|
|
246
|
+
1. Check skill name follows pattern: lowercase alphanumeric with single hyphens
|
|
247
|
+
2. Verify `SKILL.md` exists in the skill folder
|
|
248
|
+
3. Check permissions in `opencode.json`
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Development
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
# Clone and install
|
|
256
|
+
git clone <repo-url>
|
|
257
|
+
cd bmad-opencode-converter
|
|
258
|
+
npm install
|
|
259
|
+
|
|
260
|
+
# Run tests with sample data
|
|
261
|
+
npm test
|
|
262
|
+
|
|
263
|
+
# Build for distribution
|
|
264
|
+
npm run build
|
|
265
|
+
|
|
266
|
+
# Run locally without build
|
|
267
|
+
npm run dev -- --source ./_bmad --output ./output --verbose
|
|
268
|
+
|
|
269
|
+
# Clean output
|
|
270
|
+
npm run clean
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## License
|
|
274
|
+
|
|
275
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { convert } from './converter.js';
|
|
3
|
+
function parseArgs(args) {
|
|
4
|
+
let source = '';
|
|
5
|
+
let output = '';
|
|
6
|
+
let verbose = false;
|
|
7
|
+
for (let i = 0; i < args.length; i++) {
|
|
8
|
+
const arg = args[i];
|
|
9
|
+
if (arg === '--source' || arg === '-s') {
|
|
10
|
+
source = args[++i] || '';
|
|
11
|
+
}
|
|
12
|
+
else if (arg === '--output' || arg === '-o') {
|
|
13
|
+
output = args[++i] || '';
|
|
14
|
+
}
|
|
15
|
+
else if (arg === '--verbose' || arg === '-v') {
|
|
16
|
+
verbose = true;
|
|
17
|
+
}
|
|
18
|
+
else if (arg === '--help' || arg === '-h') {
|
|
19
|
+
printHelp();
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { source, output, verbose };
|
|
24
|
+
}
|
|
25
|
+
function printHelp() {
|
|
26
|
+
console.log(`
|
|
27
|
+
BMAD to OpenCode Converter
|
|
28
|
+
|
|
29
|
+
Usage: bmad-convert --source <dir> --output <dir> [options]
|
|
30
|
+
|
|
31
|
+
Options:
|
|
32
|
+
-s, --source <dir> Path to BMAD _bmad directory
|
|
33
|
+
-o, --output <dir> Output directory for OpenCode files
|
|
34
|
+
-v, --verbose Enable verbose output
|
|
35
|
+
-h, --help Show this help message
|
|
36
|
+
|
|
37
|
+
Examples:
|
|
38
|
+
bmad-convert --source ./_bmad --output ./
|
|
39
|
+
bmad-convert -s tests/sources/_bmad -o tests/output -v
|
|
40
|
+
`);
|
|
41
|
+
}
|
|
42
|
+
async function main() {
|
|
43
|
+
const args = process.argv.slice(2);
|
|
44
|
+
const { source, output, verbose } = parseArgs(args);
|
|
45
|
+
if (!source || !output) {
|
|
46
|
+
console.error('Error: Both --source and --output are required');
|
|
47
|
+
printHelp();
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const result = await convert({
|
|
52
|
+
sourceDir: source,
|
|
53
|
+
outputDir: output,
|
|
54
|
+
verbose,
|
|
55
|
+
});
|
|
56
|
+
if (result.errors.length > 0) {
|
|
57
|
+
console.error('\nErrors:');
|
|
58
|
+
for (const error of result.errors) {
|
|
59
|
+
console.error(` - ${error}`);
|
|
60
|
+
}
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
if (!verbose) {
|
|
64
|
+
console.log(`Converted ${result.agents.length} agents and ${result.skills.length} skills to ${output}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
console.error('Conversion failed:', err);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
main();
|
|
73
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,SAAS,SAAS,CAAC,IAAc;IAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACvC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3B,CAAC;aAAM,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAC9C,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3B,CAAC;aAAM,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAC/C,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;aAAM,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAC5C,SAAS,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;CAcb,CAAC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAEpD,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChE,SAAS,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;YAC3B,SAAS,EAAE,MAAM;YACjB,SAAS,EAAE,MAAM;YACjB,OAAO;SACR,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAC3B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClC,OAAO,CAAC,KAAK,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,MAAM,eAAe,MAAM,CAAC,MAAM,CAAC,MAAM,cAAc,MAAM,EAAE,CAAC,CAAC;QAC1G,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OpenCodeConversionResult } from './types/index.js';
|
|
2
|
+
export interface ConversionOptions {
|
|
3
|
+
sourceDir: string;
|
|
4
|
+
outputDir: string;
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function convert(options: ConversionOptions): Promise<OpenCodeConversionResult>;
|
|
8
|
+
//# sourceMappingURL=converter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"converter.d.ts","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,wBAAwB,EAAgC,MAAM,kBAAkB,CAAC;AAQ/F,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAqKD,wBAAsB,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA+E3F"}
|