@skitterbyte/skitterspec 23.23.3 → 23.24.1
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/README.md +32 -0
- package/assets/claude-md-section.md +4 -0
- package/assets/core/env.config.json.example +5 -0
- package/assets/core/env.config.md +20 -1
- package/assets/hooks/run-compact.cjs +162 -0
- package/assets/review/page.html +122 -2
- package/assets/rules/spec-format.md +6 -0
- package/assets/rules/spec-planning.md +9 -0
- package/assets/rules/spec-reports.md +5 -0
- package/assets/skills/spec/SKILL.md +11 -1
- package/assets/skills/spec-complete/SKILL.md +9 -0
- package/assets/skills/spec-diff/SKILL.md +24 -0
- package/assets/skills/spec-idea/SKILL.md +6 -0
- package/assets/skills/spec-next/SKILL.md +18 -1
- package/assets/skills/spec-next/autonomous.md +126 -0
- package/assets/skills/spec-reviewed/SKILL.md +2 -1
- package/assets/skills/spec-start/SKILL.md +8 -0
- package/assets/skills/spec-start/isolation.md +1 -1
- package/bin/skitterspec.js +11 -1
- package/package.json +1 -1
- package/src/cli.js +271 -4
- package/src/env/classify.js +61 -6
- package/src/env/config.js +18 -0
- package/src/env/epic.js +1 -1
- package/src/env/epicpage.js +1 -1
- package/src/env/hooks.js +44 -20
- package/src/env/report.js +192 -0
- package/src/env/resolve.js +6 -1
- package/src/env/review.js +14 -2
- package/src/env/run.js +226 -0
- package/src/env/runpage.js +229 -0
- package/src/env/serve.js +50 -6
- package/src/ideacmd.js +5 -2
- package/src/provider.js +46 -1
package/README.md
CHANGED
|
@@ -170,6 +170,30 @@ that file changes again, announced rather than silent.
|
|
|
170
170
|
**The marks are information, never a gate**:
|
|
171
171
|
nothing counts them, and the verdict is the one thing you choose, once.
|
|
172
172
|
|
|
173
|
+
### Or let it run start to finish
|
|
174
|
+
|
|
175
|
+
`/spec-start <name> --auto` (or `> **Run:** auto` on the spec, or
|
|
176
|
+
`auto.default: "auto"` in `env.config.json`) builds every phase without waiting
|
|
177
|
+
for a verdict. Each phase is committed and its page kept as a read-only
|
|
178
|
+
snapshot, listed as they land on the run index at `<spec>/run`. The run stops
|
|
179
|
+
and waits for you on red tests after `auto.maxFixAttempts` tries, a
|
|
180
|
+
`Blocked on:` line, steps only a person can do, or a decision the spec left
|
|
181
|
+
open; `Commit & Continue` on that page resumes it. It ends as `auto.then` or
|
|
182
|
+
`--then` says:
|
|
183
|
+
|
|
184
|
+
- **`pause`**: one final page with every phase's follow-ups and notes above the
|
|
185
|
+
whole-branch diff, offering `Complete`, `Push branch` and `Open PR`
|
|
186
|
+
- **`push`**: push the branch, spec still in flight
|
|
187
|
+
- **`pr`**: `/spec-complete`'s PR run, with each phase's commit in the PR body
|
|
188
|
+
|
|
189
|
+
Naming `push` or `pr` is the push consent for that run. A push notification
|
|
190
|
+
says when it finished or stopped, and a `PreCompact` hook records how often the
|
|
191
|
+
context compacted. `--supervised` on any command turns it back off.
|
|
192
|
+
|
|
193
|
+
**Every page carries its report.** Supervised or not, the table a phase ends
|
|
194
|
+
with in the terminal (Built, Tests, Notes, Follow-ups) is on that phase's page
|
|
195
|
+
too.
|
|
196
|
+
|
|
173
197
|
### A phase that ended owes an answer
|
|
174
198
|
|
|
175
199
|
The **gate** is armed when a phase ends and its page is rendered, and exactly two
|
|
@@ -221,6 +245,14 @@ All optional, in `specs/.core/env.config.json`:
|
|
|
221
245
|
| `review.servePort` | derived | the port, normally derived from the repo's path |
|
|
222
246
|
| `review.reviewers` | `[]` | external code reviewers whose findings render as checks. Empty by default — adding one sends the worktree's diff to whatever the command talks to |
|
|
223
247
|
|
|
248
|
+
Autonomous runs read three more keys, also optional:
|
|
249
|
+
|
|
250
|
+
| Key | Default | Does |
|
|
251
|
+
|-----|---------|------|
|
|
252
|
+
| `auto.default` | `"supervised"` | `"auto"` builds every phase to the end; a spec's `Run:` header and `--auto` / `--supervised` override it |
|
|
253
|
+
| `auto.then` | `"pause"` | how an autonomous run ends: `"pause"`, `"push"` or `"pr"`. `--then` overrides it |
|
|
254
|
+
| `auto.maxFixAttempts` | `3` | tries at a red phase before the run stops and waits |
|
|
255
|
+
|
|
224
256
|
**`review.reviewers` is a seam, not a vendor.** An entry is either
|
|
225
257
|
`{ "use": "<adapter>" }` for one skitterspec bundles, or
|
|
226
258
|
`{ "name": "…", "command": "…", "format": "rdjsonl" }` for anything that prints
|
|
@@ -12,6 +12,10 @@ the day and plan the next one across projects.
|
|
|
12
12
|
Mark it up and press a verdict. `/spec-next` waits for that press, and a phase
|
|
13
13
|
that ended owes one before the next is built. A newly written spec's page
|
|
14
14
|
offers `Commit & Start` (`commit-start`).
|
|
15
|
+
- **Or let it run**: `--auto` on `/spec-start` or `/spec-next` (or
|
|
16
|
+
`> **Run:** auto`, or `auto.default` in `env.config.json`) builds every
|
|
17
|
+
phase without stopping, keeps each phase's page, and ends as `--then` says:
|
|
18
|
+
`pause`, `push` or `pr`.
|
|
15
19
|
- **Every skill ends with the same report block**: a verdict, a table, and
|
|
16
20
|
`Next`.
|
|
17
21
|
- **Guards**: work never happens in the primary checkout on the base branch,
|
|
@@ -5,7 +5,7 @@ stack + host dev servers + a front-door proxy per in-progress spec).
|
|
|
5
5
|
Provisioning is folded into `/spec-start`, teardown into `/spec-complete` ·
|
|
6
6
|
`/spec-cancel`, traffic diversion is `/spec-connect`, and reading a spec's diff
|
|
7
7
|
is `/spec-diff`; the `skitterspec spec-env
|
|
8
|
-
<up|bootstrap|nospec|main|project|down|prune|dev|connect|integrate|disposition|handoff|hotfix|live|review|stage|checks|status|resolve|resume|base>` CLI is
|
|
8
|
+
<up|bootstrap|nospec|main|project|down|prune|dev|connect|integrate|disposition|handoff|hotfix|live|review|stage|checks|status|resolve|resume|run|base>` CLI is
|
|
9
9
|
the engine beneath them.
|
|
10
10
|
|
|
11
11
|
**Once this file is present, isolation is the default policy:** `/spec-start` gives
|
|
@@ -427,6 +427,25 @@ through to a documented conservative default; see the field notes below.
|
|
|
427
427
|
"deleteRemoteBranch": "prompt"
|
|
428
428
|
},
|
|
429
429
|
|
|
430
|
+
// Autonomous runs (`spec-env run`, `/spec-next --auto`). A spec builds every
|
|
431
|
+
// phase to the end, committing each and keeping each phase's page as a
|
|
432
|
+
// snapshot, instead of stopping on every phase for a verdict.
|
|
433
|
+
// default: "supervised" (stop per phase, as always) or "auto". A spec's
|
|
434
|
+
// `> **Run:**` header overrides it, and `--auto` / `--supervised`
|
|
435
|
+
// on the command override both.
|
|
436
|
+
// then: how an autonomous run ends — "pause" (one final page that
|
|
437
|
+
// waits: Complete · Push branch · Open PR), "push" (push the
|
|
438
|
+
// branch) or "pr" (`/spec-complete`'s PR run). Setting push or pr
|
|
439
|
+
// here IS the push consent for runs that take it. `--then`
|
|
440
|
+
// overrides it.
|
|
441
|
+
// maxFixAttempts: tries at a red phase before the run stops and waits.
|
|
442
|
+
// An unrecognised value falls back to its default, never to "auto".
|
|
443
|
+
"auto": {
|
|
444
|
+
"default": "supervised",
|
|
445
|
+
"then": "pause",
|
|
446
|
+
"maxFixAttempts": 3
|
|
447
|
+
},
|
|
448
|
+
|
|
430
449
|
// Live overlay (`spec-env live` / `/spec-live`): test a spec on the already-
|
|
431
450
|
// running dev server by checking its branch out in the primary checkout.
|
|
432
451
|
// `migrations` is a list of globs (`**`, `*`, `?`) marking migration files; a
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Run compaction — the harness half of feat-autonomous-run's context record.
|
|
6
|
+
*
|
|
7
|
+
* An autonomous run builds every phase in one session, and nothing lets the
|
|
8
|
+
* agent read its own context usage — so instead of a "pause at N%" that could
|
|
9
|
+
* not be built honestly, a compaction is made SAFE (each phase re-reads the
|
|
10
|
+
* spec and git) and VISIBLE: this `PreCompact` hook tells the engine, which
|
|
11
|
+
* notes it against the phase being built, and the run's final report says
|
|
12
|
+
* "compacted 2×, during phases 3 and 5".
|
|
13
|
+
*
|
|
14
|
+
* THIS SCRIPT DECIDES NOTHING, and it can never stop a compaction. It hands
|
|
15
|
+
* the session's directory to `spec-env run compacted`, which writes only when
|
|
16
|
+
* a run is active there and is silent on every cannot-tell. No engine, an
|
|
17
|
+
* unreadable payload, no run, a crash of its own — every path exits 0 and
|
|
18
|
+
* prints nothing, because a compaction hook that speaks or fails would be
|
|
19
|
+
* noise on every session that is not an autonomous run, which is nearly all
|
|
20
|
+
* of them.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const fs = require('node:fs')
|
|
24
|
+
const path = require('node:path')
|
|
25
|
+
const { spawnSync } = require('node:child_process')
|
|
26
|
+
|
|
27
|
+
function done() {
|
|
28
|
+
process.exit(0)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function readPayload() {
|
|
32
|
+
try {
|
|
33
|
+
const parsed = JSON.parse(fs.readFileSync(0, 'utf8'))
|
|
34
|
+
return parsed && typeof parsed === 'object' ? parsed : null
|
|
35
|
+
} catch {
|
|
36
|
+
return null
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Where the engine is, in the order most likely to be right. Pure but for the
|
|
42
|
+
* existence check.
|
|
43
|
+
*
|
|
44
|
+
* A hook process does not inherit a package manager's `node_modules/.bin` on
|
|
45
|
+
* PATH, so the local install is looked for by path first — walking up from the
|
|
46
|
+
* project, because a git worktree's checkout has its own `node_modules`. PATH
|
|
47
|
+
* is the fallback for a global install, and `SKITTERSPEC_BIN` overrides
|
|
48
|
+
* everything for anyone whose layout is neither.
|
|
49
|
+
*/
|
|
50
|
+
const ENGINES = ['skitterspec', 'skitterspec-linear', 'skitterspec-jira', 'skitterspec-github', 'skitterspec-azure-boards']
|
|
51
|
+
|
|
52
|
+
function findEngine(projectDir, platform = process.platform) {
|
|
53
|
+
return locateEngine(projectDir, platform).engine
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* `findEngine`, plus the directories it walked up from — which is what a hook
|
|
58
|
+
* names when nothing answered.
|
|
59
|
+
*
|
|
60
|
+
* A GIT WORKTREE IS A SIBLING OF ITS PRIMARY CHECKOUT, not a child of it
|
|
61
|
+
* (`worktree.root` is `../{repo}-wt`), so walking up from one never reaches the
|
|
62
|
+
* primary's `node_modules`. A `--docs` worktree has none of its own, so the
|
|
63
|
+
* primary checkout is asked for second — found through git, never guessed from
|
|
64
|
+
* the folder layout.
|
|
65
|
+
*/
|
|
66
|
+
function locateEngine(projectDir, platform = process.platform) {
|
|
67
|
+
if (process.env.SKITTERSPEC_BIN) return { engine: process.env.SKITTERSPEC_BIN, tried: [] }
|
|
68
|
+
const tried = [projectDir]
|
|
69
|
+
const local = walkUp(projectDir, platform)
|
|
70
|
+
if (local) return { engine: local, tried }
|
|
71
|
+
const primary = primaryCheckoutDir(projectDir)
|
|
72
|
+
if (primary) {
|
|
73
|
+
tried.push(primary)
|
|
74
|
+
const found = walkUp(primary, platform)
|
|
75
|
+
if (found) return { engine: found, tried }
|
|
76
|
+
}
|
|
77
|
+
return { engine: 'skitterspec', tried }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Where `projectDir` sits in the checkout its worktree was added from, or null
|
|
82
|
+
* when it is not in a linked worktree.
|
|
83
|
+
*
|
|
84
|
+
* WHAT WOULD FOOL THIS: a git directory kept somewhere else
|
|
85
|
+
* (`--separate-git-dir`, a submodule's `.git/modules/<name>`). Its parent then
|
|
86
|
+
* holds no `node_modules`, so the lookup finds nothing and falls through to
|
|
87
|
+
* PATH exactly as it did before — a wasted look, never a wrong engine.
|
|
88
|
+
*/
|
|
89
|
+
function primaryCheckoutDir(projectDir) {
|
|
90
|
+
const r = spawnSync('git', ['rev-parse', '--show-toplevel', '--git-common-dir'], {
|
|
91
|
+
cwd: projectDir,
|
|
92
|
+
encoding: 'utf8',
|
|
93
|
+
timeout: 2000,
|
|
94
|
+
})
|
|
95
|
+
if (r.error || r.status !== 0) return null
|
|
96
|
+
const [top, common] = (r.stdout || '').split(/\r?\n/)
|
|
97
|
+
if (!top || !common) return null
|
|
98
|
+
const primary = path.dirname(path.resolve(projectDir, common))
|
|
99
|
+
if (path.resolve(primary) === path.resolve(top)) return null
|
|
100
|
+
// A project in a subfolder of its repo has the same subfolder in the primary.
|
|
101
|
+
// A path that will not map (a symlinked spelling of the same tree) is asked
|
|
102
|
+
// about at the primary's root instead.
|
|
103
|
+
const rel = path.relative(top, projectDir)
|
|
104
|
+
return rel && !rel.startsWith('..') && !path.isAbsolute(rel) ? path.join(primary, rel) : primary
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function walkUp(start, platform) {
|
|
108
|
+
let at = start
|
|
109
|
+
for (let i = 0; i < 6 && at; i++) {
|
|
110
|
+
for (const name of ENGINES) {
|
|
111
|
+
// ON WINDOWS, THE PACKAGE'S OWN JS ENTRY, never `.bin/<name>`. That is a
|
|
112
|
+
// shell shim nothing here can execute (spawn refuses it: EFTYPE), and the
|
|
113
|
+
// `.cmd` beside it needs a shell — which a hook handing a tool's command
|
|
114
|
+
// line over as an argument must never use. Unreachable, the hook failed
|
|
115
|
+
// open, and every guard was silently off on Windows (chore-windows-ci).
|
|
116
|
+
const candidate =
|
|
117
|
+
platform === 'win32'
|
|
118
|
+
? path.join(at, 'node_modules', '@skitterbyte', name, 'bin', `${name}.js`)
|
|
119
|
+
: path.join(at, 'node_modules', '.bin', name)
|
|
120
|
+
if (fs.existsSync(candidate)) return candidate
|
|
121
|
+
}
|
|
122
|
+
const up = path.dirname(at)
|
|
123
|
+
if (up === at) break
|
|
124
|
+
at = up
|
|
125
|
+
}
|
|
126
|
+
return null
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// How to run what `findEngine` found: a `.js` engine through this node, since
|
|
130
|
+
// Windows cannot execute one directly — anything else as itself, as before.
|
|
131
|
+
function engineCommand(projectDir, platform = process.platform) {
|
|
132
|
+
const { engine, tried } = locateEngine(projectDir, platform)
|
|
133
|
+
const command = /\.[cm]?js$/i.test(engine) ? { file: process.execPath, args: [engine] } : { file: engine, args: [] }
|
|
134
|
+
return Object.defineProperty(command, 'tried', { value: tried })
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function main() {
|
|
138
|
+
const payload = readPayload()
|
|
139
|
+
if (!payload) done()
|
|
140
|
+
// Only a compaction. A hook reached on some other event stays inert.
|
|
141
|
+
if (payload.hook_event_name && payload.hook_event_name !== 'PreCompact') done()
|
|
142
|
+
const cwd = typeof payload.cwd === 'string' && payload.cwd ? payload.cwd : process.cwd()
|
|
143
|
+
const engine = engineCommand(cwd)
|
|
144
|
+
// Output discarded on purpose: the record is the engine's, and the session
|
|
145
|
+
// that is compacting has nothing to act on.
|
|
146
|
+
spawnSync(engine.file, [...engine.args, 'spec-env', 'run', 'compacted', '--dir', cwd], {
|
|
147
|
+
cwd,
|
|
148
|
+
encoding: 'utf8',
|
|
149
|
+
timeout: 8000,
|
|
150
|
+
})
|
|
151
|
+
done()
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (require.main === module) {
|
|
155
|
+
try {
|
|
156
|
+
main()
|
|
157
|
+
} catch {
|
|
158
|
+
done()
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
module.exports = { findEngine, locateEngine, engineCommand }
|
package/assets/review/page.html
CHANGED
|
@@ -315,6 +315,24 @@ tr.band button { font-size: .72rem; padding: .1rem .5rem; margin-right: .3rem; }
|
|
|
315
315
|
margin: 0 0 1rem;
|
|
316
316
|
}
|
|
317
317
|
.review-summary { margin: 0; }
|
|
318
|
+
/* The phase report — the terminal block's table, kept on the page. */
|
|
319
|
+
.report {
|
|
320
|
+
border: 1px solid var(--line);
|
|
321
|
+
border-radius: 10px;
|
|
322
|
+
background: var(--panel);
|
|
323
|
+
padding: .8rem 1rem;
|
|
324
|
+
margin: 0 0 1rem;
|
|
325
|
+
}
|
|
326
|
+
.report-heading { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
|
|
327
|
+
.report-title { margin: 0 0 .6rem; }
|
|
328
|
+
.report-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
|
|
329
|
+
.report-table th { text-align: left; vertical-align: top; white-space: nowrap; padding: .3rem .8rem .3rem 0; color: var(--muted); font-weight: 600; }
|
|
330
|
+
.report-table td { padding: .3rem 0; overflow-wrap: anywhere; }
|
|
331
|
+
.report-table tr + tr { border-top: 1px solid var(--line); }
|
|
332
|
+
/* The final page's aggregate: every phase's follow-ups and notes, in order. */
|
|
333
|
+
.run-items { margin: 0 0 .6rem; padding-left: 1.1rem; font-size: .88rem; }
|
|
334
|
+
.run-items li { margin: .2rem 0; overflow-wrap: anywhere; }
|
|
335
|
+
.run-phase { color: var(--muted); font-size: .8rem; margin-right: .3rem; }
|
|
318
336
|
.checks { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .4rem; }
|
|
319
337
|
.check {
|
|
320
338
|
display: grid;
|
|
@@ -692,6 +710,13 @@ button:disabled:hover { color: var(--muted); border-color: var(--line); }
|
|
|
692
710
|
/* The disclosure is a CONTROL, not a panel. Full-width and boxed, it read as a
|
|
693
711
|
section header that happened to be clickable. */
|
|
694
712
|
.context-more { margin: .9rem 0 0; }
|
|
713
|
+
/* How far through the spec this is: a line, then a thin bar for phases done.
|
|
714
|
+
Theme tokens only, so it follows light and dark; the width is the bar's
|
|
715
|
+
container's, so it narrows with the page on a phone. */
|
|
716
|
+
.progress { margin: .35rem 0 .6rem; max-width: 28rem; }
|
|
717
|
+
.progress-text { font-size: .85rem; color: var(--muted); }
|
|
718
|
+
.progress-track { height: 4px; margin-top: .3rem; border-radius: 999px; background: var(--line); overflow: hidden; }
|
|
719
|
+
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); }
|
|
695
720
|
.context-more > summary {
|
|
696
721
|
display: inline-block;
|
|
697
722
|
width: auto;
|
|
@@ -718,6 +743,13 @@ button:disabled:hover { color: var(--muted); border-color: var(--line); }
|
|
|
718
743
|
white-space: nowrap;
|
|
719
744
|
}
|
|
720
745
|
a.ticket:hover { border-color: var(--accent); }
|
|
746
|
+
/* The product shares the title line with the ticket: one tracker project can
|
|
747
|
+
hold several, and the reader needs to know whose work this is. */
|
|
748
|
+
.product {
|
|
749
|
+
font-size: .62em; font-weight: 600; vertical-align: middle;
|
|
750
|
+
color: var(--muted); padding: .12em .45em; border: 1px dashed var(--line);
|
|
751
|
+
border-radius: 999px; white-space: nowrap;
|
|
752
|
+
}
|
|
721
753
|
.context-more > summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-top: .6rem; }
|
|
722
754
|
.copy-hint { font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
|
|
723
755
|
.sent-cmd { display: flex; gap: .4rem; align-items: stretch; margin: .4rem 0 0; }
|
|
@@ -837,6 +869,7 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
837
869
|
<p class="eyebrow" id="project" hidden></p>
|
|
838
870
|
<h1 id="title"></h1>
|
|
839
871
|
<p class="sub" id="sub"></p>
|
|
872
|
+
<div class="progress" id="progress" hidden></div>
|
|
840
873
|
<div class="controls">
|
|
841
874
|
<button id="expand-all" type="button">Show all context</button>
|
|
842
875
|
<button id="collapse-all" type="button">Collapse context</button>
|
|
@@ -949,6 +982,12 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
949
982
|
context-dependent reading of "Commit", because one of those two
|
|
950
983
|
readings destroys a worktree. -->
|
|
951
984
|
<button id="verdict-commit-land" class="v-commit" type="button" hidden>✓ Commit & Land</button>
|
|
985
|
+
<!-- THE FINAL PAGE'S ENDINGS (feat-autonomous-run), hidden unless the
|
|
986
|
+
render asked for the `final` set. Every phase is already committed,
|
|
987
|
+
so each names what happens to the finished branch. -->
|
|
988
|
+
<button id="verdict-complete" class="v-commit" type="button" hidden>✓ Complete</button>
|
|
989
|
+
<button id="verdict-push" class="v-commit" type="button" hidden>↑ Push branch</button>
|
|
990
|
+
<button id="verdict-pr" class="v-commit" type="button" hidden>↑ Open PR</button>
|
|
952
991
|
<button id="verdict-changes" class="v-changes" type="button">↺ Request changes</button>
|
|
953
992
|
<button id="verdict-discuss" type="button">… Discuss first</button>
|
|
954
993
|
<span class="verdict-count" id="verdict-count" aria-live="polite"></span>
|
|
@@ -1920,6 +1959,9 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
1920
1959
|
'commit-continue': document.getElementById('verdict-commit-continue'),
|
|
1921
1960
|
'commit-start': document.getElementById('verdict-commit-start'),
|
|
1922
1961
|
'commit-land': document.getElementById('verdict-commit-land'),
|
|
1962
|
+
complete: document.getElementById('verdict-complete'),
|
|
1963
|
+
push: document.getElementById('verdict-push'),
|
|
1964
|
+
pr: document.getElementById('verdict-pr'),
|
|
1923
1965
|
continue: document.getElementById('verdict-continue'),
|
|
1924
1966
|
changes: document.getElementById('verdict-changes'),
|
|
1925
1967
|
discuss: document.getElementById('verdict-discuss'),
|
|
@@ -1927,7 +1969,7 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
1927
1969
|
// The committing pair, named once. A fifth verdict that commits is added
|
|
1928
1970
|
// here, and the shared block below follows for free — the same reason the
|
|
1929
1971
|
// engine keeps a `COMMITTING` list rather than a second condition.
|
|
1930
|
-
var COMMITTERS = ['commit', 'commit-continue', 'commit-start', 'commit-land']
|
|
1972
|
+
var COMMITTERS = ['commit', 'commit-continue', 'commit-start', 'commit-land', 'complete', 'push', 'pr']
|
|
1931
1973
|
|
|
1932
1974
|
/*
|
|
1933
1975
|
* WHICH BUTTONS THIS PAGE OFFERS, and it comes from the render rather than
|
|
@@ -1955,11 +1997,25 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
1955
1997
|
// because `Commit & Continue` names a next phase a spec with no phase files
|
|
1956
1998
|
// does not have. Same three buttons as `refresh`, a different subject.
|
|
1957
1999
|
fix: ['commit', 'changes', 'discuss'],
|
|
2000
|
+
// A KEPT PHASE of an autonomous run: the run committed it and carried on,
|
|
2001
|
+
// so there is nothing to decide here — it is read, not answered.
|
|
2002
|
+
snapshot: [],
|
|
2003
|
+
// THE PAGE AN AUTONOMOUS RUN ENDS ON: every phase committed, so the
|
|
2004
|
+
// choice left is what happens to the branch.
|
|
2005
|
+
final: ['complete', 'push', 'pr', 'changes', 'discuss'],
|
|
1958
2006
|
}
|
|
1959
2007
|
var OFFERED = OFFERS[data.buttons] || OFFERS.committing
|
|
1960
2008
|
Object.keys(verdictBtns).forEach(function (key) {
|
|
1961
|
-
|
|
2009
|
+
// A button the markup lacks is skipped, not a crash: an older or trimmed
|
|
2010
|
+
// template must still get a working page.
|
|
2011
|
+
if (verdictBtns[key]) verdictBtns[key].hidden = OFFERED.indexOf(key) === -1
|
|
1962
2012
|
})
|
|
2013
|
+
// NOTHING TO ANSWER, so no bar at all: a kept phase page offers no verdict,
|
|
2014
|
+
// and an empty bar would read as a page that forgot its buttons.
|
|
2015
|
+
if (!OFFERED.length) {
|
|
2016
|
+
var bar = document.getElementById('verdict')
|
|
2017
|
+
if (bar) bar.hidden = true
|
|
2018
|
+
}
|
|
1963
2019
|
|
|
1964
2020
|
// EVERY VERDICT, because this is the one place a verdict gets a reader-facing
|
|
1965
2021
|
// name: `refresh` relabels only the committing pair, but the decided panel
|
|
@@ -1971,6 +2027,9 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
1971
2027
|
'commit-continue': '✓ Commit & Continue',
|
|
1972
2028
|
'commit-start': '✓ Commit & Start',
|
|
1973
2029
|
'commit-land': '✓ Commit & Land',
|
|
2030
|
+
complete: '✓ Complete',
|
|
2031
|
+
push: '↑ Push branch',
|
|
2032
|
+
pr: '↑ Open PR',
|
|
1974
2033
|
continue: '→ Continue',
|
|
1975
2034
|
changes: '↺ Request changes',
|
|
1976
2035
|
discuss: '… Discuss first',
|
|
@@ -1990,6 +2049,9 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
1990
2049
|
// Says what it will NOT do, for the same reason: nothing is committed by
|
|
1991
2050
|
// this, so the work it resumes is still uncommitted afterwards.
|
|
1992
2051
|
continue: 'You have read it — carry on with the run; nothing is committed',
|
|
2052
|
+
complete: 'Finish the spec: verify, land on the base branch, and remove the worktree',
|
|
2053
|
+
push: 'Push the branch to the remote and stop; the spec stays in flight',
|
|
2054
|
+
pr: 'Push the branch and open a pull request listing each phase',
|
|
1993
2055
|
}
|
|
1994
2056
|
|
|
1995
2057
|
var verdictEl = document.getElementById('verdict')
|
|
@@ -2282,6 +2344,10 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
2282
2344
|
'commit-continue': 'committed, then carried on',
|
|
2283
2345
|
'commit-start': 'committed, then put in flight',
|
|
2284
2346
|
'commit-land': 'committed, landed, and torn down',
|
|
2347
|
+
complete: 'completed',
|
|
2348
|
+
push: 'pushed',
|
|
2349
|
+
pr: 'opened as a PR',
|
|
2350
|
+
'auto-commit': 'committed by the autonomous run',
|
|
2285
2351
|
continue: 'read it and carried on',
|
|
2286
2352
|
changes: 'changes requested',
|
|
2287
2353
|
discuss: 'discussed',
|
|
@@ -3273,6 +3339,17 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
3273
3339
|
titleEl.appendChild(document.createTextNode(' '))
|
|
3274
3340
|
titleEl.appendChild(node)
|
|
3275
3341
|
})()
|
|
3342
|
+
// The spec's product, beside the ticket. textContent: it comes from a spec file.
|
|
3343
|
+
;(function () {
|
|
3344
|
+
var product = data.context && data.context.product
|
|
3345
|
+
if (!product) return
|
|
3346
|
+
var node = document.createElement('span')
|
|
3347
|
+
node.className = 'product'
|
|
3348
|
+
node.title = 'Product'
|
|
3349
|
+
node.textContent = product
|
|
3350
|
+
titleEl.appendChild(document.createTextNode(' '))
|
|
3351
|
+
titleEl.appendChild(node)
|
|
3352
|
+
})()
|
|
3276
3353
|
|
|
3277
3354
|
/**
|
|
3278
3355
|
* An ISO timestamp is a machine's format. The header showed
|
|
@@ -3293,6 +3370,49 @@ a.ticket:hover { border-color: var(--accent); }
|
|
|
3293
3370
|
return iso
|
|
3294
3371
|
}
|
|
3295
3372
|
}
|
|
3373
|
+
/**
|
|
3374
|
+
* How far through the spec this page is, under the title: which phase out of
|
|
3375
|
+
* how many and that phase's ticked tasks, and a bar for phases done. Read off
|
|
3376
|
+
* `data.phases`, which the engine already sends.
|
|
3377
|
+
*
|
|
3378
|
+
* NOTHING when there are no phases to count — a legacy or single-pass spec
|
|
3379
|
+
* (`phases` null) or an epic (`total` 0). "0 of 0" would be the page
|
|
3380
|
+
* inventing progress for work that is not measured in phases.
|
|
3381
|
+
*/
|
|
3382
|
+
;(function () {
|
|
3383
|
+
var ph = data.phases
|
|
3384
|
+
if (!ph || !(ph.total > 0)) return
|
|
3385
|
+
var live = ph.live
|
|
3386
|
+
var text
|
|
3387
|
+
if (ph.done >= ph.total) {
|
|
3388
|
+
text = ph.total + ' of ' + ph.total + ' phases done'
|
|
3389
|
+
} else if (live && live.n) {
|
|
3390
|
+
text = 'Phase ' + live.n + ' of ' + ph.total
|
|
3391
|
+
var tasks = Array.isArray(live.tasks) ? live.tasks : []
|
|
3392
|
+
if (tasks.length) {
|
|
3393
|
+
var ticked = tasks.filter(function (k) { return k && k.done }).length
|
|
3394
|
+
text += ' \u00b7 ' + ticked + '/' + tasks.length + ' tasks'
|
|
3395
|
+
}
|
|
3396
|
+
} else if (!ph.done) {
|
|
3397
|
+
text = ph.total + ' phases \u00b7 none started'
|
|
3398
|
+
} else {
|
|
3399
|
+
text = ph.done + ' of ' + ph.total + ' phases done'
|
|
3400
|
+
}
|
|
3401
|
+
var box = document.getElementById('progress')
|
|
3402
|
+
box.appendChild(el('div', 'progress-text', text))
|
|
3403
|
+
var track = el('div', 'progress-track')
|
|
3404
|
+
var fill = el('div', 'progress-fill')
|
|
3405
|
+
var pct = Math.round((Math.min(ph.done, ph.total) / ph.total) * 100)
|
|
3406
|
+
fill.style.setProperty('width', pct + '%')
|
|
3407
|
+
track.setAttribute('role', 'progressbar')
|
|
3408
|
+
track.setAttribute('aria-valuemin', '0')
|
|
3409
|
+
track.setAttribute('aria-valuemax', String(ph.total))
|
|
3410
|
+
track.setAttribute('aria-valuenow', String(Math.min(ph.done, ph.total)))
|
|
3411
|
+
track.appendChild(fill)
|
|
3412
|
+
box.appendChild(track)
|
|
3413
|
+
box.hidden = false
|
|
3414
|
+
})()
|
|
3415
|
+
|
|
3296
3416
|
var t = data.totals
|
|
3297
3417
|
var sub = document.getElementById('sub')
|
|
3298
3418
|
function part(text, cls) { sub.appendChild(el('span', cls, text)) }
|
|
@@ -75,6 +75,12 @@ Each spec has one of seven kinds, recorded twice: in the header
|
|
|
75
75
|
the base branch.
|
|
76
76
|
- `> **Lanes:**`: on an epic, optional: how many members may be in flight at
|
|
77
77
|
once.
|
|
78
|
+
- `> **Product:**`: optional: the product the spec belongs to, where one
|
|
79
|
+
tracker project holds several. A key from the provider's config, which
|
|
80
|
+
decides what it means there (Azure Boards: `azure.products` maps it to an
|
|
81
|
+
area path).
|
|
82
|
+
- `> **Run:**`: optional: `auto` or `supervised`, only where the spec differs
|
|
83
|
+
from `auto.default` in `env.config.json`. A flag on the command overrides it.
|
|
78
84
|
- `> **Blocked on:**`: on a spec or a phase file: a wait outside the repo, in
|
|
79
85
|
free text, optionally with `(until YYYY-MM-DD)`. Only a person can judge it
|
|
80
86
|
met. `/spec-resume` clears it.
|
|
@@ -95,6 +95,15 @@ Read it when a skill sends you there.
|
|
|
95
95
|
`git commit` takes whatever someone else staged. `skitterspec spec-env stage`
|
|
96
96
|
splits the tree into this spec's documents and everything else.
|
|
97
97
|
|
|
98
|
+
## Autonomous runs
|
|
99
|
+
|
|
100
|
+
A spec can build every phase without stopping for a verdict: `--auto` on
|
|
101
|
+
`/spec-start` or `/spec-next`, a `> **Run:** auto` header, or `auto.default`
|
|
102
|
+
in `env.config.json`. Each phase is committed and its page kept as a snapshot.
|
|
103
|
+
The run stops for red tests, a blocker, manual steps or an open decision, and
|
|
104
|
+
ends as `auto.then` (or `--then`) says: `pause`, `push` or `pr`. The loop is
|
|
105
|
+
in `.claude/skills/spec-next/autonomous.md`.
|
|
106
|
+
|
|
98
107
|
## Ticketing provider (when one is installed)
|
|
99
108
|
|
|
100
109
|
The repo owns each spec's **content**. The tracker is a one-way generated
|
|
@@ -41,6 +41,11 @@ row:
|
|
|
41
41
|
waiting on a verdict. The banner, its tier stack and the wait are defined in
|
|
42
42
|
`.claude/skills/spec-diff/review-wait.md`. Read it before rendering one.
|
|
43
43
|
|
|
44
|
+
**An autonomous run reports once**, at its end or its stop, not per phase:
|
|
45
|
+
each phase's rows are already on its snapshot. Ending on `pause`, its banner's
|
|
46
|
+
exits are `Complete` lands it · `Push branch` · `Open PR` · `Request changes`
|
|
47
|
+
works them.
|
|
48
|
+
|
|
44
49
|
**Asking implies waiting.** A render that asks the reader for a verdict ends the
|
|
45
50
|
turn waiting for one, under the banner. A run that is not going to wait does not
|
|
46
51
|
ask: it reports the page in a `Review` row with the counts and the link, and no
|
|
@@ -104,7 +104,15 @@ not write the spec until this is resolved.
|
|
|
104
104
|
before building that phase, and `/spec-resume` is how it goes on. This
|
|
105
105
|
is free text, a condition only a person can judge, which is what sets it
|
|
106
106
|
apart from an epic member's `Waits on:`. With no such wait, write none.
|
|
107
|
-
12. **
|
|
107
|
+
12. **Run mode** *(only when `specs/.core/env.config.json` exists)*: should
|
|
108
|
+
this spec build autonomously, every phase committed with no stop for
|
|
109
|
+
review, or stop on every phase's page? Offer the project's `auto.default`
|
|
110
|
+
(supervised when unset) and ask only whether this spec differs. A
|
|
111
|
+
difference is written as `> **Run:** auto` or `> **Run:** supervised`.
|
|
112
|
+
Matching the default writes no line, so the config keeps deciding.
|
|
113
|
+
Recommend `supervised` for anything that touches data, auth or a public
|
|
114
|
+
surface.
|
|
115
|
+
13. **Open questions** — anything still undecided.
|
|
108
116
|
|
|
109
117
|
Stop grilling when there are no unresolved branches that would change the spec.
|
|
110
118
|
Briefly play back the agreed understanding before writing.
|
|
@@ -278,6 +286,8 @@ the codebase, link rather than duplicate):
|
|
|
278
286
|
> **Area:** <comma-separated files/modules this touches>
|
|
279
287
|
> **Stack:** <worktree — or "worktree + docker" if it touches the DB/stateful
|
|
280
288
|
> services; only acted on when isolation is enabled — see Phase A item 9>
|
|
289
|
+
> **Run:** <auto or supervised — only when it differs from the project's
|
|
290
|
+
> `auto.default` (Phase A item 12). Omit the line entirely otherwise>
|
|
281
291
|
> **Incident:** <incident-<name> — only when this spec is a fix for an open
|
|
282
292
|
> incident spec; the next push links the two as related on the tracker, and
|
|
283
293
|
> `/spec-complete` on the incident counts this spec among its fixes. Omit the
|
|
@@ -433,10 +433,19 @@ person happens before the ready, in this order:
|
|
|
433
433
|
merge?"* — the base branch is named so a spec that outlived a release roll
|
|
434
434
|
is caught by the person reading a stale rc name. On a no, stop with the
|
|
435
435
|
held commands relayed.
|
|
436
|
+
**An autonomous run that ends on `pr` has already consented**: the
|
|
437
|
+
operator named `pr` by flag, config or the final page's `Open PR` button.
|
|
438
|
+
Say the target in the report's `Landed` row instead of asking.
|
|
436
439
|
3. **Run the plan.** `skitterspec spec-env integrate <name> --push` and run
|
|
437
440
|
what it prints: fetch, rebase onto `<remote>/<base>`, the push, and the PR
|
|
438
441
|
create — or, where a draft already exists, the flip-to-ready. A rebase
|
|
439
442
|
conflict aborts and stops exactly as 6-feature/bug step 2.
|
|
443
|
+
**Where `skitterspec spec-env run status <name> --json` returns a record**,
|
|
444
|
+
the spec was built by an autonomous run. Add one line per phase to the PR
|
|
445
|
+
body: the phase number, its title from the phase index, and its commit from
|
|
446
|
+
the record. Use the host's PR-edit command (`gh pr edit <n> --body-file`,
|
|
447
|
+
or `az repos pr update --description`). The PR's commit list is already one
|
|
448
|
+
commit per phase, and this names them.
|
|
440
449
|
4. **Defer the finalise.** §4's bucket move follows the spec documents'
|
|
441
450
|
`land.specDocs` lane: under `trunk` leave the spec in `specs/in-progress/`
|
|
442
451
|
— run 2 moves it on base after the merge; under `branch` commit the move on
|
|
@@ -356,6 +356,30 @@ it — and the paste was the one place it broke. The *work* either authorises is
|
|
|
356
356
|
ordinary phase-sized cost, and step 3 is where the operator decides whether to
|
|
357
357
|
spend it.
|
|
358
358
|
|
|
359
|
+
### `complete`, `push`, `pr` — the final page of an autonomous run
|
|
360
|
+
|
|
361
|
+
These come only from the page an autonomous run ends on under `pause`
|
|
362
|
+
(`spec-next/autonomous.md`). Every phase is already committed, so there is
|
|
363
|
+
nothing to hand to `review.commitWith`. Each verdict names what happens to the
|
|
364
|
+
branch, and each one ends the run with
|
|
365
|
+
`skitterspec spec-env run end <spec> --outcome <verdict>` once it has acted:
|
|
366
|
+
|
|
367
|
+
- **`complete`**: carry on into **`/spec-complete`**, which verifies, lands
|
|
368
|
+
and tears down exactly as if typed.
|
|
369
|
+
- **`push`**: `skitterspec spec-env integrate <spec> --push`, and run what it
|
|
370
|
+
plans. The press is the push consent. The spec stays in flight.
|
|
371
|
+
- **`pr`**: carry on into **`/spec-complete`** under PR landing
|
|
372
|
+
(`--strategy pr` where `land.strategy` is not already `pr`). Its PR body lists
|
|
373
|
+
each phase with its commit.
|
|
374
|
+
|
|
375
|
+
A failure stops there, exactly as a failed commit ends `commit-continue`. Say
|
|
376
|
+
where it broke, and leave the run active so the page can be answered again.
|
|
377
|
+
|
|
378
|
+
**`commit-continue` on a phase where an autonomous run stopped resumes the run.**
|
|
379
|
+
`/spec-next` resolves the run record first, so it carries on in the
|
|
380
|
+
run's own mode and ending with nothing passed. That is the stop condition being
|
|
381
|
+
answered, not a new run.
|
|
382
|
+
|
|
359
383
|
## 2b. An action changes something, then hands the page back
|
|
360
384
|
|
|
361
385
|
Only on a pass carrying an **action**. Two of them, and
|
|
@@ -55,6 +55,12 @@ line becomes the title and the rest becomes the body:
|
|
|
55
55
|
skitterspec idea add "<text>" --json
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
When the reader names the product the idea belongs to, add
|
|
59
|
+
`--product <key>`. A tracker that files by product (Azure Boards'
|
|
60
|
+
`azure.products`) puts the idea in that product's area; the file store notes
|
|
61
|
+
it and records nothing. Never ask for one unprompted, because an idea is meant
|
|
62
|
+
to cost one step.
|
|
63
|
+
|
|
58
64
|
**Never push.** On the file store the engine commits onto the base branch and
|
|
59
65
|
prints the push instead of running it, because a push publishes the base
|
|
60
66
|
branch and that is always the operator's call.
|
|
@@ -16,6 +16,15 @@ flight — provisioning, moving it to `in-progress`, getting its branch here —
|
|
|
16
16
|
`/spec-start`'s job. Re-run this per phase until the spec is done, then
|
|
17
17
|
`/spec-complete`.
|
|
18
18
|
|
|
19
|
+
**Or let it run.** `--auto`, `--supervised` and `--then pause|push|pr` choose
|
|
20
|
+
whether this run stops on every phase's page or builds every phase to the
|
|
21
|
+
end. Once §1 has named the spec, ask the engine
|
|
22
|
+
(`skitterspec spec-env run resolve <spec> … --json`, passing only the flags
|
|
23
|
+
typed). On `mode: "auto"`, follow
|
|
24
|
+
[`autonomous.md`](autonomous.md) for the whole run. It reuses §2 to §4b
|
|
25
|
+
unchanged and replaces §5 and §6. On `supervised`, the default everywhere
|
|
26
|
+
nothing says otherwise, this file applies exactly as written.
|
|
27
|
+
|
|
19
28
|
## 1. Identify the spec in flight
|
|
20
29
|
|
|
21
30
|
**`--worktree <path>` answers before anything else.** When the invocation names a
|
|
@@ -399,9 +408,17 @@ the moment the page is about, so render it now — **after** the tests pass and
|
|
|
399
408
|
**before** the commit:
|
|
400
409
|
|
|
401
410
|
```
|
|
402
|
-
skitterspec spec-env review <spec> --run-reviewers
|
|
411
|
+
skitterspec spec-env review <spec> --run-reviewers --report <rows.json> --phase <n>
|
|
403
412
|
```
|
|
404
413
|
|
|
414
|
+
**`--report` puts this phase's report table on the page**, so its Notes and
|
|
415
|
+
Follow-ups are there for anyone who reads the page later, not only in this
|
|
416
|
+
terminal. Write the rows of the block §6 will end with, as JSON in a scratch
|
|
417
|
+
file: `{"title": "<verdict sentence>", "rows": [{"field": "Built", "value":
|
|
418
|
+
"…"}, …]}`, leaving out `Next` and `Review`, which only make sense here. An
|
|
419
|
+
empty `field` continues the row above. The engine orders, escapes and keeps
|
|
420
|
+
them per phase, and a bad file is reported and skipped, never a failed render.
|
|
421
|
+
|
|
405
422
|
**This is free.** It is the engine reading git and splicing text into a template;
|
|
406
423
|
the diff never passes through you, so a 266KB patch costs nothing. Report the
|
|
407
424
|
path it prints and move on.
|