@skitterbyte/skitterspec 16.10.0 → 18.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.
- package/MIGRATION.md +88 -0
- package/README.md +3 -3
- package/assets/claude-md-section.md +20 -48
- package/assets/core/env.config.json.example +7 -1
- package/assets/core/env.config.md +56 -11
- package/assets/core/gating.config.json.example +4 -0
- package/assets/core/gating.config.md +81 -0
- package/assets/rules/spec-planning.md +53 -13
- package/assets/skills/spec/SKILL.md +44 -16
- package/assets/skills/spec-bug/SKILL.md +30 -25
- package/assets/skills/spec-cancel/SKILL.md +26 -0
- package/assets/skills/spec-complete/SKILL.md +70 -17
- package/assets/skills/spec-hotfix/SKILL.md +38 -17
- package/assets/skills/spec-init/SKILL.md +31 -8
- package/assets/skills/spec-next/SKILL.md +98 -0
- package/assets/skills/spec-review/SKILL.md +24 -11
- package/assets/skills/spec-start/SKILL.md +226 -0
- package/assets/skills/spec-to-main/SKILL.md +21 -19
- package/package.json +1 -1
- package/src/cli.js +405 -15
- package/src/env/classify.js +91 -0
- package/src/env/config.js +39 -1
- package/src/env/integrate.js +61 -1
- package/src/env/live.js +27 -3
- package/src/env/provision.js +196 -5
- package/src/env/resolve.js +1 -0
- package/src/env/teardown.js +41 -3
- package/src/gating.js +155 -0
- package/src/init.js +45 -9
- package/src/prompts.js +41 -4
- package/assets/skills/spec-go/SKILL.md +0 -190
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-next
|
|
3
|
+
description: Build the next unfinished phase of the spec in flight for this session — pre-flight, implement with tests, record progress and refresh the tracker. Refuses when no spec is in flight rather than guessing one, and never builds a spec it is not standing in. 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 start one`.
|
|
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-
|
|
11
|
+
implement anything (that's `/spec-next`).
|
|
12
12
|
|
|
13
13
|
## 1. Identify the target spec
|
|
14
14
|
|
|
@@ -44,22 +44,35 @@ trust the spec's own wording — verify:
|
|
|
44
44
|
- **Backward compatibility.** Re-confirm the planned API/schema changes are still
|
|
45
45
|
additive/safe given the current code (see the project's compatibility rules).
|
|
46
46
|
|
|
47
|
+
### Release gating (only when configured)
|
|
48
|
+
|
|
49
|
+
**Only when `specs/.core/gating.config.json` exists.** Run
|
|
50
|
+
`skitterspec gating check <spec>`. A spec it names has no recorded gating
|
|
51
|
+
decision — or a bare `none` that records nothing — and that is
|
|
52
|
+
**drift like any other**: the question was never asked, or its answer was lost. Grill for it in
|
|
53
|
+
step 3 and write the header in step 4, exactly as you would a stale file path.
|
|
54
|
+
|
|
55
|
+
**This check is advisory.** It reports; it never refuses, and nothing below is
|
|
56
|
+
conditional on it. A spec written before the project adopted gating has no header
|
|
57
|
+
and is not broken — turning this into a gate would accuse the very specs the
|
|
58
|
+
feature was designed not to disturb.
|
|
59
|
+
|
|
47
60
|
## 3. Grill only where a decision is needed
|
|
48
61
|
|
|
49
62
|
Where the drift forces a choice (the old approach no longer fits, a referenced
|
|
50
63
|
thing is gone, scope is now ambiguous), grill the user like `/spec` Phase A —
|
|
51
|
-
**
|
|
52
|
-
the drift. Don't re-litigate decisions that still hold. If you can
|
|
53
|
-
reading the code, do that instead of asking.
|
|
64
|
+
**batching independent questions, each with a recommended answer** — but scoped
|
|
65
|
+
tightly to the drift. Don't re-litigate decisions that still hold. If you can
|
|
66
|
+
resolve it by reading the code, do that instead of asking.
|
|
54
67
|
|
|
55
68
|
## 4. Update the spec
|
|
56
69
|
|
|
57
|
-
- Rewrite stale **Decisions** / **Solution overview** and refresh the
|
|
58
|
-
map** in `00-overview.md`, and stale **tasks** in the phase files,
|
|
59
|
-
match the current code and the resolved questions. Add/remove tasks
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
completed `[x]` history**.
|
|
70
|
+
- Rewrite stale **Decisions** / **Solution overview** and refresh the
|
|
71
|
+
**Impact map** in `00-overview.md`, and stale **tasks** in the phase files,
|
|
72
|
+
so they match the current code and the resolved questions. Add/remove tasks
|
|
73
|
+
within a phase file; add a new phase by creating a `0N-<slug>.md` file
|
|
74
|
+
**and** a matching overview index row, or drop a dead phase by removing both.
|
|
75
|
+
Keep the index and files in sync; **preserve completed `[x]` history**.
|
|
63
76
|
- **A phase's status is the `⬜`/`🔄`/`✅` on its H1** — `# Phase 2 — <goal> 🔄`.
|
|
64
77
|
It is mirrored in that file's `> **Status:**` line and in the matching
|
|
65
78
|
`00-overview.md` phase-index row, but the **heading is the authoritative one**:
|
|
@@ -87,5 +100,5 @@ reading the code, do that instead of asking.
|
|
|
87
100
|
## 5. Report
|
|
88
101
|
|
|
89
102
|
Summarise the drift found, what you changed, any questions still open, and
|
|
90
|
-
whether the spec is now safe to `/spec-
|
|
103
|
+
whether the spec is now safe to `/spec-start` (or should drop back to `Draft` until
|
|
91
104
|
the open questions are resolved). Do **not** `git commit` unless the user asks.
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-start
|
|
3
|
+
description: Put a spec in flight — provision its branch, move it to in-progress, refresh the tracker, then build phase 1. Commits the spec itself when that is all that is uncommitted, and refuses to touch anyone else'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.** What the
|
|
16
|
+
gate demands depends on the mode, because the two modes hold work in different
|
|
17
|
+
places — read `mode` from `specs/.core/env.config.json` (default `worktree`).
|
|
18
|
+
|
|
19
|
+
**`worktree` mode — the tree must be clean, and that is all.** The spec is built
|
|
20
|
+
in its own worktree, so another spec being in flight is not a conflict; it is the
|
|
21
|
+
parallelism the mode exists for. The only requirement is that this checkout has
|
|
22
|
+
no uncommitted work — *except* the spec you are starting, which `spec-env up`
|
|
23
|
+
commits for you (see below). Nothing is switched here and nothing is parked.
|
|
24
|
+
|
|
25
|
+
**`checkout` mode — the workbench must be free**: on the base branch (`main`, or
|
|
26
|
+
the configured `baseBranch`) and clean, since the branch is built right here and
|
|
27
|
+
this mode holds one spec at a time. If it isn't, relay what is in flight and
|
|
28
|
+
stop — name the spec holding the checkout and the two ways out, then end your
|
|
29
|
+
turn:
|
|
30
|
+
|
|
31
|
+
- **`/spec-complete`** — it's finished; land it and free the workbench.
|
|
32
|
+
- **`/spec-cancel`** — it isn't wanted; record why and free the workbench.
|
|
33
|
+
|
|
34
|
+
**Never get past the gate yourself.** Do not stash, do not commit
|
|
35
|
+
**another spec's** work, do not switch branches for them. An uncommitted tree
|
|
36
|
+
and a half-built phase are each a decision someone must make deliberately — and
|
|
37
|
+
the cost of guessing is another spec's work moved without its author asking. A
|
|
38
|
+
refusal costs one command; the alternative can cost an afternoon.
|
|
39
|
+
|
|
40
|
+
**The one exception is the spec you are starting.** `spec-env up` classifies the
|
|
41
|
+
uncommitted tree against the target spec and answers one of three ways — relay
|
|
42
|
+
what it says rather than deciding for yourself:
|
|
43
|
+
|
|
44
|
+
| What it found | What it does |
|
|
45
|
+
|---------------|--------------|
|
|
46
|
+
| clean | provisions, as always |
|
|
47
|
+
| every path belongs to this spec | plans `git add` + `git commit` **first**, then the fork |
|
|
48
|
+
| any path does not | refuses, naming the paths that disqualified it |
|
|
49
|
+
|
|
50
|
+
That is membership in an exactly-known set — the spec's own folder plus the
|
|
51
|
+
project's `spec.companionPaths` — and **not** a judgement about whether the
|
|
52
|
+
changes look important. The gate still never decides that. When it plans the
|
|
53
|
+
commit, the paths are printed above the commands, so run them as printed; when it
|
|
54
|
+
refuses, relay the reason and stop.
|
|
55
|
+
|
|
56
|
+
It also refuses a **clean** tree whose spec is not in the commit the worktree
|
|
57
|
+
would fork from — otherwise you get a branch missing the very spec it is for.
|
|
58
|
+
|
|
59
|
+
## 2. Identify the spec
|
|
60
|
+
|
|
61
|
+
- Use the name/path argument when given.
|
|
62
|
+
- Otherwise use the spec **in context** (the one just created or discussed).
|
|
63
|
+
Unlike `/spec-next`, that fallback is safe here: this skill starts nothing
|
|
64
|
+
without the gate above passing, and a wrong guess is caught by the operator
|
|
65
|
+
before any code is written.
|
|
66
|
+
- Locate it under `specs/` — `specs/backlog/` first, then the other buckets. A
|
|
67
|
+
spec is a `<name>/` folder whose entry point is `00-overview.md`, with one
|
|
68
|
+
file per phase beside it (`01-<slug>.md`, `02-…`). Legacy specs may be a bare
|
|
69
|
+
`<name>.md`, or a `00-overview.md` with inline phases — handle those too.
|
|
70
|
+
- A spec already in `specs/in-progress/` was started before. Its worktree
|
|
71
|
+
probably still exists, so this is a re-attach: say so rather than reporting a
|
|
72
|
+
fresh start, and skip the housekeeping that is already done.
|
|
73
|
+
|
|
74
|
+
## 3. Build its branch
|
|
75
|
+
|
|
76
|
+
### `worktree` mode
|
|
77
|
+
|
|
78
|
+
1. **Provision.** Run `skitterspec spec-env up <name>` — a planner, so run the
|
|
79
|
+
`to provision, run:` commands it prints and confirm they succeeded, **except**
|
|
80
|
+
the `open.command` line, which belongs to the hand-off in 3 below.
|
|
81
|
+
|
|
82
|
+
2. **Enter the worktree — this session, no new window.** The spec is built in its
|
|
83
|
+
worktree; that is what the mode is for, and it is why `main` stays free and
|
|
84
|
+
several specs run at once. So put *this* session there rather than opening
|
|
85
|
+
another one: call **`EnterWorktree`** with the worktree path.
|
|
86
|
+
|
|
87
|
+
**Do it immediately after `git worktree add`, before bootstrap and before the step 4 housekeeping.**
|
|
88
|
+
Once the session is the worktree, `setup` runs in place and the housekeeping
|
|
89
|
+
is plain `git` — the `cd` and the `git -C <worktreePath>` prefix both
|
|
90
|
+
disappear. **Never `cd` into the worktree first:** `EnterWorktree` refuses a
|
|
91
|
+
path that is already the working directory
|
|
92
|
+
(`is the current working directory`), so a bootstrap `cd` does not merely
|
|
93
|
+
make the call redundant, it makes it fail.
|
|
94
|
+
|
|
95
|
+
Then run the planner's **`then, in the worktree, run:`** steps in order (file
|
|
96
|
+
seeding, then `setup`) — a fresh worktree has no dependencies and none of the
|
|
97
|
+
repo's gitignored files, so hooks, typechecks and tests fail until they are
|
|
98
|
+
there. Do the step 4 housekeeping, then say to run **`/spec-next`**, here.
|
|
99
|
+
|
|
100
|
+
**Do not move the branch into this checkout**, and do not ask the operator to.
|
|
101
|
+
Entering the worktree is the opposite of moving the branch out of it — the
|
|
102
|
+
branch never leaves. `/spec-live` is for testing a finished-enough spec on the
|
|
103
|
+
already-running dev server; it is not the way work gets started, and reaching
|
|
104
|
+
for it here is what used to split a start across two invocations.
|
|
105
|
+
|
|
106
|
+
3. **When you cannot enter, hand off as before.** Two cases, and
|
|
107
|
+
**decide from cwd before calling**, not by calling and catching — an error
|
|
108
|
+
surfaced mid-skill reads as a bug, and both conditions are knowable in
|
|
109
|
+
advance:
|
|
110
|
+
|
|
111
|
+
- **This session's cwd is already inside a worktree.** `EnterWorktree` only
|
|
112
|
+
allows a worktree→worktree switch when the target lives under
|
|
113
|
+
`.claude/worktrees/`, and a project's worktree root usually does not
|
|
114
|
+
(`../{repo}-wt` is the shipped shape). Do not "fix" this by relocating the
|
|
115
|
+
root: starting a spec from the base branch is the documented path anyway.
|
|
116
|
+
- **`EnterWorktree` is unavailable** — a harness without it. There is no CLI
|
|
117
|
+
counterpart to fall back on, so the skill degrades rather than fails.
|
|
118
|
+
|
|
119
|
+
On either, do exactly what this skill did before: bootstrap with
|
|
120
|
+
`cd "<worktreePath>"`, housekeep with `git -C <worktreePath>`, run
|
|
121
|
+
`open.command` if one is configured, print the worktree path, and say to run
|
|
122
|
+
**`/spec-next`** from a session in it.
|
|
123
|
+
**Trust the worktree first** on this path: `spec-env up` wrote the printed
|
|
124
|
+
`trusted:` root into `.claude/settings.local.json`, but that file will not
|
|
125
|
+
hot-reload in this session — run `/add-dir <trusted root>` before editing into
|
|
126
|
+
the worktree, or the first write prompts. (Entering the worktree makes both
|
|
127
|
+
moot: the writes are then in-cwd.)
|
|
128
|
+
|
|
129
|
+
`EnterWorktree` is gated on being told to work in a worktree by the user or by
|
|
130
|
+
project instructions. A lifecycle skill directing it **is** project
|
|
131
|
+
instruction, so the call is in contract here.
|
|
132
|
+
|
|
133
|
+
**`/spec-next` is unchanged by this.** Its rule 2 — "the worktree you are
|
|
134
|
+
standing in" — is what answers once the session has actually moved; nothing about
|
|
135
|
+
its resolution is loosened, and it must not be. The refusal exists so the wrong
|
|
136
|
+
branch is never built.
|
|
137
|
+
|
|
138
|
+
### `checkout` mode
|
|
139
|
+
|
|
140
|
+
Run `skitterspec spec-env up <name>` and the single `git switch` it prints.
|
|
141
|
+
There is no worktree, no bootstrap and no hand-off — the checkout is already the
|
|
142
|
+
workbench. Its planner enforces the same gate from the engine side, so relay any
|
|
143
|
+
refusal and stop.
|
|
144
|
+
|
|
145
|
+
## 4. Move the spec into development
|
|
146
|
+
|
|
147
|
+
**Do this before you report anything**, so no path can end with a provisioned
|
|
148
|
+
worktree and a spec still reading `Ready` in `specs/backlog/`. Having entered the
|
|
149
|
+
worktree (step 3.2) this is plain `git` — you are standing in it. On the hand-off
|
|
150
|
+
path (step 3.3) run it against the worktree with `git -C <worktreePath>` instead;
|
|
151
|
+
in `checkout` mode the branch is already here.
|
|
152
|
+
|
|
153
|
+
- `git mv "specs/backlog/<name>" "specs/in-progress/<name>"` if it isn't there
|
|
154
|
+
already (`mkdir -p specs/in-progress` first). Use `git mv` to keep history.
|
|
155
|
+
- Set the **Status** header: `> **Status:** In Progress — Phase 1 (started <YYYY-MM-DD>)`.
|
|
156
|
+
- Set **Developer** if it is still `—` (`git config user.name`).
|
|
157
|
+
- Append a **State log** row: `| <YYYY-MM-DD> | In Progress | in-progress | <git user.name> |`.
|
|
158
|
+
- **Commit it, and push the branch.** One commit, the spec's own — it records the
|
|
159
|
+
in-progress state for everyone and fires the tracker's automation. Do this
|
|
160
|
+
*before* the tracker refresh below, so the snapshot that refresh writes is
|
|
161
|
+
swept up by the phase's own commit rather than left dirty.
|
|
162
|
+
|
|
163
|
+
A spec ideally arrives `Ready` from `/spec`; a `Draft` works too — sanity-check
|
|
164
|
+
it is well-formed first.
|
|
165
|
+
|
|
166
|
+
## 4b. Note a missing gating decision (only if configured)
|
|
167
|
+
|
|
168
|
+
**Only when `specs/.core/gating.config.json` exists.** Run
|
|
169
|
+
`skitterspec gating check <name>` and, if it names this spec, mention it **once**
|
|
170
|
+
before phase 1 starts — the cheapest moment to decide is before any code exists.
|
|
171
|
+
|
|
172
|
+
**This check is advisory.** It reports; it never refuses, and nothing below is
|
|
173
|
+
conditional on it. A spec written before the project adopted gating has no header
|
|
174
|
+
and is not broken — turning this into a gate would accuse the very specs the
|
|
175
|
+
feature was designed not to disturb.
|
|
176
|
+
|
|
177
|
+
## 5. Bring the spec's dev servers up — confirm before heavy steps
|
|
178
|
+
|
|
179
|
+
**Only when the project configures host dev servers** (`env.config.json` → a
|
|
180
|
+
non-empty `dev` array). Show what will start — the commands, the ports, any
|
|
181
|
+
Docker stack — and get a yes; on **`--plan`**, print it and stop. On
|
|
182
|
+
confirmation run `skitterspec spec-env dev up <name>`. With none configured this
|
|
183
|
+
is a clean no-op.
|
|
184
|
+
|
|
185
|
+
To reach the spec at your normal `localhost` URL afterwards, the **user** types
|
|
186
|
+
**`/spec-connect <name>`** (`/spec-connect main` hands the ports back). Never
|
|
187
|
+
invoke it yourself.
|
|
188
|
+
|
|
189
|
+
## 6. Build phase 1
|
|
190
|
+
|
|
191
|
+
**`checkout` mode — carry straight on into `/spec-next`** in this session: it
|
|
192
|
+
marks phase 1 started, refreshes the mirror again, builds it with tests and
|
|
193
|
+
reports. Do not stop and ask the operator to run it: the branch is here and they
|
|
194
|
+
asked to start the spec.
|
|
195
|
+
|
|
196
|
+
**`worktree` mode — the spec is built in its worktree**, and step 3.2 put this
|
|
197
|
+
session there, so end by saying the worktree path is now the session's and to run
|
|
198
|
+
**`/spec-next`** here. On the hand-off path (step 3.3) the session did not move:
|
|
199
|
+
say so plainly, print the path, and tell them to run `/spec-next` from a session
|
|
200
|
+
in it.
|
|
201
|
+
|
|
202
|
+
`/spec-next` resolves the spec it is *standing in* — the live spec of the
|
|
203
|
+
checkout, the worktree its cwd is inside, or the branch in `checkout` mode — and
|
|
204
|
+
a name argument narrows a re-run rather than selecting a spec elsewhere. That
|
|
205
|
+
refusal is deliberate: building the wrong spec's phase writes commits on a branch
|
|
206
|
+
nobody asked for. **Do not work around it**, and do not offer to build the phase
|
|
207
|
+
from here.
|
|
208
|
+
|
|
209
|
+
## Opt-outs
|
|
210
|
+
|
|
211
|
+
- **`--plan`** — print the provisioning and dev-server plan, change nothing.
|
|
212
|
+
- **`--no-worktree`** — skip provisioning and build on the current branch. Warn
|
|
213
|
+
that the work lands wherever you are (usually the base branch); reserve it for
|
|
214
|
+
a trivial change or an explicit request.
|
|
215
|
+
|
|
216
|
+
There is no `--here`: `/spec-start` **is** here. It puts the branch in the
|
|
217
|
+
checkout you are in, which is what the old opt-out was reaching for.
|
|
218
|
+
|
|
219
|
+
## Why there is no tracker seam here
|
|
220
|
+
|
|
221
|
+
This skill creates no spec and mints no issue, so it has nothing to link — the
|
|
222
|
+
intake and picker steps belong to `/spec`, `/spec-bug` and `/spec-hotfix`. The
|
|
223
|
+
state change it *does* make (the spec moving to `in-progress`) is mirrored by
|
|
224
|
+
the refresh `/spec-next` runs the moment it starts, which pushes the issue state
|
|
225
|
+
and the phase states together. Adding a push here would send the same thing
|
|
226
|
+
twice, one commit apart.
|
|
@@ -8,27 +8,29 @@ disable-model-invocation: true
|
|
|
8
8
|
|
|
9
9
|
The **intermediate** landing. `/spec-complete` also lands the branch, but then
|
|
10
10
|
verifies every phase, flips the status to Complete, `git mv`s the spec to
|
|
11
|
-
`complete/`, and tears the environment down.
|
|
12
|
-
land**: the worktree stays, the spec stays
|
|
13
|
-
as you add commits.
|
|
11
|
+
`complete/`, and tears the environment down.
|
|
12
|
+
**`/spec-to-main` stops after the land**: the worktree stays, the spec stays
|
|
13
|
+
`In Progress`, and you can land again as you add commits.
|
|
14
14
|
|
|
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-
|
|
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
|
|
22
|
-
fast-forward leaves `base == branch`, the operation is
|
|
23
|
-
repeatable**: new commits put the branch ahead of base again,
|
|
24
|
-
`/spec-to-main` as many times as you like.
|
|
22
|
+
fast-forward leaves `base == branch`, the operation is
|
|
23
|
+
**idempotent and repeatable**: new commits put the branch ahead of base again,
|
|
24
|
+
and you can run `/spec-to-main` as many times as you like.
|
|
25
25
|
|
|
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
|
-
|
|
30
|
-
|
|
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
|
|
@@ -56,10 +58,10 @@ primary checkout is dirty, or if a *different* spec holds it (release that one w
|
|
|
56
58
|
|
|
57
59
|
## 3. Tests must be green before landing
|
|
58
60
|
|
|
59
|
-
Don't push red to `main`. Run the project's typecheck and test commands
|
|
60
|
-
worktree**; the suite must be **green**. For a **Bug** spec, confirm
|
|
61
|
-
originally-failing test now passes. If anything is red, stop and report —
|
|
62
|
-
broken code onto `main` defeats the purpose.
|
|
61
|
+
Don't push red to `main`. Run the project's typecheck and test commands
|
|
62
|
+
**in the worktree**; the suite must be **green**. For a **Bug** spec, confirm
|
|
63
|
+
the originally-failing test now passes. If anything is red, stop and report —
|
|
64
|
+
landing broken code onto `main` defeats the purpose.
|
|
63
65
|
|
|
64
66
|
(Note this is the *worktree* suite. The whole point of this skill is often to run
|
|
65
67
|
a *further* check that only exists on `main` / in CI — that one runs **after** the
|
|
@@ -67,8 +69,8 @@ land, in step 5.)
|
|
|
67
69
|
|
|
68
70
|
## 4. Land — rebase + fast-forward
|
|
69
71
|
|
|
70
|
-
Run `skitterspec spec-env integrate <name>` and run the printed commands
|
|
71
|
-
order**:
|
|
72
|
+
Run `skitterspec spec-env integrate <name>` and run the printed commands
|
|
73
|
+
**in order**:
|
|
72
74
|
|
|
73
75
|
- `git -C <worktree> rebase <base>` — replay the branch onto base.
|
|
74
76
|
- `git -C <mainRepoPath> merge --ff-only <branch>` — fast-forward base.
|
|
@@ -89,12 +91,12 @@ and continue — the branch has no commits base doesn't already have.
|
|
|
89
91
|
`- <YYYY-MM-DD> — Landed intermediate work onto <base> to <run CI / deploy to
|
|
90
92
|
test env / …>; spec stays In Progress.`
|
|
91
93
|
- Do **NOT**: add a State-log row (status doesn't change), flip any phase/status
|
|
92
|
-
to Complete, `git mv` the spec, or tear down the worktree/stack.
|
|
93
|
-
stays `In Progress` and the worktree stays put.**
|
|
94
|
+
to Complete, `git mv` the spec, or tear down the worktree/stack.
|
|
95
|
+
**The spec stays `In Progress` and the worktree stays put.**
|
|
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-
|
|
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": "
|
|
3
|
+
"version": "18.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",
|