@skitterbyte/skitterspec 8.1.0 → 8.3.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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spec-bug
3
- description: Investigate a bug, capture it as a Bug-type spec, and drive it red→green. ALWAYS starts by reproducing the bug with a failing test, then writes the spec and works the test to green. Creates specs/in-progress/bug-<name>/00-overview.md. Use when the user reports a bug, says "/spec-bug", "investigate this bug", "this is broken — find and fix it", or pastes an error/stack trace.
3
+ description: Investigate a bug, capture it as a Bug-type spec, and drive it red→green. When per-spec isolation is enabled it provisions a worktree first, so the failing test and fix land on the bug's own branch, never on main. ALWAYS starts by reproducing the bug with a failing test, then writes the spec and works the test to green. Creates specs/in-progress/bug-<name>/00-overview.md. Use when the user reports a bug, says "/spec-bug", "investigate this bug", "this is broken — find and fix it", or pastes an error/stack trace.
4
4
  ---
5
5
 
6
6
  # /spec-bug — investigate a bug, prove it with a failing test, fix it
@@ -24,7 +24,49 @@ Bugs are concrete — confirm, don't over-grill. Establish:
24
24
  against the broken one (the bug usually lives in the differential). Do NOT
25
25
  patch a symptom before you understand the cause.
26
26
 
27
- ## 2. Write the failing test FIRST (RED)mandatory
27
+ ## 2. Isolate the fix in a worktreewhen isolation is enabled
28
+
29
+ **Only when per-spec isolation is enabled** (`specs/.core/env.config.json`
30
+ exists). Skip this whole section otherwise — the fix happens in place, on the
31
+ current branch.
32
+
33
+ **Opt-out:** if the user passes `--no-worktree` (or explicitly asks to work in
34
+ place), skip this whole section and fix on the current branch — same as when
35
+ isolation is off. Warn that the fix will land wherever you currently are (usually
36
+ `main`); reserve it for a trivial one-liner or an explicit request.
37
+
38
+ A bug fix changes real source, so — exactly like `/spec-go` — it belongs on the
39
+ bug's **own branch**, never directly on `main`. Provision the worktree **now**,
40
+ before the failing test, so the test, the fix, and the spec all land together and
41
+ arrive as one reviewable PR.
42
+
43
+ The engine resolves a spec by its folder, so seed a **minimal stub** for it to
44
+ provision from — you'll flesh it out in §4:
45
+
46
+ - From the base branch (`main`), create
47
+ `specs/in-progress/bug-<name>/00-overview.md` with just the header block and the
48
+ `## Symptom` you established above.
49
+ - Run `skitterspec spec-env up bug-<name>` (the `spec-env` CLI engine). It prints
50
+ the `git worktree add … -b bug/<name>` command (a branch forked from `main`),
51
+ the worktree path, the opener, and any `in the worktree, run:` bootstrap steps.
52
+ - Run the printed `git worktree add`. **The worktree forks from `main`'s last
53
+ commit, so your uncommitted stub doesn't travel with it** — move it across so
54
+ `main` is left pristine:
55
+ `mv specs/in-progress/bug-<name> <worktreePath>/specs/in-progress/`.
56
+ - **Bootstrap the worktree.** A fresh worktree has no installed dependencies and
57
+ none of the repo's gitignored files (`.env`, local overrides). Run the printed
58
+ `in the worktree, run:` steps (file seeding, then `setup`) in order, before
59
+ anything else.
60
+ - **Trust the worktree for this session.** The engine wrote the printed
61
+ `trusted:` root into `.claude/settings.local.json`, but it won't hot-reload now
62
+ — run `/add-dir <trusted root>` before editing into the worktree, or the first
63
+ edits will prompt.
64
+ - **Do everything below in the worktree**, on the branch — the red test, the fix,
65
+ and the rest of the spec. Act on the worktree with absolute paths /
66
+ `git -C <worktreePath>`, or open a fresh session rooted there (the printed
67
+ opener). `main` changes only when the branch merges (at `/spec-complete`).
68
+
69
+ ## 3. Write the failing test FIRST (RED) — mandatory
28
70
 
29
71
  Encode the **correct** (expected) behaviour as a test, then run it and confirm it
30
72
  **fails for the right reason**:
@@ -36,10 +78,13 @@ Encode the **correct** (expected) behaviour as a test, then run it and confirm i
36
78
  passes before the fix proves nothing — keep refining the assertion until it
37
79
  genuinely captures the bug.
38
80
 
39
- ## 3. Write the Bug spec
81
+ ## 4. Write the Bug spec
40
82
 
41
- Create the spec **folder** `specs/in-progress/bug-<kebab-name>/` with its entry
42
- point `00-overview.md` (every spec is a folder never a bare file). A bug is
83
+ Fill in the spec's entry point `00-overview.md`. **When isolated**, you already
84
+ seeded this stub in §2 and moved it into the worktree flesh it out there.
85
+ **When not isolated**, create the spec **folder**
86
+ `specs/in-progress/bug-<kebab-name>/` with its entry point `00-overview.md` now
87
+ (every spec is a folder — never a bare file). A bug is
43
88
  usually a single-pass fix, so the `## Fix` block can live directly in
44
89
  `00-overview.md`. **If the fix needs phasing** (large/uncertain root cause),
45
90
  split it into phase files (`01-<slug>.md`, `02-…`) with a phase index in
@@ -90,7 +135,7 @@ The **State log** is the folder/status audit trail; later transitions
90
135
  (`/spec-complete`, `/spec-cancel`) append a row. The **Changelog** is for the
91
136
  fix narrative and decisions — keep them separate.
92
137
 
93
- ## 4. Drive to GREEN
138
+ ## 5. Drive to GREEN
94
139
 
95
140
  - Implement the **minimal, root-cause** fix. Match surrounding code; honour all
96
141
  project rules (see `.claude/rules/`).
@@ -103,8 +148,10 @@ test, split the fix into phase files (`01-<slug>.md` …) with a phase index in
103
148
  `00-overview.md`, and leave the spec in `in-progress` for `/spec-go` to continue.
104
149
  Say so explicitly — don't fake green.
105
150
 
106
- ## 5. Report
151
+ ## 6. Report
107
152
 
108
153
  Summarise: root cause, the failing→passing test, the fix, and the full test
109
154
  result. The spec stays in `in-progress`; suggest `/spec-complete` to verify and
110
- archive it. Do **not** `git commit` unless the user asks.
155
+ archive it (**when isolated**, the fix lives on the bug's branch, and
156
+ `/spec-complete` merges it back to `main`). Do **not** `git commit` unless the
157
+ user asks.
@@ -26,6 +26,12 @@ Diverting your browser to the spec is a separate explicit step — `/spec-connec
26
26
  the spec doesn't already have a worktree, provision it **first**, so all the
27
27
  housekeeping below lands on the spec's branch and never on `main`:
28
28
 
29
+ **Opt-out:** if the user passes `--no-worktree` (or explicitly asks to work in
30
+ place), skip the provisioning bullets below and build on the current branch — the
31
+ same "in place otherwise" path used when isolation is off. Warn that the work
32
+ will land wherever you currently are (usually `main`); reserve it for a trivial
33
+ change or an explicit request.
34
+
29
35
  - Run `skitterspec spec-env up <name>` (the `spec-env` CLI engine). It adds a git
30
36
  worktree on a branch forked from `main`, and — only when the spec's
31
37
  `> **Stack:**` header is `worktree + docker` — also brings up its Docker stack.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skitterbyte/skitterspec",
3
- "version": "8.1.0",
3
+ "version": "8.3.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",