@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,85 @@
1
+ ---
2
+ diff_output: '' # set at runtime
3
+ spec_file: '' # set at runtime (path or empty)
4
+ review_mode: '' # set at runtime: "full" or "no-spec"
5
+ story_key: '' # set at runtime when discovered from sprint status
6
+ ---
7
+
8
+ # Step 1: Gather Context
9
+
10
+ ## RULES
11
+
12
+ - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
13
+ - The prompt that triggered this workflow IS the intent — not a hint.
14
+ - Do not modify any files. This step is read-only.
15
+
16
+ ## INSTRUCTIONS
17
+
18
+ 1. **Find the review target.** The conversation context before this skill was triggered IS your starting point — not a blank slate. Check in this order — stop as soon as the review target is identified:
19
+
20
+ **Tier 1 — Explicit argument.**
21
+ Did the user pass a PR, commit SHA, branch, spec file, or diff source this message?
22
+ - PR reference → resolve to branch/commit via `gh pr view`. If resolution fails, ask for a SHA or branch.
23
+ - Commit or branch → use directly.
24
+ - Spec file → set `{spec_file}` to the provided path. Check its frontmatter for `baseline_commit`. If found, use as diff baseline. If not found, continue the cascade (a spec alone does not identify a diff source).
25
+ - Also scan the argument for diff-mode keywords that narrow the scope:
26
+ - "staged" / "staged changes" → Staged changes only
27
+ - "uncommitted" / "working tree" / "all changes" → Uncommitted changes (staged + unstaged)
28
+ - "branch diff" / "vs main" / "against main" / "compared to <branch>" → Branch diff (extract base branch if mentioned)
29
+ - "commit range" / "last N commits" / "<from-sha>..<to-sha>" → Specific commit range
30
+ - "this diff" / "provided diff" / "paste" → User-provided diff (do not match bare "diff" — it appears in other modes)
31
+ - When multiple keywords match, prefer the most specific (e.g., "branch diff" over bare "diff").
32
+
33
+ **Tier 2 — Recent conversation.**
34
+ Do the last few messages reveal what the user wants to be reviewed? Look for spec paths, commit refs, branches, PRs, or descriptions of a change. Apply the same diff-mode keyword scan and routing as Tier 1.
35
+
36
+ **Tier 3 — Sprint tracking.**
37
+ Look for a sprint status file (`*sprint-status*`) in `{implementation_artifacts}` or `{planning_artifacts}`. If found, scan for stories with status `review`:
38
+ - **Exactly one `review` story:** Set `{story_key}` to the story's key (e.g., `1-2-user-auth`). Suggest it: "I found story <story-id> in `review` status. Would you like to review its changes? [Y] Yes / [N] No, let me choose". If confirmed, use the story context to determine the diff source (branch name derived from story slug, or uncommitted changes). If declined, clear `{story_key}` and fall through.
39
+ - **Multiple `review` stories:** Present them as numbered options alongside a manual choice option. Wait for user selection. If a story is selected, set `{story_key}` and use its context to determine the diff source. If manual choice is selected, clear `{story_key}` and fall through.
40
+ - **None:** Fall through.
41
+
42
+ **Tier 4 — Current git state.**
43
+ If version control is unavailable, skip to Tier 5. Otherwise, check the current branch and HEAD. If the branch is not `main` (or the default branch), confirm: "I see HEAD is `<short-sha>` on `<branch>` — do you want to review this branch's changes?" If confirmed, treat as a branch diff against `main`. If declined, fall through.
44
+
45
+ **Tier 5 — Ask.**
46
+ Fall through to instruction 2.
47
+
48
+ Never ask extra questions beyond what the cascade prescribes. If a tier above already identified the target, skip the remaining tiers and proceed to instruction 3 (construct diff).
49
+
50
+ 2. HALT. Ask the user: **What do you want to review?** Present these options:
51
+ - **Uncommitted changes** (staged + unstaged)
52
+ - **Staged changes only**
53
+ - **Branch diff** vs a base branch (ask which base branch)
54
+ - **Specific commit range** (ask for the range)
55
+ - **Provided diff or file list** (user pastes or provides a path)
56
+
57
+ 3. Construct `{diff_output}` from the chosen source.
58
+ - For **staged changes only**: run `git diff --cached`.
59
+ - For **uncommitted changes** (staged + unstaged): run `git diff HEAD`.
60
+ - For **branch diff**: verify the base branch exists before running `git diff`. If it does not exist, HALT and ask the user for a valid branch.
61
+ - For **commit range**: verify the range resolves. If it does not, HALT and ask the user for a valid range.
62
+ - For **provided diff**: validate the content is non-empty and parseable as a unified diff. If it is not parseable, HALT and ask the user to provide a valid diff.
63
+ - For **file list**: validate each path exists in the working tree. Construct `{diff_output}` by running `git diff HEAD -- <path1> <path2> ...`. If any paths are untracked (new files not yet staged), use `git diff --no-index /dev/null <path>` to include them. If the diff is empty (files have no uncommitted changes and are not untracked), ask the user whether to review the full file contents or to specify a different baseline.
64
+ - After constructing `{diff_output}`, verify it is non-empty regardless of source type. If empty, HALT and tell the user there is nothing to review.
65
+
66
+ 4. **Set the spec context.**
67
+ - If `{spec_file}` is already set (from Tier 1 or Tier 2): verify the file exists and is readable, then set `{review_mode}` = `"full"`.
68
+ - Otherwise, ask the user: **Is there a spec or story file that provides context for these changes?**
69
+ - If yes: set `{spec_file}` to the path provided, verify the file exists and is readable, then set `{review_mode}` = `"full"`.
70
+ - If no: set `{review_mode}` = `"no-spec"`.
71
+
72
+ 5. If `{review_mode}` = `"full"` and the file at `{spec_file}` has a `context` field in its frontmatter listing additional docs, load each referenced document. Warn the user about any docs that cannot be found.
73
+
74
+ 6. Sanity check: if `{diff_output}` exceeds approximately 3000 lines, warn the user and offer to chunk the review by file group.
75
+ - If the user opts to chunk: agree on the first group, narrow `{diff_output}` accordingly, and list the remaining groups for the user to note for follow-up runs.
76
+ - If the user declines: proceed as-is with the full diff.
77
+
78
+ ### CHECKPOINT
79
+
80
+ Present a summary before proceeding: diff stats (files changed, lines added/removed), `{review_mode}`, and loaded spec/context docs (if any). HALT and wait for user confirmation to proceed.
81
+
82
+
83
+ ## NEXT
84
+
85
+ Read fully and follow `./step-02-review.md`
@@ -0,0 +1,35 @@
1
+ ---
2
+ failed_layers: '' # set at runtime: comma-separated list of layers that failed or returned empty
3
+ ---
4
+
5
+ # Step 2: Review
6
+
7
+ ## RULES
8
+
9
+ - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
10
+ - The Blind Hunter subagent receives NO project context — diff only.
11
+ - The Edge Case Hunter subagent receives diff and project read access.
12
+ - The Acceptance Auditor subagent receives diff, spec, and context docs.
13
+ - All review subagents must run at the same model capability as the current session.
14
+
15
+ ## INSTRUCTIONS
16
+
17
+ 1. If `{review_mode}` = `"no-spec"`, note to the user: "Acceptance Auditor skipped — no spec file provided."
18
+
19
+ 2. Launch parallel subagents without conversation context. If subagents are not available, generate prompt files in `{implementation_artifacts}` — one per reviewer role below — and HALT. Ask the user to run each in a separate session (ideally a different LLM) and paste back the findings. When findings are pasted, resume from this point and proceed to step 3.
20
+
21
+ - **Blind Hunter** — receives `{diff_output}` only. No spec, no context docs, no project access. Invoke via the `bmad-review-adversarial-general` skill.
22
+
23
+ - **Edge Case Hunter** — receives `{diff_output}` and read access to the project. Invoke via the `bmad-review-edge-case-hunter` skill.
24
+
25
+ - **Acceptance Auditor** (only if `{review_mode}` = `"full"`) — receives `{diff_output}`, the content of the file at `{spec_file}`, and any loaded context docs. Its prompt:
26
+ > You are an Acceptance Auditor. Review this diff against the spec and context docs. Check for: violations of acceptance criteria, deviations from spec intent, missing implementation of specified behavior, contradictions between spec constraints and actual code. Output findings as a Markdown list. Each finding: one-line title, which AC/constraint it violates, and evidence from the diff.
27
+
28
+ 3. **Subagent failure handling**: If any subagent fails, times out, or returns empty results, append the layer name to `{failed_layers}` (comma-separated) and proceed with findings from the remaining layers.
29
+
30
+ 4. Collect all findings from the completed layers.
31
+
32
+
33
+ ## NEXT
34
+
35
+ Read fully and follow `./step-03-triage.md`
@@ -0,0 +1,49 @@
1
+ ---
2
+ ---
3
+
4
+ # Step 3: Triage
5
+
6
+ ## RULES
7
+
8
+ - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
9
+ - Be precise. When uncertain between categories, prefer the more conservative classification.
10
+
11
+ ## INSTRUCTIONS
12
+
13
+ 1. **Normalize** findings into a common format. Expected input formats:
14
+ - Adversarial (Blind Hunter): markdown list of descriptions
15
+ - Edge Case Hunter: JSON array with `location`, `trigger_condition`, `guard_snippet`, `potential_consequence` fields
16
+ - Acceptance Auditor: markdown list with title, AC/constraint reference, and evidence
17
+
18
+ If a layer's output does not match its expected format, attempt best-effort parsing. Note any parsing issues for the user.
19
+
20
+ Convert all to a unified list where each finding has:
21
+ - `id` -- sequential integer
22
+ - `source` -- `blind`, `edge`, `auditor`, or merged sources (e.g., `blind+edge`)
23
+ - `title` -- one-line summary
24
+ - `detail` -- full description
25
+ - `location` -- file and line reference (if available)
26
+
27
+ 2. **Deduplicate.** If two or more findings describe the same issue, merge them into one:
28
+ - Use the most specific finding as the base (prefer edge-case JSON with location over adversarial prose).
29
+ - Append any unique detail, reasoning, or location references from the other finding(s) into the surviving `detail` field.
30
+ - Set `source` to the merged sources (e.g., `blind+edge`).
31
+
32
+ 3. **Classify** each finding into exactly one bucket:
33
+ - **decision_needed** -- There is an ambiguous choice that requires human input. The code cannot be correctly patched without knowing the user's intent. Only possible if `{review_mode}` = `"full"`.
34
+ - **patch** -- Code issue that is fixable without human input. The correct fix is unambiguous.
35
+ - **defer** -- Pre-existing issue not caused by the current change. Real but not actionable now.
36
+ - **dismiss** -- Noise, false positive, or handled elsewhere.
37
+
38
+ If `{review_mode}` = `"no-spec"` and a finding would otherwise be `decision_needed`, reclassify it as `patch` (if the fix is unambiguous) or `defer` (if not).
39
+
40
+ 4. **Drop** all `dismiss` findings. Record the dismiss count for the summary.
41
+
42
+ 5. If `{failed_layers}` is non-empty, report which layers failed before announcing results. If zero findings remain after dropping dismissed AND `{failed_layers}` is non-empty, warn the user that the review may be incomplete rather than announcing a clean review.
43
+
44
+ 6. If zero findings remain after triage (all rejected or none raised): state "✅ Clean review — all layers passed." (Step 3 already warned if any review layers failed via `{failed_layers}`.)
45
+
46
+
47
+ ## NEXT
48
+
49
+ Read fully and follow `./step-04-present.md`
@@ -0,0 +1,132 @@
1
+ ---
2
+ deferred_work_file: '{implementation_artifacts}/deferred-work.md'
3
+ ---
4
+
5
+ # Step 4: Present and Act
6
+
7
+ ## RULES
8
+
9
+ - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
10
+ - When `{spec_file}` is set, always write findings to the story file before offering action choices.
11
+ - `decision-needed` findings must be resolved before handling `patch` findings.
12
+
13
+ ## INSTRUCTIONS
14
+
15
+ ### 1. Clean review shortcut
16
+
17
+ If zero findings remain after triage (all dismissed or none raised): state that and proceed to section 6 (Sprint Status Update).
18
+
19
+ ### 2. Write findings to the story file
20
+
21
+ If `{spec_file}` exists and contains a Tasks/Subtasks section, append a `### Review Findings` subsection. Write all findings in this order:
22
+
23
+ 1. **`decision-needed`** findings (unchecked):
24
+ `- [ ] [Review][Decision] <Title> — <Detail>`
25
+
26
+ 2. **`patch`** findings (unchecked):
27
+ `- [ ] [Review][Patch] <Title> [<file>:<line>]`
28
+
29
+ 3. **`defer`** findings (checked off, marked deferred):
30
+ `- [x] [Review][Defer] <Title> [<file>:<line>] — deferred, pre-existing`
31
+
32
+ Also append each `defer` finding to `{deferred_work_file}` under a heading `## Deferred from: code review ({date})`. If `{spec_file}` is set, include its basename in the heading (e.g., `code review of story-3.3 (2026-03-18)`). One bullet per finding with description.
33
+
34
+ ### 3. Present summary
35
+
36
+ Announce what was written:
37
+
38
+ > **Code review complete.** <D> `decision-needed`, <P> `patch`, <W> `defer`, <R> dismissed as noise.
39
+
40
+ If `{spec_file}` is set, add: `Findings written to the review findings section in {spec_file}.`
41
+ Otherwise add: `Findings are listed above. No story file was provided, so nothing was persisted.`
42
+
43
+ ### 4. Resolve decision-needed findings
44
+
45
+ If `decision_needed` findings exist, present each one with its detail and the options available. The user must decide — the correct fix is ambiguous without their input. Walk through each finding (or batch related ones) and get the user's call. Once resolved, each becomes a `patch`, `defer`, or is dismissed.
46
+
47
+ If the user chooses to defer, ask: Quick one-line reason for deferring this item? (helps future reviews): — then append that reason to both the story file bullet and the `{deferred_work_file}` entry.
48
+
49
+ **HALT** — I am waiting for your numbered choice. Reply with only the number. Do not proceed until you select an option.
50
+
51
+ ### 5. Handle `patch` findings
52
+
53
+ If `patch` findings exist (including any resolved from step 4), HALT. Ask the user:
54
+
55
+ If `{spec_file}` is set, present all three options:
56
+
57
+ > **How would you like to handle the `<P>` `patch` findings?**
58
+ > 1. **Apply every patch** — fix all of them now, no per-finding confirmation. Defer and decision-needed items are not touched.
59
+ > 2. **Leave as action items** — they are already in the story file
60
+ > 3. **Walk through each patch** — show details for each before deciding
61
+
62
+ If `{spec_file}` is **not** set, present only options 1 and 2 (omit "Leave as action items" — findings were not written to a file):
63
+
64
+ > **How would you like to handle the `<P>` `patch` findings?**
65
+ > 1. **Apply every patch** — fix all of them now, no per-finding confirmation. Defer and decision-needed items are not touched.
66
+ > 2. **Walk through each patch** — show details for each before deciding
67
+
68
+ **HALT** — I am waiting for your numbered choice. Reply with only the number. Do not proceed until you select an option.
69
+
70
+ - **Apply every patch**: Apply every patch finding without per-finding confirmation. Do not modify defer or decision-needed items. After all patches are applied, present a summary of changes made. If `{spec_file}` is set, check off the patch items in the story file (leave defer items as-is).
71
+ - **Leave as action items** (only when `{spec_file}` is set): Done — findings are already written to the story.
72
+ - **Walk through each patch**: Present each finding with full detail, diff context, and suggested fix. After walkthrough, re-offer the applicable options above.
73
+
74
+ **HALT** — I am waiting for your numbered choice. Do not proceed until you select an option.
75
+
76
+ **✅ Code review actions complete**
77
+
78
+ - Decision-needed resolved: <D>
79
+ - Patches handled: <P>
80
+ - Deferred: <W>
81
+ - Dismissed: <R>
82
+
83
+ ### 6. Update story status and sync sprint tracking
84
+
85
+ Skip this section if `{spec_file}` is not set.
86
+
87
+ #### Determine new status based on review outcome
88
+
89
+ - If all `decision-needed` and `patch` findings were resolved (fixed or dismissed) AND no unresolved HIGH/MEDIUM issues remain: set `{new_status}` = `done`. Update the story file Status section to `done`.
90
+ - If `patch` findings were left as action items, or unresolved issues remain: set `{new_status}` = `in-progress`. Update the story file Status section to `in-progress`.
91
+
92
+ Save the story file.
93
+
94
+ #### Sync sprint-status.yaml
95
+
96
+ If `{story_key}` is not set, skip this subsection and note that sprint status was not synced because no story key was available.
97
+
98
+ If `{sprint_status}` file exists:
99
+
100
+ 1. Load the FULL `{sprint_status}` file.
101
+ 2. Find the `development_status` entry matching `{story_key}`.
102
+ 3. If found: update `development_status[{story_key}]` to `{new_status}`. Update `last_updated` to current date. Save the file, preserving ALL comments and structure including STATUS DEFINITIONS.
103
+ 4. If `{story_key}` not found in sprint status: warn the user that the story file was updated but sprint-status sync failed.
104
+
105
+ If `{sprint_status}` file does not exist, note that story status was updated in the story file only.
106
+
107
+ #### Completion summary
108
+
109
+ > **Review Complete!**
110
+ >
111
+ > **Story Status:** `{new_status}`
112
+ > **Issues Fixed:** <fixed_count>
113
+ > **Action Items Created:** <action_count>
114
+ > **Deferred:** <W>
115
+ > **Dismissed:** <R>
116
+
117
+ ### 7. Next steps
118
+
119
+ Present the user with follow-up options:
120
+
121
+ > **What would you like to do next?**
122
+ > 1. **Start the next story** — run `dev-story` to pick up the next `ready-for-dev` story
123
+ > 2. **Re-run code review** — address findings and review again
124
+ > 3. **Done** — end the workflow
125
+
126
+ **HALT** — I am waiting for your choice. Do not proceed until the user selects an option.
127
+
128
+ ## On Complete
129
+
130
+ Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete`
131
+
132
+ If the resolved `workflow.on_complete` is non-empty, follow it as the final terminal instruction before exiting.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: bmad-create-architecture
3
+ description: 'Create architecture solution design decisions for AI agent consistency. Use when the user says "lets create architecture" or "create technical architecture" or "create a solution design"'
4
+ ---
5
+
6
+ # bmad-create-architecture · OpenCode edition
7
+
8
+ ## Artifact storage
9
+
10
+ Use the **BMAD artifact storage** contract injected by the OpenCode BMAD plugin for this project. It names the selected backend, project root and exact artifact prefix. Call `bmad_storage` if the contract is missing or you need to refresh it. Read existing artifacts before editing, write complete Markdown, then read back and verify. Keep each artifact's logical name stable. Do not switch storage backends silently. The plugin is installed globally; project artifacts are scoped to the current repository. Source code changes remain in the repository. Bundled references may mention upstream project-local `_bmad` setup, config or scripts; use their methodology without requiring those files in the project. The selected storage contract overrides artifact paths in references.
11
+
12
+ ## Workflow
13
+
14
+ 1. Read the PRD, project context and existing architecture from artifact storage. Inspect relevant code and dependency manifests to establish actual constraints.
15
+ 2. Decide the system boundaries, data ownership, interfaces, security, deployment, failure handling and observability needed by those requirements. Reuse the existing stack where it fits.
16
+ 3. Record alternatives, selected choices and reasons. Define concrete code placement, naming and integration conventions that multiple agents can follow.
17
+ 4. Check requirement coverage and contradictions, distinguish unresolved choices from decisions, and record validation evidence.
18
+
19
+ **Primary artifact:** `architecture.md`. Use a stable descriptive `<story-id>`, `<review-id>` or `<change-id>` where shown, and return its full verified artifact path.
20
+
21
+ ## Optional method references
22
+
23
+ Read only the template or checklist needed for the current step, relative to this skill directory: `reference/architecture-decision-template.md`; `reference/steps/step-07-validation.md`. The references preserve upstream methodology; their filesystem writes, activation scripts and local artifact discovery are replaced by the BMAD artifact storage contract above. Do not load the entire upstream workflow or unrelated artifacts.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: bmad-create-architecture
3
+ description: 'Create architecture solution design decisions for AI agent consistency. Use when the user says "lets create architecture" or "create technical architecture" or "create a solution design"'
4
+ ---
5
+
6
+ # Architecture Workflow
7
+
8
+ **Goal:** Create comprehensive architecture decisions through collaborative step-by-step discovery that ensures AI agents implement consistently.
9
+
10
+ **Your Role:** You are an architectural facilitator collaborating with a peer. This is a partnership, not a client-vendor relationship. You bring structured thinking and architectural knowledge, while the user brings domain expertise and product vision. Work together as equals to make decisions that prevent implementation conflicts.
11
+
12
+ ## Conventions
13
+
14
+ - Bare paths (e.g. `steps/step-01-init.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
+ ## WORKFLOW ARCHITECTURE
20
+
21
+ This uses **micro-file architecture** for disciplined execution:
22
+
23
+ - Each step is a self-contained file with embedded rules
24
+ - Sequential progression with user control at each step
25
+ - Document state tracked in frontmatter
26
+ - Append-only document building through conversation
27
+ - You NEVER proceed to a step file if the current step file indicates the user must approve and indicate continuation.
28
+
29
+ ## On Activation
30
+
31
+ ### Step 1: Resolve the Workflow Block
32
+
33
+ Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
34
+
35
+ **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:
36
+
37
+ 1. `{skill-root}/customize.toml` — defaults
38
+ 2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
39
+ 3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
40
+
41
+ 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.
42
+
43
+ ### Step 2: Execute Prepend Steps
44
+
45
+ Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
46
+
47
+ ### Step 3: Load Persistent Facts
48
+
49
+ 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.
50
+
51
+ ### Step 4: Load Config
52
+
53
+ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
54
+ - Use `{user_name}` for greeting
55
+ - Use `{communication_language}` for all communications
56
+ - Use `{document_output_language}` for output documents
57
+ - Use `{planning_artifacts}` for output location and artifact scanning
58
+ - Use `{project_knowledge}` for additional context scanning
59
+
60
+ ### Step 5: Greet the User
61
+
62
+ Greet `{user_name}`, speaking in `{communication_language}`.
63
+
64
+ ### Step 6: Execute Append Steps
65
+
66
+ Execute each entry in `{workflow.activation_steps_append}` in order.
67
+
68
+ 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.
69
+
70
+ ## Execution
71
+
72
+ Read fully and follow: `./steps/step-01-init.md` to begin the workflow.
73
+
74
+ **Note:** Input document discovery and all initialization protocols are handled in step-01-init.md.
@@ -0,0 +1,12 @@
1
+ ---
2
+ stepsCompleted: []
3
+ inputDocuments: []
4
+ workflowType: 'architecture'
5
+ project_name: '{{project_name}}'
6
+ user_name: '{{user_name}}'
7
+ date: '{{date}}'
8
+ ---
9
+
10
+ # Architecture Decision Document
11
+
12
+ _This document builds collaboratively through step-by-step discovery. Sections are appended as we work through each architectural decision together._
@@ -0,0 +1,41 @@
1
+ # DO NOT EDIT -- overwritten on every update.
2
+ #
3
+ # Workflow customization surface for bmad-create-architecture. 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. "Our org is AWS-only -- do not propose GCP or Azure."
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 Step 8 (Architecture Completion & Handoff),
38
+ # after the architecture document frontmatter is updated and next-steps guidance is given.
39
+ # Override wins. Leave empty for no custom post-completion behavior.
40
+
41
+ on_complete = ""
@@ -0,0 +1,13 @@
1
+ domain,signals,complexity_level,suggested_workflow,web_searches
2
+ e_commerce,"shopping,cart,checkout,payment,products,store",medium,standard,"ecommerce architecture patterns, payment processing, inventory management"
3
+ fintech,"banking,payment,trading,finance,money,investment",high,enhanced,"financial security, PCI compliance, trading algorithms, fraud detection"
4
+ healthcare,"medical,diagnostic,clinical,patient,hospital,health",high,enhanced,"HIPAA compliance, medical data security, FDA regulations, health tech"
5
+ social,"social network,community,users,friends,posts,sharing",high,advanced,"social graph algorithms, feed ranking, notification systems, privacy"
6
+ education,"learning,course,student,teacher,training,academic",medium,standard,"LMS architecture, progress tracking, assessment systems, video streaming"
7
+ productivity,"productivity,workflow,tasks,management,business,tools",medium,standard,"collaboration patterns, real-time editing, notification systems, integration"
8
+ media,"content,media,video,audio,streaming,broadcast",high,advanced,"CDN architecture, video encoding, streaming protocols, content delivery"
9
+ iot,"IoT,sensors,devices,embedded,smart,connected",high,advanced,"device communication, real-time data processing, edge computing, security"
10
+ government,"government,civic,public,admin,policy,regulation",high,enhanced,"accessibility standards, security clearance, data privacy, audit trails"
11
+ process_control,"industrial automation,process control,PLC,SCADA,DCS,HMI,operational technology,control system,cyberphysical,MES,instrumentation,I&C,P&ID",high,advanced,"industrial process control architecture, SCADA system design, OT cybersecurity architecture, real-time control systems"
12
+ building_automation,"building automation,BAS,BMS,HVAC,smart building,fire alarm,fire protection,fire suppression,life safety,elevator,DDC,access control,sequence of operations,commissioning",high,advanced,"building automation architecture, BACnet integration patterns, smart building design, building management system security"
13
+ gaming,"game,gaming,multiplayer,real-time,interactive,entertainment",high,advanced,"real-time multiplayer, game engine architecture, matchmaking, leaderboards"
@@ -0,0 +1,7 @@
1
+ project_type,detection_signals,description,typical_starters
2
+ web_app,"website,web application,browser,frontend,UI,interface",Web-based applications running in browsers,Next.js, Vite, Remix
3
+ mobile_app,"mobile,iOS,Android,app,smartphone,tablet",Native mobile applications,React Native, Expo, Flutter
4
+ api_backend,"API,REST,GraphQL,backend,service,microservice",Backend services and APIs,NestJS, Express, Fastify
5
+ full_stack,"full-stack,complete,web+mobile,frontend+backend",Applications with both frontend and backend,T3 App, RedwoodJS, Blitz
6
+ cli_tool,"CLI,command line,terminal,console,tool",Command-line interface tools,oclif, Commander, Caporal
7
+ desktop_app,"desktop,Electron,Tauri,native app,macOS,Windows",Desktop applications,Electron, Tauri, Flutter Desktop
@@ -0,0 +1,153 @@
1
+ # Step 1: Architecture Workflow Initialization
2
+
3
+ ## MANDATORY EXECUTION RULES (READ FIRST):
4
+
5
+ - 🛑 NEVER generate content without user input
6
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
7
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
8
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
9
+ - 📋 YOU ARE A FACILITATOR, not a content generator
10
+ - 💬 FOCUS on initialization and setup only - don't look ahead to future steps
11
+ - 🚪 DETECT existing workflow state and handle continuation properly
12
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
13
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
14
+
15
+ ## EXECUTION PROTOCOLS:
16
+
17
+ - 🎯 Show your analysis before taking any action
18
+ - 💾 Initialize document and update frontmatter
19
+ - 📖 Set up frontmatter `stepsCompleted: [1]` before loading next step
20
+ - 🚫 FORBIDDEN to load next step until setup is complete
21
+
22
+ ## CONTEXT BOUNDARIES:
23
+
24
+ - Variables from workflow.md are available in memory
25
+ - Previous context = what's in output document + frontmatter
26
+ - Don't assume knowledge from other steps
27
+ - Input document discovery happens in this step
28
+
29
+ ## YOUR TASK:
30
+
31
+ Initialize the Architecture workflow by detecting continuation state, discovering input documents, and setting up the document for collaborative architectural decision making.
32
+
33
+ ## INITIALIZATION SEQUENCE:
34
+
35
+ ### 1. Check for Existing Workflow
36
+
37
+ First, check if the output document already exists:
38
+
39
+ - Look for existing {planning_artifacts}/`*architecture*.md`
40
+ - If exists, read the complete file(s) including frontmatter
41
+ - If not exists, this is a fresh workflow
42
+
43
+ ### 2. Handle Continuation (If Document Exists)
44
+
45
+ If the document exists and has frontmatter with `stepsCompleted`:
46
+
47
+ - **STOP here** and load `./step-01b-continue.md` immediately
48
+ - Do not proceed with any initialization tasks
49
+ - Let step-01b handle the continuation logic
50
+
51
+ ### 3. Fresh Workflow Setup (If No Document)
52
+
53
+ If no document exists or no `stepsCompleted` in frontmatter:
54
+
55
+ #### A. Input Document Discovery
56
+
57
+ Discover and load context documents using smart discovery. Documents can be in the following locations:
58
+ - {planning_artifacts}/**
59
+ - {output_folder}/**
60
+ - {project_knowledge}/**
61
+ - {project-root}/docs/**
62
+
63
+ Also - when searching - documents can be a single markdown file, or a folder with an index and multiple files. For Example, if searching for `*foo*.md` and not found, also search for a folder called *foo*/index.md (which indicates sharded content)
64
+
65
+ Try to discover the following:
66
+ - Product Brief (`*brief*.md`)
67
+ - Product Requirements Document (`*prd*.md`)
68
+ - UX Design (`*ux-design*.md`) and other
69
+ - Research Documents (`*research*.md`)
70
+ - Project Documentation (generally multiple documents might be found for this in the `{project_knowledge}` or `{project-root}/docs` folder.)
71
+ - Project Context (`**/project-context.md`)
72
+
73
+ <critical>Confirm what you have found with the user, along with asking if the user wants to provide anything else. Only after this confirmation will you proceed to follow the loading rules</critical>
74
+
75
+ **Loading Rules:**
76
+
77
+ - Load ALL discovered files completely that the user confirmed or provided (no offset/limit)
78
+ - If there is a project context, whatever is relevant should try to be biased in the remainder of this whole workflow process
79
+ - For sharded folders, load ALL files to get complete picture, using the index first to potentially know the potential of each document
80
+ - index.md is a guide to what's relevant whenever available
81
+ - Track all successfully loaded files in frontmatter `inputDocuments` array
82
+
83
+ #### B. Validate Required Inputs
84
+
85
+ Before proceeding, verify we have the essential inputs:
86
+
87
+ **PRD Validation:**
88
+
89
+ - If no PRD found: "Architecture requires a PRD to work from. Please run the PRD workflow first or provide the PRD file path."
90
+ - Do NOT proceed without PRD
91
+
92
+ **Other Input that might exist:**
93
+
94
+ - UX Spec: "Provides UI/UX architectural requirements"
95
+
96
+ #### C. Create Initial Document
97
+
98
+ Copy the template from `../architecture-decision-template.md` to `{planning_artifacts}/architecture.md`
99
+
100
+ #### D. Complete Initialization and Report
101
+
102
+ Complete setup and report to user:
103
+
104
+ **Document Setup:**
105
+
106
+ - Created: `{planning_artifacts}/architecture.md` from template
107
+ - Initialized frontmatter with workflow state
108
+
109
+ **Input Documents Discovered:**
110
+ Report what was found:
111
+ "Welcome {{user_name}}! I've set up your Architecture workspace for {{project_name}}.
112
+
113
+ **Documents Found:**
114
+
115
+ - PRD: {number of PRD files loaded or "None found - REQUIRED"}
116
+ - UX Design: {number of UX files loaded or "None found"}
117
+ - Research: {number of research files loaded or "None found"}
118
+ - Project docs: {number of project files loaded or "None found"}
119
+ - Project context: {project_context_rules count of rules for AI agents found}
120
+
121
+ **Files loaded:** {list of specific file names or "No additional documents found"}
122
+
123
+ Ready to begin architectural decision making. Do you have any other documents you'd like me to include?
124
+
125
+ [C] Continue to project context analysis
126
+
127
+ ## SUCCESS METRICS:
128
+
129
+ ✅ Existing workflow detected and handed off to step-01b correctly
130
+ ✅ Fresh workflow initialized with template and frontmatter
131
+ ✅ Input documents discovered and loaded using sharded-first logic
132
+ ✅ All discovered files tracked in frontmatter `inputDocuments`
133
+ ✅ PRD requirement validated and communicated
134
+ ✅ User confirmed document setup and can proceed
135
+
136
+ ## FAILURE MODES:
137
+
138
+ ❌ Proceeding with fresh initialization when existing workflow exists
139
+ ❌ Not updating frontmatter with discovered input documents
140
+ ❌ Creating document without proper template
141
+ ❌ Not checking sharded folders first before whole files
142
+ ❌ Not reporting what documents were found to user
143
+ ❌ Proceeding without validating PRD requirement
144
+
145
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
146
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
147
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
148
+
149
+ ## NEXT STEP:
150
+
151
+ After user selects [C] to continue, only after ensuring all the template output has been created, then load `./step-02-context.md` to analyze the project context and begin architectural decision making.
152
+
153
+ Remember: Do NOT proceed to step-02 until user explicitly selects [C] from the menu and setup is confirmed!