chamba 0.6.1 → 0.8.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 +53 -14
- package/README.md +38 -11
- package/dist/commands/advanced.js +7 -278
- package/dist/commands/dev.js +11 -612
- package/dist/commands/doctor.js +1 -29
- package/dist/commands/menu.js +1 -80
- package/dist/commands/onboard.js +6 -230
- package/dist/commands/settings.js +15 -349
- package/dist/lib/agent-commands.js +2 -0
- package/dist/lib/agent-context.js +6 -184
- package/dist/lib/browser.js +1 -40
- package/dist/lib/chamba-yaml.js +10 -191
- package/dist/lib/constants.js +1 -125
- package/dist/lib/dockerfile-builder.js +41 -260
- package/dist/lib/env.js +2 -78
- package/dist/lib/git-env.js +1 -21
- package/dist/lib/global-config.js +4 -66
- package/dist/lib/pnpm-store.js +1 -19
- package/dist/lib/ports.js +1 -210
- package/dist/lib/safe-rm.js +1 -26
- package/dist/lib/sessions.js +2 -34
- package/dist/lib/shadows.js +1 -176
- package/dist/lib/skills.js +2 -0
- package/dist/lib/templates.js +1 -0
- package/dist/lib/webterm.js +1 -305
- package/dist/lib/workspace-identity.js +4 -260
- package/package.json +6 -6
- package/templates/Dockerfile +24 -12
- package/templates/claude-statusline.sh +5 -7
- package/templates/context/baseline.md +2 -0
- package/templates/pane-apps/client/assets/c-BNa-DeUl.json +3552 -0
- package/templates/pane-apps/client/assets/cpp-B-T4NRoH.json +20239 -0
- package/templates/pane-apps/client/assets/csharp-BbxHChhA.json +6010 -0
- package/templates/pane-apps/client/assets/css-CWCxuwmz.json +1860 -0
- package/templates/pane-apps/client/assets/diff-B-2N89g8.json +154 -0
- package/templates/pane-apps/client/assets/docker-DWTvYW26.json +103 -0
- package/templates/pane-apps/client/assets/files-D0nJgFAA.js +12 -0
- package/templates/pane-apps/client/assets/files-h0K1vZyQ.css +1 -0
- package/templates/pane-apps/client/assets/go-B2hyYeNg.json +3156 -0
- package/templates/pane-apps/client/assets/graphql-Z6Id2aNO.json +1292 -0
- package/templates/pane-apps/client/assets/html-BtzvlIfu.json +2627 -0
- package/templates/pane-apps/client/assets/ini-Bn3Twap1.json +108 -0
- package/templates/pane-apps/client/assets/java-C7t2dwLO.json +1885 -0
- package/templates/pane-apps/client/assets/javascript-DuC2v0C0.json +5996 -0
- package/templates/pane-apps/client/assets/json-CwdkWeV5.json +206 -0
- package/templates/pane-apps/client/assets/jsonc-MYWDbTU3.json +206 -0
- package/templates/pane-apps/client/assets/jsx-Cn8EZuIC.json +5996 -0
- package/templates/pane-apps/client/assets/kotlin-CFNOz1gw.json +580 -0
- package/templates/pane-apps/client/assets/make-BVnlFCcl.json +629 -0
- package/templates/pane-apps/client/assets/markdown-B4Xk2WM_.json +3263 -0
- package/templates/pane-apps/client/assets/php-CAQzQmmI.json +4188 -0
- package/templates/pane-apps/client/assets/python-CYQee8m4.json +4174 -0
- package/templates/pane-apps/client/assets/reviews-BsoGZ35r.css +1 -0
- package/templates/pane-apps/client/assets/reviews-iW0Mbn4e.js +153 -0
- package/templates/pane-apps/client/assets/ruby-D7R58tus.json +3114 -0
- package/templates/pane-apps/client/assets/rust-BFBbFiei.json +1103 -0
- package/templates/pane-apps/client/assets/scss-TQRhBkPG.json +1874 -0
- package/templates/pane-apps/client/assets/shellscript-DieAkC4W.json +2375 -0
- package/templates/pane-apps/client/assets/specs-D9z3neR-.js +13 -0
- package/templates/pane-apps/client/assets/sql-Bxd030LV.json +634 -0
- package/templates/pane-apps/client/assets/toml-ChrKGzsV.json +430 -0
- package/templates/pane-apps/client/assets/tsx-D2e90MFw.json +5996 -0
- package/templates/pane-apps/client/assets/typescript-DonXQ_n1.json +5747 -0
- package/templates/pane-apps/client/assets/xml-B17r2RXF.json +382 -0
- package/templates/pane-apps/client/assets/yaml-CKn4h1zy.json +627 -0
- package/templates/pane-apps/client/reviews/index.html +15 -0
- package/templates/pane-apps/client/specs/index.html +14 -0
- package/templates/pane-apps/server/reviews.mjs +20 -0
- package/templates/pane-apps/server/specs.mjs +5 -0
- package/templates/skills/chamba-statusline/SKILL.md +7 -19
- package/templates/skills/dx-review/SKILL.md +123 -0
- package/templates/skills/dx-review/references/acts.md +162 -0
- package/templates/skills/dx-spec/SKILL.md +561 -0
- package/templates/skills/dx-spec/references/imagination-guide.md +140 -0
- package/templates/skills/dx-spec/references/principles-template.md +2 -0
- package/templates/skills/dx-spec/references/review-guide.md +127 -0
- package/templates/skills/dx-spec/references/spec-guide.md +145 -0
- package/templates/skills/dx-spec/references/stages.md +484 -0
- package/templates/skills/dx-spec-execute/SKILL.md +437 -0
- package/templates/startup.mjs +10 -4
- package/templates/tool-helper.sh +166 -0
- package/templates/webterm/README.md +79 -9
- package/templates/webterm/color.js +61 -0
- package/templates/webterm/config.js +74 -0
- package/templates/webterm/context/claude.md +0 -1
- package/templates/webterm/public/app/alerts.js +4 -4
- package/templates/webterm/public/app/anchored.js +81 -0
- package/templates/webterm/public/app/composer.js +4 -1
- package/templates/webterm/public/app/connection.js +9 -0
- package/templates/webterm/public/app/dom.js +15 -5
- package/templates/webterm/public/app/frames.js +51 -10
- package/templates/webterm/public/app/main.js +26 -6
- package/templates/webterm/public/app/new-session.js +13 -41
- package/templates/webterm/public/app/palette.js +58 -0
- package/templates/webterm/public/app/pane-shape.js +167 -0
- package/templates/webterm/public/app/pane-shell.js +380 -0
- package/templates/webterm/public/app/pane.js +77 -193
- package/templates/webterm/public/app/reviews-host.js +15 -0
- package/templates/webterm/public/app/specs-host.js +16 -0
- package/templates/webterm/public/app/state.js +5 -0
- package/templates/webterm/public/app/tabs.js +6 -2
- package/templates/webterm/public/app/terminal.js +8 -0
- package/templates/webterm/public/app/theme.js +75 -27
- package/templates/webterm/public/app/tool-host.js +302 -0
- package/templates/webterm/public/app/workspace-color.js +192 -0
- package/templates/webterm/public/index.html +68 -30
- package/templates/webterm/public/styles.css +270 -34
- package/templates/webterm/server.js +321 -0
- package/templates/webterm/tool-document.js +67 -0
- package/templates/webterm/tools/commands.js +61 -0
- package/templates/webterm/tools/index.js +25 -0
- package/templates/webterm/tools/mount.js +337 -0
- package/templates/webterm/tools/paths.js +34 -0
- package/templates/webterm/tools/reviews.js +133 -0
- package/templates/webterm/tools/specs.js +154 -0
- package/templates/webterm/typed-line.js +148 -0
- package/templates/context/context-usage.md +0 -1
- package/templates/context-usage.sh +0 -266
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
# The stages
|
|
2
|
+
|
|
3
|
+
This file holds the stage definitions for `/dx-spec` (`SKILL.md` in the directory above).
|
|
4
|
+
Read a stage's section when the stage starts, and run the stage from that definition.
|
|
5
|
+
|
|
6
|
+
Every gate here is declared with `specs await`, in the shapes `SKILL.md` gives.
|
|
7
|
+
Declaring one ends your turn.
|
|
8
|
+
|
|
9
|
+
## The tab
|
|
10
|
+
|
|
11
|
+
The spec directory is the whole product: plain files that agents write and the user reads.
|
|
12
|
+
The Specs tab renders every one of them as it stands on disk.
|
|
13
|
+
Nothing is generated for the tab, and nothing is kept in step with it.
|
|
14
|
+
|
|
15
|
+
The tab is where the user reads and where the user answers.
|
|
16
|
+
Name the artifact in a gate's `file`, and the tab opens it and puts the gate under it.
|
|
17
|
+
Say nothing about how to read a file: the user is already looking at it.
|
|
18
|
+
|
|
19
|
+
## The text of a round
|
|
20
|
+
|
|
21
|
+
The text you compose for a round must agree with the options that round offers.
|
|
22
|
+
An option that declines a step makes that step the user's choice.
|
|
23
|
+
No text beside it may say that the step happens anyway.
|
|
24
|
+
Compose the question from the options, and read the two together before you declare the round.
|
|
25
|
+
|
|
26
|
+
## Asking again
|
|
27
|
+
|
|
28
|
+
The "Needs you" list says what is genuinely open.
|
|
29
|
+
Only your own care keeps that true.
|
|
30
|
+
|
|
31
|
+
An ask the user answered leaves the list as they answer it.
|
|
32
|
+
A gate they asked for changes on is thus gone before you revise anything: declare the next one and carry on.
|
|
33
|
+
|
|
34
|
+
An ask you supersede is different, because nobody answered it.
|
|
35
|
+
You replace it with a different question, or the answer reaches you in the terminal instead.
|
|
36
|
+
The ask then stays on the list, and tells the user to answer something you know already.
|
|
37
|
+
Take it off in the same act that supersedes it, with `specs withdraw` and the reason.
|
|
38
|
+
`SKILL.md` carries the verb and its payload.
|
|
39
|
+
A gate declared again on the same artifact is the one case the tool takes back on its own.
|
|
40
|
+
|
|
41
|
+
## Applying the user's annotations
|
|
42
|
+
|
|
43
|
+
The user annotates any part of any artifact on the tab.
|
|
44
|
+
Two actions and no others: a comment on something, or a request that it be removed.
|
|
45
|
+
Each round of annotations lands in `.specs/user-feedback.json` in the spec directory, and the pane types one line into this terminal naming the file.
|
|
46
|
+
|
|
47
|
+
The file is also the signal to a session picking the work up: a file that is there holds annotations nobody applied.
|
|
48
|
+
Apply a round in four steps:
|
|
49
|
+
|
|
50
|
+
1. Rename the file to `.specs/user-feedback.applying.json`. Rename it first. A round the user sends while you revise then lands on the free name, and is applied in the next round rather than deleted unread.
|
|
51
|
+
2. Read the file, and open the asset files it names.
|
|
52
|
+
3. Revise the artifacts the comments point at.
|
|
53
|
+
4. Delete the renamed file and every asset file it named. Delete the assets directory when nothing is left in it.
|
|
54
|
+
|
|
55
|
+
Then declare the gate again, or ask what to do next when this happened while you picked the work up.
|
|
56
|
+
A `.specs/user-feedback.applying.json` file left behind means an earlier session stopped mid-apply.
|
|
57
|
+
Apply it the same way, from step 2.
|
|
58
|
+
|
|
59
|
+
The file names the piece of work in `entry`, and holds one round per submit:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"version": 1,
|
|
64
|
+
"entry": "checkout-discounts",
|
|
65
|
+
"rounds": [
|
|
66
|
+
{
|
|
67
|
+
"submittedAt": "2026-08-19T09:41:12.004Z",
|
|
68
|
+
"comments": [
|
|
69
|
+
{
|
|
70
|
+
"unit": "spec-spec-goal",
|
|
71
|
+
"file": "spec/SPEC.md",
|
|
72
|
+
"heading": "Goal",
|
|
73
|
+
"kind": "comment",
|
|
74
|
+
"quote": "renders any spec directory",
|
|
75
|
+
"text": "Say plainly that this holds for a directory that is not a spec too.",
|
|
76
|
+
"assets": []
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"unit": "mocks-dashboard",
|
|
80
|
+
"file": "mocks/dashboard.html",
|
|
81
|
+
"heading": "",
|
|
82
|
+
"kind": "remove",
|
|
83
|
+
"quote": "",
|
|
84
|
+
"text": "",
|
|
85
|
+
"assets": []
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"unit": "overall",
|
|
89
|
+
"file": "",
|
|
90
|
+
"heading": "",
|
|
91
|
+
"kind": "comment",
|
|
92
|
+
"quote": "",
|
|
93
|
+
"text": "Good direction. My notes on the wording are attached.",
|
|
94
|
+
"assets": [
|
|
95
|
+
{
|
|
96
|
+
"path": "user-feedback-assets/2026-08-19-094112-wording.txt",
|
|
97
|
+
"name": "wording.txt",
|
|
98
|
+
"type": "text/plain"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
How to read one comment:
|
|
109
|
+
|
|
110
|
+
- `file` is relative to the spec directory.
|
|
111
|
+
- An asset's `path` is relative to the `.specs/` directory the feedback file sits in, not to the spec directory.
|
|
112
|
+
- `unit` is that path with the heading on the end, both slugified. It is the address of the exact place the annotation sits on.
|
|
113
|
+
- `kind` is `comment` or `remove`. A `remove` asks you to take that thing out, and its `text` is often empty, because pointing is the whole request.
|
|
114
|
+
- `quote` is the text the annotation was anchored on, when the user selected text. It is empty when they pointed at an image, a section or the file itself, which is what tells you the difference.
|
|
115
|
+
- `unit: "overall"` has `file` and `heading` empty, and belongs to the piece of work rather than to one place in it.
|
|
116
|
+
- A comment on a section of the review report is input to the finding in that section.
|
|
117
|
+
|
|
118
|
+
## Visuals
|
|
119
|
+
|
|
120
|
+
When a stage document is finished, decide whether a standalone visual would make the user's reading easier: a diagram, an SVG, or a small HTML figure.
|
|
121
|
+
Write it as a lowercase file beside the document, when it earns its place.
|
|
122
|
+
The tab renders an image inline and shows an HTML page in a frame, so a visual beside the document is read on the same page.
|
|
123
|
+
When a visual belongs to one section, put it inside the document instead, as inline SVG or as an HTML table.
|
|
124
|
+
Either way, keep it self-contained: no external image, no script, nothing fetched.
|
|
125
|
+
This is a judgment call, never a rule.
|
|
126
|
+
Most documents need no visual, and a visual nobody would look at is not worth writing.
|
|
127
|
+
|
|
128
|
+
## High-level exploration
|
|
129
|
+
|
|
130
|
+
Think together before you commit to anything.
|
|
131
|
+
Hold an open conversation, not a script.
|
|
132
|
+
Normal message text and ASCII diagrams are what this stage is made of.
|
|
133
|
+
Map the problem space, question assumptions, compare directions, and raise the risks and the unknowns.
|
|
134
|
+
Ground the thinking in the code rather than in theory.
|
|
135
|
+
|
|
136
|
+
With imagination mode on, the first pass names the ideal as if everything were possible, and allows no talk of feasibility.
|
|
137
|
+
`references/imagination-guide.md` states how the stage then runs.
|
|
138
|
+
|
|
139
|
+
When things become clear, declare a gate on the work as a whole, asking whether to move on or keep exploring.
|
|
140
|
+
Then write the conclusions into `spec/SPEC.md` as background and direction.
|
|
141
|
+
|
|
142
|
+
## Interview
|
|
143
|
+
|
|
144
|
+
Track down every doubt, until the spec stands on its own.
|
|
145
|
+
Read what the input points to first: an uninformed interview wastes the user's time.
|
|
146
|
+
|
|
147
|
+
Open `[NEEDS CLARIFICATION: ...]` markers in `SPEC.md` are the interview's first input.
|
|
148
|
+
Read them before you write a question, and turn each one into a question of its own.
|
|
149
|
+
An earlier stage already judged those doubts worth asking.
|
|
150
|
+
|
|
151
|
+
Then interview the user in rounds, most important points first.
|
|
152
|
+
A round is one `specs await` call, and it holds as many questions as the round needs.
|
|
153
|
+
With imagination mode on, ask for the ideal experience first, and put the constraint questions after it.
|
|
154
|
+
|
|
155
|
+
In every round:
|
|
156
|
+
|
|
157
|
+
- **Frame the options production-grade by default**, and mark that one recommended.
|
|
158
|
+
- **Lay out a real trade-off** in the question, and let the user decide. Do not decide it silently.
|
|
159
|
+
- **Cross-reference the code.** When the user's claim contradicts what you read, say so: "You said a partial cancel is possible, but `orders.cancel:42` cancels the whole order - which is right?"
|
|
160
|
+
- **Pin down vague language.** "By 'account' do you mean the Customer or the User? They are different here."
|
|
161
|
+
- **Fold each answer into `SPEC.md` right after the round that produced it**, and clear the markers that round settles. An interview the user stops early then leaves nothing living in chat alone.
|
|
162
|
+
|
|
163
|
+
Check these categories for candidates, most important first:
|
|
164
|
+
|
|
165
|
+
- functional scope and non-goals
|
|
166
|
+
- domain and data - shapes and contracts
|
|
167
|
+
- the flow the user goes through
|
|
168
|
+
- qualities that are not features - permissions, tenant scope
|
|
169
|
+
- integrations
|
|
170
|
+
- edge cases and failures - empty, loading, error
|
|
171
|
+
- constraints and trade-offs
|
|
172
|
+
- terminology
|
|
173
|
+
- how success is measured
|
|
174
|
+
|
|
175
|
+
**Theme support and the target devices.**
|
|
176
|
+
For every piece of user-facing work, pin down which themes the application draws in - dark, light, or both - and which devices it is laid out for - desktop only, responsive, or mobile-first.
|
|
177
|
+
Ask both once, in a round, whichever stages the protocol holds.
|
|
178
|
+
No form asks them, so this stage is where they are settled.
|
|
179
|
+
|
|
180
|
+
Look at the code that answers it before you ask, and mark the answer the code already gives as recommended.
|
|
181
|
+
Almost always that is the answer: the work is in an application that has a theme and a layout already, and matching them is what the work needs.
|
|
182
|
+
So the round is usually the user confirming what is there, and it stays a round because a piece of work that changes either one is exactly the piece of work an agent must not guess about.
|
|
183
|
+
Say in the option which one the code gives, in the code's own terms - "both, which is what every screen in this app draws today".
|
|
184
|
+
|
|
185
|
+
Write both answers into the `Themes and devices` section of `SPEC.md`, which the UI-mocks stage reads by name, so the stage that draws reads them from the spec rather than from a form.
|
|
186
|
+
`references/spec-guide.md` holds that section's shape.
|
|
187
|
+
|
|
188
|
+
Whatever stays open becomes a labeled assumption in `SPEC.md`, or a `[NEEDS CLARIFICATION: ...]` marker when it clears the bar in `references/spec-guide.md`.
|
|
189
|
+
The implementer has to know what was confirmed and what was assumed.
|
|
190
|
+
|
|
191
|
+
The stage ends at a gate: enough asked, or another round.
|
|
192
|
+
|
|
193
|
+
## Research
|
|
194
|
+
|
|
195
|
+
Run this stage for work that needs knowledge beyond the codebase: a protocol, a library, an algorithm, a subject area.
|
|
196
|
+
|
|
197
|
+
**Open with no round.**
|
|
198
|
+
The scope was settled beside this stage on the confirmation form, and it is in `stageSettings.research`.
|
|
199
|
+
Where the settings hold nothing, the steps were confirmed before the form asked: open with one round for the scope, and carry on from the answer.
|
|
200
|
+
The scope is one of three:
|
|
201
|
+
|
|
202
|
+
- `focused` - you decide what to research, sized to the work.
|
|
203
|
+
- `named` - research what `subject` names, and nothing wider.
|
|
204
|
+
- `broad` - deep research across the subjects this work touches. Use a deep-research capability where your environment offers one.
|
|
205
|
+
|
|
206
|
+
Check the scope against the code, the way **Cross-check a stored answer against the code** in `SKILL.md` says.
|
|
207
|
+
Where `broad` is plainly more than the work needs, say so in a message and offer to narrow it - the user chose it, so the choice to keep it is theirs.
|
|
208
|
+
|
|
209
|
+
Ask about sources in a round where the sources genuinely decide something: a paywalled standard, an internal document, a version you cannot reach.
|
|
210
|
+
This is a judgment call, and most research needs no such round.
|
|
211
|
+
|
|
212
|
+
Then research as settled, and write `research/RESEARCH.md`: what you learned, the options you compared, a recommendation, and the sources with links.
|
|
213
|
+
Write a finding that decides something as **Decision / Rationale / Alternatives**: what was chosen, why, and what was rejected with the reason.
|
|
214
|
+
Compare the options in a table when the comparison has more than two axes.
|
|
215
|
+
Keep the volume sized to the work. The format is the discipline, not the length.
|
|
216
|
+
The choices themselves land in the `Decisions` section of `SPEC.md`.
|
|
217
|
+
|
|
218
|
+
Consider a visual beside the write-up.
|
|
219
|
+
Then gate on `research/RESEARCH.md`: enough to go on, or one area worth more digging.
|
|
220
|
+
|
|
221
|
+
## Codebase analysis
|
|
222
|
+
|
|
223
|
+
Map the parts of the code the work touches: entry points, data shapes, the conventions and patterns to follow, and anything that constrains the design.
|
|
224
|
+
Use the `Explore` agent for a broad search where you have one.
|
|
225
|
+
Write the findings into `spec/SPEC.md` with `path:line` references.
|
|
226
|
+
|
|
227
|
+
Read the project's own documents while you map the code: the README, the guides, and each document that sits beside the code the work touches.
|
|
228
|
+
Find the ones the planned work makes not correct, and write them into the `Documentation impact` section of `spec/SPEC.md`, as `references/spec-guide.md` describes it.
|
|
229
|
+
Name each document, and say which part of it the work makes not correct.
|
|
230
|
+
Where the work leaves every document correct, write that, so the stages after this one know the question was asked.
|
|
231
|
+
|
|
232
|
+
This stage is where the code is read as a whole, so it is where **Cross-check a stored answer against the code** in `SKILL.md` runs.
|
|
233
|
+
Read every answer the user has given against what the code says, and raise what disagrees: the stage settings the protocol form carries, and what a round settled earlier, the interview's own answers included.
|
|
234
|
+
|
|
235
|
+
This stage has no gate. It feeds the stages after it.
|
|
236
|
+
So it does not end your turn: write its findings, and start the next stage in the same turn.
|
|
237
|
+
A contradiction it finds becomes an interview question, a labeled assumption, or a `[NEEDS CLARIFICATION: ...]` marker.
|
|
238
|
+
|
|
239
|
+
## Technical specs
|
|
240
|
+
|
|
241
|
+
This is the core writing stage.
|
|
242
|
+
Fill `spec/SPEC.md` by following `references/spec-guide.md`, from everything the earlier stages produced.
|
|
243
|
+
|
|
244
|
+
First, ask in a round whether the spec should suggest how to build the work.
|
|
245
|
+
When the user says yes, read the codebase as the agent about to build this would.
|
|
246
|
+
Then offer two or three distinct approaches in the next round, where the solution space holds that many, each with a short label and a rough file layout.
|
|
247
|
+
Mark your pick recommended.
|
|
248
|
+
Keep the sketch high-level: a clear starting point and a rough file tree, not a design.
|
|
249
|
+
|
|
250
|
+
Consider a visual beside the spec.
|
|
251
|
+
Then gate on `spec/SPEC.md`.
|
|
252
|
+
On changes: revise, and declare a new gate. Loop until the user approves it.
|
|
253
|
+
|
|
254
|
+
With imagination mode on, and UI mocks in the protocol, this stage runs after the mocks stage.
|
|
255
|
+
|
|
256
|
+
## UI mocks
|
|
257
|
+
|
|
258
|
+
Run this stage only for work that has a user interface.
|
|
259
|
+
A mock is a web page the user opens.
|
|
260
|
+
Start building when the stage starts, and ask nothing first.
|
|
261
|
+
|
|
262
|
+
With imagination mode on, the stage opens with a fan-out instead: many deliberately different candidate screens for the user to choose among.
|
|
263
|
+
`references/imagination-guide.md` defines the fan-out, its one round, and the choice.
|
|
264
|
+
That round is the one exception to "ask nothing first".
|
|
265
|
+
|
|
266
|
+
Each mock is a complete standalone HTML document at `mocks/<mock-id>.html`, where `<mock-id>` is a kebab-case name for the screen.
|
|
267
|
+
Use inline styles, no external resources, and images as data URLs.
|
|
268
|
+
A standalone page lets the agent who builds the work open the mock on its own.
|
|
269
|
+
|
|
270
|
+
**The theme and the devices come from the `Themes and devices` section of `SPEC.md`.**
|
|
271
|
+
The interview settled both and wrote them there.
|
|
272
|
+
Read them from the spec, and ask in one round only where the spec does not say - work that reached this stage with no interview.
|
|
273
|
+
Style both `[data-theme="dark"]` and `[data-theme="light"]` on the root element for both themes, and one of them for one.
|
|
274
|
+
Lay the screen out for the devices: one desktop width for desktop only, every width from a phone up for responsive, and the phone first for mobile-first.
|
|
275
|
+
Where the code says something else than the spec does, raise it the way **Cross-check a stored answer against the code** in `SKILL.md` says before you draw.
|
|
276
|
+
|
|
277
|
+
List each mock in the `Mocks` section of `SPEC.md` as soon as the first one exists.
|
|
278
|
+
|
|
279
|
+
The loop:
|
|
280
|
+
|
|
281
|
+
1. Build or revise the mock files.
|
|
282
|
+
2. Declare a gate on the mock the user is judging.
|
|
283
|
+
3. On changes, or on annotations the user sent: apply them, revise each file in place, and gate again.
|
|
284
|
+
4. On approval: add the approval date to the `Mocks` section. Approval ends the stage.
|
|
285
|
+
|
|
286
|
+
## Execution plan
|
|
287
|
+
|
|
288
|
+
**Ask nothing about how the run is shaped.**
|
|
289
|
+
The commits, the branch, where the run stops and who reviews it are settled on the execute form, in one act, when the user starts the run.
|
|
290
|
+
This stage recommends them as data, and writes none of them into `PLAN.md`.
|
|
291
|
+
|
|
292
|
+
Break the work into phases.
|
|
293
|
+
**Each phase fits one session, and leaves the repo in a working state.**
|
|
294
|
+
Write `plan/PLAN.md`: the goal, the principles check, and the phase list with checkboxes.
|
|
295
|
+
Give each phase its goal and its definition of done.
|
|
296
|
+
Decide the phase boundaries, the goals and the definitions of done now, for every phase. They are cheap to get right in advance.
|
|
297
|
+
|
|
298
|
+
Do not give much weight to development cost or to output size.
|
|
299
|
+
Prefer quality, simplicity, robustness, scalability and long-term maintainability.
|
|
300
|
+
When something has grown unwieldy, restructure it by judgment: refactor, split, or extract.
|
|
301
|
+
Never restructure by a number set in advance.
|
|
302
|
+
|
|
303
|
+
Check the plan against the principles the bootstrap read.
|
|
304
|
+
Record the outcome as a `## Principles check` section: one line per principle the work touches, saying how the plan honors it.
|
|
305
|
+
When a plan must break a principle, record it in a table with the columns `Deviation | Why needed | Simpler alternative rejected because`.
|
|
306
|
+
Look for the simpler alternative before you record a deviation, and say why you rejected it.
|
|
307
|
+
A deviation is an exception the user decides on at the gate.
|
|
308
|
+
It is not a way to soften a principle, so the usual fix for a conflict is a different plan.
|
|
309
|
+
|
|
310
|
+
When `SPEC.md` carries requirement IDs, end every phase entry with a `Covers: FR-03, FR-04` line.
|
|
311
|
+
Every ID appears in one phase's `Covers` line at least, and a requirement may span several phases.
|
|
312
|
+
An ID no phase covers means a missing phase, or scope that belongs in the non-goals.
|
|
313
|
+
Add the phase, or move the requirement, before the gate. Ask the user when the call is not yours.
|
|
314
|
+
|
|
315
|
+
**A phase covers each document the spec's `Documentation impact` section names.**
|
|
316
|
+
Name the document in the definition of done of the phase that changes what it describes, so the run makes the document correct as it changes the code.
|
|
317
|
+
Do not collect the documents into a phase of their own at the end.
|
|
318
|
+
|
|
319
|
+
**Post the phases as soon as `PLAN.md` is on disk:**
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
echo '{"kind":"plan","phases":[{"phase":"phase-01-the-state","title":"The state"},{"phase":"phase-02-the-routes","title":"The routes"}]}' | specs post <spec>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
One call, holding the whole list, in plan order.
|
|
326
|
+
A phase's id is the name of the file it will be written into, without the extension, which is what the executing agent writes and ticks.
|
|
327
|
+
The execute form names phases from this list: without it the user cannot place a pause or a checkpoint at all.
|
|
328
|
+
|
|
329
|
+
Post the whole list again after each revision of the plan.
|
|
330
|
+
The list the post carries becomes the list: a phase that is gone from the plan goes from the state with it, and a phase that survives keeps the status it had.
|
|
331
|
+
This is the only write that drops a phase, so a plan the user changed at the gate leaves nothing behind for the execute form to offer.
|
|
332
|
+
|
|
333
|
+
**Then recommend how the run is shaped**, with `specs recommend`.
|
|
334
|
+
`SKILL.md` carries the payload.
|
|
335
|
+
The user decides it on the execute form; this is your reading of the work, and it binds nobody.
|
|
336
|
+
|
|
337
|
+
**The commits.**
|
|
338
|
+
Recommend `per-phase` for a plan of several phases, because a phase that is committed is a phase a later session finds finished.
|
|
339
|
+
Recommend `single` for small work that reads as one change.
|
|
340
|
+
Recommend `none` where the user is likely to want to read the whole thing before any of it lands.
|
|
341
|
+
Recommend a new branch for work of any size that touches shared code, and the current branch for a small change on a branch that is already the work's own.
|
|
342
|
+
Name the branch `spec/<slug>`, with this spec's own slug, unless a principle in the principles file names another shape.
|
|
343
|
+
|
|
344
|
+
**The pauses.**
|
|
345
|
+
A pause is where the run stops and waits for the user.
|
|
346
|
+
The modes are `none`, `chosen` with the phases named, and `every`.
|
|
347
|
+
|
|
348
|
+
Recommend a pause only where skipping it has a real downside: a later phase builds on something the user must see or decide first.
|
|
349
|
+
Recommend `none` for every other plan, which is most of them.
|
|
350
|
+
A phase that is only visible, or only complicated, earns no pause.
|
|
351
|
+
A pause with no such downside costs the user a stop for nothing.
|
|
352
|
+
|
|
353
|
+
A pause is not a mid-run review checkpoint.
|
|
354
|
+
A checkpoint stops nobody: fresh reviewers judge the work, and the run goes on.
|
|
355
|
+
A pause needs the user, and the run waits until the user answers.
|
|
356
|
+
A phase that needs another reader gets a checkpoint.
|
|
357
|
+
A phase that needs the user's own judgment gets a pause.
|
|
358
|
+
|
|
359
|
+
Never recommend `every` yourself.
|
|
360
|
+
That mode is the user's to pick on the form, and a recommendation of it carries no reason.
|
|
361
|
+
|
|
362
|
+
**The pause reasons.**
|
|
363
|
+
Give every pause you recommend one line in `pauseReasons`, keyed by the phase it sits after.
|
|
364
|
+
Say what the later phases build on, and what goes wrong where the user does not see it first.
|
|
365
|
+
Where you recommend `none`, give `noPauseReason` one line saying why nothing needs the user before the run ends.
|
|
366
|
+
Write both to the user, in plain words.
|
|
367
|
+
The execute form shows them under the Pauses field, and they are how the user judges the stops you proposed.
|
|
368
|
+
|
|
369
|
+
**The review checkpoints.**
|
|
370
|
+
A review checkpoint is a point in the run where fresh reviewers, who did not do the work, judge what is built so far.
|
|
371
|
+
Propose concrete checkpoints, each with a panel of one focus per reviewer.
|
|
372
|
+
Correctness against the spec, security, performance, repo rules and docs consistency are examples, not a menu.
|
|
373
|
+
|
|
374
|
+
Where they go:
|
|
375
|
+
|
|
376
|
+
- **Every recommendation carries the final checkpoint**, after the last phase. It judges the finished work as a whole, and the user may still untick it.
|
|
377
|
+
- Recommend a mid-run checkpoint only under the **dependency-risk rule**: the one risk that justifies stopping for reviewers mid-run is a phase whose wrong implementation sends later phases wrong. Review a complicated phase with no effect on later phases at the end instead. A five-phase plan with no such risk gets the final checkpoint alone.
|
|
378
|
+
- Give each checkpoint a `why` of one line, saying why it sits where it does. The form shows it on a line under the checkpoint.
|
|
379
|
+
- **Include a "better ways to do this" reviewer in the final panel.**
|
|
380
|
+
|
|
381
|
+
**Write no phase file now.**
|
|
382
|
+
Each `plan/phase-NN-<slug>.md` holds a `Status:` line, tasks as checkboxes, and a **Verify** section stating how to prove the phase done.
|
|
383
|
+
The executing agent writes that file just before its phase runs, against the code as it stands then.
|
|
384
|
+
A detailed plan for a later phase, written this early, is mostly guessing.
|
|
385
|
+
|
|
386
|
+
An executing agent loads `PLAN.md` and its one phase file, never the whole plan.
|
|
387
|
+
|
|
388
|
+
`PLAN.md` follows this layout.
|
|
389
|
+
Copy the opening note roughly as written, and adapt the rest to the work.
|
|
390
|
+
Include the deviation table only when the plan breaks a principle, and the `Covers:` bullets only when `SPEC.md` carries IDs:
|
|
391
|
+
|
|
392
|
+
```markdown
|
|
393
|
+
# <Title of the work>
|
|
394
|
+
|
|
395
|
+
> **For the executing agent - read this first.** Read `spec/SPEC.md` before any phase.
|
|
396
|
+
> This plan was written before the work started; check each phase against the actual code before building, and raise anything that looks off instead of pushing through.
|
|
397
|
+
> How this run is shaped - the commits, the branch, the pauses and the review checkpoints - is in the state, decided on the execute form.
|
|
398
|
+
|
|
399
|
+
## Goal
|
|
400
|
+
|
|
401
|
+
<what the work achieves, in a line or two>
|
|
402
|
+
|
|
403
|
+
## Principles check
|
|
404
|
+
|
|
405
|
+
<one line per principle the work touches, saying how the plan honors it>
|
|
406
|
+
|
|
407
|
+
| Deviation | Why needed | Simpler alternative rejected because |
|
|
408
|
+
| --- | --- | --- |
|
|
409
|
+
| <the principle the plan breaks> | <why the plan needs to> | <the simpler alternative, and why it was rejected> |
|
|
410
|
+
|
|
411
|
+
## Phases
|
|
412
|
+
|
|
413
|
+
- [ ] Phase 1 - <name>
|
|
414
|
+
- Goal: <what this phase achieves>
|
|
415
|
+
- Definition of done: <how to tell it is complete>
|
|
416
|
+
- Covers: <the requirement IDs this phase covers>
|
|
417
|
+
- [ ] Phase 2 - <name>
|
|
418
|
+
...
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Consider a visual beside the plan.
|
|
422
|
+
Then gate on `plan/PLAN.md`, saying the phases in a line each, how the plan honors the principles, and any deviation with its reason.
|
|
423
|
+
Say in one line what you recommended for the run, and that the user settles it when they press Execute.
|
|
424
|
+
On changes: revise the plan, post the phases again where they moved, recommend the run again where the change made the recommendation wrong, and gate again.
|
|
425
|
+
Loop until the user approves it.
|
|
426
|
+
The rule over that last part is **Keep what derives from a change true**, in `SKILL.md`.
|
|
427
|
+
|
|
428
|
+
## Quality review
|
|
429
|
+
|
|
430
|
+
This is the last stage before the coherence rewrite and finalize.
|
|
431
|
+
It reviews everything the spec produced - `spec/SPEC.md`, the research, the plan, and the mocks the spec lists - and whether those documents agree with each other.
|
|
432
|
+
Read `references/review-guide.md` when the stage starts.
|
|
433
|
+
It holds the reviewer briefs, the lenses, the severities, and the report format.
|
|
434
|
+
|
|
435
|
+
**The panel.**
|
|
436
|
+
Ask who reviews the work, in a round.
|
|
437
|
+
Propose a panel sized to the work and its risk, one reviewer per focus, and mark your proposal recommended.
|
|
438
|
+
Give a short line saying what each reviewer looks at.
|
|
439
|
+
The default proposal has three reviewers: consistency and completeness, principles alignment, and better ways to do this.
|
|
440
|
+
**Include the "better ways to do this" reviewer in every proposal.**
|
|
441
|
+
Bigger or riskier work may add a focus of its own - security, performance, the work's own subject - and small work may run with two reviewers.
|
|
442
|
+
Always offer an option that turns the review off.
|
|
443
|
+
Say in its description that nothing gets checked independently, and that the spec goes straight to the rewrite and finalize.
|
|
444
|
+
|
|
445
|
+
On the skip: post the stage done with a note saying it was skipped, write no report, and move on.
|
|
446
|
+
A skipped stage counts as not run, so finalize keeps its full read-through.
|
|
447
|
+
|
|
448
|
+
**Running it.**
|
|
449
|
+
Run one reviewer per confirmed focus, each as a subagent with a brief from `references/review-guide.md`.
|
|
450
|
+
The reviewers share no context: each gets its own prompt, none sees this conversation, and none is told what the others found.
|
|
451
|
+
|
|
452
|
+
An agent with no subagent tool runs the same passes itself, one lens at a time, and writes each pass's findings into the report before it starts the next.
|
|
453
|
+
The report's mode line then says the review ran inline, and that the fresh-context guarantee did not hold.
|
|
454
|
+
An agent that has the capability but cannot make it work stops and asks in a round.
|
|
455
|
+
It never downgrades quietly.
|
|
456
|
+
|
|
457
|
+
Post each round of review as it lands, so the board shows it:
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
echo '{"round":1,"verdict":"holds, two for you","findings":9,"judgments":2}' | specs review <spec>
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
**Handling the findings.**
|
|
464
|
+
Merge the findings, and remove the duplicates.
|
|
465
|
+
Dismiss a finding you disagree with, and say why in the report.
|
|
466
|
+
Fix a finding that is plainly right, apply the fix, and mark it applied.
|
|
467
|
+
Bring a taste or scope finding to the user, "better ways" suggestions included, with the reviewer's reasoning.
|
|
468
|
+
Bring a finding to the user too when it is right but the fix is not obvious, or when acting on it would undo something the user approved at an earlier gate.
|
|
469
|
+
Resolve a conflict with a principle by changing the work, never the principle.
|
|
470
|
+
|
|
471
|
+
**The report and the gate.**
|
|
472
|
+
Write `review/REVIEW.md` in the format `references/review-guide.md` defines.
|
|
473
|
+
Consider a visual beside it: where the findings fall across the artifacts is the kind of thing a figure shows faster than a list.
|
|
474
|
+
|
|
475
|
+
Declare one decision card per finding that waits on the user.
|
|
476
|
+
Each card names the passage precisely: the artifact in `file`, and the `##` section in `heading`.
|
|
477
|
+
Write what was found and what each way costs into the question's own `ask`.
|
|
478
|
+
Say the proposed change as one option, in the exact words it would be done in, and the alternative as another option.
|
|
479
|
+
Mark one of them recommended.
|
|
480
|
+
The card's own box is where the user's words go, and it is already there, so write no `invite` on a card: the form draws one box for the card and gives it its own words.
|
|
481
|
+
Then gate on `review/REVIEW.md`.
|
|
482
|
+
Read the answers back, record what the user decided in the report, and apply it.
|
|
483
|
+
Then gate again.
|
|
484
|
+
A comment the user sent on a finding's section is input to that finding.
|