@morozinc/opencode-bmad-plugin 0.0.0-stage → 0.1.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.
Files changed (104) hide show
  1. package/LICENSE +31 -0
  2. package/NOTICE.md +6 -0
  3. package/README.md +64 -2
  4. package/dist/gui-experimental.cjs +64 -0
  5. package/docs/screenshots/artifact-storage.png +0 -0
  6. package/package.json +53 -4
  7. package/skills/bmad-code-review/SKILL.md +23 -0
  8. package/skills/bmad-code-review/reference/SKILL.md +90 -0
  9. package/skills/bmad-code-review/reference/customize.toml +41 -0
  10. package/skills/bmad-code-review/reference/steps/step-01-gather-context.md +85 -0
  11. package/skills/bmad-code-review/reference/steps/step-02-review.md +35 -0
  12. package/skills/bmad-code-review/reference/steps/step-03-triage.md +49 -0
  13. package/skills/bmad-code-review/reference/steps/step-04-present.md +132 -0
  14. package/skills/bmad-create-architecture/SKILL.md +23 -0
  15. package/skills/bmad-create-architecture/reference/SKILL.md +74 -0
  16. package/skills/bmad-create-architecture/reference/architecture-decision-template.md +12 -0
  17. package/skills/bmad-create-architecture/reference/customize.toml +41 -0
  18. package/skills/bmad-create-architecture/reference/data/domain-complexity.csv +13 -0
  19. package/skills/bmad-create-architecture/reference/data/project-types.csv +7 -0
  20. package/skills/bmad-create-architecture/reference/steps/step-01-init.md +153 -0
  21. package/skills/bmad-create-architecture/reference/steps/step-01b-continue.md +173 -0
  22. package/skills/bmad-create-architecture/reference/steps/step-02-context.md +224 -0
  23. package/skills/bmad-create-architecture/reference/steps/step-03-starter.md +329 -0
  24. package/skills/bmad-create-architecture/reference/steps/step-04-decisions.md +318 -0
  25. package/skills/bmad-create-architecture/reference/steps/step-05-patterns.md +359 -0
  26. package/skills/bmad-create-architecture/reference/steps/step-06-structure.md +379 -0
  27. package/skills/bmad-create-architecture/reference/steps/step-07-validation.md +361 -0
  28. package/skills/bmad-create-architecture/reference/steps/step-08-complete.md +82 -0
  29. package/skills/bmad-create-epics-and-stories/SKILL.md +23 -0
  30. package/skills/bmad-create-epics-and-stories/reference/SKILL.md +93 -0
  31. package/skills/bmad-create-epics-and-stories/reference/customize.toml +41 -0
  32. package/skills/bmad-create-epics-and-stories/reference/steps/step-01-validate-prerequisites.md +255 -0
  33. package/skills/bmad-create-epics-and-stories/reference/steps/step-02-design-epics.md +242 -0
  34. package/skills/bmad-create-epics-and-stories/reference/steps/step-03-create-stories.md +255 -0
  35. package/skills/bmad-create-epics-and-stories/reference/steps/step-04-final-validation.md +143 -0
  36. package/skills/bmad-create-epics-and-stories/reference/templates/epics-template.md +61 -0
  37. package/skills/bmad-create-story/SKILL.md +23 -0
  38. package/skills/bmad-create-story/reference/SKILL.md +429 -0
  39. package/skills/bmad-create-story/reference/checklist.md +357 -0
  40. package/skills/bmad-create-story/reference/customize.toml +41 -0
  41. package/skills/bmad-create-story/reference/discover-inputs.md +88 -0
  42. package/skills/bmad-create-story/reference/template.md +49 -0
  43. package/skills/bmad-dev-story/SKILL.md +23 -0
  44. package/skills/bmad-dev-story/reference/SKILL.md +500 -0
  45. package/skills/bmad-dev-story/reference/checklist.md +80 -0
  46. package/skills/bmad-dev-story/reference/customize.toml +41 -0
  47. package/skills/bmad-document-project/SKILL.md +23 -0
  48. package/skills/bmad-document-project/reference/SKILL.md +62 -0
  49. package/skills/bmad-document-project/reference/checklist.md +245 -0
  50. package/skills/bmad-document-project/reference/customize.toml +41 -0
  51. package/skills/bmad-document-project/reference/documentation-requirements.csv +12 -0
  52. package/skills/bmad-document-project/reference/instructions.md +128 -0
  53. package/skills/bmad-document-project/reference/templates/deep-dive-template.md +345 -0
  54. package/skills/bmad-document-project/reference/templates/index-template.md +169 -0
  55. package/skills/bmad-document-project/reference/templates/project-overview-template.md +103 -0
  56. package/skills/bmad-document-project/reference/templates/project-scan-report-schema.json +160 -0
  57. package/skills/bmad-document-project/reference/templates/source-tree-template.md +135 -0
  58. package/skills/bmad-document-project/reference/workflows/deep-dive-instructions.md +300 -0
  59. package/skills/bmad-document-project/reference/workflows/deep-dive-workflow.md +34 -0
  60. package/skills/bmad-document-project/reference/workflows/full-scan-instructions.md +1108 -0
  61. package/skills/bmad-document-project/reference/workflows/full-scan-workflow.md +34 -0
  62. package/skills/bmad-generate-project-context/SKILL.md +23 -0
  63. package/skills/bmad-generate-project-context/reference/SKILL.md +81 -0
  64. package/skills/bmad-generate-project-context/reference/customize.toml +41 -0
  65. package/skills/bmad-generate-project-context/reference/project-context-template.md +21 -0
  66. package/skills/bmad-generate-project-context/reference/steps/step-01-discover.md +186 -0
  67. package/skills/bmad-generate-project-context/reference/steps/step-02-generate.md +321 -0
  68. package/skills/bmad-generate-project-context/reference/steps/step-03-complete.md +284 -0
  69. package/skills/bmad-help/SKILL.md +19 -0
  70. package/skills/bmad-help/reference/SKILL.md +75 -0
  71. package/skills/bmad-prd/SKILL.md +23 -0
  72. package/skills/bmad-prd/reference/SKILL.md +92 -0
  73. package/skills/bmad-prd/reference/assets/headless-schemas.md +76 -0
  74. package/skills/bmad-prd/reference/assets/prd-template.md +165 -0
  75. package/skills/bmad-prd/reference/assets/prd-validation-checklist.md +135 -0
  76. package/skills/bmad-prd/reference/assets/validation-report-template.html +325 -0
  77. package/skills/bmad-prd/reference/customize.toml +147 -0
  78. package/skills/bmad-prd/reference/references/headless.md +39 -0
  79. package/skills/bmad-prd/reference/references/validate.md +97 -0
  80. package/skills/bmad-product-brief/SKILL.md +22 -0
  81. package/skills/bmad-product-brief/reference/SKILL.md +91 -0
  82. package/skills/bmad-product-brief/reference/assets/brief-template.md +41 -0
  83. package/skills/bmad-product-brief/reference/customize.toml +99 -0
  84. package/skills/bmad-quick-dev/SKILL.md +26 -0
  85. package/skills/bmad-quick-dev/reference/SKILL.md +111 -0
  86. package/skills/bmad-quick-dev/reference/compile-epic-context.md +62 -0
  87. package/skills/bmad-quick-dev/reference/customize.toml +41 -0
  88. package/skills/bmad-quick-dev/reference/spec-template.md +88 -0
  89. package/skills/bmad-quick-dev/reference/step-01-clarify-and-route.md +100 -0
  90. package/skills/bmad-quick-dev/reference/step-02-plan.md +47 -0
  91. package/skills/bmad-quick-dev/reference/step-03-implement.md +41 -0
  92. package/skills/bmad-quick-dev/reference/step-04-review.md +50 -0
  93. package/skills/bmad-quick-dev/reference/step-05-present.md +78 -0
  94. package/skills/bmad-quick-dev/reference/step-oneshot.md +71 -0
  95. package/skills/bmad-quick-dev/reference/sync-sprint-status.md +19 -0
  96. package/skills/bmad-sprint-planning/SKILL.md +23 -0
  97. package/skills/bmad-sprint-planning/reference/SKILL.md +300 -0
  98. package/skills/bmad-sprint-planning/reference/checklist.md +33 -0
  99. package/skills/bmad-sprint-planning/reference/customize.toml +41 -0
  100. package/skills/bmad-sprint-planning/reference/sprint-status-template.yaml +56 -0
  101. package/src/gui.tsx +127 -0
  102. package/src/index.ts +114 -0
  103. package/src/rpc.ts +27 -0
  104. package/src/storage.ts +21 -0
@@ -0,0 +1,300 @@
1
+ ---
2
+ name: bmad-sprint-planning
3
+ description: 'Generate sprint status tracking from epics. Use when the user says "run sprint planning" or "generate sprint plan"'
4
+ ---
5
+
6
+ # Sprint Planning Workflow
7
+
8
+ **Goal:** Generate sprint status tracking from epics, detecting current story statuses and building a complete sprint-status.yaml file.
9
+
10
+ **Your Role:** You are a Developer generating and maintaining sprint tracking. Parse epic files, detect story statuses, and produce a structured sprint-status.yaml.
11
+
12
+ ## Conventions
13
+
14
+ - Bare paths (e.g. `checklist.md`) resolve from the skill root.
15
+ - `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
16
+ - `{project-root}`-prefixed paths resolve from the project working directory.
17
+ - `{skill-name}` resolves to the skill directory's basename.
18
+
19
+ ## On Activation
20
+
21
+ ### Step 1: Resolve the Workflow Block
22
+
23
+ Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
24
+
25
+ **If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
26
+
27
+ 1. `{skill-root}/customize.toml` — defaults
28
+ 2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
29
+ 3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
30
+
31
+ Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
32
+
33
+ ### Step 2: Execute Prepend Steps
34
+
35
+ Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
36
+
37
+ ### Step 3: Load Persistent Facts
38
+
39
+ Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
40
+
41
+ ### Step 4: Load Config
42
+
43
+ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
44
+
45
+ - `project_name`, `user_name`
46
+ - `communication_language`, `document_output_language`
47
+ - `implementation_artifacts`
48
+ - `planning_artifacts`
49
+ - `date` as system-generated current datetime
50
+ - `project_context` = `**/project-context.md` (load if exists)
51
+ - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
52
+ - Generate all documents in `{document_output_language}`
53
+
54
+ ### Step 5: Greet the User
55
+
56
+ Greet `{user_name}`, speaking in `{communication_language}`.
57
+
58
+ ### Step 6: Execute Append Steps
59
+
60
+ Execute each entry in `{workflow.activation_steps_append}` in order.
61
+
62
+ Activation is complete. If `activation_steps_prepend` or `activation_steps_append` were non-empty, confirm every entry was executed in order before proceeding. Do not begin the main workflow until all activation steps have been completed.
63
+
64
+ ## Paths
65
+
66
+ - `tracking_system` = `file-system`
67
+ - `project_key` = `NOKEY`
68
+ - `story_location` = `{implementation_artifacts}`
69
+ - `story_location_absolute` = `{implementation_artifacts}`
70
+ - `epics_location` = `{planning_artifacts}`
71
+ - `epics_pattern` = `*epic*.md`
72
+ - `status_file` = `{implementation_artifacts}/sprint-status.yaml`
73
+
74
+ ## Input Files
75
+
76
+ | Input | Path | Load Strategy |
77
+ |-------|------|---------------|
78
+ | Epics | `{planning_artifacts}/*epic*.md` (whole) or `{planning_artifacts}/*epic*/*.md` (sharded) | FULL_LOAD |
79
+
80
+ ## Execution
81
+
82
+ ### Document Discovery - Full Epic Loading
83
+
84
+ **Strategy**: Sprint planning needs ALL epics and stories to build complete status tracking.
85
+
86
+ **Epic Discovery Process:**
87
+
88
+ 1. **Search for whole document first** - Look for `epics.md`, `bmm-epics.md`, or any `*epic*.md` file
89
+ 2. **Check for sharded version** - If whole document not found, look for `epics/index.md`
90
+ 3. **If sharded version found**:
91
+ - Read `index.md` to understand the document structure
92
+ - Read ALL epic section files listed in the index (e.g., `epic-1.md`, `epic-2.md`, etc.)
93
+ - Process all epics and their stories from the combined content
94
+ - This ensures complete sprint status coverage
95
+ 4. **Priority**: If both whole and sharded versions exist, use the whole document
96
+
97
+ **Fuzzy matching**: Be flexible with document names - users may use variations like `epics.md`, `bmm-epics.md`, `user-stories.md`, etc.
98
+
99
+ <workflow>
100
+
101
+ <step n="1" goal="Parse epic files and extract all work items">
102
+ <action>Load {project_context} for project-wide patterns and conventions (if exists)</action>
103
+ <action>Communicate in {communication_language} with {user_name}</action>
104
+ <action>Look for all files matching `{epics_pattern}` in {epics_location}</action>
105
+ <action>Could be a single `epics.md` file or multiple `epic-1.md`, `epic-2.md` files</action>
106
+
107
+ <action>For each epic file found, extract:</action>
108
+
109
+ - Epic numbers from headers like `## Epic 1:` or `## Epic 2:`
110
+ - Story IDs and titles from patterns like `### Story 1.1: User Authentication`
111
+ - Convert story format from `Epic.Story: Title` to kebab-case key: `epic-story-title`
112
+
113
+ **Story ID Conversion Rules:**
114
+
115
+ - Original: `### Story 1.1: User Authentication`
116
+ - Replace period with dash: `1-1`
117
+ - Convert title to kebab-case: `user-authentication`
118
+ - Final key: `1-1-user-authentication`
119
+
120
+ <action>Build complete inventory of all epics and stories from all epic files</action>
121
+ </step>
122
+
123
+ <step n="2" goal="Build sprint status structure">
124
+ <action>For each epic found, create entries in this order:</action>
125
+
126
+ 1. **Epic entry** - Key: `epic-{num}`, Default status: `backlog`
127
+ 2. **Story entries** - Key: `{epic}-{story}-{title}`, Default status: `backlog`
128
+ 3. **Retrospective entry** - Key: `epic-{num}-retrospective`, Default status: `optional`
129
+
130
+ **Example structure:**
131
+
132
+ ```yaml
133
+ development_status:
134
+ epic-1: backlog
135
+ 1-1-user-authentication: backlog
136
+ 1-2-account-management: backlog
137
+ epic-1-retrospective: optional
138
+ ```
139
+
140
+ </step>
141
+
142
+ <step n="3" goal="Apply intelligent status detection">
143
+ <action>For each story, detect current status by checking files:</action>
144
+
145
+ **Story file detection:**
146
+
147
+ - Check: `{story_location_absolute}/{story-key}.md` (e.g., `stories/1-1-user-authentication.md`)
148
+ - If exists → upgrade status to at least `ready-for-dev`
149
+
150
+ **Preservation rule:**
151
+
152
+ - If existing `{status_file}` exists and has more advanced status, preserve it
153
+ - Never downgrade status (e.g., don't change `done` to `ready-for-dev`)
154
+
155
+ **Status Flow Reference:**
156
+
157
+ - Epic: `backlog` → `in-progress` → `done`
158
+ - Story: `backlog` → `ready-for-dev` → `in-progress` → `review` → `done`
159
+ - Retrospective: `optional` ↔ `done`
160
+ </step>
161
+
162
+ <step n="4" goal="Generate sprint status file">
163
+ <action>Create or update {status_file} with:</action>
164
+
165
+ **File Structure:**
166
+
167
+ ```yaml
168
+ # generated: {date}
169
+ # last_updated: {date}
170
+ # project: {project_name}
171
+ # project_key: {project_key}
172
+ # tracking_system: {tracking_system}
173
+ # story_location: {story_location}
174
+
175
+ # STATUS DEFINITIONS:
176
+ # ==================
177
+ # Epic Status:
178
+ # - backlog: Epic not yet started
179
+ # - in-progress: Epic actively being worked on
180
+ # - done: All stories in epic completed
181
+ #
182
+ # Epic Status Transitions:
183
+ # - backlog → in-progress: Automatically when first story is created (via create-story)
184
+ # - in-progress → done: Manually when all stories reach 'done' status
185
+ #
186
+ # Story Status:
187
+ # - backlog: Story only exists in epic file
188
+ # - ready-for-dev: Story file created in stories folder
189
+ # - in-progress: Developer actively working on implementation
190
+ # - review: Ready for code review (via Dev's code-review workflow)
191
+ # - done: Story completed
192
+ #
193
+ # Retrospective Status:
194
+ # - optional: Can be completed but not required
195
+ # - done: Retrospective has been completed
196
+ #
197
+ # WORKFLOW NOTES:
198
+ # ===============
199
+ # - Epic transitions to 'in-progress' automatically when first story is created
200
+ # - Stories can be worked in parallel if team capacity allows
201
+ # - Developer typically creates next story after previous one is 'done' to incorporate learnings
202
+ # - Dev moves story to 'review', then runs code-review (fresh context, different LLM recommended)
203
+
204
+ generated: { date }
205
+ last_updated: { date }
206
+ project: { project_name }
207
+ project_key: { project_key }
208
+ tracking_system: { tracking_system }
209
+ story_location: { story_location }
210
+
211
+ development_status:
212
+ # All epics, stories, and retrospectives in order
213
+ ```
214
+
215
+ <action>Write the complete sprint status YAML to {status_file}</action>
216
+ <action>CRITICAL: Metadata appears TWICE - once as comments (#) for documentation, once as YAML key:value fields for parsing</action>
217
+ <action>Ensure all items are ordered: epic, its stories, its retrospective, next epic...</action>
218
+ </step>
219
+
220
+ <step n="5" goal="Validate and report">
221
+ <action>Perform validation checks:</action>
222
+
223
+ - [ ] Every epic in epic files appears in {status_file}
224
+ - [ ] Every story in epic files appears in {status_file}
225
+ - [ ] Every epic has a corresponding retrospective entry
226
+ - [ ] No items in {status_file} that don't exist in epic files
227
+ - [ ] All status values are legal (match state machine definitions)
228
+ - [ ] File is valid YAML syntax
229
+
230
+ <action>Count totals:</action>
231
+
232
+ - Total epics: {{epic_count}}
233
+ - Total stories: {{story_count}}
234
+ - Epics in-progress: {{in_progress_count}}
235
+ - Stories done: {{done_count}}
236
+
237
+ <action>Display completion summary to {user_name} in {communication_language}:</action>
238
+
239
+ **Sprint Status Generated Successfully**
240
+
241
+ - **File Location:** {status_file}
242
+ - **Total Epics:** {{epic_count}}
243
+ - **Total Stories:** {{story_count}}
244
+ - **Epics In Progress:** {{in_progress_count}}
245
+ - **Stories Completed:** {{done_count}}
246
+
247
+ **Next Steps:**
248
+
249
+ 1. Review the generated {status_file}
250
+ 2. Use this file to track development progress
251
+ 3. Agents will update statuses as they work
252
+ 4. Re-run this workflow to refresh auto-detected statuses
253
+
254
+ <action>Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` — if the resolved value is non-empty, follow it as the final terminal instruction before exiting.</action>
255
+ </step>
256
+
257
+ </workflow>
258
+
259
+ ## Additional Documentation
260
+
261
+ ### Status State Machine
262
+
263
+ **Epic Status Flow:**
264
+
265
+ ```
266
+ backlog → in-progress → done
267
+ ```
268
+
269
+ - **backlog**: Epic not yet started
270
+ - **in-progress**: Epic actively being worked on (stories being created/implemented)
271
+ - **done**: All stories in epic completed
272
+
273
+ **Story Status Flow:**
274
+
275
+ ```
276
+ backlog → ready-for-dev → in-progress → review → done
277
+ ```
278
+
279
+ - **backlog**: Story only exists in epic file
280
+ - **ready-for-dev**: Story file created (e.g., `stories/1-3-plant-naming.md`)
281
+ - **in-progress**: Developer actively working
282
+ - **review**: Ready for code review (via Dev's code-review workflow)
283
+ - **done**: Completed
284
+
285
+ **Retrospective Status:**
286
+
287
+ ```
288
+ optional ↔ done
289
+ ```
290
+
291
+ - **optional**: Ready to be conducted but not required
292
+ - **done**: Finished
293
+
294
+ ### Guidelines
295
+
296
+ 1. **Epic Activation**: Mark epic as `in-progress` when starting work on its first story
297
+ 2. **Sequential Default**: Stories are typically worked in order, but parallel work is supported
298
+ 3. **Parallel Work Supported**: Multiple stories can be `in-progress` if team capacity allows
299
+ 4. **Review Before Done**: Stories should pass through `review` before `done`
300
+ 5. **Learning Transfer**: Developer typically creates next story after previous one is `done` to incorporate learnings
@@ -0,0 +1,33 @@
1
+ # Sprint Planning Validation Checklist
2
+
3
+ ## Core Validation
4
+
5
+ ### Complete Coverage Check
6
+
7
+ - [ ] Every epic found in epic\*.md files appears in sprint-status.yaml
8
+ - [ ] Every story found in epic\*.md files appears in sprint-status.yaml
9
+ - [ ] Every epic has a corresponding retrospective entry
10
+ - [ ] No items in sprint-status.yaml that don't exist in epic files
11
+
12
+ ### Parsing Verification
13
+
14
+ Compare epic files against generated sprint-status.yaml:
15
+
16
+ ```
17
+ Epic Files Contains: Sprint Status Contains:
18
+ ✓ Epic 1 ✓ epic-1: [status]
19
+ ✓ Story 1.1: User Auth ✓ 1-1-user-auth: [status]
20
+ ✓ Story 1.2: Account Mgmt ✓ 1-2-account-mgmt: [status]
21
+ ✓ Story 1.3: Plant Naming ✓ 1-3-plant-naming: [status]
22
+ ✓ epic-1-retrospective: [status]
23
+ ✓ Epic 2 ✓ epic-2: [status]
24
+ ✓ Story 2.1: Personality Model ✓ 2-1-personality-model: [status]
25
+ ✓ Story 2.2: Chat Interface ✓ 2-2-chat-interface: [status]
26
+ ✓ epic-2-retrospective: [status]
27
+ ```
28
+
29
+ ### Final Check
30
+
31
+ - [ ] Total count of epics matches
32
+ - [ ] Total count of stories matches
33
+ - [ ] All items are in the expected order (epic, stories, retrospective)
@@ -0,0 +1,41 @@
1
+ # DO NOT EDIT -- overwritten on every update.
2
+ #
3
+ # Workflow customization surface for bmad-sprint-planning. Mirrors the
4
+ # agent customization shape under the [workflow] namespace.
5
+
6
+ [workflow]
7
+
8
+ # --- Configurable below. Overrides merge per BMad structural rules: ---
9
+ # scalars: override wins • arrays (persistent_facts, activation_steps_*): append
10
+ # arrays-of-tables with `code`/`id`: replace matching items, append new ones.
11
+
12
+ # Steps to run before the standard activation (config load, greet).
13
+ # Overrides append. Use for pre-flight loads, compliance checks, etc.
14
+
15
+ activation_steps_prepend = []
16
+
17
+ # Steps to run after greet but before the workflow begins.
18
+ # Overrides append. Use for context-heavy setup that should happen
19
+ # once the user has been acknowledged.
20
+
21
+ activation_steps_append = []
22
+
23
+ # Persistent facts the workflow keeps in mind for the whole run
24
+ # (standards, compliance constraints, stylistic guardrails).
25
+ # Distinct from the runtime memory sidecar — these are static context
26
+ # loaded on activation. Overrides append.
27
+ #
28
+ # Each entry is either:
29
+ # - a literal sentence, e.g. "All stories must include testable acceptance criteria."
30
+ # - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/standards.md"
31
+ # (glob patterns are supported; the file's contents are loaded and treated as facts).
32
+
33
+ persistent_facts = [
34
+ "file:{project-root}/**/project-context.md",
35
+ ]
36
+
37
+ # Scalar: executed when the workflow reaches its final step,
38
+ # after sprint-status.yaml is generated and validated. Override wins.
39
+ # Leave empty for no custom post-completion behavior.
40
+
41
+ on_complete = ""
@@ -0,0 +1,56 @@
1
+ # Sprint Status Template
2
+ # This is an EXAMPLE showing the expected format
3
+ # The actual file will be generated with all epics/stories from your epic files
4
+
5
+ # generated: {date}
6
+ # project: {project_name}
7
+ # project_key: {project_key}
8
+ # tracking_system: {tracking_system}
9
+ # story_location: {story_location}
10
+
11
+ # STATUS DEFINITIONS:
12
+ # ==================
13
+ # Epic Status:
14
+ # - backlog: Epic not yet started
15
+ # - in-progress: Epic actively being worked on
16
+ # - done: All stories in epic completed
17
+ #
18
+ # Story Status:
19
+ # - backlog: Story only exists in epic file
20
+ # - ready-for-dev: Story file created, ready for development
21
+ # - in-progress: Developer actively working on implementation
22
+ # - review: Implementation complete, ready for review
23
+ # - done: Story completed
24
+ #
25
+ # Retrospective Status:
26
+ # - optional: Can be completed but not required
27
+ # - done: Retrospective has been completed
28
+ #
29
+ # WORKFLOW NOTES:
30
+ # ===============
31
+ # - Mark epic as 'in-progress' when starting work on its first story
32
+ # - Developer typically creates next story ONLY after previous one is 'done' to incorporate learnings
33
+ # - Dev moves story to 'review', then Dev runs code-review (fresh context, ideally different LLM)
34
+
35
+ # EXAMPLE STRUCTURE (your actual epics/stories will replace these):
36
+
37
+ generated: 05-06-2-2025 21:30
38
+ last_updated: 05-06-2-2025 21:30
39
+ project: My Awesome Project
40
+ project_key: NOKEY
41
+ tracking_system: file-system
42
+ story_location: "{story_location}"
43
+
44
+ development_status:
45
+ epic-1: backlog
46
+ 1-1-user-authentication: done
47
+ 1-2-account-management: ready-for-dev
48
+ 1-3-plant-data-model: backlog
49
+ 1-4-add-plant-manual: backlog
50
+ epic-1-retrospective: optional
51
+
52
+ epic-2: backlog
53
+ 2-1-personality-system: backlog
54
+ 2-2-chat-interface: backlog
55
+ 2-3-llm-integration: backlog
56
+ epic-2-retrospective: optional
package/src/gui.tsx ADDED
@@ -0,0 +1,127 @@
1
+ import {
2
+ Command,
3
+ Plugin,
4
+ SettingsPage,
5
+ usePlugin,
6
+ type Context,
7
+ } from "@opencode/plugin/gui";
8
+ import { createResource, createSignal, Show } from "solid-js";
9
+ import { Bmad, type StorageMode } from "./rpc.js";
10
+
11
+ async function loadStatus(ctx: Context) {
12
+ return ctx.client.rpc(Bmad).status({});
13
+ }
14
+
15
+ const statusCache = new WeakMap<
16
+ Context,
17
+ Awaited<ReturnType<typeof loadStatus>>
18
+ >();
19
+
20
+ function Settings() {
21
+ const ctx = usePlugin();
22
+ const ui = ctx.ui;
23
+ const [status, { mutate, refetch }] = createResource(
24
+ async () => {
25
+ const result = await loadStatus(ctx);
26
+ statusCache.set(ctx, result);
27
+ return result;
28
+ },
29
+ { initialValue: statusCache.get(ctx) },
30
+ );
31
+ const [busy, setBusy] = createSignal(false);
32
+ const [error, setError] = createSignal("");
33
+
34
+ async function choose(storage: StorageMode) {
35
+ setBusy(true);
36
+ setError("");
37
+ try {
38
+ const result = await ctx.client.rpc(Bmad).setStorage({ storage });
39
+ statusCache.set(ctx, result);
40
+ mutate(result);
41
+ } catch (cause) {
42
+ setError(cause instanceof Error ? cause.message : String(cause));
43
+ } finally {
44
+ setBusy(false);
45
+ }
46
+ }
47
+
48
+ return (
49
+ <ui.SettingsLayout
50
+ title="BMAD Method"
51
+ description="Global BMAD skills for every OpenCode project. Choose where project artifacts are stored."
52
+ actions={<ui.Button onClick={() => void refetch()}>Refresh</ui.Button>}
53
+ >
54
+ <Show when={status.error || error()}>
55
+ <p role="alert">
56
+ {error() ||
57
+ (status.error instanceof Error
58
+ ? status.error.message
59
+ : "Could not load BMAD settings.")}
60
+ </p>
61
+ </Show>
62
+ <Show when={status()}>
63
+ {(data) => (
64
+ <ui.SettingsSection
65
+ title="Artifact storage"
66
+ footer={`${data().skills} global skills available`}
67
+ >
68
+ <ui.SettingsRow
69
+ title="Repository Markdown"
70
+ description="Default. Save BMAD artifacts in _bmad-output/ in each repository."
71
+ >
72
+ <ui.Button
73
+ variant={
74
+ data().storage === "repository" ? "contrast" : undefined
75
+ }
76
+ disabled={busy() || data().storage === "repository"}
77
+ onClick={() => void choose("repository")}
78
+ >
79
+ {data().storage === "repository"
80
+ ? "Selected"
81
+ : "Use repository"}
82
+ </ui.Button>
83
+ </ui.SettingsRow>
84
+ <ui.SettingsRow
85
+ title="TencentDB"
86
+ description={
87
+ data().tencentdbAvailable
88
+ ? "Save artifacts in this project's TencentDB document scope."
89
+ : "Install and activate opencode-tencentdb-plugin to enable this option."
90
+ }
91
+ >
92
+ <ui.Button
93
+ variant={
94
+ data().storage === "tencentdb" ? "contrast" : undefined
95
+ }
96
+ disabled={
97
+ busy() ||
98
+ !data().tencentdbAvailable ||
99
+ data().storage === "tencentdb"
100
+ }
101
+ onClick={() => void choose("tencentdb")}
102
+ >
103
+ {data().storage === "tencentdb" ? "Selected" : "Use TencentDB"}
104
+ </ui.Button>
105
+ </ui.SettingsRow>
106
+ </ui.SettingsSection>
107
+ )}
108
+ </Show>
109
+ </ui.SettingsLayout>
110
+ );
111
+ }
112
+
113
+ export default Plugin.define({
114
+ setup(ctx) {
115
+ ctx.add(SettingsPage, {
116
+ id: "bmad",
117
+ title: "BMAD Method",
118
+ icon: "file-tree",
119
+ render: () => <Settings />,
120
+ });
121
+ ctx.add(Command, {
122
+ id: "settings",
123
+ title: "Open BMAD Settings",
124
+ run: () => ctx.layout.settings("bmad"),
125
+ });
126
+ },
127
+ });
package/src/index.ts ADDED
@@ -0,0 +1,114 @@
1
+ import path from "node:path";
2
+ import { readFile, readdir } from "node:fs/promises";
3
+ import { fileURLToPath } from "node:url";
4
+ import { Plugin, Skill } from "@opencode/plugin";
5
+ import { Schema } from "effect";
6
+ import { z } from "zod";
7
+ import { Bmad, pluginID, storageMode, type StorageMode } from "./rpc.js";
8
+ import { artifactContract, settingsKey, tencentID } from "./storage.js";
9
+
10
+ const skillsRoot = fileURLToPath(new URL("../skills/", import.meta.url));
11
+ const result = <T>(output: T) => ({ content: JSON.stringify(output), output });
12
+
13
+ export default Plugin.define({
14
+ id: pluginID,
15
+ async setup(ctx) {
16
+ const names = (await readdir(skillsRoot, { withFileTypes: true }))
17
+ .filter((entry) => entry.isDirectory() && entry.name.startsWith("bmad-"))
18
+ .map((entry) => entry.name)
19
+ .sort();
20
+ const skills = await Promise.all(
21
+ names.map(async (name) => {
22
+ const file = path.join(skillsRoot, name, "SKILL.md");
23
+ const source = await readFile(file, "utf8");
24
+ const match = source.match(
25
+ /^---\r?\n[\s\S]*?^description:\s*(.+)\r?\n[\s\S]*?^---\r?\n/m,
26
+ );
27
+ if (!match) throw new Error(`Invalid BMAD skill: ${file}`);
28
+ const description = match[1].trim().replace(/^['"]|['"]$/g, "");
29
+ return Schema.decodeUnknownSync(Skill.Info)({
30
+ id: name,
31
+ name,
32
+ description,
33
+ autoinvoke: false,
34
+ path: file,
35
+ content: source,
36
+ });
37
+ }),
38
+ );
39
+
40
+ async function selected(): Promise<StorageMode> {
41
+ const value = await ctx.storage.get(settingsKey);
42
+ return storageMode.parse(value ?? "repository");
43
+ }
44
+
45
+ async function hasTencentDB() {
46
+ const plugins = await ctx.plugin.list();
47
+ return plugins.data.some(
48
+ (plugin) => plugin.id === tencentID && plugin.state.status === "active",
49
+ );
50
+ }
51
+
52
+ async function status() {
53
+ return {
54
+ storage: await selected(),
55
+ tencentdbAvailable: await hasTencentDB(),
56
+ project: ctx.location.project.canonical,
57
+ skills: skills.length,
58
+ };
59
+ }
60
+
61
+ await ctx.skill.transform((editor) => {
62
+ for (const skill of skills) if (!editor.get(skill.id)) editor.add(skill);
63
+ });
64
+
65
+ await ctx.session.hook("context", async (event) => {
66
+ const mode = await selected();
67
+ const available = await hasTencentDB();
68
+ const contract =
69
+ mode === "tencentdb" && !available
70
+ ? "TencentDB storage is selected but the TencentDB plugin is unavailable. BMAD artifact writes must wait until the plugin is active or repository storage is selected in BMAD settings."
71
+ : artifactContract(mode, ctx.location.project.canonical, available);
72
+ event.system.push({
73
+ type: "text",
74
+ text: `OpenCode BMAD plugin. The globally registered BMAD skills use this current storage contract when invoked. ${contract}`,
75
+ });
76
+ });
77
+
78
+ await ctx.tool.transform((editor) => {
79
+ editor.add({
80
+ name: "bmad_storage",
81
+ description:
82
+ "Read the current project's BMAD artifact storage contract and availability.",
83
+ input: z.strictObject({}),
84
+ output: z.strictObject({ storage: storageMode, contract: z.string() }),
85
+ async execute() {
86
+ const mode = await selected();
87
+ return result({
88
+ storage: mode,
89
+ contract: artifactContract(
90
+ mode,
91
+ ctx.location.project.canonical,
92
+ await hasTencentDB(),
93
+ ),
94
+ });
95
+ },
96
+ });
97
+ });
98
+
99
+ await ctx.rpc.register(Bmad, {
100
+ status: async () => status(),
101
+ async setStorage({ storage }, rpc) {
102
+ if (storage === "tencentdb" && !(await hasTencentDB())) {
103
+ return rpc.error(
104
+ "bmad_error",
105
+ "TencentDB plugin is not active for this project.",
106
+ {},
107
+ );
108
+ }
109
+ await ctx.storage.set(settingsKey, storage);
110
+ return status();
111
+ },
112
+ });
113
+ },
114
+ });