@skitterbyte/skitterspec 2.0.1 → 7.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Reuben Greaves
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,10 +1,18 @@
1
1
  # @skitterbyte/skitterspec
2
2
 
3
3
  Spec-driven development for [Claude Code](https://claude.com/claude-code) — a
4
- **tracker-free** filesystem workflow. Ships the spec-lifecycle skills (`/spec`,
5
- `/spec-ready`, `/spec-go`, `/spec-complete`, `/spec-cancel`, `/spec-bug`,
6
- `/spec-init`) and per-spec **isolation** (a git worktree per in-progress spec,
7
- Docker on demand).
4
+ **tracker-free** filesystem workflow. The everyday loop is five verbs:
5
+
6
+ ```
7
+ /spec → /spec-go → /spec-connect → /commit → /spec-complete
8
+ plan build it test it live save it finish + land
9
+ ```
10
+
11
+ Ships the spec-lifecycle skills (`/spec`, `/spec-go`, `/spec-complete`,
12
+ `/spec-cancel`, `/spec-bug`, `/spec-review`, `/spec-init`) plus per-spec
13
+ **isolation** — a git worktree per in-progress spec, Docker on demand, host dev
14
+ servers on reserved ports, and `/spec-connect` to test a worktree at your normal
15
+ `localhost` URL.
8
16
 
9
17
  ```sh
10
18
  npx @skitterbyte/skitterspec init
@@ -25,6 +33,25 @@ Ticketing sync is a **separate superset you install instead of this one**:
25
33
 
26
34
  Install exactly one — the superset is a strict superset of this package.
27
35
 
36
+ ## Testing UI/API worktrees — `/spec-connect`
37
+
38
+ When your app runs from `main` on `localhost`, a worktree's changes are
39
+ unreachable. Add a `dev` block to `specs/.core/env.config.json` listing your host
40
+ dev servers (each `{ name, command, portVar, health?, frontPort? }`); `/spec-go`
41
+ starts them on the spec's reserved ports, and **`/spec-connect <name>`** points
42
+ your canonical `localhost` ports at that spec (via a small bundled reverse proxy —
43
+ no external install), so you test at the exact URL you always use.
44
+ `/spec-connect main` hands the ports back. Exclusive: one spec at a time. See
45
+ `specs/.core/env.config.md` for the `dev`/`proxy` config.
46
+
47
+ ## v3 — slimmer surface + `/spec-connect`
48
+
49
+ **3.0** folds provisioning into `/spec-go`, teardown into
50
+ `/spec-complete`·`/spec-cancel`, and grooming into `/spec` — removing the
51
+ `/spec-env`, `/spec-env-down`, and `/spec-ready` skills (the `skitterspec
52
+ spec-env` CLI engine stays). It adds `/spec-connect` and the `dev`/`proxy` config
53
+ blocks. See [MIGRATION.md](../../MIGRATION.md).
54
+
28
55
  ## v2 — Linear removed from the base
29
56
 
30
57
  `@skitterbyte/skitterspec` **2.0** is tracker-free: the Linear sync skills, the
@@ -1,17 +1,18 @@
1
1
  ## Spec workflow
2
2
 
3
- Spec-driven development runs through eight skills use them so structure and
4
- lifecycle stay consistent (see `.claude/rules/spec-planning.md`):
3
+ Spec-driven development runs through seven lifecycle skills (plus `/spec-connect`
4
+ when isolation is on) — use them so structure and lifecycle stay consistent (see
5
+ `.claude/rules/spec-planning.md`). The everyday loop is
6
+ **`spec → go → connect → commit → complete`**:
5
7
 
6
8
  | Skill | Action | Status | Folder |
7
9
  |-------|--------|--------|--------|
8
- | `/spec` | (Feature) Grill to a clear shared understanding, then write a concise spec | `Draft` | `specs/backlog/` |
10
+ | `/spec` | (Feature) Grill to a shared understanding, then write a groomed spec | `Ready` (or `Draft`) | `specs/backlog/` |
9
11
  | `/spec-bug` | (Bug) Reproduce with a failing test, capture spec, drive red→green | `In Progress` | `specs/in-progress/` |
10
- | `/spec-ready` | Confirm the spec is groomed (no open questions, phases + tests defined) | `Ready` | `specs/backlog/` |
11
12
  | `/spec-review` | Re-validate a spec against the codebase; refresh stale parts | `—` | (unchanged) |
12
- | `/spec-go` | Implement the next phase (with tests) | `In Progress` | `specs/in-progress/` |
13
- | `/spec-complete` | Verify all phases done + tests green | `Complete` | `specs/complete/` |
14
- | `/spec-cancel` | Record progress, stamp a reason on the header | `Cancelled` | `specs/cancelled/` |
13
+ | `/spec-go` | Provision the env, bring dev servers up, implement the next phase | `In Progress` | `specs/in-progress/` |
14
+ | `/spec-complete` | Verify all phases done + tests green; land + tear down | `Complete` | `specs/complete/` |
15
+ | `/spec-cancel` | Record progress, stamp a reason; tear down | `Cancelled` | `specs/cancelled/` |
15
16
  | `/spec-init` | Bootstrap/repair this workflow in a project (idempotent) | — | — |
16
17
 
17
18
  Every spec has a **type** (`> **Type:** Feature\|Bug`) and a filename prefix
@@ -30,10 +31,13 @@ State log.
30
31
  **Per-spec isolation (adopt once, then default):** with isolation adopted
31
32
  (`skitterspec init --isolation`, or `specs/.core/env.config.json` present),
32
33
  **`/spec-go`** gives every in-progress spec its own git worktree automatically —
33
- parallel specs, no stashing, `main` left free. Docker is a **per-spec
34
- escalation**: `/spec` sets `> **Stack:** worktree` (default) or `worktree +
35
- docker` when the spec touches the DB / stateful services, and only the latter
36
- gets a namespaced stack (isolated volumes + reserved port block). **`/spec-env`**
37
- · **`/spec-env-down`** are the manual engine (escalate Docker later, re-attach,
38
- tear down guarding dirty/unpushed work, backing up volumes first). Independent
39
- of lifecycle status; inactive when `env.config.json` is absent.
34
+ parallel specs, no stashing, `main` left free and brings up the project's host
35
+ **dev servers** (`env.config` `dev`) on the spec's ports. **`/spec-connect
36
+ <name>`** then exposes that spec on your canonical `localhost` ports so you can
37
+ test it at the normal URL (`/spec-connect main` hands them back). Docker is a
38
+ **per-spec escalation**: `/spec` sets `> **Stack:** worktree` (default) or
39
+ `worktree + docker` when the spec touches the DB / stateful services, and only
40
+ the latter gets a namespaced stack. Teardown is folded into **`/spec-complete`** ·
41
+ **`/spec-cancel`**; beneath the skills, `skitterspec spec-env
42
+ <up|down|dev|connect|integrate>` is the CLI engine. Independent of lifecycle
43
+ status; inactive when `env.config.json` is absent.
@@ -12,6 +12,12 @@
12
12
  "envFile": ".env",
13
13
  "backupCommand": ""
14
14
  },
15
+ "setup": [],
16
+ "dev": [],
17
+ "proxy": {
18
+ "enabled": true,
19
+ "host": "127.0.0.1"
20
+ },
15
21
  "open": {
16
22
  "command": ""
17
23
  },
@@ -1,8 +1,11 @@
1
1
  # `env.config.json` — per-spec isolation config
2
2
 
3
3
  Opt-in config for per-spec isolation (git worktree + optional namespaced Docker
4
- stack + an optional opener per in-progress spec), driven by `/spec-go` and the
5
- `/spec-env` · `/spec-env-down` skills.
4
+ stack + host dev servers + a front-door proxy + an optional opener per
5
+ in-progress spec). Provisioning is folded into `/spec-go`, teardown into
6
+ `/spec-complete` · `/spec-cancel`, and traffic diversion is `/spec-connect`; the
7
+ `skitterspec spec-env <up|down|dev|connect|integrate>` CLI is the engine beneath
8
+ them.
6
9
 
7
10
  **Once this file is present, isolation is the default policy:** `/spec-go` gives
8
11
  **every** in-progress spec its own git worktree automatically. Docker is a **per-
@@ -49,6 +52,40 @@ no live `env.config.json` was found.
49
52
  // empty = no backup, volumes dropped directly.
50
53
  },
51
54
 
55
+ // Bootstrap commands `spec-env up <spec>` runs IN the worktree, right after
56
+ // `git worktree add` (before Docker/dev), on every provision including
57
+ // re-attach — so a fresh worktree's dependencies exist and git hooks,
58
+ // typechecks, builds and tests work immediately instead of failing on a
59
+ // missing node_modules. An array, run in order; [] = none. Each string is a
60
+ // shell command; {slug}/{branch}/{worktreePath}/{projectName}/{portOffset}
61
+ // expand (the cwd is already the worktree, so {worktreePath} is usually
62
+ // redundant). Example: ["pnpm install --frozen-lockfile"].
63
+ "setup": [],
64
+
65
+ // Host dev servers `spec-env dev up <spec>` starts on the spec's port block
66
+ // (for apps that run via `pnpm dev` on the host, not inside the Docker stack).
67
+ // An array so UI + API (or more) are supervised independently; [] = none.
68
+ // Each entry:
69
+ // name label used in logs/pid files (.spec-env/{logs,pids}/<spec>-<name>).
70
+ // command the launch command, run detached in the worktree. {portVar} and
71
+ // {port} expand to the process's resolved port.
72
+ // portVar env var the command reads for its port; injected into its env.
73
+ // Process i in the block gets portBase + slot*portsPerSpec + i.
74
+ // health optional URL polled until it answers before reporting ready;
75
+ // {portVar}/{port} expand here too. Omit for no health gate.
76
+ // frontPort optional canonical origin this process fronts (e.g. 3000 for the
77
+ // UI, 8080 for the API) — used by the proxy to route to it.
78
+ "dev": [],
79
+
80
+ // Front-door proxy for `spec-env connect <spec>` — a small bundled Node
81
+ // reverse proxy (no external install) that exposes ONE connected spec's
82
+ // frontPort dev servers on the canonical ports. Exclusive: one target at a
83
+ // time. `connect main` stops it so the primary checkout owns the ports again.
84
+ "proxy": {
85
+ "enabled": true, // false = the connect command is unavailable
86
+ "host": "127.0.0.1" // bind host for the canonical ports
87
+ },
88
+
52
89
  // Optional, editor/terminal-agnostic opener run after `spec-env up`. The
53
90
  // template is expanded with {worktreePath}, {slug}, {branch}, {projectName},
54
91
  // {portOffset}. Empty = nothing is opened (the path is just printed).
@@ -1,22 +1,23 @@
1
1
  # Spec Planning
2
2
 
3
- Spec-driven development is driven by eight skills use them rather than
4
- hand-rolling specs so the structure and lifecycle stay consistent. Each sets a
5
- status on the spec header (`> **Status:** …`):
3
+ Spec-driven development is driven by seven lifecycle skills (plus `/spec-connect`
4
+ when isolation is on) — use them rather than hand-rolling specs so the structure
5
+ and lifecycle stay consistent. Each sets a status on the spec header
6
+ (`> **Status:** …`):
6
7
 
7
8
  | Skill | Purpose | Status | Folder |
8
9
  |-------|---------|--------|--------|
9
- | `/spec` | (Feature) Grill to a clear shared understanding, then write a new spec | `Draft` | `specs/backlog/` |
10
+ | `/spec` | (Feature) Grill to a clear shared understanding, then write a groomed spec | `Ready` (or `Draft`) | `specs/backlog/` |
10
11
  | `/spec-bug` | (Bug) Reproduce with a failing test, capture spec, drive red→green | `In Progress` | `specs/in-progress/` |
11
- | `/spec-ready` | Confirm it's groomed (no open questions, phases + tests defined) | `Ready` | `specs/backlog/` |
12
12
  | `/spec-review` | Re-validate a spec against the codebase; refresh stale parts | `—` | (unchanged) |
13
- | `/spec-go` | Implement the next phase (with tests) | `In Progress` | `specs/in-progress/` |
14
- | `/spec-complete` | Verify all phases done + tests green | `Complete` | `specs/complete/` |
15
- | `/spec-cancel` | Record progress, stamp a reason on the header | `Cancelled` | `specs/cancelled/` |
13
+ | `/spec-go` | Provision the env, bring dev servers up, implement the next phase | `In Progress` | `specs/in-progress/` |
14
+ | `/spec-complete` | Verify all phases done + tests green; land + tear down | `Complete` | `specs/complete/` |
15
+ | `/spec-cancel` | Record progress, stamp a reason on the header; tear down | `Cancelled` | `specs/cancelled/` |
16
16
  | `/spec-init` | Bootstrap/repair this workflow in a project (idempotent) | — | — |
17
17
 
18
- Status flow: `Draft → Ready → In Progress → Complete` (or `Cancelled` from any
19
- state). `/spec-ready` is a grooming gate onlyit does not move the folder.
18
+ Status flow: `Ready → In Progress → Complete` (or `Cancelled` from any state).
19
+ `/spec` grills to a **Ready** spec directlythere is no separate grooming
20
+ command; it writes `Draft` only when open questions are deliberately left.
20
21
  `/spec-bug` is test-first and starts straight in `In Progress` (work begins
21
22
  immediately), so it skips Draft/Ready.
22
23
 
@@ -27,12 +28,16 @@ automatically — several specs run side by side without stashing or clashing, a
27
28
  `main` stays free. Docker is a **per-spec escalation**: `/spec` records
28
29
  `> **Stack:** worktree` (default) or `worktree + docker` when the spec touches the
29
30
  DB / stateful services, and `/spec-go` brings up a namespaced stack only for the
30
- latter. All housekeeping (the backlog→in-progress move, header edits, the code)
31
- happens on the spec's branch in the worktree; `main` changes only when it merges.
32
- `/spec-env` · `/spec-env-down` remain the manual engine (escalate Docker later,
33
- re-attach, tear down). Isolation is **orthogonal to lifecycle status** and
34
- inactive when `env.config.json` is absent every skill then behaves as it does
35
- today.
31
+ latter. `/spec-go` also starts the project's host **dev servers** (`env.config`
32
+ `dev`) on the spec's ports; **`/spec-connect <name>`** then exposes that spec on
33
+ your canonical `localhost` ports so you can test it at the normal URL
34
+ (`/spec-connect main` hands them back). All housekeeping (the backlog→in-progress
35
+ move, header edits, the code) happens on the spec's branch in the worktree; `main`
36
+ changes only when it merges. Teardown is folded into `/spec-complete` ·
37
+ `/spec-cancel`. Beneath the skills, `skitterspec spec-env
38
+ <up|down|dev|connect|integrate>` is the CLI engine. Isolation is **orthogonal to
39
+ lifecycle status** and inactive when `env.config.json` is absent — every skill
40
+ then behaves as it does today.
36
41
 
37
42
  **Ticketing-provider sync (opt-in, a separate package).** The base is
38
43
  tracker-free: it knows nothing about any specific ticketing system. A
@@ -110,7 +115,7 @@ When asked for a plan, implementation strategy, or feature breakdown:
110
115
  ## Lifecycle folders
111
116
 
112
117
  ```
113
- specs/backlog/ Draft + Ready specs (/spec, /spec-ready)
118
+ specs/backlog/ Ready (or Draft) specs (/spec)
114
119
  specs/in-progress/ under active implementation (/spec-go, /spec-bug)
115
120
  specs/complete/ finished (/spec-complete)
116
121
  specs/cancelled/ abandoned, with a reason on the header (/spec-cancel)
@@ -9,9 +9,10 @@ Produce ONE concise spec in `specs/backlog/`. Do not start coding — this skill
9
9
  plans only. Implementation happens later via `/spec-go`.
10
10
 
11
11
  Lifecycle (the governing skills) — status in parentheses:
12
- `/spec` (Draft, backlog) `/spec-ready` (Ready, still backlog) → `/spec-go`
12
+ `/spec` (writes **Ready** when fully groomed, else Draft; backlog) → `/spec-go`
13
13
  (In Progress, in-progress; implement phase 1) → `/spec-complete` (Complete) /
14
- `/spec-cancel` (Cancelled). See `.claude/rules/spec-planning.md`.
14
+ `/spec-cancel` (Cancelled). See `.claude/rules/spec-planning.md`. (There is no
15
+ separate grooming command — `/spec` grills to a Ready spec directly.)
15
16
 
16
17
  ## Phase A — reach a clear shared understanding (grill first)
17
18
 
@@ -72,7 +73,7 @@ the codebase, link rather than duplicate):
72
73
  # <Feature title>
73
74
 
74
75
  > **Type:** Feature
75
- > **Status:** Draft — not started
76
+ > **Status:** Ready — not started
76
77
  > **Author:** <git user.name — `git config user.name`>
77
78
  > **Developer:** —
78
79
  > **Raised:** <YYYY-MM-DD (today)>
@@ -113,7 +114,7 @@ Each phase lives in its own file in this folder. Status: ⬜ not started ·
113
114
 
114
115
  | Date | Status | Folder | By |
115
116
  |------|--------|--------|----|
116
- | <YYYY-MM-DD> | Draft | backlog | <author> |
117
+ | <YYYY-MM-DD> | Ready | backlog | <author> |
117
118
 
118
119
  ## Changelog
119
120
 
@@ -147,9 +148,9 @@ Keep the `00-overview.md` phase index and the phase files in sync: the index row
147
148
  is the one-line summary + status; the phase file is the detail.
148
149
 
149
150
  The **State log** is the audit trail of folder/status transitions — every
150
- lifecycle skill (`/spec-ready`, `/spec-go`, `/spec-complete`, `/spec-cancel`)
151
- appends one row when it moves the spec. The **Changelog** is for decisions and
152
- course-corrections only — keep the two separate.
151
+ lifecycle skill (`/spec-go`, `/spec-complete`, `/spec-cancel`) appends one row
152
+ when it moves the spec. The **Changelog** is for decisions and course-corrections
153
+ only — keep the two separate.
153
154
 
154
155
  Rules for the spec body:
155
156
 
@@ -169,8 +170,10 @@ Rules for the spec body:
169
170
 
170
171
  ## Phase C — finish up
171
172
 
172
- After writing, tell the user the path and that it's a `Draft` in `backlog`. Next
173
- step is `/spec-ready` once it's groomed, then `/spec-go` to start building.
173
+ After writing, tell the user the path and that it's **`Ready`** in `backlog`
174
+ (grilling in Phase A resolved the open questions). If you deliberately left open
175
+ questions unresolved, write `Draft` instead and say what still needs deciding.
176
+ Either way, the next step is `/spec-go` to start building.
174
177
 
175
178
  ## Phase D — record the isolation stack (only if configured)
176
179
 
@@ -180,7 +183,7 @@ decision — `worktree` (default) or `worktree + docker` when it touches the DB
180
183
  stateful services. Nothing to provision now: `/spec-go` gives every in-progress
181
184
  spec its own worktree automatically, and brings up Docker only when the Stack
182
185
  says so. Mention the operator can escalate the Stack later (edit the header, or
183
- run `/spec-env <name>` to add Docker to an existing worktree). If
186
+ run `skitterspec spec-env up <name>` to add Docker to an existing worktree). If
184
187
  `env.config.json` is absent, isolation is off — leave the default `worktree` and
185
188
  finish as above.
186
189
 
@@ -52,10 +52,17 @@ move the whole folder).
52
52
  Confirm the cancellation, the reason recorded, and the new location. Do **not**
53
53
  `git commit` unless the user asks.
54
54
 
55
- ## 7. Offer teardown (opt-in, only if configured)
55
+ ## 7. Tear down the environment (opt-in, only if configured)
56
56
 
57
57
  **Only when `specs/.core/env.config.json` exists**, offer — don't force — to
58
- reclaim the cancelled spec's environment: "Want me to run `/spec-env-down
59
- <name>` to remove its worktree, stack, volumes, and free its slot?" It respects
60
- the teardown guards (won't destroy a dirty/unpushed worktree without `--force`).
58
+ reclaim the cancelled spec's environment. On confirmation, run the `spec-env` CLI
59
+ directly (the old `/spec-env-down` skill is gone teardown is folded in here):
60
+
61
+ 1. If `.spec-env/connected` names this spec, run `skitterspec spec-env connect
62
+ main` first to free the canonical ports.
63
+ 2. `skitterspec spec-env dev down <name>` — stop its host dev servers.
64
+ 3. `skitterspec spec-env down <name>` — then execute the printed commands to
65
+ remove the worktree/stack and free the slot. It respects the teardown guards
66
+ (won't destroy a dirty/unpushed worktree without `--force`).
67
+
61
68
  If `env.config.json` is absent, skip this entirely — behave exactly as before.
@@ -75,13 +75,21 @@ applies, offer to land the finished branch on the base branch so the work reache
75
75
  4. **Report** the landing (base branch, fast-forward result). It **never pushes** —
76
76
  mention the user can `git push` the base branch themselves.
77
77
 
78
- ## 7. Offer teardown (opt-in, only if configured)
78
+ ## 7. Tear down the environment (opt-in, only if configured)
79
79
 
80
80
  **Only when `specs/.core/env.config.json` exists**, offer — don't force — to
81
- reclaim the finished spec's environment: "Want me to run `/spec-env-down <name>`
82
- to remove its worktree, delete its branch, stack, volumes, and free its slot?"
83
- Post-integrate the branch is merged into base, so teardown needs **no `--force`**
84
- and deletes the branch (`git branch -d`) as part of the plan. It still respects
85
- the guards (won't destroy a dirty or unpushed-and-unmerged worktree without
86
- `--force`). If `env.config.json` is absent, skip this entirely — behave exactly as
87
- before.
81
+ reclaim the finished spec's environment. On confirmation, run the `spec-env` CLI
82
+ directly (the old `/spec-env-down` skill is gone teardown is folded in here):
83
+
84
+ 1. **Disconnect the proxy if this spec is connected.** If `.spec-env/connected`
85
+ names this spec, run `skitterspec spec-env connect main` first so the
86
+ canonical ports go back to the primary checkout.
87
+ 2. **Stop its host dev servers:** `skitterspec spec-env dev down <name>` (a
88
+ no-op when none are running / configured).
89
+ 3. **Remove worktree + stack + slot:** run `skitterspec spec-env down <name>`
90
+ and execute the commands it prints, in order. Post-integrate the branch is
91
+ merged into base, so teardown needs **no `--force`** and deletes the branch
92
+ (`git branch -d`) as part of the plan. It still respects the guards (won't
93
+ destroy a dirty or unpushed-and-unmerged worktree without `--force`).
94
+
95
+ If `env.config.json` is absent, skip this entirely — behave exactly as before.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: spec-connect
3
+ description: Point your local canonical origin (localhost:3000/:8080) at a spec's running dev servers so you can test a worktree's UI/API changes at the normal URL — or `spec-connect main` to hand the ports back to your main checkout. Runs `skitterspec spec-env connect` (a small bundled reverse proxy). Opt-in — needs specs/.core/env.config.json with a `dev` block. Use when the user says "/spec-connect", "test <spec> locally", "point local at <spec>", or "connect to <spec>".
4
+ ---
5
+
6
+ # /spec-connect — expose one spec on the canonical ports
7
+
8
+ Make `http://localhost:<frontPort>` serve a **spec's** warm dev servers instead of
9
+ your main checkout's, so you can test a worktree's UI/API at the exact URL you
10
+ always use — no bookmark, base-URL, or OAuth-callback changes. **Exclusive:** one
11
+ spec is exposed at a time. `spec-connect main` stops the proxy and hands the ports
12
+ back to your primary checkout.
13
+
14
+ This skill is **opt-in**: it needs `specs/.core/env.config.json` with a `dev`
15
+ block (host dev servers + their `frontPort`s). If isolation or `dev` is absent,
16
+ say so and stop.
17
+
18
+ ## 1. Identify the target
19
+
20
+ - Use the spec named as an argument. The literal `main` means **disconnect**
21
+ (hand the ports back to the primary checkout). Else use the spec **currently in
22
+ context**; if unclear, ask.
23
+
24
+ ## 2. Make sure the spec's dev servers are running
25
+
26
+ `connect` proxies to a spec's dev servers on its reserved port block — it does
27
+ **not** start them. If they aren't up yet, start them first:
28
+
29
+ ```
30
+ skitterspec spec-env dev up <spec>
31
+ ```
32
+
33
+ (This is automatic under `/spec-go`; run it by hand only when connecting a spec
34
+ whose servers you stopped.)
35
+
36
+ ## 3. Connect (or disconnect)
37
+
38
+ ```
39
+ skitterspec spec-env connect <spec> # expose <spec> on the canonical ports
40
+ skitterspec spec-env connect main # stop the proxy — main owns the ports
41
+ ```
42
+
43
+ The engine (re)starts a small bundled Node reverse proxy and **prints** the
44
+ canonical URL → spec-port mapping. **If it reports a canonical port is in use**,
45
+ your **main dev server still holds it** — stop main on that port, then re-run
46
+ (the proxy can't share a port main is bound to). Relay the printed message.
47
+
48
+ ## 4. Report
49
+
50
+ Echo which spec is now on the canonical ports (and the URLs), or that the proxy
51
+ was stopped and main owns them again. Switching to a different spec is just
52
+ `spec-connect <other>` — the dev servers stay warm, so it's a near-instant
53
+ re-point.
@@ -1,10 +1,14 @@
1
1
  ---
2
2
  name: spec-go
3
- description: Promote a spec into active development and implement its first phase. Moves the spec from backlog into specs/in-progress/, then builds phase 1 with tests. Targets a spec by name (arg) or the spec currently in context. Use when the user says "/spec-go", "start this spec", "begin implementing <spec>", or "let's build the next phase".
3
+ description: Promote a spec into active development and build the next phase provisions its worktree, brings up its host dev servers (confirm first), then implements the phase with tests. Targets a spec by name (arg) or the spec currently in context. Use when the user says "/spec-go", "start this spec", "begin implementing <spec>", or "let's build the next phase".
4
4
  ---
5
5
 
6
6
  # /spec-go — start (or continue) implementing a spec
7
7
 
8
+ The "up" button: it promotes the spec, provisions its worktree, brings its host
9
+ dev servers up on the spec's reserved ports (with your OK), then builds the phase.
10
+ Diverting your browser to the spec is a separate explicit step — `/spec-connect`.
11
+
8
12
  ## 1. Identify the target spec
9
13
 
10
14
  - If a name/path is given as an argument, use it.
@@ -22,10 +26,17 @@ description: Promote a spec into active development and implement its first phas
22
26
  the spec doesn't already have a worktree, provision it **first**, so all the
23
27
  housekeeping below lands on the spec's branch and never on `main`:
24
28
 
25
- - Run `skitterspec spec-env up <name>` (the `/spec-env` engine). It adds a git
29
+ - Run `skitterspec spec-env up <name>` (the `spec-env` CLI engine). It adds a git
26
30
  worktree on a branch forked from `main`, and — only when the spec's
27
31
  `> **Stack:**` header is `worktree + docker` — also brings up its Docker stack.
28
32
  Print the worktree path and the opener command it emits.
33
+ - **Bootstrap the worktree's dependencies.** A fresh worktree has an empty
34
+ working tree — no installed dependencies — so git hooks, typechecks, builds and
35
+ tests fail until they're installed. `spec-env up` prints the project's
36
+ configured **`in the worktree, run:`** commands (from `env.config.json` →
37
+ `setup`, e.g. an install command) — run them in the worktree before doing
38
+ anything else. With no `setup` configured there's nothing to run; set one up if
39
+ agents keep stalling on missing dependencies.
29
40
  - **Trust the worktree for this session.** The engine wrote the printed
30
41
  `trusted:` root into `.claude/settings.local.json` (gitignored) so future
31
42
  sessions trust it automatically — but that file likely won't hot-reload now,
@@ -53,17 +64,35 @@ Then move the spec (in the worktree when isolated, in place otherwise):
53
64
  the in-progress state for everyone and fires the tracker's automation (when a
54
65
  ticketing provider is linked).
55
66
 
56
- A spec ideally reaches here as `Ready` (via `/spec-ready`), but `/spec-go` works
57
- on a `Draft` too — just sanity-check it's well-formed before building.
67
+ A spec ideally reaches here already `Ready` (written by `/spec`), but `/spec-go`
68
+ works on a `Draft` too — just sanity-check it's well-formed before building.
58
69
 
59
70
  If the spec is already in `in-progress`, skip the move and implement the **next
60
71
  unfinished phase** instead of Phase 1. (When isolated, subsequent `/spec-go` runs
61
72
  happen from inside the worktree — where the spec already sits in `in-progress` on
62
73
  the branch — and a re-run of `spec-env up` just re-attaches it.)
63
74
 
64
- ## 3. Pre-flightcommit prior work, then compact
75
+ ## 2b. Bring the spec's dev servers up confirm before heavy steps
76
+
77
+ **Only when isolation is enabled and the project configures host dev servers**
78
+ (`env.config.json` → a non-empty `dev` array). This is what makes the spec
79
+ runnable — its UI/API on the spec's reserved port block, isolated from `main`.
80
+
81
+ - **Show the plan and get a yes first.** List what will start: the per-process
82
+ dev commands, the ports they'll bind (the spec's slot block), and any Docker
83
+ stack. Don't start heavy processes silently. If the user passed **`--plan`**,
84
+ print this plan and **stop** (preview only).
85
+ - On confirmation, run `skitterspec spec-env dev up <name>` — it launches each
86
+ dev process detached on its port, logs to `.spec-env/logs/`, and waits on each
87
+ `health` check. With no `dev` configured it's a clean no-op; skip this step.
88
+ - **Diverting your browser is a separate step.** To test the spec at your normal
89
+ `localhost` URL, run **`/spec-connect <name>`** (exclusive — it exposes this
90
+ spec on the canonical ports; `/spec-connect main` hands them back). `/spec-go`
91
+ never seizes the canonical ports on its own.
92
+
93
+ ## 3. Pre-flight — commit prior work
65
94
 
66
- Before writing any code for this phase, get the workspace and context clean:
95
+ Before writing any code for this phase, get the workspace clean:
67
96
 
68
97
  - **Confirm the last-worked phase is committed.** Run `git status` and
69
98
  `git log --oneline -5`. The most recently *implemented* phase (not necessarily
@@ -72,10 +101,6 @@ Before writing any code for this phase, get the workspace and context clean:
72
101
  `/commit`) so each phase lands as its own reviewable commit — don't build the
73
102
  next phase on top of an uncommitted one. (Skip if this is the first phase —
74
103
  there's nothing prior to commit.)
75
- - **Compact, then continue.** Recommend the user run `/compact` now. A fresh,
76
- minimal context keeps the phase focused and avoids drift from earlier turns;
77
- the spec file on disk is the source of truth, so nothing is lost. Pause for the
78
- `/compact`, then implement the phase.
79
104
 
80
105
  ## 3b. Pull from the tracker first (only if a provider is installed)
81
106
 
@@ -65,5 +65,5 @@ reading the code, do that instead of asking.
65
65
  ## 5. Report
66
66
 
67
67
  Summarise the drift found, what you changed, any questions still open, and
68
- whether the spec is now safe to `/spec-go` (or needs `/spec-ready` again). Do
69
- **not** `git commit` unless the user asks.
68
+ whether the spec is now safe to `/spec-go` (or should drop back to `Draft` until
69
+ the open questions are resolved). Do **not** `git commit` unless the user asks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skitterbyte/skitterspec",
3
- "version": "2.0.1",
3
+ "version": "7.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",
@@ -27,11 +27,9 @@
27
27
  "dependencies": {
28
28
  "prompts": "^2.4.2"
29
29
  },
30
- "scripts": {
31
- "prepack": "node ../../scripts/build-dist.js skitterspec"
32
- },
33
30
  "repository": {
34
31
  "type": "git",
35
32
  "url": "git+https://github.com/skitterbyte/skitterspec.git"
36
- }
37
- }
33
+ },
34
+ "scripts": {}
35
+ }