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