@jspg-ai/coding-bb 0.0.3-beta.4 → 0.0.3-beta.7

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 (85) hide show
  1. package/cbb/dev-standards/rules/cbb-ai-behavior.md +118 -116
  2. package/cbb/lib/install/codebuddy.js +32 -0
  3. package/cbb/lib/install/init.js +85 -35
  4. package/cbb/lib/install/rule-rewrite.js +27 -0
  5. package/cbb/lib/install/trae.js +35 -0
  6. package/cbb/lib/openspec/index.js +337 -554
  7. package/cbb/lib/superpowers/index.js +246 -265
  8. package/cbb/lib/utils/check-update.js +8 -1
  9. package/cbb/lib/utils/gitignore.js +2 -0
  10. package/cbb/lib/utils/settings.js +17 -4
  11. package/cbb/lib/utils/tar.js +92 -0
  12. package/cbb/lib/utils/upstream.js +90 -0
  13. package/cbb/worktrees/commands/worktree-close.md +1 -1
  14. package/config/upstream-mirrors.json +12 -0
  15. package/config/workspace-agents.sample.md +41 -39
  16. package/openspec/.version +2 -3
  17. package/openspec/commands/apply.md +189 -175
  18. package/openspec/commands/archive.md +237 -216
  19. package/openspec/commands/bulk-archive.md +355 -327
  20. package/openspec/commands/continue.md +116 -105
  21. package/openspec/commands/explore.md +230 -199
  22. package/openspec/commands/ff.md +115 -104
  23. package/openspec/commands/new.md +74 -63
  24. package/openspec/commands/onboard.md +557 -548
  25. package/openspec/commands/propose.md +161 -150
  26. package/openspec/commands/sync.md +277 -249
  27. package/openspec/commands/update.md +92 -80
  28. package/openspec/commands/verify.md +175 -162
  29. package/openspec/skills/openspec-apply-change/SKILL.md +20 -5
  30. package/openspec/skills/openspec-archive-change/SKILL.md +30 -8
  31. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +36 -6
  32. package/openspec/skills/openspec-continue-change/SKILL.md +14 -2
  33. package/openspec/skills/openspec-explore/SKILL.md +21 -9
  34. package/openspec/skills/openspec-ff-change/SKILL.md +14 -2
  35. package/openspec/skills/openspec-new-change/SKILL.md +13 -1
  36. package/openspec/skills/openspec-onboard/SKILL.md +49 -39
  37. package/openspec/skills/openspec-propose/SKILL.md +15 -3
  38. package/openspec/skills/openspec-sync-specs/SKILL.md +31 -2
  39. package/openspec/skills/openspec-update-change/SKILL.md +27 -14
  40. package/openspec/skills/openspec-verify-change/SKILL.md +17 -3
  41. package/package.json +2 -2
  42. package/superpowers/.version +4 -4
  43. package/superpowers/skills/brainstorming/SKILL.md +47 -12
  44. package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -213
  45. package/superpowers/skills/brainstorming/scripts/server.cjs +723 -723
  46. package/superpowers/skills/brainstorming/visual-companion.md +6 -6
  47. package/superpowers/skills/diagnosing-superpowers/SKILL.md +120 -0
  48. package/superpowers/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
  49. package/superpowers/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
  50. package/superpowers/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
  51. package/superpowers/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
  52. package/superpowers/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
  53. package/superpowers/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
  54. package/superpowers/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
  55. package/superpowers/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
  56. package/superpowers/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
  57. package/superpowers/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
  58. package/superpowers/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
  59. package/superpowers/skills/diagnosing-superpowers/references/context-safety.md +22 -0
  60. package/superpowers/skills/diagnosing-superpowers/references/github-issues.md +47 -0
  61. package/superpowers/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
  62. package/superpowers/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
  63. package/superpowers/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
  64. package/superpowers/skills/diagnosing-superpowers/templates/case.md +64 -0
  65. package/superpowers/skills/diagnosing-superpowers/templates/issue.md +51 -0
  66. package/superpowers/skills/diagnosing-superpowers/templates/report.md +82 -0
  67. package/superpowers/skills/executing-plans/SKILL.md +350 -41
  68. package/superpowers/skills/executing-plans/scripts/task-done +52 -0
  69. package/superpowers/skills/executing-plans/scripts/task-start +28 -0
  70. package/superpowers/skills/requesting-code-review/SKILL.md +1 -1
  71. package/superpowers/skills/requesting-code-review/code-reviewer.md +17 -0
  72. package/superpowers/skills/subagent-driven-development/SKILL.md +18 -18
  73. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +1 -1
  74. package/superpowers/skills/subagent-driven-development/scripts/review-package +53 -46
  75. package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +82 -40
  76. package/superpowers/skills/subagent-driven-development/scripts/task-brief +43 -41
  77. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +2 -2
  78. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
  79. package/superpowers/skills/test-driven-development/SKILL.md +10 -0
  80. package/superpowers/skills/using-superpowers/SKILL.md +2 -0
  81. package/superpowers/skills/using-superpowers/references/claude-code-tools.md +29 -0
  82. package/superpowers/skills/using-superpowers/references/muse-tools.md +35 -0
  83. package/superpowers/skills/writing-plans/SKILL.md +30 -9
  84. package/superpowers/skills/writing-skills/SKILL.md +4 -2
  85. package/superpowers/skills/writing-skills/graphviz-conventions.dot +171 -171
@@ -1,85 +1,97 @@
1
1
  ---
2
2
  name: "OPSX: Update"
3
- description:
3
+ description: Update a change - revise existing planning artifacts and keep them coherent (Experimental)
4
4
  category: Workflow
5
5
  tags: [workflow, artifacts, experimental]
6
6
  ---
7
- Revise a change's existing planning artifacts and keep them coherent. Never edit code.
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:update` (e.g., `/opsx:update 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
- `/opsx:continue` is an optional workflow and may not be installed. Before suggesting it anywhere below, verify that it is available. If it is unavailable, `openspec status --change "<name>" --json` shows the next artifact and `openspec instructions "<artifact-id>" --change "<name>" --json` explains how to create it.
14
-
15
- **Steps**
16
-
17
- 1. **Select the change**
18
-
19
- If a name is provided, use it. Otherwise:
20
- - Infer from conversation context if the user mentioned a change
21
- - Auto-select if only one active change exists
22
- - If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
23
-
24
- When prompting, present the top 3-4 most recently modified changes as options, showing:
25
- - Change name
26
- - Schema (from `schema` field if present, otherwise "spec-driven")
27
- - Status (e.g., "0/5 tasks", "complete", "no tasks")
28
- - How recently it was modified (from `lastModified` field)
29
-
30
- Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
31
-
32
- Always announce: "Using change: <name>" and how to override (e.g., `/opsx:update <other>`).
33
-
34
- 2. **Get the change's artifacts**
35
- ```bash
36
- openspec status --change "<name>" --json
37
- ```
38
- Parse the JSON to understand current state. The response includes:
39
- - `schemaName`: The workflow schema being used (e.g., "spec-driven")
40
- - `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
41
- - `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
42
- - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
43
-
44
- The artifact ids and paths come from the active schema - do NOT assume them, and do NOT branch on hardcoded artifact names. Custom schemas must work unchanged.
45
-
46
- The files to edit are `artifactPaths.<id>.existingOutputPaths` - the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. `specs/**/*.md`). Do NOT write to `resolvedOutputPath`: for a glob artifact it is still the glob pattern, not a real file.
47
-
48
- 3. **Understand the request**
49
- - If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
50
- - If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
51
-
52
- 4. **Read and reconcile**
53
- - Read the artifact(s) the request touches and the change's other existing artifacts.
54
- - Apply the requested edit. Then check every other existing artifact against it - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
55
- - Note everything that is now inconsistent, missing, or contradictory.
56
- - Revise only files that already exist (`existingOutputPaths`). Do NOT create artifacts that don't exist yet, and do NOT invent new files under a glob artifact - note them and point the user to `/opsx:continue` to create them.
57
- - If the change is already coherent, say so and make no edits.
58
-
59
- 5. **Confirm and apply, one artifact at a time**
60
- - Show each proposed revision and why. Write only after the user confirms.
61
- - If the user rejects a revision, do not write it - leave that artifact unchanged.
62
- - When a substantial rewrite is needed, get that artifact's rules and template first:
63
- ```bash
64
- openspec instructions "<artifact-id>" --change "<name>" --json
65
- ```
66
-
67
- 6. **Point to the next step (guidance only - NEVER act on it)**
68
- - Artifacts still missing -> suggest `/opsx:continue` to create them.
69
- - Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `/opsx:apply` to carry the delta into code.
70
- - Everything done and implemented -> suggest `/opsx:archive`.
71
-
72
- **Output**
73
-
74
- After each invocation, show:
75
- - Which artifacts were revised (and which proposed revisions were rejected)
76
- - Anything deferred to `/opsx:continue` (not-yet-created artifacts or files)
77
- - Where the change stands and the recommended next command
78
-
79
- **Guardrails**
80
- - Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/opsx:apply`.
81
- - Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
82
- - Edit only the concrete files in `existingOutputPaths`; never write to a glob `resolvedOutputPath`.
83
- - Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is `/opsx:continue`'s job.
84
- - Confirm every edit with the user before writing.
85
- - If the request changes the change's *intent* rather than refining it, first verify whether the optional `/opsx:new` workflow is available. If it is, recommend starting fresh with `/opsx:new` (the "Update vs. Start Fresh" heuristic). If it is unavailable, ask for a distinct unused change name and recommend `openspec new change "<new-change-name>"` instead.
7
+ Revise a change's existing planning artifacts and keep them coherent. Never edit code.
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`, `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.
10
+
11
+ **Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
12
+
13
+ One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
14
+
15
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
16
+
17
+ - **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
18
+ - **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
19
+
20
+ In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
21
+
22
+ **Input**: Optionally specify a change name after `/opsx:update` (e.g., `/opsx:update add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
23
+
24
+ This workflow revises artifacts that already exist; `/opsx:continue` is what creates the ones that do not.
25
+
26
+ **Steps**
27
+
28
+ 1. **Select the change**
29
+
30
+ If a name is provided, use it. Otherwise:
31
+ - Infer from conversation context if the user mentioned a change
32
+ - Auto-select if only one active change exists
33
+ - If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
34
+
35
+ When prompting, present the top 3-4 most recently modified changes as options, showing:
36
+ - Change name
37
+ - Schema (from `schema` field if present, otherwise "spec-driven")
38
+ - Status (e.g., "0/5 tasks", "complete", "no tasks")
39
+ - How recently it was modified (from `lastModified` field)
40
+
41
+ Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
42
+
43
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:update <other>`).
44
+
45
+ 2. **Get the change's artifacts**
46
+ ```bash
47
+ openspec status --change "<name>" --json
48
+ ```
49
+ Parse the JSON to understand current state. The response includes:
50
+ - `schemaName`: The workflow schema being used (e.g., "spec-driven")
51
+ - `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
52
+ - `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
53
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
54
+
55
+ The artifact ids and paths come from the active schema - do NOT assume them, and do NOT branch on hardcoded artifact names. Custom schemas must work unchanged.
56
+
57
+ The files to edit are `artifactPaths.<id>.existingOutputPaths` - the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. `specs/**/*.md`). Do NOT write to `resolvedOutputPath`: for a glob artifact it is still the glob pattern, not a real file.
58
+
59
+ 3. **Understand the request**
60
+ - If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
61
+ - If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
62
+
63
+ 4. **Read and reconcile**
64
+ - Read the artifact(s) the request touches and the change's other existing artifacts.
65
+ - Draft the requested edit in the conversation, not in files. Work out exactly what it changes; step 5 owns every write. Then check every other existing artifact against the drafted edit - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
66
+ - Note everything that is now inconsistent, missing, or contradictory.
67
+ - Propose revisions only to files that already exist (`existingOutputPaths`). Do NOT create artifacts that don't exist yet, and do NOT invent new files under a glob artifact - note them and point the user to `/opsx:continue` to create them.
68
+ - If the change is already coherent, say so and propose no revisions.
69
+
70
+ 5. **Confirm and apply, one artifact at a time**
71
+ - This step performs every artifact write in this workflow; no earlier step edits an artifact.
72
+ - Show each proposed revision and why - including the requested edit drafted in step 4. Write only after the user confirms.
73
+ - If the user rejects a revision, do not write it - leave that artifact unchanged.
74
+ - When a substantial rewrite is needed, get that artifact's rules and template first:
75
+ ```bash
76
+ openspec instructions "<artifact-id>" --change "<name>" --json
77
+ ```
78
+
79
+ 6. **Point to the next step (guidance only - NEVER act on it)**
80
+ - Artifacts still missing -> suggest `/opsx:continue` to create them.
81
+ - Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `/opsx:apply` to carry the delta into code.
82
+ - Everything done and implemented -> suggest `/opsx:archive`.
83
+
84
+ **Output**
85
+
86
+ After each invocation, show:
87
+ - Which artifacts were revised (and which proposed revisions were rejected)
88
+ - Anything deferred to `/opsx:continue` (not-yet-created artifacts or files)
89
+ - Where the change stands and the recommended next command
90
+
91
+ **Guardrails**
92
+ - Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/opsx:apply`.
93
+ - Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
94
+ - Edit only the concrete files in `existingOutputPaths`; never write to a glob `resolvedOutputPath`.
95
+ - Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is `/opsx:continue`'s job.
96
+ - Confirm every edit with the user before writing.
97
+ - If the request changes the change's *intent* rather than refining it, recommend starting fresh with `/opsx:new` (the "Update vs. Start Fresh" heuristic).
@@ -4,166 +4,179 @@ description: Verify implementation matches change artifacts before archiving
4
4
  category: Workflow
5
5
  tags: [workflow, verify, experimental]
6
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
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`, `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.
10
+
11
+ **Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
12
+
13
+ One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
14
+
15
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
16
+
17
+ - **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
18
+ - **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
19
+
20
+ In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
21
+
22
+ **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.
23
+
24
+ **Steps**
25
+
26
+ 1. **Select the change**
27
+
28
+ If a name is provided, use it. Otherwise:
29
+ - Infer from conversation context if the user mentioned a change
30
+ - Auto-select if only one active change exists
31
+ - If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
32
+
33
+ When prompting, show changes that have implementation tasks (tasks artifact exists).
34
+ Include the schema used for each change if available.
35
+ Mark changes with incomplete tasks as "(In Progress)".
36
+
37
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:verify <other>`).
38
+
39
+ 2. **Check status to understand the schema**
40
+ ```bash
41
+ openspec status --change "<name>" --json
42
+ ```
43
+ Parse the JSON to understand:
44
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
45
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
46
+ - Which artifacts exist for this change
47
+
48
+ 3. **Get planning context and load artifacts**
49
+
50
+ ```bash
51
+ openspec instructions apply --change "<name>" --json
52
+ ```
53
+
54
+ This returns the change directory and `contextFiles` (artifact ID -> array of concrete file paths). Read all available artifacts from `contextFiles`.
55
+
56
+ 4. **Initialize verification report structure**
57
+
58
+ Create a report structure with three dimensions:
59
+ - **Completeness**: Track tasks and spec coverage
60
+ - **Correctness**: Track requirement implementation and scenario coverage
61
+ - **Coherence**: Track design adherence and pattern consistency
62
+
63
+ Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
64
+
65
+ 5. **Verify Completeness**
66
+
67
+ **Task Completion**:
68
+ - If `contextFiles.tasks` exists, read every file path in it
69
+ - Parse checkboxes: complete means the box holds only `x`/`X`, ignoring
70
+ spacing (`- [ x]` is complete); every other marker is incomplete
71
+ (`- [ ]`, `- []`, and unfamiliar ones such as `- [~]` or `- [-]`)
72
+ - Count complete vs total tasks
73
+ - If incomplete tasks exist:
74
+ - Add CRITICAL issue for each incomplete task
75
+ - Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
76
+
77
+ **Spec Coverage**:
78
+ - If delta specs exist in `contextFiles.specs`:
79
+ - Extract all requirements (marked with "### Requirement:")
80
+ - For each requirement:
81
+ - Search codebase for keywords related to the requirement
82
+ - Assess if implementation likely exists
83
+ - If requirements appear unimplemented:
84
+ - Add CRITICAL issue: "Requirement not found: <requirement name>"
85
+ - Recommendation: "Implement requirement X: <description>"
86
+
87
+ 6. **Verify Correctness**
88
+
89
+ **Requirement Implementation Mapping**:
90
+ - For each requirement from delta specs:
91
+ - Search codebase for implementation evidence
92
+ - If found, note file paths and line ranges
93
+ - Assess if implementation matches requirement intent
94
+ - If divergence detected:
95
+ - Add WARNING: "Implementation may diverge from spec: <details>"
96
+ - Recommendation: "Review <file>:<lines> against requirement X"
97
+
98
+ **Scenario Coverage**:
99
+ - For each scenario in delta specs (marked with "#### Scenario:"):
100
+ - Check if conditions are handled in code
101
+ - Check if tests exist covering the scenario
102
+ - If scenario appears uncovered:
103
+ - Add WARNING: "Scenario not covered: <scenario name>"
104
+ - Recommendation: "Add test or implementation for scenario: <description>"
105
+
106
+ 7. **Verify Coherence**
107
+
108
+ **Design Adherence**:
109
+ - If `contextFiles.design` exists:
110
+ - Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
111
+ - Verify implementation follows those decisions
112
+ - If contradiction detected:
113
+ - Add WARNING: "Design decision not followed: <decision>"
114
+ - Recommendation: "Update implementation or revise design.md to match reality"
115
+ - If no design.md: Skip design adherence check, note "No design.md to verify against"
116
+
117
+ **Code Pattern Consistency**:
118
+ - Review new code for consistency with project patterns
119
+ - Check file naming, directory structure, coding style
120
+ - If significant deviations found:
121
+ - Add SUGGESTION: "Code pattern deviation: <details>"
122
+ - Recommendation: "Consider following project pattern: <example>"
123
+
124
+ 8. **Generate Verification Report**
125
+
126
+ **Summary Scorecard**:
127
+ ```markdown
128
+ ## Verification Report: <change-name>
129
+
130
+ ### Summary
131
+ | Dimension | Status |
132
+ |--------------|------------------|
133
+ | Completeness | X/Y tasks, N reqs|
134
+ | Correctness | M/N reqs covered |
135
+ | Coherence | Followed/Issues |
136
+ ```
137
+
138
+ **Issues by Priority**:
139
+
140
+ 1. **CRITICAL** (Must fix before archive):
141
+ - Incomplete tasks
142
+ - Missing requirement implementations
143
+ - Each with specific, actionable recommendation
144
+
145
+ 2. **WARNING** (Should fix):
146
+ - Spec/design divergences
147
+ - Missing scenario coverage
148
+ - Each with specific recommendation
149
+
150
+ 3. **SUGGESTION** (Nice to fix):
151
+ - Pattern inconsistencies
152
+ - Minor improvements
153
+ - Each with specific recommendation
154
+
155
+ **Final Assessment**:
156
+ - If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
157
+ - If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
158
+ - If all clear: "All checks passed. Ready for archive."
159
+
160
+ **Verification Heuristics**
161
+
162
+ - **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
163
+ - **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
164
+ - **Coherence**: Look for glaring inconsistencies, don't nitpick style
165
+ - **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
166
+ - **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
167
+
168
+ **Graceful Degradation**
169
+
170
+ - If only tasks.md exists: verify task completion only, skip spec/design checks
171
+ - If tasks + specs exist: verify completeness and correctness, skip design
172
+ - If full artifacts: verify all three dimensions
173
+ - Always note which checks were skipped and why
174
+
175
+ **Output Format**
176
+
177
+ Use clear markdown with:
178
+ - Table for summary scorecard
179
+ - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
180
+ - Code references in format: `file.ts:123`
181
+ - Specific, actionable recommendations
169
182
  - No vague suggestions like "consider reviewing"