@jspg-ai/coding-bb 0.0.3-beta.1 → 0.0.3-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cbb/dev-standards/rules/cbb-ai-behavior.md +118 -116
- package/cbb/lib/install/claude-code.js +1 -3
- package/cbb/lib/install/codebuddy.js +30 -0
- package/cbb/lib/install/init.js +295 -119
- package/cbb/lib/install/opencode.js +35 -31
- package/cbb/lib/install/qoder.js +1 -3
- package/cbb/lib/install/rule-rewrite.js +27 -0
- package/cbb/lib/install/trae.js +33 -0
- package/cbb/lib/openspec/index.js +337 -554
- package/cbb/lib/superpowers/index.js +246 -265
- package/cbb/lib/utils/check-update.js +8 -1
- package/cbb/lib/utils/gitignore.js +2 -0
- package/cbb/lib/utils/settings.js +17 -4
- package/cbb/lib/utils/tar.js +92 -0
- package/cbb/lib/utils/upstream.js +90 -0
- package/cbb/worktrees/skills/cbb-worktree-close/SKILL.md +32 -23
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/remove-worktrees.js +2 -2
- package/cbb/worktrees/skills/cbb-worktree-init/SKILL.md +36 -28
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-worktrees.js +15 -37
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/update-gitignore.js +25 -9
- package/cbb/worktrees/skills/cbb-worktree-push/SKILL.md +66 -30
- package/config/openspec/schemas/spec-driven/schema.yaml +29 -30
- package/config/openspec/schemas/spec-driven/templates/design.md +0 -18
- package/config/openspec/schemas/spec-driven/templates/proposal.md +4 -3
- package/config/upstream-mirrors.json +12 -0
- package/config/workspace-agents.sample.md +41 -39
- package/openspec/.version +2 -3
- package/openspec/commands/apply.md +189 -175
- package/openspec/commands/archive.md +237 -216
- package/openspec/commands/bulk-archive.md +355 -327
- package/openspec/commands/continue.md +116 -105
- package/openspec/commands/explore.md +230 -199
- package/openspec/commands/ff.md +115 -104
- package/openspec/commands/new.md +74 -63
- package/openspec/commands/onboard.md +557 -548
- package/openspec/commands/propose.md +161 -150
- package/openspec/commands/sync.md +277 -249
- package/openspec/commands/update.md +92 -80
- package/openspec/commands/verify.md +175 -162
- package/openspec/skills/openspec-apply-change/SKILL.md +20 -5
- package/openspec/skills/openspec-archive-change/SKILL.md +30 -8
- package/openspec/skills/openspec-bulk-archive-change/SKILL.md +36 -6
- package/openspec/skills/openspec-continue-change/SKILL.md +14 -2
- package/openspec/skills/openspec-explore/SKILL.md +21 -9
- package/openspec/skills/openspec-ff-change/SKILL.md +14 -2
- package/openspec/skills/openspec-new-change/SKILL.md +13 -1
- package/openspec/skills/openspec-onboard/SKILL.md +49 -39
- package/openspec/skills/openspec-propose/SKILL.md +15 -3
- package/openspec/skills/openspec-sync-specs/SKILL.md +31 -2
- package/openspec/skills/openspec-update-change/SKILL.md +27 -14
- package/openspec/skills/openspec-verify-change/SKILL.md +17 -3
- package/package.json +2 -2
- package/superpowers/.version +4 -4
- package/superpowers/skills/brainstorming/SKILL.md +47 -12
- package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -213
- package/superpowers/skills/brainstorming/scripts/server.cjs +723 -723
- package/superpowers/skills/brainstorming/visual-companion.md +6 -6
- package/superpowers/skills/diagnosing-superpowers/SKILL.md +120 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
- package/superpowers/skills/diagnosing-superpowers/references/context-safety.md +22 -0
- package/superpowers/skills/diagnosing-superpowers/references/github-issues.md +47 -0
- package/superpowers/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
- package/superpowers/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
- package/superpowers/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
- package/superpowers/skills/diagnosing-superpowers/templates/case.md +64 -0
- package/superpowers/skills/diagnosing-superpowers/templates/issue.md +51 -0
- package/superpowers/skills/diagnosing-superpowers/templates/report.md +82 -0
- package/superpowers/skills/executing-plans/SKILL.md +350 -41
- package/superpowers/skills/executing-plans/scripts/task-done +52 -0
- package/superpowers/skills/executing-plans/scripts/task-start +28 -0
- package/superpowers/skills/requesting-code-review/SKILL.md +1 -1
- package/superpowers/skills/requesting-code-review/code-reviewer.md +17 -0
- package/superpowers/skills/subagent-driven-development/SKILL.md +18 -18
- package/superpowers/skills/subagent-driven-development/re-review-prompt.md +1 -1
- package/superpowers/skills/subagent-driven-development/scripts/review-package +53 -46
- package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +82 -40
- package/superpowers/skills/subagent-driven-development/scripts/task-brief +43 -41
- package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +2 -2
- package/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
- package/superpowers/skills/test-driven-development/SKILL.md +10 -0
- package/superpowers/skills/using-superpowers/SKILL.md +2 -0
- package/superpowers/skills/using-superpowers/references/claude-code-tools.md +29 -0
- package/superpowers/skills/using-superpowers/references/muse-tools.md +35 -0
- package/superpowers/skills/writing-plans/SKILL.md +30 -9
- package/superpowers/skills/writing-skills/SKILL.md +4 -2
- package/superpowers/skills/writing-skills/graphviz-conventions.dot +171 -171
- package/cbb/worktrees/commands/worktree-close.md +0 -64
- package/cbb/worktrees/commands/worktree-init.md +0 -51
- package/cbb/worktrees/commands/worktree-push.md +0 -42
|
@@ -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
|
-
**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
- If
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
**
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
|
|
155
|
-
**
|
|
156
|
-
|
|
157
|
-
- If only
|
|
158
|
-
- If
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
|
|
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"
|