@jspg-ai/coding-bb 0.0.1

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 (183) hide show
  1. package/README.md +41 -0
  2. package/cbb/dev-standards/rules/cbb-ai-behavior.md +104 -0
  3. package/cbb/dev-standards/rules/cbb-coding-rule.md +50 -0
  4. package/cbb/dev-standards/rules/cbb-priority.md +56 -0
  5. package/cbb/dev-standards/skills/architecture-specs/SKILL.md +129 -0
  6. package/cbb/dev-standards/skills/coding-specs/SKILL.md +376 -0
  7. package/cbb/dev-standards/skills/coding-specs/references/concurrency.md +53 -0
  8. package/cbb/dev-standards/skills/coding-specs/references/config-center.md +16 -0
  9. package/cbb/dev-standards/skills/coding-specs/references/distributed.md +42 -0
  10. package/cbb/dev-standards/skills/coding-specs/references/es-coding.md +60 -0
  11. package/cbb/dev-standards/skills/coding-specs/references/scheduled-task.md +25 -0
  12. package/cbb/dev-standards/skills/coding-specs/references/security.md +11 -0
  13. package/cbb/dev-standards/skills/coding-specs/references/unit-testing.md +43 -0
  14. package/cbb/dev-standards/skills/es-design-specs/SKILL.md +104 -0
  15. package/cbb/dev-standards/skills/mysql-design-specs/SKILL.md +89 -0
  16. package/cbb/lib/install/claude-code.js +20 -0
  17. package/cbb/lib/install/cleanup.js +64 -0
  18. package/cbb/lib/install/init.js +1875 -0
  19. package/cbb/lib/install/qoder.js +20 -0
  20. package/cbb/lib/install/workspaces.js +232 -0
  21. package/cbb/lib/openspec/index.js +554 -0
  22. package/cbb/lib/superpowers/index.js +265 -0
  23. package/cbb/lib/utils/check-update.js +147 -0
  24. package/cbb/lib/utils/checkbox.js +383 -0
  25. package/cbb/lib/utils/gitignore.js +69 -0
  26. package/cbb/lib/utils/output.js +64 -0
  27. package/cbb/lib/utils/settings.js +119 -0
  28. package/cbb/lib/utils/version.js +135 -0
  29. package/cbb/lib/wiki/api-client.js +358 -0
  30. package/cbb/lib/wiki/cli.js +427 -0
  31. package/cbb/lib/wiki/convert.js +464 -0
  32. package/cbb/lib/wiki/index.js +218 -0
  33. package/cbb/lib/wiki/mermaid-guard.js +103 -0
  34. package/cbb/lib/wiki/split.js +131 -0
  35. package/cbb/tools/cbb-decompile-jar/SKILL.md +220 -0
  36. package/cbb/tools/cbb-decompile-jar/scripts/decompile.py +863 -0
  37. package/cbb/tools/cbb-design-to-wiki/SKILL.md +180 -0
  38. package/cbb/tools/cbb-mvn-guide/SKILL.md +281 -0
  39. package/cbb/tools/cbb-mvn-guide/scripts/mvn_jdk_manager.py +378 -0
  40. package/cbb/tools/cbb-mvn-guide/scripts/mvn_pom_jdk_reader.py +197 -0
  41. package/cbb/tools/cbb-plantuml-authoring/SKILL.md +448 -0
  42. package/cbb/tools/cbb-plantuml-authoring/references/drawing-templates.md +479 -0
  43. package/cbb/tools/cbb-wiki-ops/SKILL.md +134 -0
  44. package/cbb/tools/cbb-wiki-ops/scripts/check-auth.js +44 -0
  45. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +96 -0
  46. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +67 -0
  47. package/cbb/worktrees/_shared/scripts/push-core.js +136 -0
  48. package/cbb/worktrees/_shared/scripts/silence-popup.js +23 -0
  49. package/cbb/worktrees/commands/close.md +64 -0
  50. package/cbb/worktrees/commands/extend.md +65 -0
  51. package/cbb/worktrees/commands/init.md +55 -0
  52. package/cbb/worktrees/commands/push.md +42 -0
  53. package/cbb/worktrees/skills/openspec-close-worktree/SKILL.md +449 -0
  54. package/cbb/worktrees/skills/openspec-close-worktree/scripts/check-env.js +76 -0
  55. package/cbb/worktrees/skills/openspec-close-worktree/scripts/check-unarchived.js +48 -0
  56. package/cbb/worktrees/skills/openspec-close-worktree/scripts/delete-branches.js +136 -0
  57. package/cbb/worktrees/skills/openspec-close-worktree/scripts/discover-apps.js +76 -0
  58. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-target-worktree.js +96 -0
  59. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-workspace-root.js +67 -0
  60. package/cbb/worktrees/skills/openspec-close-worktree/scripts/remove-worktrees.js +124 -0
  61. package/cbb/worktrees/skills/openspec-close-worktree/scripts/safety-check.js +174 -0
  62. package/cbb/worktrees/skills/openspec-close-worktree/scripts/silence-popup.js +23 -0
  63. package/cbb/worktrees/skills/openspec-extend-worktree/SKILL.md +390 -0
  64. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-env.js +95 -0
  65. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-repos.js +98 -0
  66. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js +135 -0
  67. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/find-target-worktree.js +96 -0
  68. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/find-workspace-root.js +67 -0
  69. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/install-ai.js +150 -0
  70. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/list-available-apps.js +88 -0
  71. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/push-core.js +136 -0
  72. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/silence-popup.js +23 -0
  73. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/sync-repos.js +93 -0
  74. package/cbb/worktrees/skills/openspec-init-worktree/SKILL.md +539 -0
  75. package/cbb/worktrees/skills/openspec-init-worktree/scripts/auto-open.js +136 -0
  76. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-env-deep.js +87 -0
  77. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-env.js +90 -0
  78. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-repos.js +171 -0
  79. package/cbb/worktrees/skills/openspec-init-worktree/scripts/create-branches.js +103 -0
  80. package/cbb/worktrees/skills/openspec-init-worktree/scripts/create-worktrees.js +154 -0
  81. package/cbb/worktrees/skills/openspec-init-worktree/scripts/find-workspace-root.js +67 -0
  82. package/cbb/worktrees/skills/openspec-init-worktree/scripts/generate-app-options.js +93 -0
  83. package/cbb/worktrees/skills/openspec-init-worktree/scripts/install-ai.js +177 -0
  84. package/cbb/worktrees/skills/openspec-init-worktree/scripts/parse-config.js +67 -0
  85. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-branches.js +101 -0
  86. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-core.js +136 -0
  87. package/cbb/worktrees/skills/openspec-init-worktree/scripts/silence-popup.js +23 -0
  88. package/cbb/worktrees/skills/openspec-init-worktree/scripts/sync-repos.js +95 -0
  89. package/cbb/worktrees/skills/openspec-init-worktree/scripts/update-gitignore.js +134 -0
  90. package/cbb/worktrees/skills/openspec-push-worktrees/SKILL.md +307 -0
  91. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/commit-worktrees.js +269 -0
  92. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/find-target-worktree.js +96 -0
  93. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/find-workspace-root.js +67 -0
  94. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/push-core.js +136 -0
  95. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/push-worktrees.js +159 -0
  96. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/silence-popup.js +23 -0
  97. package/config/cbb.yaml +6 -0
  98. package/config/config.sample.json +16 -0
  99. package/config/openspec/config.yaml +28 -0
  100. package/config/openspec/schemas/spec-driven/schema.yaml +247 -0
  101. package/config/openspec/schemas/spec-driven/templates/design.md +475 -0
  102. package/config/openspec/schemas/spec-driven/templates/proposal.md +58 -0
  103. package/config/openspec/schemas/spec-driven/templates/spec.md +8 -0
  104. package/config/openspec/schemas/spec-driven/templates/tasks.md +9 -0
  105. package/config/workspaces.json +15 -0
  106. package/openspec/.version +6 -0
  107. package/openspec/commands/apply.md +182 -0
  108. package/openspec/commands/archive.md +223 -0
  109. package/openspec/commands/bulk-archive.md +334 -0
  110. package/openspec/commands/continue.md +112 -0
  111. package/openspec/commands/explore.md +206 -0
  112. package/openspec/commands/ff.md +111 -0
  113. package/openspec/commands/new.md +70 -0
  114. package/openspec/commands/onboard.md +555 -0
  115. package/openspec/commands/propose.md +157 -0
  116. package/openspec/commands/sync.md +256 -0
  117. package/openspec/commands/update.md +85 -0
  118. package/openspec/commands/verify.md +169 -0
  119. package/openspec/skills/openspec-apply-change/SKILL.md +187 -0
  120. package/openspec/skills/openspec-archive-change/SKILL.md +181 -0
  121. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +338 -0
  122. package/openspec/skills/openspec-continue-change/SKILL.md +117 -0
  123. package/openspec/skills/openspec-explore/SKILL.md +342 -0
  124. package/openspec/skills/openspec-ff-change/SKILL.md +116 -0
  125. package/openspec/skills/openspec-new-change/SKILL.md +76 -0
  126. package/openspec/skills/openspec-onboard/SKILL.md +560 -0
  127. package/openspec/skills/openspec-propose/SKILL.md +162 -0
  128. package/openspec/skills/openspec-sync-specs/SKILL.md +261 -0
  129. package/openspec/skills/openspec-update-change/SKILL.md +90 -0
  130. package/openspec/skills/openspec-verify-change/SKILL.md +174 -0
  131. package/package.json +46 -0
  132. package/superpowers/.version +6 -0
  133. package/superpowers/skills/brainstorming/SKILL.md +250 -0
  134. package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -0
  135. package/superpowers/skills/brainstorming/scripts/helper.js +167 -0
  136. package/superpowers/skills/brainstorming/scripts/server.cjs +723 -0
  137. package/superpowers/skills/brainstorming/scripts/start-server.sh +209 -0
  138. package/superpowers/skills/brainstorming/scripts/stop-server.sh +120 -0
  139. package/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  140. package/superpowers/skills/brainstorming/visual-companion.md +299 -0
  141. package/superpowers/skills/dispatching-parallel-agents/SKILL.md +167 -0
  142. package/superpowers/skills/executing-plans/SKILL.md +64 -0
  143. package/superpowers/skills/finishing-a-development-branch/SKILL.md +225 -0
  144. package/superpowers/skills/receiving-code-review/SKILL.md +205 -0
  145. package/superpowers/skills/requesting-code-review/SKILL.md +95 -0
  146. package/superpowers/skills/requesting-code-review/code-reviewer.md +181 -0
  147. package/superpowers/skills/subagent-driven-development/SKILL.md +568 -0
  148. package/superpowers/skills/subagent-driven-development/implementer-prompt.md +154 -0
  149. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +115 -0
  150. package/superpowers/skills/subagent-driven-development/scripts/review-package +46 -0
  151. package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +40 -0
  152. package/superpowers/skills/subagent-driven-development/scripts/task-brief +41 -0
  153. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +207 -0
  154. package/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -0
  155. package/superpowers/skills/systematic-debugging/SKILL.md +283 -0
  156. package/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  157. package/superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -0
  158. package/superpowers/skills/systematic-debugging/defense-in-depth.md +122 -0
  159. package/superpowers/skills/systematic-debugging/find-polluter.sh +72 -0
  160. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -0
  161. package/superpowers/skills/systematic-debugging/test-academic.md +14 -0
  162. package/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -0
  163. package/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -0
  164. package/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -0
  165. package/superpowers/skills/test-driven-development/SKILL.md +320 -0
  166. package/superpowers/skills/test-driven-development/writing-good-tests.md +198 -0
  167. package/superpowers/skills/using-git-worktrees/SKILL.md +167 -0
  168. package/superpowers/skills/using-superpowers/SKILL.md +63 -0
  169. package/superpowers/skills/using-superpowers/references/antigravity-tools.md +23 -0
  170. package/superpowers/skills/using-superpowers/references/codex-tools.md +108 -0
  171. package/superpowers/skills/using-superpowers/references/gemini-tools.md +63 -0
  172. package/superpowers/skills/using-superpowers/references/hermes-tools.md +56 -0
  173. package/superpowers/skills/using-superpowers/references/pi-tools.md +16 -0
  174. package/superpowers/skills/verification-before-completion/SKILL.md +120 -0
  175. package/superpowers/skills/writing-plans/SKILL.md +171 -0
  176. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  177. package/superpowers/skills/writing-skills/SKILL.md +679 -0
  178. package/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -0
  179. package/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  180. package/superpowers/skills/writing-skills/graphviz-conventions.dot +172 -0
  181. package/superpowers/skills/writing-skills/persuasion-principles.md +187 -0
  182. package/superpowers/skills/writing-skills/render-graphs.js +169 -0
  183. package/superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -0
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: "OPSX: Verify"
3
+ description: Verify implementation matches change artifacts before archiving
4
+ category: Workflow
5
+ tags: [workflow, verify, experimental]
6
+ ---
7
+ Verify that an implementation matches the change artifacts (specs, tasks, design).
8
+
9
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
10
+
11
+ **Input**: Optionally specify a change name after `/opsx:verify` (e.g., `/opsx:verify add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
12
+
13
+ **Steps**
14
+
15
+ 1. **Select the change**
16
+
17
+ If a name is provided, use it. Otherwise:
18
+ - Infer from conversation context if the user mentioned a change
19
+ - Auto-select if only one active change exists
20
+ - If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
21
+
22
+ When prompting, show changes that have implementation tasks (tasks artifact exists).
23
+ Include the schema used for each change if available.
24
+ Mark changes with incomplete tasks as "(In Progress)".
25
+
26
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:verify <other>`).
27
+
28
+ 2. **Check status to understand the schema**
29
+ ```bash
30
+ openspec status --change "<name>" --json
31
+ ```
32
+ Parse the JSON to understand:
33
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
34
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
35
+ - Which artifacts exist for this change
36
+
37
+ 3. **Get planning context and load artifacts**
38
+
39
+ ```bash
40
+ openspec instructions apply --change "<name>" --json
41
+ ```
42
+
43
+ This returns the change directory and `contextFiles` (artifact ID -> array of concrete file paths). Read all available artifacts from `contextFiles`.
44
+
45
+ 4. **Initialize verification report structure**
46
+
47
+ Create a report structure with three dimensions:
48
+ - **Completeness**: Track tasks and spec coverage
49
+ - **Correctness**: Track requirement implementation and scenario coverage
50
+ - **Coherence**: Track design adherence and pattern consistency
51
+
52
+ Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
53
+
54
+ 5. **Verify Completeness**
55
+
56
+ **Task Completion**:
57
+ - If `contextFiles.tasks` exists, read every file path in it
58
+ - Parse checkboxes: `- [ ]` (incomplete) vs `- [x]` (complete)
59
+ - Count complete vs total tasks
60
+ - If incomplete tasks exist:
61
+ - Add CRITICAL issue for each incomplete task
62
+ - Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
63
+
64
+ **Spec Coverage**:
65
+ - If delta specs exist in `contextFiles.specs`:
66
+ - Extract all requirements (marked with "### Requirement:")
67
+ - For each requirement:
68
+ - Search codebase for keywords related to the requirement
69
+ - Assess if implementation likely exists
70
+ - If requirements appear unimplemented:
71
+ - Add CRITICAL issue: "Requirement not found: <requirement name>"
72
+ - Recommendation: "Implement requirement X: <description>"
73
+
74
+ 6. **Verify Correctness**
75
+
76
+ **Requirement Implementation Mapping**:
77
+ - For each requirement from delta specs:
78
+ - Search codebase for implementation evidence
79
+ - If found, note file paths and line ranges
80
+ - Assess if implementation matches requirement intent
81
+ - If divergence detected:
82
+ - Add WARNING: "Implementation may diverge from spec: <details>"
83
+ - Recommendation: "Review <file>:<lines> against requirement X"
84
+
85
+ **Scenario Coverage**:
86
+ - For each scenario in delta specs (marked with "#### Scenario:"):
87
+ - Check if conditions are handled in code
88
+ - Check if tests exist covering the scenario
89
+ - If scenario appears uncovered:
90
+ - Add WARNING: "Scenario not covered: <scenario name>"
91
+ - Recommendation: "Add test or implementation for scenario: <description>"
92
+
93
+ 7. **Verify Coherence**
94
+
95
+ **Design Adherence**:
96
+ - If `contextFiles.design` exists:
97
+ - Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
98
+ - Verify implementation follows those decisions
99
+ - If contradiction detected:
100
+ - Add WARNING: "Design decision not followed: <decision>"
101
+ - Recommendation: "Update implementation or revise design.md to match reality"
102
+ - If no design.md: Skip design adherence check, note "No design.md to verify against"
103
+
104
+ **Code Pattern Consistency**:
105
+ - Review new code for consistency with project patterns
106
+ - Check file naming, directory structure, coding style
107
+ - If significant deviations found:
108
+ - Add SUGGESTION: "Code pattern deviation: <details>"
109
+ - Recommendation: "Consider following project pattern: <example>"
110
+
111
+ 8. **Generate Verification Report**
112
+
113
+ **Summary Scorecard**:
114
+ ```markdown
115
+ ## Verification Report: <change-name>
116
+
117
+ ### Summary
118
+ | Dimension | Status |
119
+ |--------------|------------------|
120
+ | Completeness | X/Y tasks, N reqs|
121
+ | Correctness | M/N reqs covered |
122
+ | Coherence | Followed/Issues |
123
+ ```
124
+
125
+ **Issues by Priority**:
126
+
127
+ 1. **CRITICAL** (Must fix before archive):
128
+ - Incomplete tasks
129
+ - Missing requirement implementations
130
+ - Each with specific, actionable recommendation
131
+
132
+ 2. **WARNING** (Should fix):
133
+ - Spec/design divergences
134
+ - Missing scenario coverage
135
+ - Each with specific recommendation
136
+
137
+ 3. **SUGGESTION** (Nice to fix):
138
+ - Pattern inconsistencies
139
+ - Minor improvements
140
+ - Each with specific recommendation
141
+
142
+ **Final Assessment**:
143
+ - If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
144
+ - If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
145
+ - If all clear: "All checks passed. Ready for archive."
146
+
147
+ **Verification Heuristics**
148
+
149
+ - **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
150
+ - **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
151
+ - **Coherence**: Look for glaring inconsistencies, don't nitpick style
152
+ - **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
153
+ - **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
154
+
155
+ **Graceful Degradation**
156
+
157
+ - If only tasks.md exists: verify task completion only, skip spec/design checks
158
+ - If tasks + specs exist: verify completeness and correctness, skip design
159
+ - If full artifacts: verify all three dimensions
160
+ - Always note which checks were skipped and why
161
+
162
+ **Output Format**
163
+
164
+ Use clear markdown with:
165
+ - Table for summary scorecard
166
+ - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
167
+ - Code references in format: `file.ts:123`
168
+ - Specific, actionable recommendations
169
+ - No vague suggestions like "consider reviewing"
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: openspec-apply-change
3
+ description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+
12
+ Implement tasks from an OpenSpec change.
13
+
14
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
15
+
16
+ **Input**: Optionally specify a change name (e.g., `/openspec-apply-change add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
17
+
18
+ **Steps**
19
+
20
+ 1. **Select the change**
21
+
22
+ If a name is provided, use it. Otherwise:
23
+ - Infer from conversation context if the user mentioned a change
24
+ - Auto-select if only one active change exists
25
+ - If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
26
+
27
+ Always announce: "Using change: <name>" and how to override (e.g., `/openspec-apply-change <other>`).
28
+
29
+ 2. **Check status to understand the schema**
30
+ ```bash
31
+ openspec status --change "<name>" --json
32
+ ```
33
+ Parse the JSON to understand:
34
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
35
+ - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
36
+ - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
37
+
38
+ 3. **Get apply instructions**
39
+
40
+ ```bash
41
+ openspec instructions apply --change "<name>" --json
42
+ ```
43
+
44
+ This returns:
45
+ - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
46
+ - Progress (total, complete, remaining)
47
+ - Task list with status
48
+ - Dynamic instruction based on current state
49
+ - Optional `context`: current required project instruction input from the selected root
50
+ - Optional `operationGuidance`: current advisory guidance for apply
51
+
52
+ **Handle states:**
53
+ - If `state: "blocked"` (missing artifacts): show message, suggest using `/openspec-continue-change` (if it is not installed, run `openspec status --change "<name>" --json` to see the next artifact and `openspec instructions <artifact-id> --change "<name>" --json` for how to create it)
54
+ - If `state: "all_done"`: congratulate, suggest archive
55
+ - Otherwise: proceed to implementation
56
+
57
+ Treat `context` as a required prompt-level input. Read and consider it, and
58
+ apply relevant project facts, conventions, and constraints while implementing.
59
+ Treat `operationGuidance` as optional additive advice. Read and consider every
60
+ entry, and follow entries that are applicable and compatible with the built-in
61
+ workflow.
62
+
63
+ Keep both fields separate from CLI-returned state, missing artifacts, tasks,
64
+ progress, `contextFiles`, and the built-in `instruction`. They are not
65
+ evidence of task completion, do not replace the built-in instruction, and do
66
+ not permit bypassing a blocked state. If context conflicts with the built-in
67
+ instruction, an explicit user choice, or a CLI-controlled value, report the
68
+ conflict and preserve the controlling value. If guidance is inapplicable or
69
+ conflicts with those controlling inputs, do not follow it and explain why.
70
+ These are prompt-level behavior contracts, not enforceable checks.
71
+
72
+ 4. **Read context files**
73
+
74
+ Read every file path listed under `contextFiles` from the apply instructions output.
75
+ The files depend on the schema being used:
76
+ - **spec-driven**: proposal, specs, design, tasks
77
+ - Other schemas: follow the contextFiles from CLI output
78
+
79
+ Do not copy `context` or `operationGuidance` verbatim into implementation
80
+ files or planning artifacts unless the user separately asks for that content.
81
+
82
+ 5. **Show current progress**
83
+
84
+ Display:
85
+ - Schema being used
86
+ - Progress: "N/M tasks complete"
87
+ - Remaining tasks overview
88
+ - Dynamic instruction from CLI
89
+
90
+ 6. **Implement tasks (loop until done or blocked)**
91
+
92
+ For each pending task:
93
+ - Show which task is being worked on
94
+ - Make the code changes required
95
+ - Keep changes minimal and focused
96
+ - Mark task complete in the tasks file: `- [ ]` → `- [x]`
97
+ - Continue to next task
98
+
99
+ **Pause if:**
100
+ - Task is unclear → ask for clarification
101
+ - Implementation reveals a design issue → suggest updating artifacts
102
+ - A task needs work beyond what the spec and tasks describe, or you are tempted to drop, narrow, defer, or accept exceptions to specified behavior to make it fit → surface the added scope and ask; do not absorb it silently
103
+ - Error or blocker encountered → report and wait for guidance
104
+ - User interrupts
105
+
106
+ 7. **On completion or pause, show status**
107
+
108
+ Display:
109
+ - Tasks completed this session
110
+ - Overall progress: "N/M tasks complete"
111
+ - If all done: suggest archive
112
+ - If paused: explain why and wait for guidance
113
+
114
+ **Output During Implementation**
115
+
116
+ ```
117
+ ## Implementing: <change-name> (schema: <schema-name>)
118
+
119
+ Working on task 3/7: <task description>
120
+ [...implementation happening...]
121
+ ✓ Task complete
122
+
123
+ Working on task 4/7: <task description>
124
+ [...implementation happening...]
125
+ ✓ Task complete
126
+ ```
127
+
128
+ **Output On Completion**
129
+
130
+ ```
131
+ ## Implementation Complete
132
+
133
+ **Change:** <change-name>
134
+ **Schema:** <schema-name>
135
+ **Progress:** 7/7 tasks complete ✓
136
+
137
+ ### Completed This Session
138
+ - [x] Task 1
139
+ - [x] Task 2
140
+ ...
141
+
142
+ All tasks complete! You can archive this change with `/openspec-archive-change`.
143
+ ```
144
+
145
+ **Output On Pause (Issue Encountered)**
146
+
147
+ ```
148
+ ## Implementation Paused
149
+
150
+ **Change:** <change-name>
151
+ **Schema:** <schema-name>
152
+ **Progress:** 4/7 tasks complete
153
+
154
+ ### Issue Encountered
155
+ <description of the issue>
156
+
157
+ **Options:**
158
+ 1. <option 1>
159
+ 2. <option 2>
160
+ 3. Other approach
161
+
162
+ What would you like to do?
163
+ ```
164
+
165
+ **Guardrails**
166
+ - Keep going through tasks until done or blocked
167
+ - Always read context files before starting (from the apply instructions output)
168
+ - If task is ambiguous, pause and ask before implementing
169
+ - If implementation reveals issues, pause and suggest artifact updates
170
+ - Keep code changes minimal and scoped to each task
171
+ - Update task checkbox immediately after completing each task
172
+ - Pause on errors, blockers, or unclear requirements - don't guess
173
+ - When a task needs work beyond what the spec describes, surface the added scope and pause - never silently narrow, defer, or simplify away specified behavior
174
+ - Only mark a task `- [x]` when its specified behavior is fully implemented, not when it is partially done or deferred
175
+ - Use contextFiles from CLI output, don't assume specific file names
176
+ - Do not use context or operation guidance as proof that a task is complete
177
+ - Apply relevant project context; report conflicts with controlling workflow inputs
178
+ - Consider every guidance entry; explain any inapplicable or conflicting advice
179
+ - Do not copy runtime context or operation guidance into implementation files or planning artifacts
180
+ - Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
181
+
182
+ **Fluid Workflow Integration**
183
+
184
+ This skill supports the "actions on a change" model:
185
+
186
+ - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
187
+ - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: openspec-archive-change
3
+ description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+
12
+ Archive a completed change in the experimental workflow.
13
+
14
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
15
+
16
+ `<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
17
+
18
+ **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
19
+
20
+ **Steps**
21
+
22
+ 1. **Select the change**
23
+
24
+ If a name is provided, use it. Otherwise:
25
+ - Infer from conversation context if the user mentioned a change
26
+ - Auto-select if only one active change exists
27
+ - If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
28
+
29
+ When prompting, show only active changes (not already archived).
30
+ Include the schema used for each change if available.
31
+
32
+ Always announce: "Using change: <name>" and how to override (e.g., `/openspec-archive-change <other>`).
33
+
34
+ **Load current archive inputs before the existing archive checks:**
35
+
36
+ After resolving the selected change and planning root, run:
37
+ ```bash
38
+ openspec instructions archive --change "<name>" --json
39
+ ```
40
+ Keep the same selected-root flags on this command. This lookup is advisory and
41
+ optional: it only supplies extra prompt inputs, so it must never block archiving.
42
+ If it exits non-zero or returns invalid JSON — for example on an older CLI that
43
+ does not support this command yet — continue the archive workflow with no
44
+ context and no operation guidance. Do not report an error and do not stop.
45
+
46
+ A successful response may omit both optional fields. Treat `context` as a
47
+ required prompt-level input: read and consider it, and apply relevant project
48
+ facts, conventions, and constraints. Treat `operationGuidance` as optional
49
+ additive advice: read and consider every entry, and follow entries that are
50
+ applicable and compatible with the built-in archive workflow.
51
+
52
+ Keep both fields separate from built-in steps, explicit user choices, resolved
53
+ paths, CLI checks, and command contracts. If context conflicts with one of those
54
+ controlling inputs, report the conflict and preserve the controlling value. If
55
+ guidance is inapplicable or conflicts with a controlling input, do not follow it
56
+ and explain why. Do not infer replacement paths, skipped prompts, or flags from
57
+ either field, and do not copy their text verbatim into specs, change artifacts,
58
+ or archive summaries unless the user separately asks for it. These are
59
+ prompt-level behavior contracts, not enforceable checks.
60
+
61
+ 2. **Check artifact completion status**
62
+
63
+ Run `openspec status --change "<name>" --json` to check artifact completion.
64
+
65
+ Parse the JSON to understand:
66
+ - `schemaName`: The workflow being used
67
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
68
+ - `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
69
+
70
+ **If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
71
+ - Display warning listing incomplete artifacts
72
+ - Ask the user to confirm they want to proceed
73
+ - Proceed if user confirms
74
+
75
+ 3. **Check task completion status**
76
+
77
+ Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
78
+
79
+ Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
80
+
81
+ **If incomplete tasks found:**
82
+ - Display warning showing count of incomplete tasks
83
+ - Ask the user to confirm they want to proceed
84
+ - Proceed if user confirms
85
+
86
+ **If no tasks file exists:** Proceed without task-related warning.
87
+
88
+ 4. **Assess delta spec sync state**
89
+
90
+ Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
91
+ delta-spec source. If the `specs` entry is missing or
92
+ `existingOutputPaths` is empty, proceed without a sync prompt and do not infer
93
+ delta specs from other artifacts.
94
+
95
+ **If delta specs exist:**
96
+ - Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)
97
+ - Determine what changes would be applied (adds, modifications, removals, renames)
98
+ - Show a combined summary before prompting
99
+
100
+ **Prompt options:**
101
+ - If changes needed: "Sync now (recommended)", "Archive without syncing"
102
+ - If already synced: "Archive now", "Sync anyway", "Cancel"
103
+
104
+ Route on the answer:
105
+ - "Cancel" — stop, do not archive
106
+ - "Archive without syncing" or "Archive now" — proceed to archive
107
+ - "Sync now" or "Sync anyway" — sync, then verify (below)
108
+ - Anything else — ask again rather than archiving
109
+
110
+ Before a selected sync writes any main spec, run
111
+ `openspec instructions specs --change "<name>" --json` once with the same
112
+ selected-root flags. Require a zero exit status and valid artifact-instruction
113
+ JSON. If the lookup fails or returns invalid JSON, report the error and stop
114
+ before writing any main spec or moving the change. A valid response with omitted
115
+ `rules` is the no-rules case. Apply returned `rules` only to the content and
116
+ form of main specs produced by this merge; do not use them as archive guidance,
117
+ change CLI behavior, or copy the rule text into any output file.
118
+
119
+ Then run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
120
+
121
+ Then re-run the comparison from the top of this step against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
122
+ - ADDED requirements present
123
+ - MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
124
+ - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
125
+ - RENAMED requirements present under the new name and absent under the old one
126
+
127
+ If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
128
+
129
+ 5. **Perform the archive**
130
+
131
+ Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
132
+ ```bash
133
+ mkdir -p "<planningHome.changesDir>/archive"
134
+ ```
135
+
136
+ Generate the target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
137
+
138
+ **Check if target already exists:**
139
+ - If yes: Fail with error, suggest renaming existing archive or using different date
140
+ - If no: Move `changeRoot` to the archive directory
141
+
142
+ ```bash
143
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
144
+ ```
145
+
146
+ 6. **Display summary**
147
+
148
+ Show archive completion summary including:
149
+ - Change name
150
+ - Schema that was used
151
+ - Archive location
152
+ - Whether specs were synced (if applicable)
153
+ - Note about any warnings (incomplete artifacts/tasks)
154
+
155
+ **Output On Success**
156
+
157
+ ```markdown
158
+ ## Archive Complete
159
+
160
+ **Change:** <change-name>
161
+ **Schema:** <schema-name>
162
+ **Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
163
+ **Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
164
+
165
+ <"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
166
+ ```
167
+
168
+ **Guardrails**
169
+ - Announce the selected change; prompt for selection when it is ambiguous
170
+ - Use artifact graph (openspec status --json) for completion checking
171
+ - Don't block archive on warnings - just inform and confirm
172
+ - Preserve .openspec.yaml when moving to archive (it moves with the directory)
173
+ - Show clear summary of what happened
174
+ - If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven)
175
+ - Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
176
+ - If delta specs exist, always run the sync assessment and show the combined summary before prompting
177
+ - Apply relevant runtime context and report conflicts; operation guidance remains advisory
178
+ - Consider every guidance entry and explain any inapplicable or conflicting advice
179
+ - Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
180
+ - Artifact rules constrain only the specs being written and are never operation guidance
181
+ - Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files