@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
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
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# @skitterbyte/skitterspec
|
|
2
|
+
|
|
3
|
+
Spec-driven-development (SDD) workflow for [Claude Code](https://claude.com/claude-code),
|
|
4
|
+
packaged so you can drop the same spec lifecycle into any project.
|
|
5
|
+
|
|
6
|
+
It installs the **eight spec-lifecycle skills** plus a general **`/commit`**
|
|
7
|
+
skill, two governing rules, and the `specs/` folder structure. The lifecycle is
|
|
8
|
+
`backlog → in-progress → complete / cancelled`, with `.core` holding always-apply
|
|
9
|
+
project rules.
|
|
10
|
+
|
|
11
|
+
| Skill | Action | Status | Folder |
|
|
12
|
+
|-------|--------|--------|--------|
|
|
13
|
+
| `/spec` | (Feature) Grill to a shared understanding, then write a concise spec | `Draft` | `specs/backlog/` |
|
|
14
|
+
| `/spec-bug` | (Bug) Reproduce with a failing test, capture spec, drive red→green | `In Progress` | `specs/in-progress/` |
|
|
15
|
+
| `/spec-ready` | Confirm the spec is groomed | `Ready` | `specs/backlog/` |
|
|
16
|
+
| `/spec-review` | Re-validate a spec against the codebase; refresh stale parts | `—` | (unchanged) |
|
|
17
|
+
| `/spec-go` | Implement the next phase (with tests) | `In Progress` | `specs/in-progress/` |
|
|
18
|
+
| `/spec-complete` | Verify all phases done + tests green | `Complete` | `specs/complete/` |
|
|
19
|
+
| `/spec-cancel` | Record progress, stamp a reason | `Cancelled` | `specs/cancelled/` |
|
|
20
|
+
| `/spec-init` | Bootstrap/repair the workflow (manual path) | — | — |
|
|
21
|
+
| `/commit` | Stage the task's files, run typecheck + tests, write a conventional commit (+ release-note footer) | — | (unchanged) |
|
|
22
|
+
|
|
23
|
+
## Install into a project
|
|
24
|
+
|
|
25
|
+
From the root of the target project:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx @skitterbyte/skitterspec init
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
On a terminal it runs an **interactive setup** (skip it with `--yes` or drive it
|
|
32
|
+
with the flags below). It's idempotent — it creates only what's missing and
|
|
33
|
+
never clobbers customised files. It writes:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
.claude/skills/spec*/SKILL.md # the 8 spec-lifecycle skills
|
|
37
|
+
.claude/skills/commit/SKILL.md # the /commit skill
|
|
38
|
+
.claude/rules/spec-planning.md # governing rule (the single source of truth)
|
|
39
|
+
.claude/rules/commit-messages.md # commit message + release-note grammar
|
|
40
|
+
specs/{.core,backlog,in-progress,complete,cancelled}/
|
|
41
|
+
specs/backlog/00-index.md # live backlog view (skill-maintained)
|
|
42
|
+
specs/complete/00-index.md # append-only completion log
|
|
43
|
+
CLAUDE.md # adds a "## Spec workflow" section (created if absent)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If you enable the **release tooling** (see below) it also writes:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
skitterspec.config.json # which artifacts to generate, filenames, scope→area map
|
|
50
|
+
scripts/generate-changelog.js # dev-facing CHANGELOG generator (if changelog enabled)
|
|
51
|
+
scripts/generate-releases.js # user-facing RELEASES generator (if releases enabled)
|
|
52
|
+
scripts/lib/ # shared git + config helpers
|
|
53
|
+
package.json # adds a "version" hook + changelog/releases npm scripts
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Options
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx @skitterbyte/skitterspec init ./path/to/project # target a dir (default: cwd)
|
|
60
|
+
npx @skitterbyte/skitterspec init --yes # accept defaults, skip the prompts
|
|
61
|
+
npx @skitterbyte/skitterspec init --force # overwrite existing skill/rule/script files
|
|
62
|
+
npx @skitterbyte/skitterspec init --no-claude-md # don't touch CLAUDE.md
|
|
63
|
+
npx @skitterbyte/skitterspec update # re-copy skills + rule + scripts, leave specs/ + config alone
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Release-tooling flags (drive setup without the prompts):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
--changelog / --no-changelog # enable/disable CHANGELOG generation
|
|
70
|
+
--releases / --no-releases # enable/disable user-facing release notes
|
|
71
|
+
--changelog-file=NAME # changelog filename (default CHANGELOG.md)
|
|
72
|
+
--releases-file=NAME # release-notes filename (default RELEASES.md)
|
|
73
|
+
--product-name=NAME # product name shown in the release-notes header
|
|
74
|
+
--version-hook / --no-version-hook # wire (or skip) the npm "version" hook
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`update` pulls newer skill/rule/script versions after upgrading the package,
|
|
78
|
+
without disturbing your specs or `skitterspec.config.json`. The CLAUDE.md section
|
|
79
|
+
is wrapped in `<!-- skitterspec:start -->`…`<!-- skitterspec:end -->` markers so
|
|
80
|
+
`update` can refresh it in place.
|
|
81
|
+
|
|
82
|
+
## Changelog & release-note tooling (opt-in)
|
|
83
|
+
|
|
84
|
+
Conventional commits already say what changed; skitterspec can turn them into two
|
|
85
|
+
generated artifacts at `npm version`:
|
|
86
|
+
|
|
87
|
+
- **`CHANGELOG.md`** — dev-facing, built from commit **subjects** (Keep a Changelog
|
|
88
|
+
format: feat→Added, fix→Fixed, perf/refactor→Changed, breaking→Changed).
|
|
89
|
+
- **`RELEASES.md`** — user-facing, built **only** from `Release-Note:` commit
|
|
90
|
+
**footers**, grouped by area and bucket (New / Improved / Fixed / Action
|
|
91
|
+
required). The `/commit` skill writes these footers; the grammar lives in
|
|
92
|
+
`.claude/rules/commit-messages.md`.
|
|
93
|
+
|
|
94
|
+
Both walk *commits since the last version tag*. Generation is opt-in per artifact
|
|
95
|
+
and recorded in **`skitterspec.config.json`** at the repo root:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"version": 1,
|
|
100
|
+
"changelog": { "enabled": true, "file": "CHANGELOG.md" },
|
|
101
|
+
"releases": { "enabled": true, "file": "RELEASES.md",
|
|
102
|
+
"productName": "My App", "scopeAreas": {} },
|
|
103
|
+
"versionHook": true
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`scopeAreas` maps a commit scope to a user-facing area (e.g. `{"reqs":
|
|
108
|
+
"Requisitions"}`); unmapped scopes fall back to Title-Case, and a `Release-Area:`
|
|
109
|
+
footer overrides per-commit. When `versionHook` is on, `init` wires npm scripts:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm run changelog # regenerate CHANGELOG.md from commits since last tag
|
|
113
|
+
npm run releases # regenerate RELEASES.md
|
|
114
|
+
npm run changelog:retro -- 5 # backfill the last 5 tagged releases
|
|
115
|
+
npm version <patch|minor|major> # bumps, regenerates both, and stages them
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The generators are plain Node (no `tsx`/`ts-node`); the only runtime dependency
|
|
119
|
+
the package itself adds is [`prompts`](https://www.npmjs.com/package/prompts) for
|
|
120
|
+
the interactive `init`.
|
|
121
|
+
|
|
122
|
+
## Spec structure
|
|
123
|
+
|
|
124
|
+
Every spec is a **folder**, never a bare file:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
specs/backlog/feat-<name>/
|
|
128
|
+
00-overview.md # dashboard: problem, decisions, solution, phase index, logs
|
|
129
|
+
01-<phase-slug>.md # phase 1 — goal + task checkboxes (tests included)
|
|
130
|
+
02-<phase-slug>.md # phase 2 …
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
`00-overview.md` is the index — it carries a **phase table** linking to each
|
|
134
|
+
phase file with its status (`⬜`/`🔄`/`✅`). **Each phase is its own file** so it's
|
|
135
|
+
easy to dive into one phase without wading through the whole spec. The lifecycle
|
|
136
|
+
skills keep the index and phase files in sync.
|
|
137
|
+
|
|
138
|
+
## After install — tailor it
|
|
139
|
+
|
|
140
|
+
The shipped skills are **stack-agnostic**. They say things like "run the
|
|
141
|
+
project's typecheck and test commands" and "honour the project's conventions".
|
|
142
|
+
Make those concrete once, in **`.claude/rules/spec-planning.md`** (the
|
|
143
|
+
*Project conventions* section): set your real typecheck/test/lint commands and
|
|
144
|
+
link your other `.claude/rules/*.md`. The skills point at that file, so you don't
|
|
145
|
+
edit seven files per project.
|
|
146
|
+
|
|
147
|
+
## How it's distributed
|
|
148
|
+
|
|
149
|
+
The skills, rule, and generator scripts are plain assets under
|
|
150
|
+
[`assets/`](./assets). The CLI ([`bin/skitterspec.js`](./bin/skitterspec.js) →
|
|
151
|
+
[`src/`](./src)) copies them into place, patches `CLAUDE.md`, and (for the release
|
|
152
|
+
tooling) writes `skitterspec.config.json` and npm scripts. It needs Node 18+ and
|
|
153
|
+
one runtime dependency, [`prompts`](https://www.npmjs.com/package/prompts), used
|
|
154
|
+
only for the interactive `init`. The copied generator scripts are dependency-free
|
|
155
|
+
and read their config from `skitterspec.config.json` — they never call back into
|
|
156
|
+
this package.
|
|
157
|
+
|
|
158
|
+
Because the files are copied into the consumer repo (not symlinked), each project
|
|
159
|
+
pins its own version and can diverge. Re-run `update` to re-sync from a newer
|
|
160
|
+
package release.
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
MIT
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Spec workflow
|
|
2
|
+
|
|
3
|
+
Spec-driven development runs through eight skills — use them so structure and
|
|
4
|
+
lifecycle stay consistent (see `.claude/rules/spec-planning.md`):
|
|
5
|
+
|
|
6
|
+
| Skill | Action | Status | Folder |
|
|
7
|
+
|-------|--------|--------|--------|
|
|
8
|
+
| `/spec` | (Feature) Grill to a clear shared understanding, then write a concise spec | `Draft` | `specs/backlog/` |
|
|
9
|
+
| `/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
|
+
| `/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/` |
|
|
15
|
+
| `/spec-init` | Bootstrap/repair this workflow in a project (idempotent) | — | — |
|
|
16
|
+
|
|
17
|
+
Every spec has a **type** (`> **Type:** Feature\|Bug`) and a filename prefix
|
|
18
|
+
(`feat-<name>` / `bug-<name>`) — never `[BUG]` brackets (glob hazard). Specs use
|
|
19
|
+
markdown checkboxes (`- [ ]`) for task tracking and are the single source of
|
|
20
|
+
truth for progress. Every spec is a folder: `00-overview.md` is the dashboard
|
|
21
|
+
(problem, decisions, solution, **phase index**, logs) and **each phase is its own
|
|
22
|
+
file** (`01-<slug>.md`, `02-…`) holding that phase's tasks — never a bare file,
|
|
23
|
+
never phases lumped into the overview. **Every phase ends with creating and
|
|
24
|
+
running tests**; decisions go in the spec's Changelog, state transitions in its
|
|
25
|
+
State log.
|
|
26
|
+
|
|
27
|
+
> Tailor the per-phase test commands and project conventions referenced by the
|
|
28
|
+
> spec skills to this project's stack (see `.claude/rules/spec-planning.md`).
|
|
29
|
+
|
|
30
|
+
Also installed: **`/commit`** — stage only the task's files, run typecheck +
|
|
31
|
+
tests, then write a conventional-commit message with a `Release-Note:` footer
|
|
32
|
+
for user-visible changes (grammar in `.claude/rules/commit-messages.md`). If the
|
|
33
|
+
release tooling is enabled (`skitterspec.config.json`), those footers feed the
|
|
34
|
+
generated `CHANGELOG.md`/`RELEASES.md` at `npm version`.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Commit Messages
|
|
2
|
+
|
|
3
|
+
## Format
|
|
4
|
+
|
|
5
|
+
`type(scope): subject` — [Conventional Commits](https://www.conventionalcommits.org/)
|
|
6
|
+
|
|
7
|
+
## Length limits
|
|
8
|
+
|
|
9
|
+
- **Subject line:** 50 characters max
|
|
10
|
+
- **Body lines:** 72 characters max
|
|
11
|
+
|
|
12
|
+
(These match the common commitlint defaults — if your project runs commitlint,
|
|
13
|
+
they'll be enforced; otherwise treat them as the convention.)
|
|
14
|
+
|
|
15
|
+
## Template
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
type(scope): subject
|
|
19
|
+
|
|
20
|
+
- Bullet point 1
|
|
21
|
+
- Bullet point 2
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Types
|
|
25
|
+
|
|
26
|
+
`feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `style`
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
|
|
30
|
+
- Start bullets with a verb (Add, Fix, Refactor, Remove, Update)
|
|
31
|
+
- Be specific about what changed (file, module, feature)
|
|
32
|
+
- No emojis, no trailing punctuation
|
|
33
|
+
- No **authorship** trailers — `Co-authored-by`, `Signed-off-by`, etc.
|
|
34
|
+
(The `Release-Note:` footers below are the one permitted exception — they
|
|
35
|
+
carry content, not attribution.)
|
|
36
|
+
- Use plain `git commit -m "message"` only
|
|
37
|
+
- Output ONLY the commit message — no explanations before or after
|
|
38
|
+
|
|
39
|
+
## Release notes footer (user-facing changes)
|
|
40
|
+
|
|
41
|
+
When a change is **user-visible** (a feature, fix, or improvement an end user
|
|
42
|
+
would notice), add a `Release-Note:` footer. The terse subject feeds the
|
|
43
|
+
dev-facing changelog (`CHANGELOG.md` by default); the footer feeds the
|
|
44
|
+
user-facing release notes (`RELEASES.md` by default) via
|
|
45
|
+
`scripts/generate-releases.js`, run at `npm version`. Both are generated from
|
|
46
|
+
the same commit. Filenames, the product name, and the scope→area map are
|
|
47
|
+
configured in `skitterspec.config.json` (this whole section applies only when
|
|
48
|
+
the release tooling is installed — see the project README).
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
feat(tasks): explicit state/created dates + sort-by
|
|
52
|
+
|
|
53
|
+
- Add stateEnteredAt column, sortBy param
|
|
54
|
+
|
|
55
|
+
Release-Note: You can now sort your task inbox by when an item entered its
|
|
56
|
+
current state or when it was created, with both dates shown on every row.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Grammar:
|
|
60
|
+
|
|
61
|
+
- `Release-Note: <text>` — a plain-English, benefit-framed sentence aimed at
|
|
62
|
+
users (not "add column X" — say what they can now do). Multi-line is fine;
|
|
63
|
+
wrap continuation lines at 72 like the body.
|
|
64
|
+
- `Release-Note!: <text>` — same, but also promoted into the release's
|
|
65
|
+
**Highlights** line. Use for the headline change of a release.
|
|
66
|
+
- `Release-Area: <name>` — optional. Overrides the scope→area mapping (from
|
|
67
|
+
`skitterspec.config.json` → `releases.scopeAreas`) when the dev scope isn't a
|
|
68
|
+
user area (e.g. scope `engine` but area `Platform`).
|
|
69
|
+
- `Release-Note: none` — explicit "not user-facing" marker (same effect as
|
|
70
|
+
omitting it; documents the decision).
|
|
71
|
+
|
|
72
|
+
Rules:
|
|
73
|
+
|
|
74
|
+
- **Opt-in.** Omit the footer for internal/dev-only changes (`chore`, `test`,
|
|
75
|
+
`docs`, `style`, refactors with no user effect, plumbing). Only commits with a
|
|
76
|
+
footer appear in `RELEASES.md`.
|
|
77
|
+
- Put a **blank line before** the footer (so it's a proper commit footer).
|
|
78
|
+
- `feat`→New, `fix`→Fixed, `perf`/`refactor`→Improved, breaking→Action required
|
|
79
|
+
— the bucket is derived from the commit type, so just write the note.
|
|
80
|
+
|
|
81
|
+
## Abbreviations
|
|
82
|
+
|
|
83
|
+
Common short forms are fine in subjects — e.g. `config`, `ctx`, `impl`, `util`,
|
|
84
|
+
`id`, `repo`. List any project-specific abbreviations your team allows in your
|
|
85
|
+
own `.claude/rules/`.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Spec Planning
|
|
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:** …`):
|
|
6
|
+
|
|
7
|
+
| Skill | Purpose | Status | Folder |
|
|
8
|
+
|-------|---------|--------|--------|
|
|
9
|
+
| `/spec` | (Feature) Grill to a clear shared understanding, then write a new spec | `Draft` | `specs/backlog/` |
|
|
10
|
+
| `/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
|
+
| `/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/` |
|
|
16
|
+
| `/spec-init` | Bootstrap/repair this workflow in a project (idempotent) | — | — |
|
|
17
|
+
|
|
18
|
+
Status flow: `Draft → Ready → In Progress → Complete` (or `Cancelled` from any
|
|
19
|
+
state). `/spec-ready` is a grooming gate only — it does not move the folder.
|
|
20
|
+
`/spec-bug` is test-first and starts straight in `In Progress` (work begins
|
|
21
|
+
immediately), so it skips Draft/Ready.
|
|
22
|
+
|
|
23
|
+
## Project conventions (fill this in)
|
|
24
|
+
|
|
25
|
+
The spec skills tell you to run "your project's typecheck and test commands" and
|
|
26
|
+
to "honour project conventions". Make those concrete here so specs stay
|
|
27
|
+
consistent with the codebase:
|
|
28
|
+
|
|
29
|
+
- **Typecheck command:** `<e.g. npm run typecheck>`
|
|
30
|
+
- **Test command:** `<e.g. npm test>` (single file/dir: `<e.g. npx vitest run path>`)
|
|
31
|
+
- **Lint/format:** `<e.g. npm run lint>`
|
|
32
|
+
- **Other rules specs must honour:** link the relevant `.claude/rules/*.md`
|
|
33
|
+
(architecture, code style, testing, database, etc.) rather than restating them.
|
|
34
|
+
|
|
35
|
+
## Spec types — Feature vs Bug
|
|
36
|
+
|
|
37
|
+
Every spec is one of two types, recorded **both** in the header and the filename:
|
|
38
|
+
|
|
39
|
+
- **Header field:** `> **Type:** Feature` or `> **Type:** Bug` (authoritative,
|
|
40
|
+
greppable: `grep -rl 'Type:.*Bug' specs/`).
|
|
41
|
+
- **Filename prefix:** `feat-<name>` for features, `bug-<name>` for bugs
|
|
42
|
+
(visible in listings; glob-safe — never use `[BUG]`/`[FEATURE]` brackets).
|
|
43
|
+
|
|
44
|
+
Both types share the same lifecycle folders below — type is orthogonal to status.
|
|
45
|
+
|
|
46
|
+
## Header fields & State log (audit trail)
|
|
47
|
+
|
|
48
|
+
Every spec header carries:
|
|
49
|
+
|
|
50
|
+
- `> **Author:**` — who created the spec (set at `/spec` / `/spec-bug`, defaults
|
|
51
|
+
to `git config user.name`).
|
|
52
|
+
- `> **Developer:**` — who implements it (`—` until `/spec-go` starts work, then
|
|
53
|
+
set to `git config user.name`; `/spec-bug` sets it immediately).
|
|
54
|
+
|
|
55
|
+
Every spec also has a **State log** table — the audit trail of folder/status
|
|
56
|
+
transitions. Each lifecycle skill appends exactly one row when it changes state:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
## State log
|
|
60
|
+
|
|
61
|
+
| Date | Status | Folder | By |
|
|
62
|
+
|------|--------|--------|----|
|
|
63
|
+
| 2026-01-01 | Draft | backlog | Jane Dev |
|
|
64
|
+
| 2026-01-02 | In Progress | in-progress | Jane Dev |
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Keep the **State log** (state transitions) separate from the **Changelog**
|
|
68
|
+
(decisions and course-corrections) — state moves go in the table, not the
|
|
69
|
+
changelog.
|
|
70
|
+
|
|
71
|
+
When asked for a plan, implementation strategy, or feature breakdown:
|
|
72
|
+
|
|
73
|
+
1. Create or update a spec under `specs/` — never plan only in chat.
|
|
74
|
+
2. Reach a clear shared understanding of the requirement AND the proposed
|
|
75
|
+
solution before writing (the `/spec` skill grills for this).
|
|
76
|
+
3. Use markdown checkboxes `- [ ]` for tasks, `- [x]` when done.
|
|
77
|
+
4. Organise work into phased sections with short goal descriptions.
|
|
78
|
+
5. Tasks must be granular enough to complete in one coding session.
|
|
79
|
+
6. Every phase ends with creating and running tests — a phase is not done until
|
|
80
|
+
its tests are green (run the project's typecheck + test commands above).
|
|
81
|
+
7. Keep specs **as concise as possible**.
|
|
82
|
+
8. Record decisions and course-corrections in the spec's **Changelog** section.
|
|
83
|
+
|
|
84
|
+
## Lifecycle folders
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
specs/backlog/ Draft + Ready specs (/spec, /spec-ready)
|
|
88
|
+
specs/in-progress/ under active implementation (/spec-go, /spec-bug)
|
|
89
|
+
specs/complete/ finished (/spec-complete)
|
|
90
|
+
specs/cancelled/ abandoned, with a reason on the header (/spec-cancel)
|
|
91
|
+
specs/.core/ project rules — ALWAYS APPLY, never moved
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Every spec is a **folder** `specs/<bucket>/<name>/` — never a bare file, even for
|
|
95
|
+
simple changes. Inside it:
|
|
96
|
+
|
|
97
|
+
- `00-overview.md` is the entry point / dashboard: header, Problem, Decisions,
|
|
98
|
+
Solution overview, the **phase index** (a table linking to each phase file with
|
|
99
|
+
its status), Open questions, State log, Changelog. **No per-phase task lists
|
|
100
|
+
live here.**
|
|
101
|
+
- **One file per phase** — `01-<phase-slug>.md`, `02-<phase-slug>.md`, … in
|
|
102
|
+
execution order. Each holds that phase's goal, its task checkboxes (tests
|
|
103
|
+
included), and any phase-specific notes. Even a single-phase spec gets `01-….md`
|
|
104
|
+
— so each phase is easy to open and work on its own.
|
|
105
|
+
|
|
106
|
+
Keep the index and the phase files in sync (`⬜`/`🔄`/`✅`). Legacy specs may be a
|
|
107
|
+
bare `<name>.md`, or a `00-overview.md` with inline phases — the skills read
|
|
108
|
+
those, but new specs always use the folder + phase-file form.
|
|
109
|
+
|
|
110
|
+
## Folder indexes (`00-index.md`)
|
|
111
|
+
|
|
112
|
+
Two folders keep a skill-maintained `00-index.md` file (never hand-edit):
|
|
113
|
+
|
|
114
|
+
- `specs/backlog/00-index.md` — **live view** of the backlog (`Added | Spec | Type |
|
|
115
|
+
Status`, newest first). `/spec` prepends a row; `/spec-ready` updates its
|
|
116
|
+
status; `/spec-go` and `/spec-cancel` remove the row when the spec leaves.
|
|
117
|
+
- `specs/complete/00-index.md` — **append-only completion log** (`Completed | Spec |
|
|
118
|
+
Type`, newest first). `/spec-complete` prepends a row — use it to find the
|
|
119
|
+
latest completed specs.
|
|
120
|
+
|
|
121
|
+
`/spec-init` ensures both exist. No index for `in-progress` or `cancelled`.
|
|
122
|
+
|
|
123
|
+
## Rules
|
|
124
|
+
|
|
125
|
+
- If a spec already exists, update it — don't rewrite from scratch.
|
|
126
|
+
- Preserve completed `[x]` tasks.
|
|
127
|
+
- Add new tasks to the appropriate phase.
|
|
128
|
+
- Never delete historical notes.
|
|
129
|
+
- The spec file is the single source of truth for implementation progress.
|
|
130
|
+
- Move specs between buckets with `git mv` to preserve history.
|