@jspg-ai/coding-bb 0.0.3-beta.3 → 0.0.3-beta.31

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 (145) hide show
  1. package/cbb/dev-standards/rules/cbb-ai-behavior.md +135 -116
  2. package/cbb/lib/external/index.js +228 -0
  3. package/cbb/lib/install/agents-nav.js +92 -0
  4. package/cbb/lib/install/claude-code.js +7 -2
  5. package/cbb/lib/install/command-skill.js +105 -0
  6. package/cbb/lib/install/init.js +502 -168
  7. package/cbb/lib/install/minimax.js +60 -0
  8. package/cbb/lib/install/opencode.js +3 -5
  9. package/cbb/lib/install/qoder.js +1 -3
  10. package/cbb/lib/install/rule-rewrite.js +27 -0
  11. package/cbb/lib/install/setup-decision.js +48 -0
  12. package/cbb/lib/install/tool-selection.js +45 -0
  13. package/cbb/lib/install/trae.js +43 -0
  14. package/cbb/lib/install/workbuddy.js +36 -0
  15. package/cbb/lib/install/workspaces.js +21 -17
  16. package/cbb/lib/openspec/index.js +337 -554
  17. package/cbb/lib/superpowers/index.js +246 -265
  18. package/cbb/lib/utils/check-update.js +17 -2
  19. package/cbb/lib/utils/githook.js +226 -0
  20. package/cbb/lib/utils/gitignore.js +16 -3
  21. package/cbb/lib/utils/plugin-hook.js +92 -0
  22. package/cbb/lib/utils/settings.js +17 -4
  23. package/cbb/lib/utils/tar.js +92 -0
  24. package/cbb/lib/utils/upstream.js +90 -0
  25. package/cbb/worktrees/_shared/scripts/check-local-state.js +114 -0
  26. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +148 -96
  27. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +7 -7
  28. package/cbb/worktrees/_shared/scripts/install-git-hook.js +70 -0
  29. package/cbb/worktrees/_shared/scripts/junction-ai-config.js +127 -0
  30. package/cbb/worktrees/_shared/scripts/start-local.js +180 -0
  31. package/cbb/worktrees/skills/cbb-local-mode/SKILL.md +158 -0
  32. package/cbb/worktrees/skills/cbb-local-mode/scripts/check-local-state.js +114 -0
  33. package/cbb/worktrees/skills/cbb-local-mode/scripts/install-git-hook.js +70 -0
  34. package/cbb/worktrees/skills/cbb-local-mode/scripts/silence-popup.js +23 -0
  35. package/cbb/worktrees/skills/cbb-local-mode/scripts/start-local.js +180 -0
  36. package/cbb/worktrees/skills/cbb-worktree-close/SKILL.md +60 -43
  37. package/cbb/worktrees/skills/cbb-worktree-close/scripts/check-env.js +3 -3
  38. package/cbb/worktrees/skills/cbb-worktree-close/scripts/check-unarchived.js +75 -48
  39. package/cbb/worktrees/skills/cbb-worktree-close/scripts/delete-branches.js +1 -1
  40. package/cbb/worktrees/skills/cbb-worktree-close/scripts/discover-apps.js +14 -5
  41. package/cbb/worktrees/skills/cbb-worktree-close/scripts/find-target-worktree.js +148 -96
  42. package/cbb/worktrees/skills/cbb-worktree-close/scripts/find-workspace-root.js +7 -7
  43. package/cbb/worktrees/skills/cbb-worktree-close/scripts/remove-worktrees.js +13 -4
  44. package/cbb/worktrees/skills/cbb-worktree-close/scripts/safety-check.js +11 -2
  45. package/cbb/worktrees/skills/cbb-worktree-init/SKILL.md +138 -129
  46. package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-env.js +1 -1
  47. package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-repos.js +2 -2
  48. package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-branches.js +33 -8
  49. package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-worktrees.js +60 -46
  50. package/cbb/worktrees/skills/cbb-worktree-init/scripts/find-workspace-root.js +7 -7
  51. package/cbb/worktrees/skills/cbb-worktree-init/scripts/install-git-hook.js +70 -0
  52. package/cbb/worktrees/skills/cbb-worktree-init/scripts/junction-ai-config.js +127 -0
  53. package/cbb/worktrees/skills/cbb-worktree-init/scripts/parse-config.js +7 -7
  54. package/cbb/worktrees/skills/cbb-worktree-init/scripts/push-branches.js +3 -3
  55. package/cbb/worktrees/skills/cbb-worktree-init/scripts/sync-repos.js +11 -7
  56. package/cbb/worktrees/skills/cbb-worktree-init/scripts/update-gitignore.js +37 -9
  57. package/cbb/worktrees/skills/cbb-worktree-push/SKILL.md +140 -71
  58. package/cbb/worktrees/skills/cbb-worktree-push/scripts/commit-worktrees.js +70 -12
  59. package/cbb/worktrees/skills/cbb-worktree-push/scripts/find-target-worktree.js +148 -96
  60. package/cbb/worktrees/skills/cbb-worktree-push/scripts/find-workspace-root.js +7 -7
  61. package/cbb/worktrees/skills/cbb-worktree-push/scripts/make-mr-urls.js +211 -0
  62. package/cbb/worktrees/skills/cbb-worktree-push/scripts/push-worktrees.js +67 -20
  63. package/config/{workspace-config.sample.json → CBB-WORKSPACE.sample.json} +1 -1
  64. package/config/openspec/schemas/spec-driven/schema.yaml +40 -30
  65. package/config/openspec/schemas/spec-driven/templates/design.md +0 -18
  66. package/config/openspec/schemas/spec-driven/templates/proposal.md +4 -3
  67. package/config/upstream-mirrors.json +17 -0
  68. package/config/workspace-agents.sample.md +4 -33
  69. package/external/frontend-design/.version +6 -0
  70. package/external/frontend-design/LICENSE.txt +177 -0
  71. package/external/frontend-design/SKILL.md +71 -0
  72. package/openspec/.version +2 -3
  73. package/openspec/commands/apply.md +189 -175
  74. package/openspec/commands/archive.md +244 -216
  75. package/openspec/commands/bulk-archive.md +362 -327
  76. package/openspec/commands/continue.md +115 -105
  77. package/openspec/commands/explore.md +230 -199
  78. package/openspec/commands/ff.md +115 -104
  79. package/openspec/commands/new.md +74 -63
  80. package/openspec/commands/onboard.md +562 -548
  81. package/openspec/commands/propose.md +161 -150
  82. package/openspec/commands/sync.md +277 -249
  83. package/openspec/commands/update.md +98 -80
  84. package/openspec/commands/verify.md +206 -162
  85. package/openspec/skills/openspec-apply-change/SKILL.md +20 -5
  86. package/openspec/skills/openspec-archive-change/SKILL.md +40 -11
  87. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +46 -9
  88. package/openspec/skills/openspec-continue-change/SKILL.md +14 -3
  89. package/openspec/skills/openspec-explore/SKILL.md +22 -10
  90. package/openspec/skills/openspec-ff-change/SKILL.md +15 -3
  91. package/openspec/skills/openspec-new-change/SKILL.md +13 -1
  92. package/openspec/skills/openspec-onboard/SKILL.md +58 -43
  93. package/openspec/skills/openspec-propose/SKILL.md +15 -3
  94. package/openspec/skills/openspec-sync-specs/SKILL.md +31 -2
  95. package/openspec/skills/openspec-update-change/SKILL.md +34 -15
  96. package/openspec/skills/openspec-verify-change/SKILL.md +72 -26
  97. package/package.json +3 -2
  98. package/superpowers/.version +4 -4
  99. package/superpowers/skills/brainstorming/SKILL.md +47 -12
  100. package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -213
  101. package/superpowers/skills/brainstorming/scripts/server.cjs +723 -723
  102. package/superpowers/skills/brainstorming/visual-companion.md +6 -6
  103. package/superpowers/skills/diagnosing-superpowers/SKILL.md +120 -0
  104. package/superpowers/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
  105. package/superpowers/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
  106. package/superpowers/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
  107. package/superpowers/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
  108. package/superpowers/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
  109. package/superpowers/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
  110. package/superpowers/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
  111. package/superpowers/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
  112. package/superpowers/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
  113. package/superpowers/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
  114. package/superpowers/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
  115. package/superpowers/skills/diagnosing-superpowers/references/context-safety.md +22 -0
  116. package/superpowers/skills/diagnosing-superpowers/references/github-issues.md +47 -0
  117. package/superpowers/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
  118. package/superpowers/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
  119. package/superpowers/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
  120. package/superpowers/skills/diagnosing-superpowers/templates/case.md +64 -0
  121. package/superpowers/skills/diagnosing-superpowers/templates/issue.md +51 -0
  122. package/superpowers/skills/diagnosing-superpowers/templates/report.md +82 -0
  123. package/superpowers/skills/executing-plans/SKILL.md +350 -41
  124. package/superpowers/skills/executing-plans/scripts/task-done +52 -0
  125. package/superpowers/skills/executing-plans/scripts/task-start +28 -0
  126. package/superpowers/skills/requesting-code-review/SKILL.md +1 -1
  127. package/superpowers/skills/requesting-code-review/code-reviewer.md +17 -0
  128. package/superpowers/skills/subagent-driven-development/SKILL.md +18 -18
  129. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +1 -1
  130. package/superpowers/skills/subagent-driven-development/scripts/review-package +53 -46
  131. package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +82 -40
  132. package/superpowers/skills/subagent-driven-development/scripts/task-brief +43 -41
  133. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +2 -2
  134. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
  135. package/superpowers/skills/test-driven-development/SKILL.md +10 -0
  136. package/superpowers/skills/using-superpowers/SKILL.md +2 -0
  137. package/superpowers/skills/using-superpowers/references/claude-code-tools.md +29 -0
  138. package/superpowers/skills/using-superpowers/references/muse-tools.md +35 -0
  139. package/superpowers/skills/writing-plans/SKILL.md +62 -29
  140. package/superpowers/skills/writing-skills/SKILL.md +4 -2
  141. package/superpowers/skills/writing-skills/graphviz-conventions.dot +171 -171
  142. package/cbb/worktrees/commands/worktree-close.md +0 -64
  143. package/cbb/worktrees/commands/worktree-init.md +0 -51
  144. package/cbb/worktrees/commands/worktree-push.md +0 -42
  145. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
@@ -1,18 +1,30 @@
1
1
  ---
2
2
  name: openspec-onboard
3
- description: Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
3
+ description: Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work. Also use when the user says "openspec onboard" or "opsx onboard".
4
4
  allowed-tools: Bash(openspec:*)
5
5
  license: MIT
6
6
  compatibility: Requires openspec CLI.
7
7
  metadata:
8
8
  author: openspec
9
9
  version: "1.0"
10
+ generatedBy: "1.13.2"
10
11
  ---
11
12
 
12
13
  Guide the user through their first complete OpenSpec workflow cycle. This is a teaching experience—you'll do real work in their codebase while explaining each step.
13
14
 
14
15
  **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
 
17
+ **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.
18
+
19
+ 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`.
20
+
21
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
22
+
23
+ - **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.
24
+ - **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.
25
+
26
+ 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.
27
+
16
28
  ---
17
29
 
18
30
  ## Preflight
@@ -27,7 +39,7 @@ openspec --version 2>&1 || echo "CLI_NOT_INSTALLED"
27
39
  ```
28
40
 
29
41
  **If CLI not installed:**
30
- > OpenSpec CLI is not installed. Install it first, then come back to `/openspec-onboard`.
42
+ > OpenSpec CLI is not installed. Install it first, then come back to `/opsx:onboard`.
31
43
 
32
44
  Stop here if not installed.
33
45
 
@@ -154,7 +166,7 @@ Spend 1-2 minutes investigating the relevant code:
154
166
  │ [Optional: ASCII diagram if helpful] │
155
167
  └─────────────────────────────────────────┘
156
168
 
157
- Explore mode (`/openspec-explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem.
169
+ Explore mode (`/opsx:explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem.
158
170
 
159
171
  Now let's create a change to hold our work.
160
172
  ```
@@ -220,6 +232,8 @@ Here's a draft proposal:
220
232
 
221
233
  ---
222
234
 
235
+ # Proposal
236
+
223
237
  ## Why
224
238
 
225
239
  [1-2 sentences explaining the problem/opportunity]
@@ -287,6 +301,8 @@ Here's the spec:
287
301
 
288
302
  ---
289
303
 
304
+ # Spec Delta
305
+
290
306
  ## ADDED Requirements
291
307
 
292
308
  ### Requirement: <Name>
@@ -326,6 +342,8 @@ Here's the design:
326
342
 
327
343
  ---
328
344
 
345
+ # Design
346
+
329
347
  ## Context
330
348
 
331
349
  [Brief context about the current state]
@@ -361,7 +379,7 @@ Save to the `resolvedOutputPath` from `openspec instructions design --change "<n
361
379
 
362
380
  Finally, we break the work into implementation tasks—checkboxes that drive the apply phase.
363
381
 
364
- These should be small, clear, and in logical order.
382
+ These should be small, clear, and in logical order. Each group carries the tests and documentation for its own work - the last group is only for integration checks.
365
383
  ```
366
384
 
367
385
  **DO:** Generate tasks based on specs and design:
@@ -371,6 +389,8 @@ Here are the implementation tasks:
371
389
 
372
390
  ---
373
391
 
392
+ # Tasks
393
+
374
394
  ## 1. [Category or file]
375
395
 
376
396
  - [ ] 1.1 [Specific task] — verify: [test, command, observable behavior, or delivered artifact]
@@ -382,12 +402,17 @@ Here are the implementation tasks:
382
402
 
383
403
  ---
384
404
 
385
- Each checkbox becomes a unit of work in the apply phase. Ready to implement?
405
+ Each checkbox becomes a unit of work in the apply phase. Does this task breakdown look right?
386
406
  ```
387
407
 
388
- **PAUSE** - Wait for user to confirm they're ready to implement.
408
+ **PAUSE** - Wait for user approval/feedback.
409
+
410
+ After approval, save to the `resolvedOutputPath` from `openspec instructions tasks --change "<name>" --json`.
389
411
 
390
- Save to the `resolvedOutputPath` from `openspec instructions tasks --change "<name>" --json`.
412
+ Then ask:
413
+ > "Tasks are saved. Ready to implement?"
414
+
415
+ **PAUSE** - Wait for user to confirm before implementation.
391
416
 
392
417
  ---
393
418
 
@@ -472,29 +497,24 @@ This same rhythm works for any size change—a small fix or a major feature.
472
497
 
473
498
  ## Command Reference
474
499
 
475
- **Core workflow:**
476
-
477
- | Command | What it does |
478
- |-------------------|--------------------------------------------|
479
- | `/openspec-propose` | Create a change and generate all artifacts |
480
- | `/openspec-explore` | Think through problems before/during work |
481
- | `/openspec-apply-change` | Implement tasks from a change |
482
- | `/openspec-archive-change` | Archive a completed change |
500
+ **The commands you have installed:**
483
501
 
484
- **Additional commands** (only if installed - availability depends on your profile):
485
-
486
- | Command | What it does |
487
- |--------------------|----------------------------------------------------------|
488
- | `/openspec-new-change` | Start a new change, step through artifacts one at a time |
489
- | `/openspec-continue-change` | Continue working on an existing change |
490
- | `/openspec-ff-change` | Fast-forward: create all artifacts at once |
491
- | `/openspec-verify-change` | Verify implementation matches artifacts |
502
+ | Command | What it does |
503
+ |------------------|--------------------------------------------|
504
+ | `/opsx:propose` | Create a change and generate all artifacts |
505
+ | `/opsx:explore` | Think through problems before/during work |
506
+ | `/opsx:apply` | Implement tasks from a change |
507
+ | `/opsx:archive` | Archive a completed change |
508
+ | `/opsx:new` | Start a new change, one artifact at a time |
509
+ | `/opsx:continue` | Continue working on an existing change |
510
+ | `/opsx:ff` | Fast-forward: create all artifacts at once |
511
+ | `/opsx:verify` | Verify implementation matches artifacts |
492
512
 
493
513
  ---
494
514
 
495
515
  ## What's Next?
496
516
 
497
- Try `/openspec-propose` on something you actually want to build. You've got the rhythm now!
517
+ Try `/opsx:propose` on something you actually want to build. You've got the rhythm now!
498
518
  ```
499
519
 
500
520
  ---
@@ -508,9 +528,9 @@ If the user says they need to stop, want to pause, or seem disengaged:
508
528
  ```
509
529
  No problem! Your change is saved at the `changeRoot` reported by `openspec status --change "<name>" --json`.
510
530
 
511
- To pick up where we left off later:
512
- - `/openspec-continue-change <name>` - Resume artifact creation (if installed; otherwise `openspec status --change "<name>" --json` shows the next artifact)
513
- - `/openspec-apply-change <name>` - Jump to implementation (if tasks exist)
531
+ To pick up where we left off later, `openspec status --change "<name>" --json` shows exactly where the change stands.
532
+ - `/opsx:continue <name>` - Resume artifact creation
533
+ - `/opsx:apply <name>` - Jump to implementation (if tasks exist)
514
534
 
515
535
  The work won't be lost. Come back whenever you're ready.
516
536
  ```
@@ -524,25 +544,20 @@ If the user says they just want to see the commands or skip the tutorial:
524
544
  ```
525
545
  ## OpenSpec Quick Reference
526
546
 
527
- **Core workflow:**
547
+ **The commands you have installed:**
528
548
 
529
549
  | Command | What it does |
530
550
  |--------------------------|--------------------------------------------|
531
- | `/openspec-propose <name>` | Create a change and generate all artifacts |
532
- | `/openspec-explore` | Think through problems (no code changes) |
533
- | `/openspec-apply-change <name>` | Implement tasks |
534
- | `/openspec-archive-change <name>` | Archive when done |
535
-
536
- **Additional commands** (only if installed - availability depends on your profile):
537
-
538
- | Command | What it does |
539
- |---------------------------|-------------------------------------|
540
- | `/openspec-new-change <name>` | Start a new change, step by step |
541
- | `/openspec-continue-change <name>` | Continue an existing change |
542
- | `/openspec-ff-change <name>` | Fast-forward: all artifacts at once |
543
- | `/openspec-verify-change <name>` | Verify implementation |
544
-
545
- Try `/openspec-propose` to start your first change.
551
+ | `/opsx:propose <name>` | Create a change and generate all artifacts |
552
+ | `/opsx:explore` | Think through problems (no code changes) |
553
+ | `/opsx:apply <name>` | Implement tasks |
554
+ | `/opsx:archive <name>` | Archive when done |
555
+ | `/opsx:new <name>` | Start a new change, step by step |
556
+ | `/opsx:continue <name>` | Continue an existing change |
557
+ | `/opsx:ff <name>` | Fast-forward: all artifacts at once |
558
+ | `/opsx:verify <name>` | Verify implementation |
559
+
560
+ Try `/opsx:propose` to start your first change.
546
561
  ```
547
562
 
548
563
  Exit gracefully.
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  name: openspec-propose
3
- description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
3
+ description: Propose a new OpenSpec change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation. Also use when the user says "openspec propose" or "opsx propose".
4
4
  allowed-tools: Bash(openspec:*)
5
5
  license: MIT
6
6
  compatibility: Requires openspec CLI.
7
7
  metadata:
8
8
  author: openspec
9
9
  version: "1.0"
10
+ generatedBy: "1.13.2"
10
11
  ---
11
12
 
12
13
  Propose a new change - create the change and generate all artifacts in one step.
@@ -27,6 +28,17 @@ When the user is ready to implement, they must start the apply workflow explicit
27
28
 
28
29
  **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.
29
30
 
31
+ **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.
32
+
33
+ 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`.
34
+
35
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
36
+
37
+ - **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.
38
+ - **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.
39
+
40
+ 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.
41
+
30
42
  **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
31
43
 
32
44
  **Steps**
@@ -44,7 +56,7 @@ When the user is ready to implement, they must start the apply workflow explicit
44
56
 
45
57
  2. **Load project context**
46
58
 
47
- Run `openspec context --json` from the current working directory (or `openspec context --json --store "<store-id>"` when a registered store was explicitly selected). Use the returned `root.path` as the authoritative OpenSpec root. If context reports `no_openspec_root`, stop without creating or changing any files. Offer `openspec init` and wait for the user to request initialization. Do not initialize automatically or run `openspec new change`. After initialization, rerun this context check before continuing. For any other context failure, stop and report the error; do not fall back to the current directory or run later OpenSpec commands without the selected store.
59
+ Run `openspec context --json` from the current working directory (or `openspec context --json --store "<store-id>"` when a registered store was explicitly selected). Use the returned `root.path` as the authoritative OpenSpec root. If context reports `no_openspec_root`, stop without creating or changing any files and follow the **Project check** above for how this workflow was reached. Offer `openspec init` only for an explicit OpenSpec request, and wait for the user to request initialization. Do not initialize automatically or run `openspec new change`. After initialization, rerun this context check before continuing. For any other context failure, stop and report the error; do not fall back to the current directory or run later OpenSpec commands without the selected store.
48
60
 
49
61
  Only when context returns a resolved `root.path`, read `<root.path>/openspec/config.yaml`. Use `config.yml` only when `config.yaml` does not exist. If neither file exists, continue without project context. Do not fall back to `config.yml` if `config.yaml` is unreadable or invalid.
50
62
 
@@ -140,7 +152,7 @@ After completing all artifacts, summarize:
140
152
  - Change name and location
141
153
  - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
142
154
  - What's ready: "All artifacts needed for implementation are ready."
143
- - Prompt: "The artifacts are ready for review. When you are ready, run `/openspec-apply-change` or ask me to apply this change."
155
+ - Prompt: "The artifacts are ready for review. When you are ready, run `/opsx:apply` or ask me to apply this change."
144
156
 
145
157
  **Artifact Creation Guidelines**
146
158
 
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  name: openspec-sync-specs
3
- description: Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.
3
+ description: Sync delta specs from an OpenSpec change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change. Also use when the user says "openspec sync" or "opsx sync".
4
4
  allowed-tools: Bash(openspec:*)
5
5
  license: MIT
6
6
  compatibility: Requires openspec CLI.
7
7
  metadata:
8
8
  author: openspec
9
9
  version: "1.0"
10
+ generatedBy: "1.13.2"
10
11
  ---
11
12
 
12
13
  Sync delta specs from a change to main specs.
@@ -15,6 +16,17 @@ This is an **agent-driven** operation - you will read delta specs and directly e
15
16
 
16
17
  **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.
17
18
 
19
+ **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.
20
+
21
+ 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`.
22
+
23
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
24
+
25
+ - **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.
26
+ - **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.
27
+
28
+ 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.
29
+
18
30
  `<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.
19
31
 
20
32
  **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.
@@ -30,7 +42,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
30
42
 
31
43
  When prompting, show changes that have delta specs (under `specs/` directory).
32
44
 
33
- Always announce: "Using change: <name>" and how to override (e.g., `/openspec-sync-specs <other>`).
45
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:sync <other>`).
34
46
 
35
47
  2. **Resolve change context**
36
48
 
@@ -95,6 +107,13 @@ This is an **agent-driven** operation - you will read delta specs and directly e
95
107
 
96
108
  b. **Read the main spec** at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (may not exist yet)
97
109
 
110
+ **If it does not exist yet** (a new capability), match what `openspec archive` does:
111
+ only ADDED requirements may be applied - step d creates the spec from them.
112
+ MODIFIED and RENAMED have no requirement to act on, so stop the sync for that
113
+ capability and report that its main spec does not exist and only ADDED is allowed
114
+ for a new spec; never invent the missing requirement. REMOVED has nothing to
115
+ remove - skip it and warn.
116
+
98
117
  c. **Apply changes intelligently**:
99
118
 
100
119
  **ADDED Requirements:**
@@ -142,6 +161,14 @@ This is an **agent-driven** operation - you will read delta specs and directly e
142
161
  (this is what `openspec archive` does; it warns and moves on)
143
162
 
144
163
  d. **Create new main spec** if capability doesn't exist yet:
164
+ - Only when the delta has ADDED requirements to put in it and no MODIFIED or
165
+ RENAMED requirements blocked this capability in step b. Otherwise create nothing
166
+ and leave the specs directory untouched. For a REMOVED-only delta, if the change's
167
+ `.openspec.yaml` declares `retire_capabilities: true`, report it as already retired
168
+ and continue without recreating the spec. Without that marker, report the sync as blocked:
169
+ `openspec archive` rejects it with `Spec must have at least one requirement`.
170
+ An empty delta has no operations to sync; report it as blocked too.
171
+ Never write an empty `## Requirements` section.
145
172
  - Create `<planningHome.root>/openspec/specs/<capability-path>/spec.md`
146
173
  - Add Purpose section: copy the delta's `## Purpose` body verbatim when it has one
147
174
  (this is what `openspec archive` does); only write a brief TBD placeholder when it does not
@@ -166,6 +193,8 @@ This is an **agent-driven** operation - you will read delta specs and directly e
166
193
  **Delta Spec Format Reference**
167
194
 
168
195
  ```markdown
196
+ # Spec Delta
197
+
169
198
  ## Purpose
170
199
 
171
200
  Only on a delta that introduces a brand-new capability. Seeds the new main spec.
@@ -1,21 +1,33 @@
1
1
  ---
2
2
  name: openspec-update-change
3
- description: Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.
3
+ description: Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Also use when the user says "openspec update change" or "opsx update". If the user means the openspec update CLI command, which refreshes generated files, run that command instead. Never edits code.
4
4
  allowed-tools: Bash(openspec:*)
5
5
  license: MIT
6
6
  compatibility: Requires openspec CLI.
7
7
  metadata:
8
8
  author: openspec
9
9
  version: "1.0"
10
+ generatedBy: "1.13.2"
10
11
  ---
11
12
 
12
13
  Revise a change's existing planning artifacts and keep them coherent. Never edit code.
13
14
 
14
15
  **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
 
17
+ **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.
18
+
19
+ 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`.
20
+
21
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
22
+
23
+ - **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.
24
+ - **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.
25
+
26
+ 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.
27
+
16
28
  **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.
17
29
 
18
- `/openspec-continue-change` 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.
30
+ This workflow revises artifacts that already exist; `/opsx:continue` is what creates the ones that do not.
19
31
 
20
32
  **Steps**
21
33
 
@@ -28,13 +40,12 @@ Revise a change's existing planning artifacts and keep them coherent. Never edit
28
40
 
29
41
  When prompting, present the top 3-4 most recently modified changes as options, showing:
30
42
  - Change name
31
- - Schema (from `schema` field if present, otherwise "spec-driven")
32
43
  - Status (e.g., "0/5 tasks", "complete", "no tasks")
33
44
  - How recently it was modified (from `lastModified` field)
34
45
 
35
46
  Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
36
47
 
37
- Always announce: "Using change: <name>" and how to override (e.g., `/openspec-update-change <other>`).
48
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:update <other>`).
38
49
 
39
50
  2. **Get the change's artifacts**
40
51
  ```bash
@@ -56,13 +67,20 @@ Revise a change's existing planning artifacts and keep them coherent. Never edit
56
67
 
57
68
  4. **Read and reconcile**
58
69
  - Read the artifact(s) the request touches and the change's other existing artifacts.
59
- - 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.
70
+ - 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.
60
71
  - Note everything that is now inconsistent, missing, or contradictory.
61
- - 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 `/openspec-continue-change` to create them.
62
- - If the change is already coherent, say so and make no edits.
72
+ - Propose revisions to files that already exist (`existingOutputPaths`). If an artifact has no existing output files and status `ready` or `blocked`, note it and point the user to `/opsx:continue` to create them. Leave `skipped` artifacts untouched; do not treat them as missing or defer them to the continue workflow.
73
+ - A glob artifact (e.g. `specs/**/*.md`) is marked `done` after at least one file matches, and the continue workflow only handles `ready` artifacts. When reconciliation identifies a missing file for a glob artifact whose `existingOutputPaths` is non-empty:
74
+ 1. Run `openspec instructions "<artifact-id>" --change "<name>" --json` and use its `instruction` and `template`. Treat `context` and `rules` as constraints; do not copy them into the file. If instructions report `skipped: true`, do not create the file. Read current dependency files from disk; if a required non-skipped dependency is missing, stop and ask the user to restore it first.
75
+ 2. Choose a concrete path inside `changeRoot` that matches `artifactPaths.<id>.outputPath` and does not already exist. Verify it remains inside `changeRoot` after resolving any symlinked parent directories. The glob `resolvedOutputPath` is not a valid target.
76
+ 3. Include the new file in step 5's proposed revisions and create it only after the user confirms.
77
+ 4. After confirmation, immediately before creation, refresh status and instructions. Verify the artifact is still in scope, not skipped, and partially populated; repeat the concrete-path checks above.
78
+ 5. Use a create operation that fails if the target already exists. If `instruction` delegates creation to another skill or command, invoke it only if it can honor the confirmed path and these guardrails; otherwise stop. If any check fails or the confirmed draft is no longer valid, stop and reconcile with the user rather than replacing existing content or choosing a different path.
79
+ - If the change is already coherent, say so and propose no revisions.
63
80
 
64
81
  5. **Confirm and apply, one artifact at a time**
65
- - Show each proposed revision and why. Write only after the user confirms.
82
+ - This step performs every artifact write in this workflow; no earlier step edits an artifact.
83
+ - Show each proposed revision and why - including the requested edit drafted in step 4. Write only after the user confirms.
66
84
  - If the user rejects a revision, do not write it - leave that artifact unchanged.
67
85
  - When a substantial rewrite is needed, get that artifact's rules and template first:
68
86
  ```bash
@@ -70,21 +88,22 @@ Revise a change's existing planning artifacts and keep them coherent. Never edit
70
88
  ```
71
89
 
72
90
  6. **Point to the next step (guidance only - NEVER act on it)**
73
- - Artifacts still missing -> suggest `/openspec-continue-change` to create them.
74
- - Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `/openspec-apply-change` to carry the delta into code.
75
- - Everything done and implemented -> suggest `/openspec-archive-change`.
91
+ - Artifacts with empty `existingOutputPaths` and status `ready` or `blocked` -> suggest `/opsx:continue` to create them.
92
+ - 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.
93
+ - Everything done and implemented -> suggest `/opsx:archive`.
76
94
 
77
95
  **Output**
78
96
 
79
97
  After each invocation, show:
80
98
  - Which artifacts were revised (and which proposed revisions were rejected)
81
- - Anything deferred to `/openspec-continue-change` (not-yet-created artifacts or files)
99
+ - Any file created under a glob artifact that was already partially populated
100
+ - Anything deferred to `/opsx:continue` (artifacts with no files yet and status `ready` or `blocked`, never `skipped` artifacts)
82
101
  - Where the change stands and the recommended next command
83
102
 
84
103
  **Guardrails**
85
- - Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/openspec-apply-change`.
104
+ - Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/opsx:apply`.
86
105
  - Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
87
106
  - Edit only the concrete files in `existingOutputPaths`; never write to a glob `resolvedOutputPath`.
88
- - Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is `/openspec-continue-change`'s job.
107
+ - Do not advance the build frontier: if an artifact has empty `existingOutputPaths` and status `ready` or `blocked`, that is `/opsx:continue`'s job. Leave `skipped` artifacts untouched. The only new-file scope is a confirmed concrete path under a glob artifact whose `existingOutputPaths` is non-empty.
89
108
  - Confirm every edit with the user before writing.
90
- - If the request changes the change's *intent* rather than refining it, first verify whether the optional `/openspec-new-change` workflow is available. If it is, recommend starting fresh with `/openspec-new-change` (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.
109
+ - If the request changes the change's *intent* rather than refining it, recommend starting fresh with `/opsx:new` (the "Update vs. Start Fresh" heuristic).