@jspg-ai/coding-bb 0.0.1 → 0.0.2-beta.22

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/bin/cbb.js +6 -0
  2. package/cbb/bin/cbbm.js +6 -0
  3. package/cbb/dev-standards/rules/cbb-ai-behavior.md +103 -103
  4. package/cbb/dev-standards/rules/cbb-priority.md +55 -55
  5. package/cbb/lib/install/claude-code.js +2 -0
  6. package/cbb/lib/install/init.js +496 -290
  7. package/cbb/lib/install/opencode.js +31 -0
  8. package/cbb/lib/install/qoder.js +2 -0
  9. package/cbb/lib/install/workspaces.js +53 -13
  10. package/cbb/lib/openspec/index.js +3 -3
  11. package/cbb/lib/superpowers/index.js +1 -1
  12. package/cbb/lib/utils/check-update.js +16 -14
  13. package/cbb/lib/utils/gitignore.js +2 -1
  14. package/cbb/lib/utils/output.js +92 -4
  15. package/cbb/lib/utils/version.js +2 -31
  16. package/cbb/lib/wiki/cli.js +25 -25
  17. package/cbb/lib/wiki/index.js +16 -16
  18. package/cbb/tools/cbb-design-to-wiki/SKILL.md +14 -14
  19. package/cbb/tools/cbb-wiki-ops/SKILL.md +22 -22
  20. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +2 -2
  21. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +7 -7
  22. package/cbb/worktrees/_shared/scripts/push-core.js +18 -0
  23. package/cbb/worktrees/commands/{close.md → worktree-close.md} +8 -8
  24. package/cbb/worktrees/commands/{init.md → worktree-init.md} +9 -9
  25. package/cbb/worktrees/commands/{push.md → worktree-push.md} +3 -3
  26. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/SKILL.md +20 -20
  27. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-env.js +4 -4
  28. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-unarchived.js +1 -1
  29. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/delete-branches.js +3 -3
  30. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/discover-apps.js +6 -6
  31. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-close}/scripts/find-target-worktree.js +2 -2
  32. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-close}/scripts/find-workspace-root.js +7 -7
  33. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/remove-worktrees.js +4 -4
  34. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/safety-check.js +4 -4
  35. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/SKILL.md +81 -107
  36. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/auto-open.js +1 -1
  37. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env-deep.js +4 -4
  38. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env.js +6 -6
  39. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-repos.js +4 -4
  40. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-branches.js +4 -4
  41. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-worktrees.js +8 -7
  42. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-init}/scripts/find-workspace-root.js +7 -7
  43. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/install-ai.js +33 -33
  44. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/parse-config.js +7 -7
  45. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/push-branches.js +9 -7
  46. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/push-core.js +18 -0
  47. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/sync-repos.js +10 -12
  48. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/update-gitignore.js +19 -6
  49. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/SKILL.md +16 -16
  50. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/commit-worktrees.js +2 -2
  51. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/find-target-worktree.js +2 -2
  52. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-push}/scripts/find-workspace-root.js +7 -7
  53. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-core.js +18 -0
  54. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-worktrees.js +7 -5
  55. package/config/workspace-config.sample.json +18 -0
  56. package/config/workspaces.json +11 -6
  57. package/openspec/.version +6 -6
  58. package/openspec/commands/apply.md +7 -7
  59. package/openspec/commands/archive.md +7 -7
  60. package/openspec/commands/bulk-archive.md +7 -7
  61. package/openspec/commands/continue.md +7 -7
  62. package/openspec/commands/explore.md +7 -7
  63. package/openspec/commands/ff.md +7 -7
  64. package/openspec/commands/new.md +7 -7
  65. package/openspec/commands/onboard.md +7 -7
  66. package/openspec/commands/propose.md +7 -7
  67. package/openspec/commands/sync.md +7 -7
  68. package/openspec/commands/update.md +7 -7
  69. package/openspec/commands/verify.md +7 -7
  70. package/openspec/skills/openspec-apply-change/SKILL.md +187 -187
  71. package/openspec/skills/openspec-archive-change/SKILL.md +181 -181
  72. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +338 -338
  73. package/openspec/skills/openspec-continue-change/SKILL.md +117 -117
  74. package/openspec/skills/openspec-explore/SKILL.md +342 -342
  75. package/openspec/skills/openspec-ff-change/SKILL.md +116 -116
  76. package/openspec/skills/openspec-new-change/SKILL.md +76 -76
  77. package/openspec/skills/openspec-onboard/SKILL.md +560 -560
  78. package/openspec/skills/openspec-propose/SKILL.md +162 -162
  79. package/openspec/skills/openspec-sync-specs/SKILL.md +261 -261
  80. package/openspec/skills/openspec-update-change/SKILL.md +90 -90
  81. package/openspec/skills/openspec-verify-change/SKILL.md +174 -174
  82. package/package.json +4 -3
  83. package/superpowers/.version +6 -6
  84. package/superpowers/skills/brainstorming/SKILL.md +250 -250
  85. package/superpowers/skills/brainstorming/scripts/helper.js +167 -167
  86. package/superpowers/skills/brainstorming/scripts/start-server.sh +209 -209
  87. package/superpowers/skills/brainstorming/scripts/stop-server.sh +120 -120
  88. package/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -49
  89. package/superpowers/skills/brainstorming/visual-companion.md +299 -299
  90. package/superpowers/skills/dispatching-parallel-agents/SKILL.md +167 -167
  91. package/superpowers/skills/executing-plans/SKILL.md +64 -64
  92. package/superpowers/skills/finishing-a-development-branch/SKILL.md +225 -225
  93. package/superpowers/skills/receiving-code-review/SKILL.md +205 -205
  94. package/superpowers/skills/requesting-code-review/SKILL.md +95 -95
  95. package/superpowers/skills/requesting-code-review/code-reviewer.md +181 -181
  96. package/superpowers/skills/subagent-driven-development/SKILL.md +568 -568
  97. package/superpowers/skills/subagent-driven-development/implementer-prompt.md +154 -154
  98. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +115 -115
  99. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +207 -207
  100. package/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -119
  101. package/superpowers/skills/systematic-debugging/SKILL.md +283 -283
  102. package/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  103. package/superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -115
  104. package/superpowers/skills/systematic-debugging/defense-in-depth.md +122 -122
  105. package/superpowers/skills/systematic-debugging/find-polluter.sh +72 -72
  106. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -169
  107. package/superpowers/skills/systematic-debugging/test-academic.md +14 -14
  108. package/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -58
  109. package/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -68
  110. package/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -69
  111. package/superpowers/skills/test-driven-development/SKILL.md +320 -320
  112. package/superpowers/skills/test-driven-development/writing-good-tests.md +198 -198
  113. package/superpowers/skills/using-git-worktrees/SKILL.md +167 -167
  114. package/superpowers/skills/using-superpowers/SKILL.md +63 -63
  115. package/superpowers/skills/using-superpowers/references/antigravity-tools.md +23 -23
  116. package/superpowers/skills/using-superpowers/references/codex-tools.md +108 -108
  117. package/superpowers/skills/using-superpowers/references/gemini-tools.md +63 -63
  118. package/superpowers/skills/using-superpowers/references/hermes-tools.md +56 -56
  119. package/superpowers/skills/using-superpowers/references/pi-tools.md +16 -16
  120. package/superpowers/skills/verification-before-completion/SKILL.md +120 -120
  121. package/superpowers/skills/writing-plans/SKILL.md +171 -171
  122. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -49
  123. package/superpowers/skills/writing-skills/SKILL.md +679 -679
  124. package/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -1150
  125. package/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -189
  126. package/superpowers/skills/writing-skills/persuasion-principles.md +187 -187
  127. package/superpowers/skills/writing-skills/render-graphs.js +169 -169
  128. package/superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -384
  129. package/cbb/worktrees/commands/extend.md +0 -65
  130. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-target-worktree.js +0 -96
  131. package/cbb/worktrees/skills/openspec-extend-worktree/SKILL.md +0 -390
  132. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-env.js +0 -95
  133. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-repos.js +0 -98
  134. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js +0 -135
  135. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/install-ai.js +0 -150
  136. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/list-available-apps.js +0 -88
  137. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/sync-repos.js +0 -93
  138. package/cbb/worktrees/skills/openspec-init-worktree/scripts/find-workspace-root.js +0 -67
  139. package/cbb/worktrees/skills/openspec-init-worktree/scripts/generate-app-options.js +0 -93
  140. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-core.js +0 -136
  141. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/silence-popup.js +0 -23
  142. package/config/config.sample.json +0 -16
  143. /package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/silence-popup.js +0 -0
  144. /package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/silence-popup.js +0 -0
  145. /package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-push}/scripts/silence-popup.js +0 -0
@@ -1,116 +1,116 @@
1
- ---
2
- name: openspec-ff-change
3
- description: Fast-forward through OpenSpec artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.
4
- allowed-tools: Bash(openspec:*)
5
- license: MIT
6
- compatibility: Requires openspec CLI.
7
- metadata:
8
- author: openspec
9
- version: "1.0"
10
- ---
11
-
12
- Fast-forward through artifact creation - generate everything needed to start implementation in one go.
13
-
14
- **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
15
-
16
- **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
17
-
18
- **Steps**
19
-
20
- 1. **If no clear input provided, ask what they want to build**
21
-
22
- Ask the user (open-ended, no preset options):
23
- > "What change do you want to work on? Describe what you want to build or fix."
24
-
25
- From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
26
-
27
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
28
-
29
- 2. **Create the change directory**
30
- ```bash
31
- openspec new change "<name>"
32
- ```
33
- This creates a scaffolded change in the planning home resolved by the CLI.
34
-
35
- 3. **Get the artifact build order**
36
- ```bash
37
- openspec status --change "<name>" --json
38
- ```
39
- Parse the JSON to get:
40
- - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
41
- - `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
42
- - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
43
-
44
- 4. **Create every artifact in the required set**
45
-
46
- Use a todo list to track progress through the artifacts.
47
-
48
- Loop through artifacts in dependency order (artifacts with no pending dependencies first):
49
-
50
- a. **For each artifact that is `ready` (dependencies satisfied)**:
51
- - Get instructions:
52
- ```bash
53
- openspec instructions <artifact-id> --change "<name>" --json
54
- ```
55
- - The instructions JSON includes:
56
- - `context`: Project background (constraints for you - do NOT include in output)
57
- - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
58
- - `template`: The structure to use for your output file
59
- - `instruction`: Schema-specific guidance for this artifact type
60
- - `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
61
- - `resolvedOutputPath`: Resolved path or pattern to write the artifact
62
- - `dependencies`: Completed artifacts to read for context
63
- - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
64
- - **Inspect the relevant project before drafting**: Read `context` and `rules` first, then inspect relevant implementation, nearby tests, configuration, and documentation outside `openspec/`. Keep inspection read-only and proportional to the change; reuse findings for later artifacts and inspect more only as needed.
65
- - Identify the target project from the request and project context; the planning home may be separate from the code. If the target is unclear, ask. For greenfield or non-code changes, inspect the available structure and relevant documents. If source is unavailable, state the limitation and ask when it materially affects the plan.
66
- - Ground scope, approach, and tasks in what you find. Distinguish observed behavior from assumptions and proposed additions; surface conflicts with existing specs instead of silently deciding which is correct.
67
- - Do this discovery now, rather than leaving generic "explore the codebase" or "make a plan" tasks for implementation. Keep any necessary follow-up investigation specific to an unresolved question.
68
- - If the `instruction` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at `resolvedOutputPath`
69
- - Otherwise create the artifact file using `template` as the structure and write it to `resolvedOutputPath`. If `resolvedOutputPath` is a glob, follow `instruction` to choose the concrete file path
70
- - Apply `context` and `rules` as constraints - but do NOT copy them into the file
71
- - Show brief progress: "✓ Created <artifact-id>"
72
-
73
- b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
74
- - After creating each artifact, re-run `openspec status --change "<name>" --json`
75
- - The required set is `applyRequires` plus every artifact reachable from those by following the `requires` edges in `status --json` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
76
- - `status` is file-existence only, so an `applyRequires` artifact reading `done` does NOT mean its dependencies exist - writing `tasks.md` early marks `tasks` done while `specs` was never written. Use each artifact's `requires` edges, not its `status`, to build the required set: a `done` artifact still lists what it depends on
77
- - An artifact already reading `status: "skipped"` is satisfied: the change declares `skip_specs` in `.openspec.yaml`, so its files must NOT exist. Never try to create one
78
- - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
79
- - Skip one only when `status` already reports it `skipped`, or when its own `instruction` says it is conditional: run `openspec instructions <artifact-id> --change "<name>" --json` and skip only if its `instruction` field marks it optional (e.g. "create only if..."). Spec-driven's `design.md` qualifies; `specs` qualifies only via the `skipped` status above, never by your own judgment. Tell the user, and do not reconsider it
80
- - Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
81
- - Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
82
-
83
- c. **If an artifact requires user input** (unclear context):
84
- - Ask the user to clarify
85
- - Then continue with creation
86
-
87
- 5. **Show final status**
88
- ```bash
89
- openspec status --change "<name>"
90
- ```
91
-
92
- **Output**
93
-
94
- After completing all artifacts, summarize:
95
- - Change name and location
96
- - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
97
- - What's ready: "All artifacts needed for implementation are ready."
98
- - Prompt: "Run `/openspec-apply-change` or ask me to implement to start working on the tasks."
99
-
100
- **Artifact Creation Guidelines**
101
-
102
- - Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
103
- - If the `instruction` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
104
- - The schema defines what each artifact should contain - follow it
105
- - Read dependency artifacts for context before creating new ones
106
- - Use `template` as the structure for your output file - fill in its sections
107
- - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
108
- - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
109
- - These guide what you write, but should never appear in the output
110
-
111
- **Guardrails**
112
- - Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
113
- - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
114
- - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
115
- - If a change with that name already exists, suggest continuing that change instead
116
- - Verify each artifact file exists after writing before proceeding to next
1
+ ---
2
+ name: openspec-ff-change
3
+ description: Fast-forward through OpenSpec artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+
12
+ Fast-forward through artifact creation - generate everything needed to start implementation in one go.
13
+
14
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
15
+
16
+ **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
17
+
18
+ **Steps**
19
+
20
+ 1. **If no clear input provided, ask what they want to build**
21
+
22
+ Ask the user (open-ended, no preset options):
23
+ > "What change do you want to work on? Describe what you want to build or fix."
24
+
25
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
26
+
27
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
28
+
29
+ 2. **Create the change directory**
30
+ ```bash
31
+ openspec new change "<name>"
32
+ ```
33
+ This creates a scaffolded change in the planning home resolved by the CLI.
34
+
35
+ 3. **Get the artifact build order**
36
+ ```bash
37
+ openspec status --change "<name>" --json
38
+ ```
39
+ Parse the JSON to get:
40
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
41
+ - `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
42
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
43
+
44
+ 4. **Create every artifact in the required set**
45
+
46
+ Use a todo list to track progress through the artifacts.
47
+
48
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
49
+
50
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
51
+ - Get instructions:
52
+ ```bash
53
+ openspec instructions <artifact-id> --change "<name>" --json
54
+ ```
55
+ - The instructions JSON includes:
56
+ - `context`: Project background (constraints for you - do NOT include in output)
57
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
58
+ - `template`: The structure to use for your output file
59
+ - `instruction`: Schema-specific guidance for this artifact type
60
+ - `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
61
+ - `resolvedOutputPath`: Resolved path or pattern to write the artifact
62
+ - `dependencies`: Completed artifacts to read for context
63
+ - Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
64
+ - **Inspect the relevant project before drafting**: Read `context` and `rules` first, then inspect relevant implementation, nearby tests, configuration, and documentation outside `openspec/`. Keep inspection read-only and proportional to the change; reuse findings for later artifacts and inspect more only as needed.
65
+ - Identify the target project from the request and project context; the planning home may be separate from the code. If the target is unclear, ask. For greenfield or non-code changes, inspect the available structure and relevant documents. If source is unavailable, state the limitation and ask when it materially affects the plan.
66
+ - Ground scope, approach, and tasks in what you find. Distinguish observed behavior from assumptions and proposed additions; surface conflicts with existing specs instead of silently deciding which is correct.
67
+ - Do this discovery now, rather than leaving generic "explore the codebase" or "make a plan" tasks for implementation. Keep any necessary follow-up investigation specific to an unresolved question.
68
+ - If the `instruction` field delegates creation to a specific skill or command, invoke it to produce the artifact instead of writing the file yourself, then verify the artifact file exists at `resolvedOutputPath`
69
+ - Otherwise create the artifact file using `template` as the structure and write it to `resolvedOutputPath`. If `resolvedOutputPath` is a glob, follow `instruction` to choose the concrete file path
70
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
71
+ - Show brief progress: "✓ Created <artifact-id>"
72
+
73
+ b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
74
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
75
+ - The required set is `applyRequires` plus every artifact reachable from those by following the `requires` edges in `status --json` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
76
+ - `status` is file-existence only, so an `applyRequires` artifact reading `done` does NOT mean its dependencies exist - writing `tasks.md` early marks `tasks` done while `specs` was never written. Use each artifact's `requires` edges, not its `status`, to build the required set: a `done` artifact still lists what it depends on
77
+ - An artifact already reading `status: "skipped"` is satisfied: the change declares `skip_specs` in `.openspec.yaml`, so its files must NOT exist. Never try to create one
78
+ - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
79
+ - Skip one only when `status` already reports it `skipped`, or when its own `instruction` says it is conditional: run `openspec instructions <artifact-id> --change "<name>" --json` and skip only if its `instruction` field marks it optional (e.g. "create only if..."). Spec-driven's `design.md` qualifies; `specs` qualifies only via the `skipped` status above, never by your own judgment. Tell the user, and do not reconsider it
80
+ - Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
81
+ - Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
82
+
83
+ c. **If an artifact requires user input** (unclear context):
84
+ - Ask the user to clarify
85
+ - Then continue with creation
86
+
87
+ 5. **Show final status**
88
+ ```bash
89
+ openspec status --change "<name>"
90
+ ```
91
+
92
+ **Output**
93
+
94
+ After completing all artifacts, summarize:
95
+ - Change name and location
96
+ - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
97
+ - What's ready: "All artifacts needed for implementation are ready."
98
+ - Prompt: "Run `/openspec-apply-change` or ask me to implement to start working on the tasks."
99
+
100
+ **Artifact Creation Guidelines**
101
+
102
+ - Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
103
+ - If the `instruction` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly
104
+ - The schema defines what each artifact should contain - follow it
105
+ - Read dependency artifacts for context before creating new ones
106
+ - Use `template` as the structure for your output file - fill in its sections
107
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
108
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
109
+ - These guide what you write, but should never appear in the output
110
+
111
+ **Guardrails**
112
+ - Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
113
+ - Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
114
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
115
+ - If a change with that name already exists, suggest continuing that change instead
116
+ - Verify each artifact file exists after writing before proceeding to next
@@ -1,76 +1,76 @@
1
- ---
2
- name: openspec-new-change
3
- description: Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.
4
- allowed-tools: Bash(openspec:*)
5
- license: MIT
6
- compatibility: Requires openspec CLI.
7
- metadata:
8
- author: openspec
9
- version: "1.0"
10
- ---
11
-
12
- Start a new change using the experimental artifact-driven approach.
13
-
14
- **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
15
-
16
- **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
17
-
18
- **Steps**
19
-
20
- 1. **If no clear input provided, ask what they want to build**
21
-
22
- Ask the user (open-ended, no preset options):
23
- > "What change do you want to work on? Describe what you want to build or fix."
24
-
25
- From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
26
-
27
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
28
-
29
- 2. **Determine the workflow schema**
30
-
31
- Use the default schema (omit `--schema`) unless the user explicitly requests a different workflow.
32
-
33
- **Use a different schema only if the user mentions:**
34
- - A specific schema name → use `--schema <name>`
35
- - "show workflows" or "what workflows" → run `openspec schemas --json` and let them choose
36
-
37
- **Otherwise**: Omit `--schema` to use the default.
38
-
39
- 3. **Create the change directory**
40
- ```bash
41
- openspec new change "<name>"
42
- ```
43
- Add `--schema <name>` only if the user requested a specific workflow.
44
- This creates a scaffolded change in the planning home resolved by the CLI.
45
-
46
- 4. **Show the artifact status**
47
- ```bash
48
- openspec status --change "<name>" --json
49
- ```
50
- Use the returned `planningHome`, `changeRoot`, `artifactPaths`, and `nextSteps` instead of assuming repo-local paths.
51
-
52
- 5. **Get instructions for the first artifact**
53
- The first artifact depends on the schema (e.g., `proposal` for spec-driven).
54
- Check the status output to find the first artifact with status "ready".
55
- ```bash
56
- openspec instructions <first-artifact-id> --change "<name>"
57
- ```
58
- This outputs the template and context for creating the first artifact.
59
-
60
- 6. **STOP and wait for user direction**
61
-
62
- **Output**
63
-
64
- After completing the steps, summarize:
65
- - Change name and location
66
- - Schema/workflow being used and its artifact sequence
67
- - Current status (0/N artifacts complete)
68
- - The template for the first artifact
69
- - Prompt: "Ready to create the first artifact? Just describe what this change is about and I'll draft it, or ask me to continue."
70
-
71
- **Guardrails**
72
- - Do NOT create any artifacts yet - just show the instructions
73
- - Do NOT advance beyond showing the first artifact template
74
- - If the name is invalid (not kebab-case), ask for a valid name
75
- - If a change with that name already exists, suggest continuing that change instead
76
- - Pass --schema if using a non-default workflow
1
+ ---
2
+ name: openspec-new-change
3
+ description: Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+
12
+ Start a new change using the experimental artifact-driven approach.
13
+
14
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
15
+
16
+ **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
17
+
18
+ **Steps**
19
+
20
+ 1. **If no clear input provided, ask what they want to build**
21
+
22
+ Ask the user (open-ended, no preset options):
23
+ > "What change do you want to work on? Describe what you want to build or fix."
24
+
25
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
26
+
27
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
28
+
29
+ 2. **Determine the workflow schema**
30
+
31
+ Use the default schema (omit `--schema`) unless the user explicitly requests a different workflow.
32
+
33
+ **Use a different schema only if the user mentions:**
34
+ - A specific schema name → use `--schema <name>`
35
+ - "show workflows" or "what workflows" → run `openspec schemas --json` and let them choose
36
+
37
+ **Otherwise**: Omit `--schema` to use the default.
38
+
39
+ 3. **Create the change directory**
40
+ ```bash
41
+ openspec new change "<name>"
42
+ ```
43
+ Add `--schema <name>` only if the user requested a specific workflow.
44
+ This creates a scaffolded change in the planning home resolved by the CLI.
45
+
46
+ 4. **Show the artifact status**
47
+ ```bash
48
+ openspec status --change "<name>" --json
49
+ ```
50
+ Use the returned `planningHome`, `changeRoot`, `artifactPaths`, and `nextSteps` instead of assuming repo-local paths.
51
+
52
+ 5. **Get instructions for the first artifact**
53
+ The first artifact depends on the schema (e.g., `proposal` for spec-driven).
54
+ Check the status output to find the first artifact with status "ready".
55
+ ```bash
56
+ openspec instructions <first-artifact-id> --change "<name>"
57
+ ```
58
+ This outputs the template and context for creating the first artifact.
59
+
60
+ 6. **STOP and wait for user direction**
61
+
62
+ **Output**
63
+
64
+ After completing the steps, summarize:
65
+ - Change name and location
66
+ - Schema/workflow being used and its artifact sequence
67
+ - Current status (0/N artifacts complete)
68
+ - The template for the first artifact
69
+ - Prompt: "Ready to create the first artifact? Just describe what this change is about and I'll draft it, or ask me to continue."
70
+
71
+ **Guardrails**
72
+ - Do NOT create any artifacts yet - just show the instructions
73
+ - Do NOT advance beyond showing the first artifact template
74
+ - If the name is invalid (not kebab-case), ask for a valid name
75
+ - If a change with that name already exists, suggest continuing that change instead
76
+ - Pass --schema if using a non-default workflow