@jspg-ai/coding-bb 0.0.2-beta.29 → 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.
Files changed (107) hide show
  1. package/cbb/bin/cbbm.js +1 -1
  2. package/cbb/dev-standards/rules/cbb-ai-behavior.md +118 -103
  3. package/cbb/lib/install/claude-code.js +1 -3
  4. package/cbb/lib/install/codebuddy.js +30 -0
  5. package/cbb/lib/install/init.js +354 -305
  6. package/cbb/lib/install/opencode.js +35 -31
  7. package/cbb/lib/install/qoder.js +1 -3
  8. package/cbb/lib/install/rule-rewrite.js +27 -0
  9. package/cbb/lib/install/trae.js +33 -0
  10. package/cbb/lib/install/workspaces.js +24 -0
  11. package/cbb/lib/openspec/index.js +337 -554
  12. package/cbb/lib/superpowers/index.js +246 -265
  13. package/cbb/lib/utils/check-update.js +9 -2
  14. package/cbb/lib/utils/gitignore.js +2 -0
  15. package/cbb/lib/utils/settings.js +17 -4
  16. package/cbb/lib/utils/tar.js +92 -0
  17. package/cbb/lib/utils/upstream.js +90 -0
  18. package/cbb/worktrees/skills/cbb-worktree-close/SKILL.md +33 -24
  19. package/cbb/worktrees/skills/cbb-worktree-close/scripts/check-env.js +4 -4
  20. package/cbb/worktrees/skills/cbb-worktree-close/scripts/remove-worktrees.js +2 -2
  21. package/cbb/worktrees/skills/cbb-worktree-init/SKILL.md +61 -78
  22. package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-env-deep.js +3 -33
  23. package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-env.js +5 -14
  24. package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-worktrees.js +15 -37
  25. package/cbb/worktrees/skills/cbb-worktree-init/scripts/update-gitignore.js +25 -9
  26. package/cbb/worktrees/skills/cbb-worktree-push/SKILL.md +67 -31
  27. package/config/openspec/schemas/spec-driven/schema.yaml +29 -30
  28. package/config/openspec/schemas/spec-driven/templates/design.md +0 -18
  29. package/config/openspec/schemas/spec-driven/templates/proposal.md +4 -3
  30. package/config/upstream-mirrors.json +12 -0
  31. package/config/workspace-agents.sample.md +17 -13
  32. package/config/workspaces.json +5 -0
  33. package/openspec/.version +2 -3
  34. package/openspec/commands/apply.md +189 -175
  35. package/openspec/commands/archive.md +237 -216
  36. package/openspec/commands/bulk-archive.md +355 -327
  37. package/openspec/commands/continue.md +116 -105
  38. package/openspec/commands/explore.md +230 -199
  39. package/openspec/commands/ff.md +115 -104
  40. package/openspec/commands/new.md +74 -63
  41. package/openspec/commands/onboard.md +557 -548
  42. package/openspec/commands/propose.md +161 -150
  43. package/openspec/commands/sync.md +277 -249
  44. package/openspec/commands/update.md +92 -80
  45. package/openspec/commands/verify.md +175 -162
  46. package/openspec/skills/openspec-apply-change/SKILL.md +20 -5
  47. package/openspec/skills/openspec-archive-change/SKILL.md +30 -8
  48. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +36 -6
  49. package/openspec/skills/openspec-continue-change/SKILL.md +14 -2
  50. package/openspec/skills/openspec-explore/SKILL.md +21 -9
  51. package/openspec/skills/openspec-ff-change/SKILL.md +14 -2
  52. package/openspec/skills/openspec-new-change/SKILL.md +13 -1
  53. package/openspec/skills/openspec-onboard/SKILL.md +49 -39
  54. package/openspec/skills/openspec-propose/SKILL.md +15 -3
  55. package/openspec/skills/openspec-sync-specs/SKILL.md +31 -2
  56. package/openspec/skills/openspec-update-change/SKILL.md +27 -14
  57. package/openspec/skills/openspec-verify-change/SKILL.md +17 -3
  58. package/package.json +2 -2
  59. package/superpowers/.version +4 -4
  60. package/superpowers/skills/brainstorming/SKILL.md +47 -12
  61. package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -213
  62. package/superpowers/skills/brainstorming/scripts/server.cjs +723 -723
  63. package/superpowers/skills/brainstorming/visual-companion.md +6 -6
  64. package/superpowers/skills/diagnosing-superpowers/SKILL.md +120 -0
  65. package/superpowers/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
  66. package/superpowers/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
  67. package/superpowers/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
  68. package/superpowers/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
  69. package/superpowers/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
  70. package/superpowers/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
  71. package/superpowers/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
  72. package/superpowers/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
  73. package/superpowers/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
  74. package/superpowers/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
  75. package/superpowers/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
  76. package/superpowers/skills/diagnosing-superpowers/references/context-safety.md +22 -0
  77. package/superpowers/skills/diagnosing-superpowers/references/github-issues.md +47 -0
  78. package/superpowers/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
  79. package/superpowers/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
  80. package/superpowers/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
  81. package/superpowers/skills/diagnosing-superpowers/templates/case.md +64 -0
  82. package/superpowers/skills/diagnosing-superpowers/templates/issue.md +51 -0
  83. package/superpowers/skills/diagnosing-superpowers/templates/report.md +82 -0
  84. package/superpowers/skills/executing-plans/SKILL.md +350 -41
  85. package/superpowers/skills/executing-plans/scripts/task-done +52 -0
  86. package/superpowers/skills/executing-plans/scripts/task-start +28 -0
  87. package/superpowers/skills/requesting-code-review/SKILL.md +1 -1
  88. package/superpowers/skills/requesting-code-review/code-reviewer.md +17 -0
  89. package/superpowers/skills/subagent-driven-development/SKILL.md +18 -18
  90. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +1 -1
  91. package/superpowers/skills/subagent-driven-development/scripts/review-package +53 -46
  92. package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +82 -40
  93. package/superpowers/skills/subagent-driven-development/scripts/task-brief +43 -41
  94. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +2 -2
  95. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
  96. package/superpowers/skills/test-driven-development/SKILL.md +10 -0
  97. package/superpowers/skills/using-superpowers/SKILL.md +2 -0
  98. package/superpowers/skills/using-superpowers/references/claude-code-tools.md +29 -0
  99. package/superpowers/skills/using-superpowers/references/muse-tools.md +35 -0
  100. package/superpowers/skills/writing-plans/SKILL.md +30 -9
  101. package/superpowers/skills/writing-skills/SKILL.md +4 -2
  102. package/superpowers/skills/writing-skills/graphviz-conventions.dot +171 -171
  103. package/cbb/worktrees/commands/worktree-close.md +0 -64
  104. package/cbb/worktrees/commands/worktree-init.md +0 -55
  105. package/cbb/worktrees/commands/worktree-push.md +0 -42
  106. package/cbb/worktrees/skills/cbb-worktree-init/scripts/auto-open.js +0 -136
  107. package/cbb/worktrees/skills/cbb-worktree-init/scripts/install-ai.js +0 -177
@@ -4,108 +4,119 @@ description: Create a change and generate all artifacts needed for implementatio
4
4
  category: Workflow
5
5
  tags: [workflow, artifacts, experimental]
6
6
  ---
7
- Fast-forward through artifact creation - generate everything needed to start implementation.
8
-
9
- **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
10
-
11
- **Input**: The argument after `/opsx:ff` is the change name (kebab-case), OR a description of what the user wants to build.
12
-
13
- **Steps**
14
-
15
- 1. **If no input provided, ask what they want to build**
16
-
17
- Ask the user (open-ended, no preset options):
18
- > "What change do you want to work on? Describe what you want to build or fix."
19
-
20
- From their description, derive a kebab-case name (e.g., "add user authentication" `add-user-auth`).
21
-
22
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
23
-
24
- 2. **Create the change directory**
25
- ```bash
26
- openspec new change "<name>"
27
- ```
28
- This creates a scaffolded change in the planning home resolved by the CLI.
29
-
30
- 3. **Get the artifact build order**
31
- ```bash
32
- openspec status --change "<name>" --json
33
- ```
34
- Parse the JSON to get:
35
- - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
36
- - `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
37
- - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
38
-
39
- 4. **Create every artifact in the required set**
40
-
41
- Use a todo list to track progress through the artifacts.
42
-
43
- Loop through artifacts in dependency order (artifacts with no pending dependencies first):
44
-
45
- a. **For each artifact that is `ready` (dependencies satisfied)**:
46
- - Get instructions:
47
- ```bash
48
- openspec instructions <artifact-id> --change "<name>" --json
49
- ```
50
- - The instructions JSON includes:
51
- - `context`: Project background (constraints for you - do NOT include in output)
52
- - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
53
- - `template`: The structure to use for your output file
54
- - `instruction`: Schema-specific guidance for this artifact type
55
- - `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
56
- - `resolvedOutputPath`: Resolved path or pattern to write the artifact
57
- - `dependencies`: Completed artifacts to read for context
58
- - 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)
59
- - **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.
60
- - 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.
61
- - 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.
62
- - 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.
63
- - 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`
64
- - 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
65
- - Apply `context` and `rules` as constraints - but do NOT copy them into the file
66
- - Show brief progress: "✓ Created <artifact-id>"
67
-
68
- b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
69
- - After creating each artifact, re-run `openspec status --change "<name>" --json`
70
- - 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
71
- - `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
72
- - 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
73
- - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
74
- - 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
75
- - Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
76
- - Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
77
-
78
- c. **If an artifact requires user input** (unclear context):
79
- - Ask the user to clarify
80
- - Then continue with creation
81
-
82
- 5. **Show final status**
83
- ```bash
84
- openspec status --change "<name>"
85
- ```
86
-
87
- **Output**
88
-
89
- After completing all artifacts, summarize:
90
- - Change name and location
91
- - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
92
- - What's ready: "All artifacts needed for implementation are ready."
93
- - Prompt: "Run `/opsx:apply` to start implementing."
94
-
95
- **Artifact Creation Guidelines**
96
-
97
- - Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
98
- - 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
99
- - The schema defines what each artifact should contain - follow it
100
- - Read dependency artifacts for context before creating new ones
101
- - Use `template` as the structure for your output file - fill in its sections
102
- - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
103
- - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
104
- - These guide what you write, but should never appear in the output
105
-
106
- **Guardrails**
107
- - Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
108
- - 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)
109
- - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
110
- - If a change with that name already exists, ask if user wants to continue it or create a new one
7
+ Fast-forward through artifact creation - generate everything needed to start implementation.
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**: The argument after `/opsx:ff` is the change name (kebab-case), OR a description of what the user wants to build.
23
+
24
+ **Steps**
25
+
26
+ 1. **If no input provided, ask what they want to build**
27
+
28
+ Ask the user (open-ended, no preset options):
29
+ > "What change do you want to work on? Describe what you want to build or fix."
30
+
31
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
32
+
33
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
34
+
35
+ 2. **Create the change directory**
36
+ ```bash
37
+ openspec new change "<name>"
38
+ ```
39
+ This creates a scaffolded change in the planning home resolved by the CLI.
40
+
41
+ 3. **Get the artifact build order**
42
+ ```bash
43
+ openspec status --change "<name>" --json
44
+ ```
45
+ Parse the JSON to get:
46
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
47
+ - `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
48
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
49
+
50
+ 4. **Create every artifact in the required set**
51
+
52
+ Use a todo list to track progress through the artifacts.
53
+
54
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
55
+
56
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
57
+ - Get instructions:
58
+ ```bash
59
+ openspec instructions <artifact-id> --change "<name>" --json
60
+ ```
61
+ - The instructions JSON includes:
62
+ - `context`: Project background (constraints for you - do NOT include in output)
63
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
64
+ - `template`: The structure to use for your output file
65
+ - `instruction`: Schema-specific guidance for this artifact type
66
+ - `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
67
+ - `resolvedOutputPath`: Resolved path or pattern to write the artifact
68
+ - `dependencies`: Completed artifacts to read for context
69
+ - 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)
70
+ - **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.
71
+ - 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.
72
+ - 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.
73
+ - 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.
74
+ - 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`
75
+ - 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
76
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
77
+ - Show brief progress: "✓ Created <artifact-id>"
78
+
79
+ b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
80
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
81
+ - 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
82
+ - `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
83
+ - 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
84
+ - Create every artifact in the required set that is missing, then re-check - creating one can unblock others
85
+ - 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
86
+ - Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
87
+ - Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
88
+
89
+ c. **If an artifact requires user input** (unclear context):
90
+ - Ask the user to clarify
91
+ - Then continue with creation
92
+
93
+ 5. **Show final status**
94
+ ```bash
95
+ openspec status --change "<name>"
96
+ ```
97
+
98
+ **Output**
99
+
100
+ After completing all artifacts, summarize:
101
+ - Change name and location
102
+ - List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
103
+ - What's ready: "All artifacts needed for implementation are ready."
104
+ - Prompt: "Run `/opsx:apply` to start implementing."
105
+
106
+ **Artifact Creation Guidelines**
107
+
108
+ - Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
109
+ - 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
110
+ - The schema defines what each artifact should contain - follow it
111
+ - Read dependency artifacts for context before creating new ones
112
+ - Use `template` as the structure for your output file - fill in its sections
113
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
114
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
115
+ - These guide what you write, but should never appear in the output
116
+
117
+ **Guardrails**
118
+ - Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
119
+ - 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)
120
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
121
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
111
122
  - Verify each artifact file exists after writing before proceeding to next
@@ -4,67 +4,78 @@ description: Start a new change using the experimental artifact workflow (OPSX)
4
4
  category: Workflow
5
5
  tags: [workflow, artifacts, experimental]
6
6
  ---
7
- Start a new change using the experimental artifact-driven approach.
8
-
9
- **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
10
-
11
- **Input**: The argument after `/opsx:new` is the change name (kebab-case), OR a description of what the user wants to build.
12
-
13
- **Steps**
14
-
15
- 1. **If no input provided, ask what they want to build**
16
-
17
- Ask the user (open-ended, no preset options):
18
- > "What change do you want to work on? Describe what you want to build or fix."
19
-
20
- From their description, derive a kebab-case name (e.g., "add user authentication" `add-user-auth`).
21
-
22
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
23
-
24
- 2. **Determine the workflow schema**
25
-
26
- Use the default schema (omit `--schema`) unless the user explicitly requests a different workflow.
27
-
28
- **Use a different schema only if the user mentions:**
29
- - A specific schema name use `--schema <name>`
30
- - "show workflows" or "what workflows" → run `openspec schemas --json` and let them choose
31
-
32
- **Otherwise**: Omit `--schema` to use the default.
33
-
34
- 3. **Create the change directory**
35
- ```bash
36
- openspec new change "<name>"
37
- ```
38
- Add `--schema <name>` only if the user requested a specific workflow.
39
- This creates a scaffolded change in the planning home resolved by the CLI.
40
-
41
- 4. **Show the artifact status**
42
- ```bash
43
- openspec status --change "<name>" --json
44
- ```
45
- Use the returned `planningHome`, `changeRoot`, `artifactPaths`, and `nextSteps` instead of assuming repo-local paths.
46
-
47
- 5. **Get instructions for the first artifact**
48
- The first artifact depends on the schema. Check the status output to find the first artifact with status "ready".
49
- ```bash
50
- openspec instructions <first-artifact-id> --change "<name>"
51
- ```
52
- This outputs the template and context for creating the first artifact.
53
-
54
- 6. **STOP and wait for user direction**
55
-
56
- **Output**
57
-
58
- After completing the steps, summarize:
59
- - Change name and location
60
- - Schema/workflow being used and its artifact sequence
61
- - Current status (0/N artifacts complete)
62
- - The template for the first artifact
63
- - Prompt: "Ready to create the first artifact? Run `/opsx:continue` or just describe what this change is about and I'll draft it."
64
-
65
- **Guardrails**
66
- - Do NOT create any artifacts yet - just show the instructions
67
- - Do NOT advance beyond showing the first artifact template
68
- - If the name is invalid (not kebab-case), ask for a valid name
69
- - If a change with that name already exists, suggest using `/opsx:continue` instead
7
+ Start a new change using the experimental artifact-driven approach.
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**: The argument after `/opsx:new` is the change name (kebab-case), OR a description of what the user wants to build.
23
+
24
+ **Steps**
25
+
26
+ 1. **If no input provided, ask what they want to build**
27
+
28
+ Ask the user (open-ended, no preset options):
29
+ > "What change do you want to work on? Describe what you want to build or fix."
30
+
31
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
32
+
33
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
34
+
35
+ 2. **Determine the workflow schema**
36
+
37
+ Use the default schema (omit `--schema`) unless the user explicitly requests a different workflow.
38
+
39
+ **Use a different schema only if the user mentions:**
40
+ - A specific schema name → use `--schema <name>`
41
+ - "show workflows" or "what workflows" → run `openspec schemas --json` and let them choose
42
+
43
+ **Otherwise**: Omit `--schema` to use the default.
44
+
45
+ 3. **Create the change directory**
46
+ ```bash
47
+ openspec new change "<name>"
48
+ ```
49
+ Add `--schema <name>` only if the user requested a specific workflow.
50
+ This creates a scaffolded change in the planning home resolved by the CLI.
51
+
52
+ 4. **Show the artifact status**
53
+ ```bash
54
+ openspec status --change "<name>" --json
55
+ ```
56
+ Use the returned `planningHome`, `changeRoot`, `artifactPaths`, and `nextSteps` instead of assuming repo-local paths.
57
+
58
+ 5. **Get instructions for the first artifact**
59
+ The first artifact depends on the schema. Check the status output to find the first artifact with status "ready".
60
+ ```bash
61
+ openspec instructions <first-artifact-id> --change "<name>"
62
+ ```
63
+ This outputs the template and context for creating the first artifact.
64
+
65
+ 6. **STOP and wait for user direction**
66
+
67
+ **Output**
68
+
69
+ After completing the steps, summarize:
70
+ - Change name and location
71
+ - Schema/workflow being used and its artifact sequence
72
+ - Current status (0/N artifacts complete)
73
+ - The template for the first artifact
74
+ - Prompt: "Ready to create the first artifact? Run `/opsx:continue` or just describe what this change is about and I'll draft it."
75
+
76
+ **Guardrails**
77
+ - Do NOT create any artifacts yet - just show the instructions
78
+ - Do NOT advance beyond showing the first artifact template
79
+ - If the name is invalid (not kebab-case), ask for a valid name
80
+ - If a change with that name already exists, suggest using `/opsx:continue` instead
70
81
  - Pass --schema if using a non-default workflow