@skitterbyte/skitterspec 0.1.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 +21 -0
- package/README.md +164 -0
- package/assets/claude-md-section.md +34 -0
- package/assets/rules/commit-messages.md +85 -0
- package/assets/rules/spec-planning.md +130 -0
- package/assets/scripts/generate-changelog.js +274 -0
- package/assets/scripts/generate-releases.js +360 -0
- package/assets/scripts/lib/config.js +127 -0
- package/assets/scripts/lib/git-commits.js +265 -0
- package/assets/skills/commit/SKILL.md +28 -0
- package/assets/skills/spec/SKILL.md +176 -0
- package/assets/skills/spec-bug/SKILL.md +114 -0
- package/assets/skills/spec-cancel/SKILL.md +56 -0
- package/assets/skills/spec-complete/SKILL.md +60 -0
- package/assets/skills/spec-go/SKILL.md +87 -0
- package/assets/skills/spec-init/SKILL.md +92 -0
- package/assets/skills/spec-ready/SKILL.md +52 -0
- package/assets/skills/spec-review/SKILL.md +69 -0
- package/bin/skitterspec.js +9 -0
- package/package.json +42 -0
- package/src/cli.js +132 -0
- package/src/config.js +13 -0
- package/src/init.js +348 -0
- package/src/prompts.js +82 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-bug — investigate a bug, prove it with a failing test, fix it
|
|
7
|
+
|
|
8
|
+
This is the **bug** counterpart to `/spec` (which is for **features**, plan-only).
|
|
9
|
+
Unlike `/spec`, this skill is hands-on and test-first: it reproduces the bug as a
|
|
10
|
+
**failing test (RED)**, captures a lean Bug spec, then works the test to **GREEN**.
|
|
11
|
+
|
|
12
|
+
Spec type convention (see `.claude/rules/spec-planning.md`):
|
|
13
|
+
- Bug specs are named `bug-<kebab-name>`; feature specs `feat-<kebab-name>`.
|
|
14
|
+
- Every spec header carries `> **Type:** Bug` (or `Feature`).
|
|
15
|
+
|
|
16
|
+
## 1. Reproduce & isolate (light investigation)
|
|
17
|
+
|
|
18
|
+
Bugs are concrete — confirm, don't over-grill. Establish:
|
|
19
|
+
|
|
20
|
+
- **Repro:** exact steps / input that triggers it. Ask only if you can't derive it.
|
|
21
|
+
- **Expected vs actual:** what *should* happen vs what does.
|
|
22
|
+
- **Scope & blast radius:** which module(s)/endpoint(s)/package; one tenant or all.
|
|
23
|
+
- **Root cause:** read the code, trace it to `file:line`. Compare a working path
|
|
24
|
+
against the broken one (the bug usually lives in the differential). Do NOT
|
|
25
|
+
patch a symptom before you understand the cause.
|
|
26
|
+
|
|
27
|
+
## 2. Write the failing test FIRST (RED) — mandatory
|
|
28
|
+
|
|
29
|
+
Encode the **correct** (expected) behaviour as a test, then run it and confirm it
|
|
30
|
+
**fails for the right reason**:
|
|
31
|
+
|
|
32
|
+
- Put it where the suite already covers that area. Reuse existing test helpers /
|
|
33
|
+
factories; follow the project's test rules (see `.claude/rules/`). Never
|
|
34
|
+
hardcode dates — compute them relative to now.
|
|
35
|
+
- Run it with the project's test command. Quote the red output. A test that
|
|
36
|
+
passes before the fix proves nothing — keep refining the assertion until it
|
|
37
|
+
genuinely captures the bug.
|
|
38
|
+
|
|
39
|
+
## 3. Write the Bug spec
|
|
40
|
+
|
|
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
|
|
43
|
+
usually a single-pass fix, so the `## Fix` block can live directly in
|
|
44
|
+
`00-overview.md`. **If the fix needs phasing** (large/uncertain root cause),
|
|
45
|
+
split it into phase files (`01-<slug>.md`, `02-…`) with a phase index in
|
|
46
|
+
`00-overview.md`, exactly like a feature spec. It starts in `in-progress`
|
|
47
|
+
because work is already underway. Keep it lean:
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
# Bug: <short title>
|
|
51
|
+
|
|
52
|
+
> **Type:** Bug
|
|
53
|
+
> **Status:** In Progress — fixing (red test added)
|
|
54
|
+
> **Author:** <git user.name — who reported/captured it>
|
|
55
|
+
> **Developer:** <git user.name — you, since you're fixing it now>
|
|
56
|
+
> **Raised:** <YYYY-MM-DD (today)>
|
|
57
|
+
> **Area:** <files/modules>
|
|
58
|
+
|
|
59
|
+
## Symptom
|
|
60
|
+
|
|
61
|
+
<observed wrong behaviour + repro steps; paste the error/stack if any>
|
|
62
|
+
|
|
63
|
+
## Root cause
|
|
64
|
+
|
|
65
|
+
<the actual cause, at `file:line`. One paragraph — be specific.>
|
|
66
|
+
|
|
67
|
+
## Failing test (red)
|
|
68
|
+
|
|
69
|
+
<test name + path; what it asserts. How to run it. Paste the red failure line.>
|
|
70
|
+
|
|
71
|
+
## Fix
|
|
72
|
+
|
|
73
|
+
- [ ] <the minimal change that addresses the root cause, not the symptom>
|
|
74
|
+
- [ ] Failing test now passes (GREEN); run the project's typecheck and test
|
|
75
|
+
commands — confirm no regressions.
|
|
76
|
+
- [ ] <any follow-up hardening, or "None">
|
|
77
|
+
|
|
78
|
+
## State log
|
|
79
|
+
|
|
80
|
+
| Date | Status | Folder | By |
|
|
81
|
+
|------|--------|--------|----|
|
|
82
|
+
| <YYYY-MM-DD> | In Progress | in-progress | <developer> |
|
|
83
|
+
|
|
84
|
+
## Changelog
|
|
85
|
+
|
|
86
|
+
- <YYYY-MM-DD> — Bug reproduced; failing test added (red).
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The **State log** is the folder/status audit trail; later transitions
|
|
90
|
+
(`/spec-complete`, `/spec-cancel`) append a row. The **Changelog** is for the
|
|
91
|
+
fix narrative and decisions — keep them separate.
|
|
92
|
+
|
|
93
|
+
## 4. Drive to GREEN
|
|
94
|
+
|
|
95
|
+
- Implement the **minimal, root-cause** fix. Match surrounding code; honour all
|
|
96
|
+
project rules (see `.claude/rules/`).
|
|
97
|
+
- Re-run the failing test → it must pass. Then run the project's typecheck and
|
|
98
|
+
test commands to confirm no regressions. Quote results.
|
|
99
|
+
- Tick the Fix tasks, add a Changelog line (`- <date> — Fixed: <one line>; test green`).
|
|
100
|
+
|
|
101
|
+
If the root cause is large/uncertain and can't be fixed in one pass: keep the red
|
|
102
|
+
test, split the fix into phase files (`01-<slug>.md` …) with a phase index in
|
|
103
|
+
`00-overview.md`, and leave the spec in `in-progress` for `/spec-go` to continue.
|
|
104
|
+
Say so explicitly — don't fake green.
|
|
105
|
+
|
|
106
|
+
It starts in `in-progress`, so it does **not** touch `specs/backlog/00-index.md`
|
|
107
|
+
(there is no index for in-progress). When `/spec-complete` later finishes it,
|
|
108
|
+
that skill logs it to `specs/complete/00-index.md`.
|
|
109
|
+
|
|
110
|
+
## 5. Report
|
|
111
|
+
|
|
112
|
+
Summarise: root cause, the failing→passing test, the fix, and the full test
|
|
113
|
+
result. The spec stays in `in-progress`; suggest `/spec-complete` to verify and
|
|
114
|
+
archive it. Do **not** `git commit` unless the user asks.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-cancel
|
|
3
|
+
description: Cancel a spec — capture the reason, record final progress, stamp the reason on the spec header, then move it into specs/cancelled/. Targets a spec by name (arg) or the spec currently in context. Use when the user says "/spec-cancel", "drop this spec", "we're not doing this spec", or "shelve <spec>".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-cancel — record, stamp a reason, archive a spec
|
|
7
|
+
|
|
8
|
+
## 1. Identify the target spec
|
|
9
|
+
|
|
10
|
+
- Use the name/path argument if given, else the spec **in context**. If unclear,
|
|
11
|
+
ask which spec.
|
|
12
|
+
- Locate it under `specs/` (any bucket — `backlog/`, `in-progress/`, …). Entry point
|
|
13
|
+
is its `00-overview.md`; phases are separate files (`01-<slug>.md`, `02-…`) listed
|
|
14
|
+
in its phase index (legacy specs may be a bare `<name>.md`).
|
|
15
|
+
|
|
16
|
+
## 2. Ask for the cancellation reason — required
|
|
17
|
+
|
|
18
|
+
Ask the user **why** it's being cancelled (e.g. superseded by X, descoped, no
|
|
19
|
+
longer needed, blocked indefinitely). Do not proceed without a reason; capture
|
|
20
|
+
it verbatim/condensed for the header.
|
|
21
|
+
|
|
22
|
+
## 3. Double-check and record progress
|
|
23
|
+
|
|
24
|
+
- Read the overview and every phase file and reconcile task state with reality:
|
|
25
|
+
tick anything that was actually completed before cancelling so the record is
|
|
26
|
+
honest about what landed.
|
|
27
|
+
- Note any partial/abandoned work so it isn't mistaken for unstarted.
|
|
28
|
+
|
|
29
|
+
## 4. Stamp the spec
|
|
30
|
+
|
|
31
|
+
Update the **Status** header in the entry point so the reason is visible at the
|
|
32
|
+
top:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
> **Status:** Cancelled (<YYYY-MM-DD>) — <reason>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Append a **State log** row:
|
|
39
|
+
`| <YYYY-MM-DD> | Cancelled | cancelled | <git user.name> |`.
|
|
40
|
+
|
|
41
|
+
Add a **Changelog** entry:
|
|
42
|
+
`- <YYYY-MM-DD> — Cancelled: <reason>.`
|
|
43
|
+
|
|
44
|
+
## 5. Move to cancelled
|
|
45
|
+
|
|
46
|
+
`mkdir -p specs/cancelled` then **`git mv`** the file or folder:
|
|
47
|
+
`git mv "specs/<bucket>/<name>" "specs/cancelled/<name>"` (preserve history;
|
|
48
|
+
move the whole folder).
|
|
49
|
+
|
|
50
|
+
If the spec was in `backlog`, **remove its row from `specs/backlog/00-index.md`**
|
|
51
|
+
(it has left the backlog). There is no index for `cancelled`.
|
|
52
|
+
|
|
53
|
+
## 6. Report
|
|
54
|
+
|
|
55
|
+
Confirm the cancellation, the reason recorded, and the new location. Do **not**
|
|
56
|
+
`git commit` unless the user asks.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-complete
|
|
3
|
+
description: Finish a spec — verify all phases are genuinely done, update progress, then move it into specs/complete/. Targets a spec by name (arg) or the spec currently in context. Use when the user says "/spec-complete", "mark this spec done", or "this spec is complete".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-complete — verify, finalise, archive a spec
|
|
7
|
+
|
|
8
|
+
## 1. Identify the target spec
|
|
9
|
+
|
|
10
|
+
- Use the name/path argument if given, else the spec **in context**. If unclear,
|
|
11
|
+
ask which spec.
|
|
12
|
+
- Locate the spec folder under `specs/` (usually `specs/in-progress/`). Entry
|
|
13
|
+
point is its `00-overview.md`; phases are separate files (`01-<slug>.md`, `02-…`)
|
|
14
|
+
listed in its phase index (legacy specs may be a bare `<name>.md`).
|
|
15
|
+
|
|
16
|
+
## 2. Double-check progress — don't rubber-stamp
|
|
17
|
+
|
|
18
|
+
Before marking complete, confirm the work is actually finished:
|
|
19
|
+
|
|
20
|
+
- Read every phase file. For each **unchecked** task, check whether it is in fact
|
|
21
|
+
done in the code — tick it (`- [x]`) if so, or surface it if not.
|
|
22
|
+
- Run the project's typecheck and test commands. The suite must be **green** to
|
|
23
|
+
call a spec complete.
|
|
24
|
+
- For a **Bug** spec (`Type: Bug`), confirm the originally-failing test named in
|
|
25
|
+
the spec now passes — that test is the proof the bug is fixed.
|
|
26
|
+
- If genuinely incomplete work remains, **stop and tell the user** rather than
|
|
27
|
+
forcing completion. Offer to finish it (`/spec-go`) or to complete with the
|
|
28
|
+
remaining items explicitly listed as deferred.
|
|
29
|
+
|
|
30
|
+
## 3. Update the spec
|
|
31
|
+
|
|
32
|
+
- Tick all completed tasks in the phase files; flip every finished phase-file
|
|
33
|
+
heading **and** every row in the `00-overview.md` phase index to `✅`.
|
|
34
|
+
- Set the **Status** header in the entry point:
|
|
35
|
+
`> **Status:** Complete (<YYYY-MM-DD>)`.
|
|
36
|
+
- Append a **State log** row:
|
|
37
|
+
`| <YYYY-MM-DD> | Complete | complete | <git user.name> |`.
|
|
38
|
+
- Add a **Changelog** entry:
|
|
39
|
+
`- <YYYY-MM-DD> — Completed; all phases done, tests green.`
|
|
40
|
+
(Note any consciously-deferred items here too.)
|
|
41
|
+
|
|
42
|
+
## 4. Move to complete
|
|
43
|
+
|
|
44
|
+
`mkdir -p specs/complete` then **`git mv`** the file or folder:
|
|
45
|
+
`git mv "specs/in-progress/<name>" "specs/complete/<name>"` (preserve history;
|
|
46
|
+
move the whole folder).
|
|
47
|
+
|
|
48
|
+
Then **prepend a row to `specs/complete/00-index.md`** (newest first — directly under
|
|
49
|
+
the table header, above existing rows):
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
| <YYYY-MM-DD> | <name> | Feature|Bug |
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This is the append-only completion log used to find the latest completed specs.
|
|
56
|
+
|
|
57
|
+
## 5. Report
|
|
58
|
+
|
|
59
|
+
Confirm the move, the final test result, and list anything deferred. Do **not**
|
|
60
|
+
`git commit` unless the user asks.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
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".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-go — start (or continue) implementing a spec
|
|
7
|
+
|
|
8
|
+
## 1. Identify the target spec
|
|
9
|
+
|
|
10
|
+
- If a name/path is given as an argument, use it.
|
|
11
|
+
- Otherwise use the spec **currently in context** (the one just created or
|
|
12
|
+
discussed). If neither is clear, ask which spec.
|
|
13
|
+
- Locate it by searching `specs/` (check `specs/backlog/` first, then the other
|
|
14
|
+
buckets). A spec is a `<name>/` folder whose entry point is `00-overview.md`,
|
|
15
|
+
with **one file per phase** alongside it (`01-<slug>.md`, `02-…`). Legacy specs
|
|
16
|
+
may be a bare `<name>.md`, or a `00-overview.md` with inline phases — handle
|
|
17
|
+
those too.
|
|
18
|
+
|
|
19
|
+
## 2. Move it into development
|
|
20
|
+
|
|
21
|
+
- If it isn't already under `specs/in-progress/`, move the whole spec folder
|
|
22
|
+
there. **Use `git mv`** to keep history:
|
|
23
|
+
`git mv "specs/backlog/<name>" "specs/in-progress/<name>"`.
|
|
24
|
+
`mkdir -p specs/in-progress` first if needed.
|
|
25
|
+
- Update the **Status** header in the entry point:
|
|
26
|
+
`> **Status:** In Progress — Phase 1 (started <YYYY-MM-DD>)`.
|
|
27
|
+
- Set the **Developer** header field if it's still `—`: use `git config user.name`.
|
|
28
|
+
- Append a **State log** row:
|
|
29
|
+
`| <YYYY-MM-DD> | In Progress | in-progress | <git user.name> |`.
|
|
30
|
+
- **Remove the spec's row from `specs/backlog/00-index.md`** — it has left the backlog
|
|
31
|
+
(there is no index for `in-progress`).
|
|
32
|
+
|
|
33
|
+
A spec ideally reaches here as `Ready` (via `/spec-ready`), but `/spec-go` works
|
|
34
|
+
on a `Draft` too — just sanity-check it's well-formed before building.
|
|
35
|
+
|
|
36
|
+
If the spec is already in `in-progress`, skip the move and implement the **next
|
|
37
|
+
unfinished phase** instead of Phase 1.
|
|
38
|
+
|
|
39
|
+
## 3. Pre-flight — commit prior work, then compact
|
|
40
|
+
|
|
41
|
+
Before writing any code for this phase, get the workspace and context clean:
|
|
42
|
+
|
|
43
|
+
- **Confirm the last-worked phase is committed.** Run `git status` and
|
|
44
|
+
`git log --oneline -5`. The most recently *implemented* phase (not necessarily
|
|
45
|
+
the numerically previous one) should already be committed. If prior-phase work
|
|
46
|
+
is still uncommitted, **stop and suggest committing it first** (e.g. via
|
|
47
|
+
`/commit`) so each phase lands as its own reviewable commit — don't build the
|
|
48
|
+
next phase on top of an uncommitted one. (Skip if this is the first phase —
|
|
49
|
+
there's nothing prior to commit.)
|
|
50
|
+
- **Compact, then continue.** Recommend the user run `/compact` now. A fresh,
|
|
51
|
+
minimal context keeps the phase focused and avoids drift from earlier turns;
|
|
52
|
+
the spec file on disk is the source of truth, so nothing is lost. Pause for the
|
|
53
|
+
`/compact`, then implement the phase.
|
|
54
|
+
|
|
55
|
+
## 4. Implement the phase
|
|
56
|
+
|
|
57
|
+
Identify the **first unfinished phase** from the `00-overview.md` phase index,
|
|
58
|
+
then open its phase file (`0N-<slug>.md`) — that file holds the tasks. Mark it
|
|
59
|
+
started: set the phase-file heading to `🔄` and its `> **Status:**` to
|
|
60
|
+
`In progress`, and flip the matching row in the overview phase index to `🔄`.
|
|
61
|
+
Then build it, following the project rules in `.claude/rules/*.md` and `CLAUDE.md`:
|
|
62
|
+
|
|
63
|
+
- Work task by task through the phase file. Make focused edits that match
|
|
64
|
+
surrounding code.
|
|
65
|
+
- Honour the project's conventions (see `.claude/rules/spec-planning.md` and the
|
|
66
|
+
rules it links).
|
|
67
|
+
- **Tests are part of the phase, not after it.** Create/extend tests for the
|
|
68
|
+
work, then run the project's typecheck and test commands. Do not declare the
|
|
69
|
+
phase done until green.
|
|
70
|
+
- Never hardcode dates in tests; never run destructive commands against a real
|
|
71
|
+
database — use the project's test database only.
|
|
72
|
+
|
|
73
|
+
## 5. Record progress
|
|
74
|
+
|
|
75
|
+
- In the **phase file**: tick completed tasks (`- [x]`), flip its heading to `✅`,
|
|
76
|
+
and set its `> **Status:**` to `Done`.
|
|
77
|
+
- In **`00-overview.md`**: flip the matching phase-index row to `✅`.
|
|
78
|
+
- If anything changed from the plan (a decision, a deviation, a discovered
|
|
79
|
+
constraint), add a dated **Changelog** entry in `00-overview.md`.
|
|
80
|
+
- If new work surfaced, add it as tasks to the appropriate phase file (or add a
|
|
81
|
+
new phase file + index row) rather than doing it silently.
|
|
82
|
+
|
|
83
|
+
## 6. Report
|
|
84
|
+
|
|
85
|
+
Summarise what was implemented, the test result (quote failures if any), and
|
|
86
|
+
which phase is next. Do **not** `git commit` unless the user asks — finish,
|
|
87
|
+
verify, and wait.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-init
|
|
3
|
+
description: Bootstrap the spec-driven-development workflow in the current project — create the specs/ lifecycle folders and .core, wire version-control so specs are tracked, verify the spec skills are installed, and add the spec workflow to CLAUDE.md and .claude/rules. Idempotent and safe to re-run. Use when setting up a new project for specs or repairing the setup, or when the user says "/spec-init", "set up specs here", "initialise the spec process".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-init — set up the spec-driven-development workflow
|
|
7
|
+
|
|
8
|
+
Bootstrap (or repair) everything this project needs to run the spec lifecycle.
|
|
9
|
+
**Idempotent:** detect what already exists, create only what's missing, and never
|
|
10
|
+
clobber customised content. Finish with a summary of created vs already-present.
|
|
11
|
+
|
|
12
|
+
> If `@skitterbyte/skitterspec` is installed, `npx @skitterbyte/skitterspec init` does
|
|
13
|
+
> all of the below mechanically. This skill is the manual/repair path and is
|
|
14
|
+
> useful when the package isn't available or you only need to fix part of the
|
|
15
|
+
> setup.
|
|
16
|
+
|
|
17
|
+
The system is **eight skills**: `spec` (feature), `spec-bug` (bug), `spec-ready`,
|
|
18
|
+
`spec-review`, `spec-go`, `spec-complete`, `spec-cancel`, and this `spec-init`. The lifecycle is
|
|
19
|
+
`backlog → in-progress → complete / cancelled`, with `.core` holding always-apply
|
|
20
|
+
project rules.
|
|
21
|
+
|
|
22
|
+
## 1. Folders
|
|
23
|
+
|
|
24
|
+
Create any that are missing; drop a `.gitkeep` into ones that would otherwise be
|
|
25
|
+
empty so git keeps them:
|
|
26
|
+
|
|
27
|
+
- `specs/.core/` — project rules (always apply; never moved)
|
|
28
|
+
- `specs/backlog/` `specs/in-progress/` `specs/complete/` `specs/cancelled/`
|
|
29
|
+
|
|
30
|
+
Also ensure the two index files exist (create with just their header comment +
|
|
31
|
+
table header if missing — do not regenerate if present):
|
|
32
|
+
|
|
33
|
+
- `specs/backlog/00-index.md` — live view of backlog (`Added | Spec | Type | Status`);
|
|
34
|
+
`/spec` adds rows, `/spec-go` and `/spec-cancel` remove them.
|
|
35
|
+
- `specs/complete/00-index.md` — append-only completion log (`Completed | Spec | Type`),
|
|
36
|
+
newest first; `/spec-complete` prepends a row.
|
|
37
|
+
|
|
38
|
+
## 2. Version control — keep specs tracked
|
|
39
|
+
|
|
40
|
+
The whole lifecycle lives in git — **everything under `specs/` is tracked**, so
|
|
41
|
+
the default is simply *no ignore rule excluding it*. Ensure `.gitignore` has no
|
|
42
|
+
`/specs/*` (or similar) entry that would hide spec folders; if one exists and the
|
|
43
|
+
project wants everything tracked, remove it. Confirm with
|
|
44
|
+
`git check-ignore -v specs/.core/<any-file>` — it should print nothing (tracked).
|
|
45
|
+
|
|
46
|
+
- **`.core` dotfile caveat:** only relevant if a `/specs/*` ignore is
|
|
47
|
+
(re)introduced — `*` matches dotfiles, so `.core` would need an explicit
|
|
48
|
+
`!/specs/.core/` negation. With no ignore rule, it's tracked automatically.
|
|
49
|
+
- If the project uses a formatter/linter ignore glob that excludes `specs/**`,
|
|
50
|
+
decide whether spec markdown should be formatted/linted and adjust accordingly.
|
|
51
|
+
- If a project later wants to **stop** versioning work-in-progress specs, that's
|
|
52
|
+
a deliberate opt-out (e.g. `/specs/*` + `!/specs/.core/`) — ask first; the
|
|
53
|
+
default is track-everything.
|
|
54
|
+
|
|
55
|
+
## 3. Verify the skills are installed
|
|
56
|
+
|
|
57
|
+
Check each of the eight skills resolves — `.claude/skills/<name>/SKILL.md`
|
|
58
|
+
(project) or `~/.claude/skills/<name>/` (global). List any missing. This skill
|
|
59
|
+
scaffolds the project; it does **not** regenerate skill bodies — missing skills
|
|
60
|
+
must be copied in (e.g. `npx @skitterbyte/skitterspec init`) from a global install
|
|
61
|
+
or a sibling project. If most/all are global, just confirm availability.
|
|
62
|
+
|
|
63
|
+
## 4. Governing rule (`.claude/rules/spec-planning.md`)
|
|
64
|
+
|
|
65
|
+
Ensure it exists. If missing, create it documenting:
|
|
66
|
+
|
|
67
|
+
- the lifecycle skills with their **status** and **folder** (table);
|
|
68
|
+
- the **type** convention — header `> **Type:** Feature|Bug` + filename prefix
|
|
69
|
+
`feat-`/`bug-` (never `[BUG]` brackets — glob hazard);
|
|
70
|
+
- the **Author** / **Developer** header fields;
|
|
71
|
+
- the **State log** audit table (folder/status transitions), kept separate from
|
|
72
|
+
the **Changelog** (decisions);
|
|
73
|
+
- the project's concrete typecheck/test commands, and the rule that **every
|
|
74
|
+
phase ends with creating + running tests**.
|
|
75
|
+
|
|
76
|
+
Read a sibling spec skill (e.g. `spec`, `spec-go`) for the canonical shapes
|
|
77
|
+
rather than inventing them. If the rule already exists, leave it unless stale.
|
|
78
|
+
|
|
79
|
+
## 5. CLAUDE.md
|
|
80
|
+
|
|
81
|
+
Ensure a `## Spec workflow` section exists. If absent, add one with the
|
|
82
|
+
skill table (`Skill | Action | Status | Folder`), the Feature/Bug type note,
|
|
83
|
+
and a pointer to `.claude/rules/spec-planning.md`. Also update the `specs/` entry
|
|
84
|
+
in any project-structure tree to show `.core/` + the four lifecycle folders. If
|
|
85
|
+
the section exists, refresh only stale folder/skill names — don't rewrite it.
|
|
86
|
+
|
|
87
|
+
## 6. Report
|
|
88
|
+
|
|
89
|
+
Summarise per area — folders, `.gitignore` lines, tooling-ignore negations,
|
|
90
|
+
skills (present/missing), rule file, CLAUDE.md section — as created / updated /
|
|
91
|
+
already-present, plus the `git check-ignore` result for `.core`. Do **not**
|
|
92
|
+
`git commit` unless the user asks.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-ready
|
|
3
|
+
description: Mark a Draft spec as Ready — confirm it's groomed (no unresolved open questions, phases and per-phase tests defined, decisions captured) and flip its status to Ready so it's a candidate for /spec-go. Stays in specs/backlog/. Targets a spec by name (arg) or the spec in context. Use when the user says "/spec-ready", "this spec is ready", or "mark <spec> ready to start".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-ready — promote a Draft spec to Ready
|
|
7
|
+
|
|
8
|
+
A grooming gate between authoring (`/spec`, status `Draft`) and implementation
|
|
9
|
+
(`/spec-go`, status `In Progress`). It does **not** move the spec — it stays in
|
|
10
|
+
`specs/backlog/`; it only confirms quality and flips the status to `Ready` so
|
|
11
|
+
you can see at a glance which backlog specs are good to start.
|
|
12
|
+
|
|
13
|
+
## 1. Identify the target spec
|
|
14
|
+
|
|
15
|
+
- Use the name/path argument if given, else the spec **in context**. If unclear,
|
|
16
|
+
ask which spec.
|
|
17
|
+
- Locate the spec folder under `specs/backlog/`. Entry point is its
|
|
18
|
+
`00-overview.md`; phases are separate files (`01-<slug>.md`, `02-…`) listed in
|
|
19
|
+
its phase index (legacy specs may be a bare `<name>.md`).
|
|
20
|
+
|
|
21
|
+
## 2. Check it's actually ready — don't rubber-stamp
|
|
22
|
+
|
|
23
|
+
Review the spec against the readiness bar. If any of these fail, **stop and tell
|
|
24
|
+
the user what's missing** rather than marking it Ready:
|
|
25
|
+
|
|
26
|
+
- **Open questions resolved** — the `## Open questions` section is empty or
|
|
27
|
+
reads "None". Unresolved branches mean it isn't ready.
|
|
28
|
+
- **Decisions captured** — the chosen solution and key trade-offs are recorded.
|
|
29
|
+
- **Phased with clear tasks** — work is broken into phases, and **every phase in
|
|
30
|
+
the `00-overview.md` index has a matching phase file** (`0N-<slug>.md`) with
|
|
31
|
+
verb-first `- [ ]` tasks granular enough for one session. No index row without
|
|
32
|
+
a file, no orphan file without an index row.
|
|
33
|
+
- **Tests baked into every phase** — each phase file ends with a
|
|
34
|
+
create-and-run-tests task (a phase isn't done until green).
|
|
35
|
+
- **Concise and current** — no stale/contradictory sections.
|
|
36
|
+
|
|
37
|
+
Offer to fix small gaps inline if the user wants; otherwise leave it `Draft`.
|
|
38
|
+
|
|
39
|
+
## 3. Mark Ready
|
|
40
|
+
|
|
41
|
+
- Set the **Status** header in the entry point:
|
|
42
|
+
`> **Status:** Ready (<YYYY-MM-DD>)`.
|
|
43
|
+
- Append a **State log** row: `| <YYYY-MM-DD> | Ready | backlog | <git user.name> |`
|
|
44
|
+
(no folder change — Ready stays in `backlog`).
|
|
45
|
+
- Update the spec's row in `specs/backlog/00-index.md` — set its Status column to
|
|
46
|
+
`Ready` (the row stays; the spec is still in backlog).
|
|
47
|
+
- Optionally add a **Changelog** note if grooming changed anything substantive.
|
|
48
|
+
|
|
49
|
+
## 4. Report
|
|
50
|
+
|
|
51
|
+
Confirm it's Ready and note it stays in `backlog` until `/spec-go` picks it up.
|
|
52
|
+
If you blocked it, list exactly what needs resolving first.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-review
|
|
3
|
+
description: Re-validate an existing spec against the current codebase — detect drift (renamed/removed files, changed APIs, tasks already done in code, stale decisions), grill where a decision is needed, and update the spec so it's relevant again. Targets a spec by name (arg) or the spec in context. Use when the user says "/spec-review", "is this spec still accurate", "this spec has gone stale", or before picking up an old backlog spec.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-review — bring a spec back in sync with the codebase
|
|
7
|
+
|
|
8
|
+
Specs rot: the code moves on while a spec sits in the backlog or pauses
|
|
9
|
+
mid-build. This skill re-validates a spec against the **current** code and
|
|
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`).
|
|
12
|
+
|
|
13
|
+
## 1. Identify the target spec
|
|
14
|
+
|
|
15
|
+
- Use the name/path argument if given, else the spec **in context**. If unclear,
|
|
16
|
+
ask which spec.
|
|
17
|
+
- Locate the spec folder under `specs/` (any bucket). Entry point is its
|
|
18
|
+
`00-overview.md`; read it **and every phase file** (`01-<slug>.md`, `02-…`)
|
|
19
|
+
listed in its phase index (legacy specs may be a bare `<name>.md`).
|
|
20
|
+
|
|
21
|
+
## 2. Validate against the codebase — evidence first
|
|
22
|
+
|
|
23
|
+
Read the spec, then check every claim it makes against the real code. Don't
|
|
24
|
+
trust the spec's own wording — verify:
|
|
25
|
+
|
|
26
|
+
- **Referenced things still exist.** Grep/read for each `file:line`, module,
|
|
27
|
+
function, route, model, type, or symbol the spec names. Flag anything renamed,
|
|
28
|
+
moved, or deleted.
|
|
29
|
+
- **Tasks already done.** For each `- [ ]`, check whether the code already
|
|
30
|
+
implements it (it may have landed via other work). Tick `- [x]` what's done.
|
|
31
|
+
- **Decisions still valid.** Re-check each `## Decisions` entry against the
|
|
32
|
+
current architecture and `.claude/rules/*.md`. Flag any that now conflict with
|
|
33
|
+
how the codebase actually works (a changed convention, a superseded approach).
|
|
34
|
+
- **New constraints.** Note rules/patterns introduced since the spec was written
|
|
35
|
+
that it must now honour (e.g. a new required field, a new error type, a new
|
|
36
|
+
pattern the rest of the code now follows).
|
|
37
|
+
- **Backward compatibility.** Re-confirm the planned API/schema changes are still
|
|
38
|
+
additive/safe given the current code (see the project's compatibility rules).
|
|
39
|
+
|
|
40
|
+
## 3. Grill only where a decision is needed
|
|
41
|
+
|
|
42
|
+
Where the drift forces a choice (the old approach no longer fits, a referenced
|
|
43
|
+
thing is gone, scope is now ambiguous), grill the user like `/spec` Phase A —
|
|
44
|
+
**one question at a time, with a recommended answer** — but scoped tightly to
|
|
45
|
+
the drift. Don't re-litigate decisions that still hold. If you can resolve it by
|
|
46
|
+
reading the code, do that instead of asking.
|
|
47
|
+
|
|
48
|
+
## 4. Update the spec
|
|
49
|
+
|
|
50
|
+
- Rewrite stale **Decisions** / **Solution overview** in `00-overview.md` and
|
|
51
|
+
stale **tasks** in the phase files so they match the current code and the
|
|
52
|
+
resolved questions. Add/remove tasks within a phase file; add a new phase by
|
|
53
|
+
creating a `0N-<slug>.md` file **and** a matching overview index row, or drop a
|
|
54
|
+
dead phase by removing both. Keep the index and files in sync; **preserve
|
|
55
|
+
completed `[x]` history**.
|
|
56
|
+
- Tick tasks already satisfied by the code; re-open `## Open questions` for
|
|
57
|
+
anything still undecided.
|
|
58
|
+
- Add a dated **Changelog** entry summarising the review (e.g. `- <date> —
|
|
59
|
+
Reviewed vs codebase: retargeted Phase 2 onto X, dropped Y (removed), ticked Z
|
|
60
|
+
(already done)`).
|
|
61
|
+
- **Status:** if drift is minor, leave status as-is. If a `Ready` spec needs real
|
|
62
|
+
re-grooming, knock it back to `Draft` (set `> **Status:** Draft`, append a
|
|
63
|
+
**State log** row, and reset its row in `specs/backlog/00-index.md` to `Draft`).
|
|
64
|
+
|
|
65
|
+
## 5. Report
|
|
66
|
+
|
|
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.
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skitterbyte/skitterspec",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Spec-driven-development workflow for Claude Code — installs the spec lifecycle skills, rule, and specs/ folders into any project.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claude",
|
|
7
|
+
"claude-code",
|
|
8
|
+
"spec-driven-development",
|
|
9
|
+
"sdd",
|
|
10
|
+
"skills",
|
|
11
|
+
"scaffold"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "Reuben Greaves",
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"bin": {
|
|
17
|
+
"skitterspec": "bin/skitterspec.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin",
|
|
21
|
+
"src",
|
|
22
|
+
"assets"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"prompts": "^2.4.2"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "node --test",
|
|
32
|
+
"changelog": "node scripts/generate-changelog.js",
|
|
33
|
+
"changelog:retro": "node scripts/generate-changelog.js --retro",
|
|
34
|
+
"releases": "node scripts/generate-releases.js",
|
|
35
|
+
"releases:retro": "node scripts/generate-releases.js --retro",
|
|
36
|
+
"version": "node scripts/generate-changelog.js && node scripts/generate-releases.js && git add CHANGELOG.md RELEASES.md"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/skitterbyte/skitterspec.git"
|
|
41
|
+
}
|
|
42
|
+
}
|