@skitterbyte/skitterspec 16.8.0 → 17.0.0

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.
@@ -22,10 +22,20 @@ clobber customised content. Finish with a summary of created vs already-present.
22
22
  > **Leave alone**. Non-interactively it only adds what's missing; `--resync` /
23
23
  > `--reset` (reset needs `--yes`) drive the stronger actions.
24
24
 
25
- The system is **eight skills**: `spec` (feature), `spec-bug` (bug), `spec-ready`,
26
- `spec-review`, `spec-go`, `spec-complete`, `spec-cancel`, and this `spec-init`. The lifecycle is
27
- `backlog in-progress → complete / cancelled`, with `.core` holding always-apply
28
- project rules.
25
+ The system is **ten skills**: `spec` (feature), `spec-bug` (bug),
26
+ `spec-hotfix` (a bug fixed on a released tag), `spec-review`, `spec-start`,
27
+ `spec-next`, `spec-to-main`, `spec-complete`, `spec-cancel`, and this
28
+ `spec-init`. The lifecycle is `backlog → in-progress → complete / cancelled`,
29
+ with `.core` holding always-apply project rules.
30
+
31
+ ## 0. Workspace mode (only when adopting isolation)
32
+
33
+ If this project is adopting per-spec isolation, ask which `mode` belongs in
34
+ `specs/.core/env.config.json` — `worktree` (default; a checkout per spec, several
35
+ at once, one terminal session each) or `checkout` (the branch is built in the
36
+ checkout you are already in; one spec at a time, no hand-off). It is a question
37
+ about how the operator works, not about what the repo contains, so ask rather
38
+ than infer it from whether dev servers or Docker are configured.
29
39
 
30
40
  ## 1. Folders
31
41
 
@@ -54,7 +64,7 @@ project wants everything tracked, remove it. Confirm with
54
64
 
55
65
  ## 3. Verify the skills are installed
56
66
 
57
- Check each of the eight skills resolves — `.claude/skills/<name>/SKILL.md`
67
+ Check each of the ten skills resolves — `.claude/skills/<name>/SKILL.md`
58
68
  (project) or `~/.claude/skills/<name>/` (global). List any missing. This skill
59
69
  scaffolds the project; it does **not** regenerate skill bodies — missing skills
60
70
  must be copied in (e.g. `npx @skitterbyte/skitterspec init`) from a global install
@@ -73,7 +83,7 @@ Ensure it exists. If missing, create it documenting:
73
83
  - the project's concrete typecheck/test commands, and the rule that **every
74
84
  phase ends with creating + running tests**.
75
85
 
76
- Read a sibling spec skill (e.g. `spec`, `spec-go`) for the canonical shapes
86
+ Read a sibling spec skill (e.g. `spec`, `spec-next`) for the canonical shapes
77
87
  rather than inventing them. If the rule already exists, leave it unless stale.
78
88
 
79
89
  ## 5. CLAUDE.md
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: spec-next
3
+ description: Build the next unfinished phase of the spec currently in flight on this checkout — pre-flight, implement with tests, record progress and refresh the tracker. Refuses when no spec is in flight rather than guessing one. Use when the user says "/spec-next", "build the next phase", "continue the spec", or "carry on with this spec".
4
+ ---
5
+
6
+ # /spec-next — build the next phase of the spec in flight
7
+
8
+ It assumes the workbench is already set up: a spec is **in flight** on this
9
+ checkout, and this skill implements its next unfinished phase. Putting a spec in
10
+ flight — provisioning, moving it to `in-progress`, getting its branch here — is
11
+ `/spec-start`'s job. Re-run this per phase until the spec is done, then
12
+ `/spec-complete`.
13
+
14
+ ## 1. Identify the spec in flight
15
+
16
+ Resolve **in this order**, and stop at the first that answers:
17
+
18
+ 1. **The live spec of this checkout** — run
19
+ `skitterspec spec-env live status` and read its `live:` line. `live: yes`
20
+ names the spec whose branch is checked out here; that is the one to build.
21
+ 2. **The worktree you are standing in** — if this session's cwd is inside a
22
+ spec's worktree, that spec is in flight *for this session*. This is the
23
+ manual-parallel path: several specs may be provisioned, and a terminal tab
24
+ opened in one is its own workbench.
25
+ 3. **The current branch, in `checkout` mode** — no worktrees exist, so the
26
+ branch the checkout is on names the spec.
27
+
28
+ **If none answers, refuse and stop:**
29
+ `no spec in flight — run /spec-start <name> to put one on this checkout`.
30
+
31
+ **Never fall back to the spec "in context".** A spec discussed in conversation
32
+ is not a spec in flight, and this skill writes real code: building the wrong
33
+ spec's phase produces commits on a branch nobody asked for. The refusal is
34
+ cheap; the mistake is not.
35
+
36
+ A **name argument** is accepted, but it must *match* the spec in flight — it
37
+ narrows a re-run, it does not select a different spec. A mismatch refuses,
38
+ naming both.
39
+
40
+ ## 2. Pre-flight — commit prior work
41
+
42
+ Before writing any code for this phase, get the workspace clean:
43
+
44
+ - **Confirm the last-worked phase is committed.** Run `git status` and
45
+ `git log --oneline -5`. The most recently *implemented* phase (not necessarily
46
+ the numerically previous one) should already be committed. If prior-phase work
47
+ is still uncommitted, **stop and suggest committing it first** (e.g. via
48
+ `/commit`) so each phase lands as its own reviewable commit — don't build the
49
+ next phase on top of an uncommitted one. (Skip if this is the first phase —
50
+ there's nothing prior to commit.)
51
+
52
+ ## 3. Implement the phase
53
+
54
+ Identify the **first unfinished phase** from the `00-overview.md` phase index,
55
+ then open its phase file (`0N-<slug>.md`) — that file holds the tasks. Mark it
56
+ started: set the phase-file heading to `🔄` and its `> **Status:**` to
57
+ `In progress`, and flip the matching row in the overview phase index to `🔄`.
58
+
59
+ **Then sync with the tracker (only if a provider is installed).** The phase has
60
+ just changed state, so refresh the mirror before the build starts — that is what
61
+ makes the phase show as in progress *while* it is being built rather than only
62
+ once it is over. Without a provider this is a no-op and nothing below changes.
63
+
64
+
65
+
66
+ Then build it, following the project rules in `.claude/rules/*.md` and `CLAUDE.md`:
67
+
68
+ - Work task by task through the phase file. Make focused edits that match
69
+ surrounding code.
70
+ - Honour the project's conventions (see `.claude/rules/spec-planning.md` and the
71
+ rules it links).
72
+ - **Tests are part of the phase, not after it.** Create/extend tests for the
73
+ work, then run the project's typecheck and test commands. Do not declare the
74
+ phase done until green.
75
+ - Never hardcode dates in tests; never run destructive commands against a real
76
+ database — use the project's test database only.
77
+
78
+ ## 4. Record progress
79
+
80
+ - In the **phase file**: tick completed tasks (`- [x]`), flip its heading to `✅`,
81
+ and set its `> **Status:**` to `Done`.
82
+ - In **`00-overview.md`**: flip the matching phase-index row to `✅`.
83
+ - If anything changed from the plan (a decision, a deviation, a discovered
84
+ constraint), add a dated **Changelog** entry in `00-overview.md`.
85
+ - If new work surfaced, add it as tasks to the appropriate phase file (or add a
86
+ new phase file + index row) rather than doing it silently.
87
+
88
+ **Then refresh the mirror (only if a provider is installed).** The phase is done
89
+ in the repo now; leaving the tracker to catch up at `/spec-complete` is what makes
90
+ a mirror lag a whole spec behind. Without a provider this is a no-op.
91
+
92
+
93
+
94
+ ## 5. Report
95
+
96
+ Summarise what was implemented, the test result (quote failures if any), and
97
+ which phase is next. Do **not** `git commit` unless the user asks — finish,
98
+ verify, and wait.
@@ -8,7 +8,7 @@ description: Re-validate an existing spec against the current codebase — detec
8
8
  Specs rot: the code moves on while a spec sits in the backlog or pauses
9
9
  mid-build. This skill re-validates a spec against the **current** code and
10
10
  rewrites the stale parts so it's safe to act on. It plans only — it does not
11
- implement anything (that's `/spec-go`).
11
+ implement anything (that's `/spec-next`).
12
12
 
13
13
  ## 1. Identify the target spec
14
14
 
@@ -48,9 +48,9 @@ trust the spec's own wording — verify:
48
48
 
49
49
  Where the drift forces a choice (the old approach no longer fits, a referenced
50
50
  thing is gone, scope is now ambiguous), grill the user like `/spec` Phase A —
51
- **one question at a time, with a recommended answer** — but scoped tightly to
52
- the drift. Don't re-litigate decisions that still hold. If you can resolve it by
53
- reading the code, do that instead of asking.
51
+ **batching independent questions, each with a recommended answer** — but scoped
52
+ tightly to the drift. Don't re-litigate decisions that still hold. If you can
53
+ resolve it by reading the code, do that instead of asking.
54
54
 
55
55
  ## 4. Update the spec
56
56
 
@@ -87,5 +87,5 @@ reading the code, do that instead of asking.
87
87
  ## 5. Report
88
88
 
89
89
  Summarise the drift found, what you changed, any questions still open, and
90
- whether the spec is now safe to `/spec-go` (or should drop back to `Draft` until
90
+ whether the spec is now safe to `/spec-start` (or should drop back to `Draft` until
91
91
  the open questions are resolved). Do **not** `git commit` unless the user asks.
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: spec-start
3
+ description: Put a spec in flight on this checkout — provision its branch, move it to in-progress, refresh the tracker, then build phase 1. Refuses unless the checkout is on the base branch with nothing already in flight, so it never parks or swaps someone's unfinished work. Use when the user says "/spec-start", "start this spec", or "begin implementing <spec>".
4
+ ---
5
+
6
+ # /spec-start — put a spec in flight
7
+
8
+ One checkout, one spec in flight. This skill is how a spec gets there:
9
+ provision, move it to `in-progress`, refresh the tracker, then hand straight on
10
+ to `/spec-next` for phase 1. Continuing a spec afterwards is `/spec-next`;
11
+ finishing it is `/spec-complete`.
12
+
13
+ ## 1. The gate — refuse unless the workbench is free
14
+
15
+ **Check this first, before resolving anything or touching a file.** In
16
+ `worktree` mode run `skitterspec spec-env live status`; in `checkout` mode read
17
+ the current branch. The workbench must be:
18
+
19
+ - **on the base branch** (`main`, or the configured `baseBranch`), and
20
+ - **clean** — no uncommitted changes.
21
+
22
+ **If it isn't, relay what is in flight and stop.** Name the spec holding the
23
+ checkout and the three ways out, then end your turn:
24
+
25
+ - **`/spec-complete`** — it's finished; land it and free the workbench.
26
+ - **`/spec-cancel`** — it isn't wanted; record why and free the workbench.
27
+ - **`/spec-live main`** *(worktree mode)* — park it: the branch goes back to its
28
+ worktree and stays exactly as it is, ready to resume later.
29
+
30
+ **Never get past the gate yourself.** Do not stash, do not commit on the
31
+ operator's behalf, do not `/spec-live main` for them, do not switch branches. An
32
+ uncommitted tree, a half-built phase and a rebase are each a decision someone
33
+ must make deliberately — and the cost of guessing is another spec's work moved
34
+ without its author asking. A refusal costs one command; the alternative can cost
35
+ an afternoon.
36
+
37
+ A dirty tree is refused *with the same words whatever the cause*: the gate does
38
+ not try to judge whether the changes look important.
39
+
40
+ ## 2. Identify the spec
41
+
42
+ - Use the name/path argument when given.
43
+ - Otherwise use the spec **in context** (the one just created or discussed).
44
+ Unlike `/spec-next`, that fallback is safe here: this skill starts nothing
45
+ without the gate above passing, and a wrong guess is caught by the operator
46
+ before any code is written.
47
+ - Locate it under `specs/` — `specs/backlog/` first, then the other buckets. A
48
+ spec is a `<name>/` folder whose entry point is `00-overview.md`, with one
49
+ file per phase beside it (`01-<slug>.md`, `02-…`). Legacy specs may be a bare
50
+ `<name>.md`, or a `00-overview.md` with inline phases — handle those too.
51
+ - A spec already in `specs/in-progress/` was started before. If its branch is
52
+ parked in a worktree, this skill brings it back into flight; say so rather
53
+ than reporting a fresh start.
54
+
55
+ ## 3. Put its branch in this checkout
56
+
57
+ **Read `mode` from `specs/.core/env.config.json`** (default `worktree`).
58
+
59
+ ### `worktree` mode
60
+
61
+ 1. **Provision.** Run `skitterspec spec-env up <name>` — a planner, so run the
62
+ `to provision, run:` commands it prints and confirm they succeeded. Then run
63
+ its **`then, in the worktree, run:`** steps in order (file seeding, then
64
+ `setup`): a fresh worktree has no dependencies and none of the repo's
65
+ gitignored files, so hooks, typechecks and tests fail until they are there.
66
+ 2. **Bring the branch here.** Tell the user to type **`/spec-live <name>`** — it
67
+ rebases the branch, frees it from the worktree and checks it out in this
68
+ checkout, which is what makes this session the workbench. It is a user-only
69
+ command, so you cannot run it: print it, end your turn, and pick up at step 4
70
+ when they re-run `/spec-start`.
71
+ **Already here?** If the live check in step 1 showed this spec live, or the
72
+ branch is already checked out, the move is done — carry straight on.
73
+ 3. **A spec the live overlay refuses** — a hotfix, a stateful spec
74
+ (`Stack: worktree + docker`), or a branch touching migrations — **parks
75
+ instead.** Do the housekeeping in step 4 with `git -C <worktreePath>`, run
76
+ `open.command` if configured, print the worktree path, and say to run
77
+ `/spec-next` from a session there. Relay the engine's refusal reason as it
78
+ printed it; those guards protect a shared dev instance and are not yours to
79
+ weaken.
80
+ **Trust the worktree first.** `spec-env up` wrote the printed `trusted:` root
81
+ into `.claude/settings.local.json`, but that file will not hot-reload in this
82
+ session — run `/add-dir <trusted root>` before editing into the worktree, or
83
+ the first write prompts.
84
+
85
+ ### `checkout` mode
86
+
87
+ Run `skitterspec spec-env up <name>` and the single `git switch` it prints.
88
+ There is no worktree, no bootstrap, no live step — the checkout is already the
89
+ workbench. Its planner enforces the same gate from the engine side, so relay any
90
+ refusal and stop.
91
+
92
+ ## 4. Move the spec into development
93
+
94
+ On the branch, in this checkout (or via `git -C <worktreePath>` for a parked
95
+ spec):
96
+
97
+ - `git mv "specs/backlog/<name>" "specs/in-progress/<name>"` if it isn't there
98
+ already (`mkdir -p specs/in-progress` first). Use `git mv` to keep history.
99
+ - Set the **Status** header: `> **Status:** In Progress — Phase 1 (started <YYYY-MM-DD>)`.
100
+ - Set **Developer** if it is still `—` (`git config user.name`).
101
+ - Append a **State log** row: `| <YYYY-MM-DD> | In Progress | in-progress | <git user.name> |`.
102
+ - **Commit it, and push the branch.** One commit, the spec's own — it records the
103
+ in-progress state for everyone and fires the tracker's automation. Do this
104
+ *before* the tracker refresh below, so the snapshot that refresh writes is
105
+ swept up by the phase's own commit rather than left dirty.
106
+
107
+ A spec ideally arrives `Ready` from `/spec`; a `Draft` works too — sanity-check
108
+ it is well-formed first.
109
+
110
+ ## 5. Bring the spec's dev servers up — confirm before heavy steps
111
+
112
+ **Only when the project configures host dev servers** (`env.config.json` → a
113
+ non-empty `dev` array). Show what will start — the commands, the ports, any
114
+ Docker stack — and get a yes; on **`--plan`**, print it and stop. On
115
+ confirmation run `skitterspec spec-env dev up <name>`. With none configured this
116
+ is a clean no-op.
117
+
118
+ To reach the spec at your normal `localhost` URL afterwards, the **user** types
119
+ **`/spec-connect <name>`** (`/spec-connect main` hands the ports back). Never
120
+ invoke it yourself.
121
+
122
+ ## 6. Build phase 1
123
+
124
+ **Carry straight on into `/spec-next`** in this session: it marks phase 1
125
+ started, refreshes the mirror again, builds it with tests and reports. Do not
126
+ stop and ask the operator to run it — the workbench is set up and they asked to
127
+ start the spec.
128
+
129
+ ## Opt-outs
130
+
131
+ - **`--plan`** — print the provisioning and dev-server plan, change nothing.
132
+ - **`--no-worktree`** — skip provisioning and build on the current branch. Warn
133
+ that the work lands wherever you are (usually the base branch); reserve it for
134
+ a trivial change or an explicit request.
135
+
136
+ There is no `--here`: `/spec-start` **is** here. It puts the branch in the
137
+ checkout you are in, which is what the old opt-out was reaching for.
138
+
139
+ ## Why there is no tracker seam here
140
+
141
+ This skill creates no spec and mints no issue, so it has nothing to link — the
142
+ intake and picker steps belong to `/spec`, `/spec-bug` and `/spec-hotfix`. The
143
+ state change it *does* make (the spec moving to `in-progress`) is mirrored by
144
+ the refresh `/spec-next` runs the moment it starts, which pushes the issue state
145
+ and the phase states together. Adding a push here would send the same thing
146
+ twice, one commit apart.
@@ -15,7 +15,7 @@ as you add commits.
15
15
  Use it when a later phase can only be done *after* the current work is on `main` —
16
16
  e.g. it needs to run in CI, a deploy pipeline, or a shared test environment that
17
17
  builds from `main`. Land what you have, run that step, then come back and finish
18
- the remaining phases with `/spec-go` and eventually `/spec-complete`.
18
+ the remaining phases with `/spec-next` and eventually `/spec-complete`.
19
19
 
20
20
  It reuses the **same engine** as `/spec-complete`'s landing (`spec-env integrate`
21
21
  — rebase + fast-forward), so it produces identical linear history. Because a
@@ -26,9 +26,11 @@ repeatable**: new commits put the branch ahead of base again, and you can run
26
26
  ## 0. Preconditions — when this applies
27
27
 
28
28
  - **Isolation must be on** (`specs/.core/env.config.json` exists **and** the spec
29
- is on a worktree provisioned by `/spec-go`). If isolation is absent, there is
30
- nothing to land the spec is authored directly on `main` already. Say so and
31
- stop.
29
+ was provisioned by `/spec-start` a worktree, or its branch in the checkout under
30
+ `mode: checkout`). If isolation is absent, there is nothing to land the spec
31
+ is authored directly on `main` already. Say so and stop. `spec-env integrate`
32
+ reads `mode` and emits the matching plan; in checkout mode it rebases in place,
33
+ switches to base and fast-forwards, all in the one repo.
32
34
  - **Feature / Bug specs only.** A **Hotfix** (`Type: Hotfix`) is built on a
33
35
  release *tag* and cannot fast-forward onto `main` — refuse it and point the user
34
36
  at `/spec-complete` (it lands a hotfix via tag + cherry-pick). Check the header
@@ -94,7 +96,7 @@ and continue — the branch has no commits base doesn't already have.
94
96
  - Report: the base branch, the fast-forward result, and the green base test. It
95
97
  **never pushes** — mention the user can `git push` the base branch themselves to
96
98
  trigger CI / the shared env.
97
- - Point the way forward: `/spec-go` to continue the remaining phases (you'll keep
99
+ - Point the way forward: `/spec-next` to continue the remaining phases (you'll keep
98
100
  committing on the same branch and can `/spec-to-main` again), and `/spec-complete`
99
101
  when every phase is genuinely done — it will land the final commits, finalise,
100
102
  and tear down.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skitterbyte/skitterspec",
3
- "version": "16.8.0",
3
+ "version": "17.0.0",
4
4
  "description": "Spec-driven development for Claude Code — a tracker-free filesystem workflow: lifecycle skills and per-spec isolation. For Linear sync, install @skitterbyte/skitterspec-linear instead.",
5
5
  "keywords": [
6
6
  "claude",