@rasensio/aidlc-content 2.21.0 → 2.23.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.
@@ -47,7 +47,10 @@ never become, derived from a product vision document. With no such document, the
47
47
  skill asks five skippable questions and saves the answers, in your words, as `docs/vision.md` — then
48
48
  imports that like any other. Triage checks items against it, and an item
49
49
  that crosses a prohibition is the clearest `hold/` there is — naming the prohibition turns "not for
50
- us" into a reason the submitter can read.
50
+ us" into a reason the submitter can read. When work in an instance crosses a prohibition, your
51
+ choice — an exception for this instance, or an amendment — is written to the instance as one line.
52
+ At completion the retrospective asks once whether any constitution or decision-register entry the
53
+ work ran into should change, and names a prohibition that has been waived two or more times.
51
54
 
52
55
  **What breaks without them:** work passes review because the reviewer was the author, the same defect
53
56
  recurs every few weeks with nobody noticing it is the same defect, and scope drifts one reasonable
package/docs/roadmap.md CHANGED
@@ -132,7 +132,7 @@ that picks has no way to write. `priority` is an ordinary extension field (a ran
132
132
  project declares in `roadmap.item_fields`.
133
133
 
134
134
  **Seeing the roadmap** is `aidlc roadmap view`: one self-contained HTML page, opened in the browser,
135
- with three tabs. Every item has a plain summary — its `## In plain words` section, or a draft built from
135
+ with four tabs. Every item has a plain summary — its `## In plain words` section, or a draft built from
136
136
  "What it is" and "Customer value", labelled Draft — and the page always shows it whole. **Board** has a
137
137
  column per status — backlog in `roadmap next` order with ranks and ready items marked, the latest 20 done
138
138
  items with the rest behind a control, hold split into Parked, Declined and On hold with the reason on each
@@ -152,12 +152,18 @@ a square jumps to that item; a sticky column shows the selected item's facts, wh
152
152
  on it. **Shipped** groups done items by release — the first `v*` tag after the merge of the item's branch —
153
153
  newest first, each heading with the version, date, item count and total true cost from `aidlc metrics`;
154
154
  each card shows its plain summary, kind of work, days from idea to done, true cost, and a red mark when it
155
- caused bugfixes. A missing cost shows nothing, never $0. The Board has status chips, presets (Active work,
155
+ caused bugfixes. **Usage** lists every done item, most tokens first, with one bar each for input, output,
156
+ cache read and cache write and each value printed beside its bar. Each type is scaled to its own largest
157
+ value on the tab, because cache reads are usually most of a feature's tokens and one shared scale would
158
+ leave the other three bars at nothing. Every cost on the page is tokens first, as `aidlc cost` prints them
159
+ (`45.2M tok`), then the dollar figure labelled "API price" — what the same usage would cost at API rates,
160
+ which a Claude or Codex subscription does not charge. Where no usage was recorded the page says "no data",
161
+ never 0 or $0: an unmeasured feature is not a free one. The Board has status chips, presets (Active work,
156
162
  Needs a decision, Shipped, Parked, Everything) and Ready/Blocked toggles and opens on inbox, backlog and in
157
163
  progress, with done and hold folded into rails you click to reopen; Dependencies has status chips with
158
164
  done off and an "Only items with links" toggle. The tab, both tabs' filters and the Summaries toggle live
159
165
  in the URL hash, so a reload or a shared link reopens the same view. `/` focuses search, `j` and `k` move to the next and previous
160
- item (the open panel follows), `1`, `2` and `3` switch tabs (`1` to `4` with milestones), `Esc` closes the panel or clears the
166
+ item (the open panel follows), `1` to `4` switch tabs (`1` to `5` with milestones), `Esc` closes the panel or clears the
161
167
  search. The page opens light; the header button switches to dark, and the browser remembers it across
162
168
  regenerations. The page is written to `<git-common-dir>/aidlc/roadmap.html` — outside every working tree, so
163
169
  it is never committed and every worktree shares one copy — or wherever `--out` says; `--no-open` only
@@ -227,7 +233,7 @@ and the first one in order that is not done is *current*, even with nothing in i
227
233
  usual order when it has none; `--explain` names it. `aidlc roadmap view` opens on a **Milestones** tab
228
234
  — a track of every milestone and its status, then each milestone's exit test and its items as done, in
229
235
  flight, next, parked, open and dropped, then Unassigned — and with milestones the tabs are numbered `1`
230
- to `4`, Milestones first. A hold card names the milestone it is parked for, so the hold reason can carry
236
+ to `5`, Milestones first. A hold card names the milestone it is parked for, so the hold reason can carry
231
237
  the trigger rather than the goal. **`aidlc roadmap status`** prints the same thing as text, for chat;
232
238
  `--milestone <id>` prints one milestone and `--milestone none` the Unassigned items. It exits 1, after
233
239
  printing, when an open item has no `milestone:` line or names an id the file does not list — `aidlc
@@ -376,8 +382,9 @@ six questions on its own. Each is a list with one choice marked recommended:
376
382
  like, but never `autopilot`, `start`, `update` or `roadmap sync`) and read-only `gh pr checks` /
377
383
  `gh run view` (recommended). A machine set up with the older scoped command is moved to this one
378
384
  the next time autopilot reads its config; Claude Code with full access; Codex editing and
379
- running commands inside its `workspace-write` sandbox, which may also write the repository's git
380
- directory so it can commit from a worktree; or a command you type. This decides what an unattended agent may do on your machine, so
385
+ running commands inside its `workspace-write` sandbox, which blocks git, so it cannot commit and
386
+ an item stops at its first commit; Codex with full access, which runs with no sandbox and no
387
+ prompts; or a command you type. This decides what an unattended agent may do on your machine, so
381
388
  it is never picked for you: with no terminal, setup needs `--agent <preset>` or
382
389
  `--non-interactive`.
383
390
  - **How many items build at once** — two (recommended) or one.
@@ -399,7 +406,23 @@ six questions on its own. Each is a list with one choice marked recommended:
399
406
  after design only, or no pauses. These are the two phases whose output decides the shape of the
400
407
  code.
401
408
  - **How far autopilot takes each item** — open the pull request and wait for you to merge it
402
- (recommended); merge when CI passes with no release; or merge and run the release step below.
409
+ (recommended); merge once CI and the pull request check pass, with no release
410
+ (`checked-merge`); merge when CI passes with no release; or merge and run the release step below.
411
+
412
+ **The pull request check.** Under `pr` and `checked-merge`, once CI passes on the pull request,
413
+ autopilot launches a new agent session in the item's worktree, with the item's agent command and
414
+ never a build session resumed. It is given the instance's active `AC-<n>` lines from
415
+ `requirements.md` (from `roadmap-item.md` when there is none), the diff against `main` and
416
+ `tasks.md`, and told to edit, commit and push nothing while it may run the project's tests and
417
+ build. It answers PASS or REJECT, with met or not met and the evidence for each criterion.
418
+ Autopilot posts that as one comment on the pull request and adds it to
419
+ `.aidlc/state/<instance>/pr-check.md`, which the close-out carries into main. Under `pr` the
420
+ verdict only informs: the item waits for you to merge it whatever it says. Under `checked-merge` a
421
+ PASS with no open question merges; a first REJECT relaunches the build agent once with the
422
+ criteria not met; a second parks the item. A check that could not decide — no criteria, a custom
423
+ agent command, an unreadable verdict, or a checker that changed the branch or a tracked file —
424
+ waits for you, saying why. The check counts toward the item's cost cap. `merge` and `release` run
425
+ no check.
403
426
  - **The release step.** In a project with `scripts/autopilot-release.sh`, running it after each
404
427
  merge (recommended); otherwise merge only, and you release when you choose. This repository's
405
428
  script runs `release-bookkeeping --write`, commits the manifest and `.aidlc`, and runs
@@ -408,12 +431,12 @@ six questions on its own. Each is a list with one choice marked recommended:
408
431
 
409
432
  Flags skip the questions: `--agent`, `--parallel`, `--token-cap <tokens|none>` (`40M`, `500k`),
410
433
  `--cost-cap <usd|none>` (a dollar cap, as before), `--pause-after
411
- <phases|none>`, `--stop-at <pr|merge|release>`, `--release <repo-script|merge-only>`. `aidlc
434
+ <phases|none>`, `--stop-at <pr|checked-merge|merge|release>`, `--release <repo-script|merge-only>`. `aidlc
412
435
  autopilot setup` writes every answer to
413
436
  `<git-common-dir>/aidlc/autopilot/config.json`, per machine and never committed, beside autopilot's
414
437
  `state.json`, `run.json`, `logs/`, `STOP` file and, while paused, `paused.json`.
415
438
 
416
- **One run at a time.** `aidlc autopilot run --stop-at <pr|merge|release>` and `--pause-after
439
+ **One run at a time.** `aidlc autopilot run --stop-at <pr|checked-merge|merge|release>` and `--pause-after
417
440
  <phases|none>` change the stops for the items that run starts, without touching either saved file.
418
441
  Each item records the stops in force when it started and is held to them until it finishes, so a
419
442
  later run cannot make an item in flight wait on a phase that completed hours ago. Every run prints a
@@ -428,7 +451,7 @@ machine:
428
451
  autopilot:
429
452
  cost_cap_tokens: 40000000 # or null for no cap; cost_cap_usd still works
430
453
  pause_after: [requirements, design] # or [] for no pauses
431
- stop_at: pr # or merge, or release
454
+ stop_at: pr # or checked-merge, merge, or release
432
455
  release: repo-script # or merge-only — a preset name, never a command
433
456
  notify: false # no desktop notifications; leave it out for them on
434
457
  ```
@@ -445,7 +468,7 @@ answer takes effect here too. The agent, its permissions and parallelism are rea
445
468
  file only: the same keys in `.aidlc/config.yaml` are ignored, so cloning a repo can never grant an
446
469
  agent full access on your machine. A team value that is not valid — a cap that is not a positive number
447
470
  or `null`, a release step that is not one of the two names, `repo-script` with no script, a `stop_at`
448
- outside the three names, a `pause_after` that is not a list of phase names — is ignored.
471
+ outside the four names, a `pause_after` that is not a list of phase names — is ignored.
449
472
  Re-running `aidlc init` pre-selects every answer in force, and an answer no choice matches is offered as
450
473
  "(current)" and left as it is. `--non-interactive --autopilot` asks nothing, keeps what is there and
451
474
  fills only what is missing with the recommended choice.
@@ -493,6 +516,21 @@ records your words and applies nothing. Between rounds the skill runs `aidlc aut
493
516
  --pending` in the background; it exits when something new waits, after 30 minutes with nothing new
494
517
  (`--heartbeat <minutes>`), or when the run ends, and that exit is what wakes the session.
495
518
 
519
+ **Routine calls the watcher keeps itself.** Each entry also says whether it is `routine`. Two kinds
520
+ are: an `(unattended default)` answer that took the option its question recommended (its
521
+ `Recommendation` field, else the one option marked `(recommended)`, else its `If you say nothing`
522
+ field), and an item's unreviewed interpretations. Those list one more option, `watcher-keep`, which
523
+ the skill runs without asking you; in its next message it names each item it kept and the
524
+ `aidlc autopilot review <instance>` command that overturns it. Everything else is asked as before:
525
+ phase approvals, open questions an agent logged, an answer that named another option, and any
526
+ answer whose option the CLI cannot tell. The watcher's keep never carries your name. In the
527
+ decision log it reads `kept <date> (kept by the autopilot watcher, not a person)`, and its
528
+ `answers.ndjson` record has `by: "the autopilot watcher"` and `watcher: true`. `aidlc autopilot
529
+ review <instance>` asks those entries again and your verdict replaces the watcher's; `--pending`
530
+ still walks only instances with an entry nobody judged. A watcher keep on an open question never
531
+ counts toward an automatic merge. The question text of a logged call names the roadmap item's title
532
+ and what the agent chose, in one line of at most 240 characters.
533
+
496
534
  **Triage from the command line** is `aidlc roadmap triage <item> backlog [--rank <n>] [--run
497
535
  autopilot|attended]`, which moves an `inbox/` item to `backlog/`, ranks it as `roadmap rank` does and
498
536
  writes its `run:` line, or `aidlc roadmap triage <item> park|decline --reason "<why>"`, which moves it
@@ -230,6 +230,10 @@ agent's advice prompt by prompt was recorded as having judged every call. Promot
230
230
  `.aidlc/guidance/decisions.md`, which every later item reads: a rejection asks what the call should
231
231
  have been, and a non-empty answer is written there as a `Correction:` entry beside the original
232
232
  decision. Why: before, a rejection kept nothing, so the next run could make the same call again.
233
+ In a worktree, the review leaves alone every instance the local `main` branch already holds: one
234
+ instance is refused with the `cd` to run in the main checkout instead, `--pending` skips and counts
235
+ them, and `--from` lists them as problems. Why: after the merge the log's home is main, and verdicts
236
+ written into the old worktree were deleted with it, 16 of them on 2026-10-28.
233
237
  Completing testing is the normal end: the agent writes the release plan and stops, and whatever runs
234
238
  it owns the push, merge and release. The list of stops came from two dry runs on 2026-10-02 that
235
239
  logged the same thirteen on two machines. The mode is a rule the agent reads, not a switch the CLI
@@ -261,7 +265,11 @@ any other command would be a cost every future change pays.
261
265
  Skill?), one file each. `packages/cli/src/compile/rules.ts` emits them to `.aidlc/resources/rules/`
262
266
  on `init` and `update`. They used to be sections of the overview, and following one cross-reference
263
267
  cost the reader the whole 24KB file; now it costs the rule. The overview keeps a one-line pointer per
264
- rule and states none of them.
268
+ rule and states none of them — except the hand-off rule (`handoff.md`), which it has no room for
269
+ under its 12,000-byte limit. That rule is reached through the next-steps rule, the Question
270
+ Protocol and the deployment, requirements and testing skills, and
271
+ `packages/content/test/handoff-rule.test.ts` fails a phase skill that hands work to a person
272
+ without naming it.
265
273
  - `packages/content/glossary.yaml` — canonical vocabulary, resolved into skill bodies where they write
266
274
  `{{glossary:<term>}}`. Deliberately not installable into a project: guidance is yours to edit,
267
275
  framework vocabulary is not, and a second copy drifts.
@@ -40,8 +40,16 @@ before anything ships. You can pause or stop the run at any time.
40
40
  ```
41
41
 
42
42
  Use `--all` instead of `--items` to keep going until nothing is ready. To change where
43
- this run stops, add `--stop-at pr`, `--stop-at merge` or `--stop-at release`. To change the
44
- phases it pauses after, add `--pause-after requirements,design`.
43
+ this run stops, add `--stop-at pr`, `--stop-at checked-merge`, `--stop-at merge` or
44
+ `--stop-at release`. To change the phases it pauses after, add
45
+ `--pause-after requirements,design`.
46
+
47
+ Under `pr` and `checked-merge`, once CI passes an agent that did not build the item checks
48
+ its pull request against the item's acceptance criteria. It posts PASS or REJECT on the pull
49
+ request, with evidence for each criterion, and adds the same text to `pr-check.md` in the
50
+ instance's state folder. Under `pr` the verdict only informs: the item still waits for you
51
+ to merge it. Under `checked-merge` a PASS merges it with no release. A first REJECT sends
52
+ the findings back to the agent once; a second parks the item.
45
53
 
46
54
  4. Watch it. Add `--watch` to keep the view live; `q` leaves and the run keeps going:
47
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasensio/aidlc-content",
3
- "version": "2.21.0",
3
+ "version": "2.23.0",
4
4
  "bugs": "https://github.com/rasensio/aidlc-feedback/issues",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -4,4 +4,6 @@ This file is the only statement of the rule. Other skills point here instead of
4
4
 
5
5
  When `.aidlc/context/constitution.md` exists, read it before shaping work. It records what this repo owns (`IN-<n>` entries) and what it must never do (`NOT-<n>` entries), each citing the vision statement it was derived from. **If the work in front of you crosses a prohibition, name that prohibition by its id and say plainly that it does, before going further.** The user may still choose to proceed, or to amend the constitution — but the crossing gets stated out loud at the start rather than discovered in review.
6
6
 
7
+ Once the user has chosen, record it in the instance: append one line to `.aidlc/state/<instance>/constitution-crossings.md` — `- NOT-<n>: exception | amend — <reason> — <YYYY-MM-DD>`. "exception" proceeds for this instance only; "amend" changes the entry through the **aidlc-constitution** skill's "Amending from work" section. Without the line, a prohibition waived five times looks the same as one never touched. A crossing found outside any instance, such as at roadmap triage, has nowhere to go and is not recorded. The retrospective reads these lines.
8
+
7
9
  The constitution never fails a gate and never blocks a transition; its whole force is that somebody read it out at the right moment. An absent file is a normal state, not a gap to fill — it is written by the **aidlc-constitution** skill, from a vision document or, when there is none, from the user's answers to five questions.
@@ -24,6 +24,8 @@ Everything else is recorded as a `decision` entity exactly as before. When unsur
24
24
 
25
25
  A reversed decision is a new entry with a `Supersedes: ADR-<n>` line, asked like any other. The old entry keeps its text unedited; only its status-table row changes, to "Superseded by ADR-<m>", and its graph entity is renamed to say so (`aidlc knowledge update <id> --name "ADR-<n> (superseded by ADR-<m>): <title>"`).
26
26
 
27
+ A person may ask to change an Accepted entry at any time, not only when design meets its reopen condition; that request runs this same flow.
28
+
27
29
  ## Before changing what an entry covers
28
30
 
29
31
  Read the register head first: the status table, then only the entries the work touches. Never inline it into a skill or `CLAUDE.md`.
@@ -0,0 +1,39 @@
1
+ # The hand-off rule
2
+
3
+ This file is the only statement of the rule. Skills and the other rules point here instead of restating it.
4
+
5
+ **A step you hand to a person stands on its own.** They should be able to do it on the first read, without scrolling back, opening another file or asking what you meant.
6
+
7
+ ## When it applies
8
+
9
+ Any step you ask a person to carry out: a command in their terminal, a sign-in, a file upload, clicks in an admin screen or a cloud console, a job to re-run. A decision is not a hand-off; ask it through the **Question Protocol** (`.aidlc/resources/rules/question-protocol.md`).
10
+
11
+ ## What a hand-off states
12
+
13
+ Written out in the hand-off itself, in this order:
14
+
15
+ 1. **What and why.** What the thing is and why it is needed, in one plain sentence.
16
+ 2. **Where.** The app or site, the account or login to use, full absolute file paths, and the URL when you know it.
17
+ 3. **How.** The literal command in a copyable block, or the click path from the page they land on, with any keyboard help they need.
18
+ 4. **Preconditions first.** A login that has probably expired goes first, as its own step. Anything that must already exist (a PR, a deploy, an earlier step) you check yourself before handing the step over.
19
+ 5. **When, and in what order.** Now, after X, or not until you confirm Y.
20
+ 6. **Success, and what to send back.** What they see when it worked, and what to paste back to you, with anything sensitive (keys, tokens, passwords) stripped from it.
21
+ 7. **No pointer in place of the step.** Never "see step 5", "as in my previous message" or "per the runbook" instead of the step. A link may be added; it never replaces the step.
22
+ 8. **When it does not match.** What to do if what they see differs: which message to look for, and what to send you instead.
23
+
24
+ ## Example — the 2026-10-30 certificate
25
+
26
+ **Bad:**
27
+
28
+ > Upload the certificate (step 5), then revoke the old tokens (step 6).
29
+
30
+ **Good:**
31
+
32
+ > Salesforce needs the public certificate of the new signing key, so the ingest job can sign in without a password. Do this after I confirm the deploy finished.
33
+ >
34
+ > 1. Sign in to Salesforce at `https://login.salesforce.com` as `<admin-login>` (org `<org-name>`). If you were signed in yesterday, sign in again; the session has probably expired.
35
+ > 2. Click the gear icon, top right → **Setup** → type **App Manager** in Quick Find → on the `<app-name>` row, the arrow at the far right → **Edit** → tick **Use digital signatures** → **Choose File**.
36
+ > 3. Pick `/Users/<you>/projects/<repo>/certs/<name>.crt`. The `certs` folder is hidden in the file chooser on macOS: press `Cmd+Shift+.` to show it.
37
+ > 4. Click **Save**. Success: the page shows **Digital Signature: <name>.crt** under API settings. Send me that line.
38
+ >
39
+ > If **Use digital signatures** is missing, OAuth is turned off for the app: send me a screenshot of the API settings box, with nothing else on screen.
@@ -25,6 +25,8 @@ When both groups are empty, say so in one line.
25
25
 
26
26
  Close the turn with exactly one next step. It names a command the user can run as written — the real instance name, the real phase or artifact — or, when decisions are open, says to answer them first.
27
27
 
28
+ When the next step is one a person does outside the terminal — a sign-in, an upload, clicks in a console — end with that step written as a hand-off in place of a command, as **The hand-off rule** (`.aidlc/resources/rules/handoff.md`) says.
29
+
28
30
  - Decisions are open → answer them first; no command yet.
29
31
  - Fixes are offered and not yet applied → the fixes, then the command below.
30
32
  - The phase's exit criteria are met → `aidlc transition <instance>`. That is the step that marks the phase complete; `aidlc gate` only checks, and fails on an open phase until it runs.
@@ -1,6 +1,6 @@
1
1
  # Question Protocol
2
2
 
3
- Ask when **different answers would change an artifact, a design decision, or scope** — the trigger is consequence, not volume. A question whose answers change nothing is not asked. Building something other than what was agreed is always asked: `.aidlc/resources/rules/departures.md`.
3
+ Ask when **different answers would change an artifact, a design decision, or scope** — the trigger is consequence, not volume. A question whose answers change nothing is not asked. Building something other than what was agreed is always asked: `.aidlc/resources/rules/departures.md`. A step a person carries out is a hand-off: `.aidlc/resources/rules/handoff.md`.
4
4
 
5
5
  **Before asking, check the sources:** `.aidlc/config.yaml`, the roadmap item, the starting prompt, the answers already recorded in this instance, and the code. If one answers it, do not ask: write the answer into the artifact it was for, citing `path:line` or `path`. A question whose recommendation could only quote one of them is already answered. Ask when they disagree or none decides; an earlier answer is not re-asked — ask only the narrow follow-up.
6
6
 
@@ -20,7 +20,7 @@ When several questions in one file share a concept, open the file with one share
20
20
 
21
21
  The example shows what would really happen. One simplified until it changes the answer misleads as badly as jargon does, and it is harder to spot.
22
22
 
23
- Expand every identifier on first use, writing the thing out with the tag in parentheses — "the citation rule (AC-1)", not a bare `AC-1`: a bare tag assumes the reader carries a mapping they do not have.
23
+ Expand every identifier on first use, writing the thing out with the tag in parentheses — "the citation rule (AC-1)", not a bare `AC-1`.
24
24
 
25
25
  ## Rendering the spec
26
26
 
@@ -1,6 +1,6 @@
1
1
  # The unattended rule
2
2
 
3
- This file is the only statement of the rule. Skills point here instead of restating it, so there is no second copy to drift.
3
+ This file is the only statement of the rule.
4
4
 
5
5
  Unattended mode is on exactly when the environment variable `AIDLC_UNATTENDED` is `1`. The launch prompt says so (`AIDLC_UNATTENDED=1`); run `printenv AIDLC_UNATTENDED` only when the prompt does not say, since a preset may refuse it. Otherwise every skill behaves as written. Nobody answers in this mode, so every place a skill would stop for a person has one outcome:
6
6
 
@@ -14,7 +14,7 @@ A situation no stop below covers is decided and logged when its choice lies insi
14
14
 
15
15
  ## The log
16
16
 
17
- Append one entry per default, decision or hard stop to `.aidlc/state/<instance>/unattended-stops.md`: a `## <n>. <title> — <slug>` heading, then **Source:** (skill and section, or rule), **Instruction:** (the exact text), **Decided:** (the default, the choice, or "hard stop"), **Type:** (`default` for a listed stop or a hard stop; for a decision, `interpretation` — how an unclear requirement was read, `deviation` — a design detail not followed that changes no scope and no chosen option, never a departure, or `open-question` — needs a person), **Why:** (why it is safe, or which hard-stop class). A Question Protocol answer also carries `(unattended default)` in its `[Answer]:` — how a reviewer finds every choice nobody made. An `open-question` builds the option easiest to undo, says how to switch, and still reaches a pull request, which autopilot does not merge until a person has answered.
17
+ Append one entry per default, decision or hard stop to `.aidlc/state/<instance>/unattended-stops.md`: a `## <n>. <title> — <slug>` heading, then **Source:** (skill and section, or rule), **Instruction:** (the exact text), **Decided:** (the default, the choice, or "hard stop"), **Type:** (`default` for a listed stop or a hard stop; for a decision, `interpretation` — how an unclear requirement was read, `deviation` — a design detail not followed that changes no scope and no chosen option, never a departure, or `open-question` — needs a person), **Why:** (why it is safe, or which hard-stop class). A Question Protocol answer also carries `(unattended default)` in its `[Answer]:` — how a reviewer finds every choice nobody made. An `open-question` builds the option easiest to undo, says how to switch, and still reaches a pull request, which autopilot does not merge until a person has answered. A hard stop needing a person to act writes that step in as a hand-off: `.aidlc/resources/rules/handoff.md`.
18
18
 
19
19
  ## Waiting for a command
20
20
 
@@ -5,7 +5,7 @@ phase: ideation
5
5
  priority: 88
6
6
  arguments: "[path to the vision document]"
7
7
  invocation: routed
8
- trigger: When the user points at a product vision document, asks what this repo is or is not allowed to do, asks to create or update a project constitution (with or without a vision document), or when the vision document has changed
8
+ trigger: When the user points at a product vision document, asks what this repo is or is not allowed to do, asks to create or update a project constitution (with or without a vision document) or to challenge or amend one of its entries, or when the vision document has changed
9
9
  native_mode_hint:
10
10
  claude-code: >-
11
11
  This skill imports a document and drafts prose for the user to correct. Do
@@ -216,6 +216,15 @@ changed, why. Amendments are how the next reader tells a deliberate local rule f
216
216
  a stale derivation. Record each answer in the question file and leave it in place —
217
217
  it is the record of what was asked and decided.
218
218
 
219
+ ## Amending from work
220
+
221
+ A crossing answered "amend", the retrospective's challenge, or the user asking to
222
+ change an entry all start here. The vision has not changed, so skip
223
+ `aidlc constitution check` and the re-import. Ask one question for that entry in
224
+ `.aidlc/questions/constitution-update-<YYYY-MM-DD>.md`, shaped like Step 2's with
225
+ leave-as-it-is among the options, and apply it only as Step 3 says: an Amendments
226
+ line naming the instance the challenge came from, when there is one.
227
+
219
228
  ## Consulting the constitution
220
229
 
221
230
  Reading it during other work is not this skill's job — the overview skill carries
@@ -137,7 +137,7 @@ To change a criterion after its phase closed:
137
137
  current one, re-arming their gates, and records a `type: reopen` entry in
138
138
  `transitions.log` so the churn is visible in history rather than reading as a normal
139
139
  forward pass. From testing onwards it requires `--confirm`, which only a person can give: the
140
- command refuses it without a terminal or under `AIDLC_UNATTENDED=1`, so ask the user to run it.
140
+ command refuses it without a terminal or under `AIDLC_UNATTENDED=1`, so ask the user to run it, as a hand-off (`.aidlc/resources/rules/handoff.md`).
141
141
 
142
142
  When the correction is confined to the phase you are in — nothing in a completed phase
143
143
  cites what you retired — write `Reopens: none` (naming the current phase means the same).
@@ -10,7 +10,7 @@ tier: mechanical
10
10
 
11
11
  ## Purpose
12
12
 
13
- Verify that the implementation satisfies all acceptance criteria. Produce evidence of correctness through automated tests and manual verification where needed.
13
+ Verify that the implementation satisfies all acceptance criteria. Produce evidence of correctness through automated tests and manual verification where needed; a step a person runs is handed over as `.aidlc/resources/rules/handoff.md` says.
14
14
 
15
15
  ## Entry Criteria
16
16
 
@@ -93,6 +93,8 @@ Deployment is inherently sensitive. You MUST:
93
93
  4. Wait for explicit user approval before executing any deployment command
94
94
  5. If deploying to production, require additional confirmation stating the environment name
95
95
 
96
+ Every step a person runs — a command, a console click path, an upload, a sign-in — is written as a hand-off, as **The hand-off rule** (`.aidlc/resources/rules/handoff.md`) defines.
97
+
96
98
  Never deploy without explicit user confirmation. If the user cancels, halt and log the cancellation.
97
99
 
98
100
  ## Guidance
@@ -37,7 +37,7 @@ The CLI does the work. This skill starts it and says how to watch and stop it. D
37
37
 
38
38
  6. **Where it stops for a person.** Three stops. The first two are set in `aidlc autopilot setup` or `aidlc init` and on by default; the third needs no setting:
39
39
  - **After a phase** — the agent stops when a phase in `pause_after` completes (requirements and design by default). The item waits as `awaiting-review`; it is *not* parked. The user reads the artifact in the item's worktree, then `aidlc autopilot approve <instance>` carries it on. A requirements or design phase that wrote "Nothing open" into its artifact, with no unanswered question, is not waited on: the item carries on, and the run log says so.
40
- - **At the pull request** — autopilot opens it and waits for the user to merge. Merging is the approval: autopilot then closes the instance out on main and runs no release.
40
+ - **At the pull request** — autopilot opens it, waits for CI, then has an agent that did not build it check the change against the instance's acceptance criteria. The verdict, PASS or REJECT with evidence per criterion, is posted on the pull request and added to `pr-check.md` in the instance's state directory. Under `stop_at: pr` the verdict only informs: the item waits for the user to merge whatever it says. Merging is the approval: autopilot then closes the instance out on main and runs no release.
41
41
  - **At an open question** — an unattended agent decides calls inside the item's scope and logs each in the instance's state directory; one it marks `open-question` needs the user. Whatever `stop_at` says, that item waits at its pull request like the stop above. The user runs `aidlc autopilot review <instance>` in the item's worktree to keep, reject or promote each logged decision — promoting adds it to `.aidlc/guidance/decisions.md`, which every later item reads, and rejecting one asks what the call should have been and adds that answer there as a correction (Enter skips) — then merges.
42
42
 
43
43
  **Preparing that review.** When the person asks for help with the logged calls, write a proposal for them; never run `aidlc autopilot review` yourself. Write it to `<git common dir>/aidlc/review-proposal.yaml` (`git rev-parse --git-common-dir`), outside every working tree, so no commit picks it up. It is YAML with one key, `instances`, mapping each instance to its entries by number. Give every entry without a `**Review:**` line, in each instance you name, a verdict: `keep`, `reject` or `promote` — the CLI refuses a proposal that leaves one out. Promote only an `interpretation`, a `deviation` or an entry with no `**Type:**` line. An entry needs the person when it is an `open-question` or you propose reject or promote: write it as a mapping with `verdict` and three parts in plain words, each under 1,000 characters — `what_happened`, `example` (one concrete case), and `what_changes` (what each answer would change):
@@ -55,17 +55,20 @@ The CLI does the work. This skill starts it and says how to watch and stop it. D
55
55
 
56
56
  Then give the person the command to run in their own terminal: `aidlc autopilot review --from <file>`. It checks the whole proposal against the logs first and names every problem, writes the routine keeps at once as accepted from the agent's proposal, and stops only on the entries that need the person, showing your explanation and your answer first. `aidlc autopilot review --pending` walks every instance with an unreviewed entry when there is no proposal.
57
57
 
58
- One run can change both without touching the saved setup: `aidlc autopilot run --items 3 --stop-at merge` or `--pause-after design` (`--pause-after none` for no pauses, `--stop-at release` for the old merge-and-release). The flags apply to the items that run starts; an item already in flight keeps the stops it started with. A config saved before stops existed keeps today's behaviour — no pauses, merge and release — until somebody sets them.
58
+ `stop_at: checked-merge` lets that check earn the merge: once CI and the check pass, autopilot merges with no release. A first REJECT sends the criteria not met back to the build agent once; a second parks the item. A check that could not decide, or an unreviewed open question, waits for the user as `pr` does.
59
+
60
+ One run can change both without touching the saved setup: `aidlc autopilot run --items 3 --stop-at merge` or `--pause-after design` (`--pause-after none` for no pauses, `--stop-at release` for the old merge-and-release, `--stop-at checked-merge` to merge on a passing check). The flags apply to the items that run starts; an item already in flight keeps the stops it started with. A config saved before stops existed keeps today's behaviour — no pauses, merge and release — until somebody sets them.
59
61
 
60
62
  When the user asks what is waiting for them, run `aidlc autopilot status`: it names the phase, the worktree and the exact approve command for each waiting item, and under it each open decision — the question, why it matters, the options with the recommended one marked, and the file to answer in. Answering is writing the chosen option after that question's `[Answer]:`, then the approve command. When they ask how the items are getting on, run `aidlc autopilot status --watch`: called from here it prints each item's phase, tasks done, time in its step and last event once, and returns.
61
63
 
62
64
  7. **Stay on watch while the run is active.** The run's agents can ask nobody, so every decision only a person can make ends up in a file. You are the one session a person is watching: ask them. Do not build, review or fix any item yourself.
63
- - **Read what waits.** Run `aidlc autopilot pending --json`. Each entry has a `fingerprint`, a `kind`, `blocks` (it blocks the run) or not (it only waits), a `question`, a `summary`, an `artifact` to read, and `options`, the recommended one first. Each option has an `id`, a `label`, a one-line `consequence`, `person` (only the person may apply it, in their own terminal), `applies` (what it comes down to) and the `command` that applies it.
65
+ - **Read what waits.** Run `aidlc autopilot pending --json`. Each entry has a `fingerprint`, a `kind`, `blocks` (it blocks the run) or not (it only waits), `routine` (a call the agent made the way its item or question file recommended), a `question`, a `summary`, an `artifact` to read, and `options`, the recommended one first. Each option has an `id`, a `label`, a one-line `consequence`, `person` (only the person may apply it, in their own terminal), `applies` (what it comes down to) and the `command` that applies it.
66
+ - **Keep the routine calls yourself.** For each entry marked `routine: true`, run its `watcher-keep` option's `command` without asking. It records the keep as the watcher's, not the person's, and `aidlc autopilot review <instance>` can still overturn it before the merge. In the same message as your next round of questions — or alone, when nothing else waits — say in one line per item what you kept and the `aidlc autopilot review <instance>` command that overturns it. Ask the person only about the entries marked `routine: false`.
64
67
  - **Ask.** At most four questions a round: blocking entries first, then the oldest. Before each round, write one message with what the person needs to answer: which item, what the agent did, the artifact path, and every command an option will run or hand to them — the question UI cannot copy text, so commands go in the message, never in a question. Ask each entry as a multiple-choice question: its `question`, and its options by `label`, recommended first, each with its `consequence` on one line. For a triage entry the rank and the run mode are one answer. When nothing new waits, say nothing.
65
68
  - **Apply each answer** by running exactly the chosen option's `command` — `aidlc autopilot answer <fingerprint> <option>` — and report what it printed. A triage answer with another rank ("rank 2, attended") is that option with `--rank 2`. A park or decline takes the person's reason as `--note "<reason>"`. An answer you cannot map to an option, run as `aidlc autopilot answer <fingerprint> other --note "<their words>"`, and repeat their words back; never guess an option from it. Approving an item, and keeping or rejecting a decision its agent logged, are applied by `answer` itself, in the person's name: run that option only when the person chose it. A person-only option prints the command for them to run in their own terminal: pass it on as printed. When the person does not answer, run nothing; the run carries on with everything else.
66
69
  - **Wait to be woken.** Then run `aidlc autopilot wait --pending` as a background command and end your turn. It exits when something new waits, after 30 minutes with nothing new, or when the run ends, and its exit wakes you. On waking, read `aidlc autopilot pending --json` again: ask what you have not asked this session, stay silent when there is nothing new, and start the wait again. When it prints `run ended`, say so in one line and stop watching. This is the one place a session ends its turn to wait: `rules/unattended.md` "Waiting for a command" binds unattended agents, not you.
67
70
  - **No background command?** Where this agent cannot be woken by a background command's exit, check `aidlc autopilot pending --json` every 20–30 minutes with a scheduled check instead. Failing both, say once that the person must run `aidlc autopilot status` themselves to see what waits.
68
- - **Never** answer a question yourself, approve or review unless the person chose that option this round (and then only through its `answer` command; `aidlc autopilot approve` and `aidlc autopilot review` are theirs to run in their own terminal), change `pause_after` or `stop_at`, merge or release beyond what the run's stops allow, or build an item. An answer already given in another session is refused by `answer` with who gave it; report that and move on.
71
+ - **Never** answer a question yourself, approve or review unless the person chose that option this round — the one exception is `watcher-keep` on an entry marked `routine: true`; every other option, a phase approval and an open question an agent logged are the person's — (and then only through its `answer` command; `aidlc autopilot approve` and `aidlc autopilot review` are theirs to run in their own terminal), change `pause_after` or `stop_at`, merge or release beyond what the run's stops allow, or build an item. An answer already given in another session is refused by `answer` with who gave it; report that and move on.
69
72
 
70
73
  8. **Pause and resume.** When the user is stepping away or closing the laptop, run `aidlc autopilot pause`; when they are back, `aidlc autopilot resume`. Report what each printed. If pause says a pass is in progress — a merge or a release — run it again a minute later rather than stopping the run.
71
74
 
@@ -30,7 +30,9 @@ Run the retro **before** any completion cleanup (worktree removal, claim release
30
30
  1. **Idempotency check.** If `retrospective.md` already exists in the instance state dir, offer to update or skip — never duplicate. A skip still removes the retro-pending marker.
31
31
  2. **Gather state.** Read `instance.yaml`, `phase-*.yaml`, and `transitions.log`. For the cost summary, prefer `aidlc cost <instance>` (it applies fidelity precedence); only read `costs.ndjson` raw when the CLI is unavailable, and mark that summary approximate. No cost data → omit the cost section entirely, never write zeros.
32
32
  3. **Draft, then ask — one round-trip.** Draft your own answers to the three questions — what surprised us? what would we do differently? what took longer than expected? — from the record: `transitions.log`, the question files, `.aidlc/state/<instance>/unattended-stops.md`, `test-results.md` and the cost summary. Cite what each answer rests on. Show the three drafts in a single message and ask the user to correct them; a reply that changes nothing keeps them. For **Micro scope**, compress to one drafted answer covering all three. Unattended (`AIDLC_UNATTENDED=1`), write the drafts into `retrospective.md` under the line "Drafted by the agent from the record; not reviewed by a person." Declining the retro is fine: remove the marker, write nothing.
33
- 4. **Write `retrospective.md`** in the instance state dir: the answers, as the user corrected the drafts; instance metadata (template, scope); per-phase durations (pair each transitions.log `to: X` with the next `from: X`; fall back to the phase YAML's `entered_at`/`completed_at`; note inconsistencies rather than guessing); and the cost summary when available.
33
+
34
+ **Challenge the entries the work ran into.** Only when the instance has a `constitution-crossings.md`, or its `design.md` or `design-questions.md` cites an `ADR-<n>`: in the same message, ask one question — should any of these entries change? — naming each one. For a `NOT-<n>`, count its `exception` lines across `.aidlc/state/*/constitution-crossings.md`; at two or more, give the count and the instances, so a rule that keeps being waived is visible. A yes goes to the **aidlc-constitution** skill's "Amending from work" section for a `NOT-<n>`, or to a superseding entry per **The decision-register rule** (`.aidlc/resources/rules/decision-register.md`) for an `ADR-<n>`; the retro edits neither document. With neither signal, ask nothing. Unattended, list the entries and counts and mark the question not asked.
35
+ 4. **Write `retrospective.md`** in the instance state dir: the answers, as the user corrected the drafts; when the challenge was asked or listed, a `## Constitution and register` section with one line per entry and its answer, a "no" included; instance metadata (template, scope); per-phase durations (pair each transitions.log `to: X` with the next `from: X`; fall back to the phase YAML's `entered_at`/`completed_at`; note inconsistencies rather than guessing); and the cost summary when available.
34
36
  5. **Distill lessons — 0 to 3.** A lesson is a durable, project-general observation ("NDJSON merge=union false-dedups identical same-second events"), not an instance anecdote ("we finished late"). If nothing generalizes, write no lesson — an empty distillation is a valid outcome.
35
37
 
36
38
  **Before distilling, search** `.aidlc/guidance/lessons.md` and `.aidlc/guidance/lessons-digest.md` for an earlier lesson making the same claim — the same mechanism, not the same words. Then end every lesson with **exactly one resolution tag**, naming what stops it next time: `[test: <path>]`, `[check: <name or path>]`, `[guidance: <file>]`, or `[observation]` when nothing does. A lesson the search matched **cannot be tagged `[observation]`**: the project has already paid for it as prose. It names the test, check or guidance file that now stops it, or it becomes one of the step 6 follow-ups with that artifact as its smallest change, and its tag names the artifact that follow-up will build.