@skitterbyte/skitterspec 2.0.1 → 3.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 +21 -0
- package/README.md +31 -4
- package/assets/claude-md-section.md +18 -14
- package/assets/core/env.config.json.example +5 -0
- package/assets/core/env.config.md +29 -2
- package/assets/rules/spec-planning.md +22 -17
- package/assets/skills/spec/SKILL.md +13 -10
- package/assets/skills/spec-cancel/SKILL.md +11 -4
- package/assets/skills/spec-complete/SKILL.md +16 -8
- package/assets/skills/spec-connect/SKILL.md +53 -0
- package/assets/skills/spec-go/SKILL.md +28 -10
- package/assets/skills/spec-review/SKILL.md +2 -2
- package/package.json +4 -6
- package/src/cli.js +177 -3
- package/src/env/config.js +44 -0
- package/src/env/dev.js +63 -0
- package/src/env/proxy.js +159 -0
- package/src/env/supervise.js +150 -0
- package/src/init.js +2 -2
- package/assets/skills/spec-env/SKILL.md +0 -63
- package/assets/skills/spec-env-down/SKILL.md +0 -64
- package/assets/skills/spec-ready/SKILL.md +0 -50
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: spec-env
|
|
3
|
-
description: Provision an isolated environment for a spec — a git worktree on its own branch + a namespaced Docker stack (isolated containers/networks/volumes + a reserved port block), plus an optional editor/terminal opener. Runs `skitterspec spec-env up` and executes the printed git/docker/open commands. Opt-in — needs specs/.core/env.config.json. Use when the user says "/spec-env", "spin up an environment for <spec>", "give this spec its own worktree/stack", or "isolate <spec>".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /spec-env — provision an isolated environment for a spec
|
|
7
|
-
|
|
8
|
-
Give an in-progress spec its own **git worktree** (a sibling directory on its own
|
|
9
|
-
branch, no stashing) + a **namespaced Docker stack** (`COMPOSE_PROJECT_NAME`
|
|
10
|
-
isolates containers/networks/volumes; `PORT_OFFSET` reserves a port block), so N
|
|
11
|
-
specs run side by side and `main` stays clean. An optional `open.command` then
|
|
12
|
-
opens the worktree however you like.
|
|
13
|
-
|
|
14
|
-
This skill is **opt-in**: it only works when `specs/.core/env.config.json` exists
|
|
15
|
-
(copy `env.config.json.example` to adopt it). If it's absent, tell the user how
|
|
16
|
-
to enable it and stop.
|
|
17
|
-
|
|
18
|
-
## 1. Identify the target spec
|
|
19
|
-
|
|
20
|
-
- Use the spec named as an argument, else the spec **currently in context**. If
|
|
21
|
-
neither is clear, ask which spec.
|
|
22
|
-
|
|
23
|
-
## 2. Plan the environment
|
|
24
|
-
|
|
25
|
-
Run the engine — it allocates the slot (idempotent), persists the registry, and
|
|
26
|
-
**prints** the plan (worktree path, branch, project name, port block, the exact
|
|
27
|
-
commands, the `.env` contents, and the opener):
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
skitterspec spec-env up <spec>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
If it reports the feature isn't enabled, relay that and stop — do not hand-roll a
|
|
34
|
-
worktree/stack.
|
|
35
|
-
|
|
36
|
-
## 3. Execute the printed side effects
|
|
37
|
-
|
|
38
|
-
Run the printed commands **in order**, exactly as printed:
|
|
39
|
-
|
|
40
|
-
1. **`git worktree add …`** — creates the sibling worktree on its branch. It is a
|
|
41
|
-
**sibling** of this checkout, **never nested** inside it. If the worktree
|
|
42
|
-
already exists, the engine prints the *attach* form (no `-b`) — do not clobber
|
|
43
|
-
an existing worktree/branch.
|
|
44
|
-
2. **Write the `.env`** — write the printed `.env` contents into the new
|
|
45
|
-
worktree's env file (default `.env`). Do this *after* the worktree exists.
|
|
46
|
-
3. **`docker compose … up -d`** — only printed when Docker is enabled. Brings the
|
|
47
|
-
namespaced stack up in the spec's reserved port block.
|
|
48
|
-
4. **Opener** — if an `open.command` line was printed, run it (e.g. opens the
|
|
49
|
-
worktree in your editor/terminal). Skipped silently when unset.
|
|
50
|
-
5. **Trust the worktree root for this session** — the engine already wrote the
|
|
51
|
-
printed `trusted:` root into `.claude/settings.local.json` (gitignored, so it
|
|
52
|
-
persists for future sessions). That file likely won't hot-reload mid-session,
|
|
53
|
-
so also run `/add-dir <trusted root>` now to lift `Edit`/`Write` prompts for
|
|
54
|
-
the **current** session. (If the engine printed a `trusted: ! …` warning,
|
|
55
|
-
`settings.local.json` isn't valid JSON — fix it, then re-run.)
|
|
56
|
-
|
|
57
|
-
## 4. Report
|
|
58
|
-
|
|
59
|
-
Echo the summary: worktree path, branch, project name, the allocated slot + port
|
|
60
|
-
block, and whether the stack was brought up. **Idempotent** — re-running attaches
|
|
61
|
-
to the existing slot/worktree and never reallocates.
|
|
62
|
-
|
|
63
|
-
Tear down later with `/spec-env-down <spec>`.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: spec-env-down
|
|
3
|
-
description: Tear down a spec's isolated environment — stop and remove its namespaced Docker stack (optionally backing up + dropping volumes), remove its git worktree, and free its slot. Guards refuse teardown on a dirty or unpushed worktree unless --force. Runs `skitterspec spec-env down` and executes the printed commands. Opt-in — needs specs/.core/env.config.json. Use when the user says "/spec-env-down", "tear down <spec>'s environment", "clean up the worktree/stack for <spec>", or "reclaim <spec>'s slot".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /spec-env-down — tear down a spec's isolated environment
|
|
7
|
-
|
|
8
|
-
Reverse `/spec-env`: stop + remove the spec's Docker stack, remove its git
|
|
9
|
-
worktree, and free its slot so the ports/slot are reclaimed. **Volumes are the
|
|
10
|
-
only destructive part** — dropped by default (to reclaim disk) unless
|
|
11
|
-
`--keep-volumes`, and always backed up first when `docker.backupCommand` is set.
|
|
12
|
-
|
|
13
|
-
Opt-in: only works when `specs/.core/env.config.json` exists. If absent, say so
|
|
14
|
-
and stop.
|
|
15
|
-
|
|
16
|
-
## 1. Identify the target spec
|
|
17
|
-
|
|
18
|
-
- Use the spec named as an argument, else the spec **currently in context**. If
|
|
19
|
-
neither is clear, ask which spec.
|
|
20
|
-
|
|
21
|
-
## 2. Plan the teardown
|
|
22
|
-
|
|
23
|
-
Run the engine — it checks the guards, frees the slot, and **prints** the plan:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
skitterspec spec-env down <spec> [--keep-volumes] [--force]
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
- **`--keep-volumes`** — keep the stack's data (plain `down`, no backup, no drop).
|
|
30
|
-
- **`--force`** — override the guards below.
|
|
31
|
-
|
|
32
|
-
## 3. Handle a guard block
|
|
33
|
-
|
|
34
|
-
If the CLI reports **blocked** (the worktree has uncommitted changes, or unpushed
|
|
35
|
-
commits that aren't yet merged into the base branch), **relay the reason and
|
|
36
|
-
stop** — do not destroy unreviewed work. Offer the user `--force` (and suggest
|
|
37
|
-
committing/pushing first). Only re-run with `--force` when the user explicitly
|
|
38
|
-
asks. **A branch already merged into the base needs no `--force`** — the unpushed
|
|
39
|
-
guard treats "landed on base" as safe, so a completed spec (post-`/spec-complete`
|
|
40
|
-
integrate) tears down cleanly even with no remote.
|
|
41
|
-
|
|
42
|
-
## 4. Execute the printed side effects
|
|
43
|
-
|
|
44
|
-
When not blocked, run the printed commands **in order**, exactly as printed:
|
|
45
|
-
|
|
46
|
-
1. **Backup** (only when a `docker.backupCommand` is configured and volumes are
|
|
47
|
-
being dropped) — writes a dump under `.spec-env/backups/` before anything is
|
|
48
|
-
destroyed.
|
|
49
|
-
2. **`docker compose … down`** — with `--volumes` unless `--keep-volumes`.
|
|
50
|
-
3. **`git worktree remove …`** — removes the sibling worktree.
|
|
51
|
-
4. **`git branch -d <branch>`** — deletes the spec's branch (freed by the worktree
|
|
52
|
-
removal above). It's `-d` (merged-only), never `-D`: if it reports the branch
|
|
53
|
-
isn't fully merged, **relay that and stop** — don't `-D` it. That only happens
|
|
54
|
-
on a `--force` teardown of unmerged work; the user can delete it by hand if
|
|
55
|
-
they're sure.
|
|
56
|
-
|
|
57
|
-
The slot is already freed by the CLI.
|
|
58
|
-
|
|
59
|
-
## 5. Report
|
|
60
|
-
|
|
61
|
-
Confirm what happened: worktree removed, branch deleted, containers down, volumes
|
|
62
|
-
**dropped|kept**, slot freed, and the backup path (if any). If a `git branch -d`
|
|
63
|
-
was refused (unmerged), say so. If the spec wasn't provisioned / was already torn
|
|
64
|
-
down, the CLI reports a clean **no-op** — relay that; it's not an error.
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
- Optionally add a **Changelog** note if grooming changed anything substantive.
|
|
46
|
-
|
|
47
|
-
## 4. Report
|
|
48
|
-
|
|
49
|
-
Confirm it's Ready and note it stays in `backlog` until `/spec-go` picks it up.
|
|
50
|
-
If you blocked it, list exactly what needs resolving first.
|