ll-skills 2.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +42 -20
  3. package/agents/ll-executor.md +2 -1
  4. package/agents/ll-verifier.md +1 -0
  5. package/assets/preamble.md +27 -39
  6. package/bin/install.js +4 -1
  7. package/hooks/ll-precompact.js +29 -1
  8. package/hooks/ll-skills-check-update.js +6 -6
  9. package/hooks/ll-state.js +30 -2
  10. package/package.json +3 -2
  11. package/scripts/evals/README.md +81 -0
  12. package/scripts/evals/cases/auto-dry-run/assert.sh +35 -0
  13. package/scripts/evals/cases/auto-dry-run/case.json +8 -0
  14. package/scripts/evals/cases/auto-dry-run/prompt.txt +1 -0
  15. package/scripts/evals/cases/auto-empty-repo/assert.sh +25 -0
  16. package/scripts/evals/cases/auto-empty-repo/case.json +8 -0
  17. package/scripts/evals/cases/auto-empty-repo/fixture/.gitkeep +0 -0
  18. package/scripts/evals/cases/auto-empty-repo/prompt.txt +1 -0
  19. package/scripts/evals/cases/decide-final-round/assert.sh +45 -0
  20. package/scripts/evals/cases/decide-final-round/case.json +8 -0
  21. package/scripts/evals/cases/decide-final-round/fixture/README.md +3 -0
  22. package/scripts/evals/cases/decide-final-round/prompt.txt +1 -0
  23. package/scripts/evals/cases/executor-block/assert.sh +33 -0
  24. package/scripts/evals/cases/executor-block/case.json +8 -0
  25. package/scripts/evals/cases/executor-block/prompt.txt +14 -0
  26. package/scripts/evals/cases/goal-autonomous/assert.sh +35 -0
  27. package/scripts/evals/cases/goal-autonomous/case.json +8 -0
  28. package/scripts/evals/cases/goal-autonomous/fixture/PLAN.md +42 -0
  29. package/scripts/evals/cases/goal-autonomous/fixture/PROGRESS.md +20 -0
  30. package/scripts/evals/cases/goal-autonomous/fixture/ROADMAP.md +29 -0
  31. package/scripts/evals/cases/goal-autonomous/fixture/package.json +8 -0
  32. package/scripts/evals/cases/goal-autonomous/fixture/src/money.js +6 -0
  33. package/scripts/evals/cases/goal-autonomous/fixture/test/reconcile.test.js +8 -0
  34. package/scripts/evals/cases/goal-autonomous/prompt.txt +1 -0
  35. package/scripts/evals/cases/implement-review-gate/assert.sh +37 -0
  36. package/scripts/evals/cases/implement-review-gate/case.json +8 -0
  37. package/scripts/evals/cases/implement-review-gate/prompt.txt +1 -0
  38. package/scripts/evals/cases/implement-stops-at-next/assert.sh +121 -0
  39. package/scripts/evals/cases/implement-stops-at-next/case.json +9 -0
  40. package/scripts/evals/cases/implement-stops-at-next/prompt.txt +1 -0
  41. package/scripts/evals/cases/preamble-no-ritual/assert.sh +17 -0
  42. package/scripts/evals/cases/preamble-no-ritual/case.json +8 -0
  43. package/scripts/evals/cases/preamble-no-ritual/fixture/README.md +3 -0
  44. package/scripts/evals/cases/preamble-no-ritual/fixture/src/a.ts +3 -0
  45. package/scripts/evals/cases/preamble-no-ritual/prompt.txt +1 -0
  46. package/scripts/evals/cases/router-no-skill/assert.sh +33 -0
  47. package/scripts/evals/cases/router-no-skill/case.json +8 -0
  48. package/scripts/evals/cases/router-no-skill/fixture/PLAN.md +21 -0
  49. package/scripts/evals/cases/router-no-skill/fixture/README.md +7 -0
  50. package/scripts/evals/cases/router-no-skill/fixture/decisions/README.md +3 -0
  51. package/scripts/evals/cases/router-no-skill/prompt.txt +1 -0
  52. package/scripts/evals/cases/router-small/assert.sh +21 -0
  53. package/scripts/evals/cases/router-small/case.json +8 -0
  54. package/scripts/evals/cases/router-small/fixture/README.md +17 -0
  55. package/scripts/evals/cases/router-small/prompt.txt +1 -0
  56. package/scripts/evals/cases/scout-no-plan/assert.sh +41 -0
  57. package/scripts/evals/cases/scout-no-plan/case.json +8 -0
  58. package/scripts/evals/cases/scout-no-plan/prompt.txt +8 -0
  59. package/scripts/evals/cases/verifier-weakened-test/assert.sh +19 -0
  60. package/scripts/evals/cases/verifier-weakened-test/case.json +8 -0
  61. package/scripts/evals/cases/verifier-weakened-test/prompt.txt +13 -0
  62. package/scripts/evals/cases/verifier-weakened-test/setup.sh +19 -0
  63. package/scripts/evals/fixtures/manual-contract/out.json +29 -0
  64. package/scripts/evals/fixtures/manual-contract/out.txt +5 -0
  65. package/scripts/evals/fixtures/manual-contract/with-skill.json +46 -0
  66. package/scripts/evals/fixtures/router-no-skill/fail.txt +5 -0
  67. package/scripts/evals/fixtures/router-no-skill/out.json +27 -0
  68. package/scripts/evals/fixtures/router-no-skill/pass.txt +4 -0
  69. package/scripts/evals/lib/assert.sh +107 -0
  70. package/scripts/evals/lib/extract.js +73 -0
  71. package/scripts/evals/run.sh +369 -0
  72. package/scripts/fixtures/auto-closed/PLAN.md +5 -0
  73. package/scripts/fixtures/auto-closed/PROGRESS.md +20 -0
  74. package/scripts/fixtures/auto-closed/ROADMAP.md +6 -0
  75. package/scripts/fixtures/auto-closed/docs/DELIVERY.md +3 -0
  76. package/scripts/fixtures/auto-decisions/decisions/DEC-0001-taken-alone.md +13 -0
  77. package/scripts/fixtures/auto-decisions/decisions/DEC-0002-owner.md +13 -0
  78. package/scripts/fixtures/auto-noroadmap/PLAN.md +20 -0
  79. package/scripts/fixtures/auto-noroadmap/PROGRESS.md +11 -0
  80. package/scripts/fixtures/auto-verify-next/PLAN.md +5 -0
  81. package/scripts/fixtures/auto-verify-next/PROGRESS.md +18 -0
  82. package/scripts/fixtures/auto-verify-next/ROADMAP.md +5 -0
  83. package/scripts/fixtures/auto-verify-next/phases/01/PLAN.md +6 -0
  84. package/scripts/fixtures/evals-auto/auto-dry-run/pass.txt +18 -0
  85. package/scripts/fixtures/evals-auto/auto-empty-repo/pass.txt +2 -0
  86. package/scripts/fixtures/evals-auto/goal-autonomous/pass.txt +29 -0
  87. package/scripts/fixtures/lint-bad/folded-description/SKILL.md +13 -0
  88. package/scripts/fixtures/lint-bad/jargon-in-questions/SKILL.md +36 -0
  89. package/scripts/fixtures/lint-bad/model-invocation-false/SKILL.md +10 -0
  90. package/scripts/fixtures/next-bad/skills/ll-bad/SKILL.md +30 -0
  91. package/scripts/fixtures/next-good/skills/ll-good/SKILL.md +26 -0
  92. package/scripts/fixtures/project/BACKLOG.md +6 -5
  93. package/scripts/fixtures/project/PROGRESS.md +4 -0
  94. package/scripts/lint-contract.cjs +495 -0
  95. package/scripts/lint-prompts.sh +443 -0
  96. package/scripts/ll-tools.js +497 -450
  97. package/scripts/smoke-test.sh +481 -4
  98. package/skills/ll-auto/SKILL.md +74 -0
  99. package/skills/ll-auto/references/run.md +75 -0
  100. package/skills/ll-auto/references/stages.md +66 -0
  101. package/skills/ll-auto/scripts/ll-auto.js +345 -0
  102. package/skills/ll-brainstorm/SKILL.md +14 -12
  103. package/skills/ll-brainstorm/references/decision-policy.md +22 -12
  104. package/skills/ll-close/SKILL.md +8 -7
  105. package/skills/ll-close/references/delivery.md +3 -1
  106. package/skills/ll-decide/SKILL.md +21 -19
  107. package/skills/ll-decide/references/decision-policy.md +22 -12
  108. package/skills/ll-decide/references/decision-room.md +5 -3
  109. package/skills/ll-decide/references/interview.md +29 -13
  110. package/skills/ll-decide/references/plan-skeleton.md +14 -14
  111. package/skills/ll-decide/references/premise-gate.md +34 -20
  112. package/skills/ll-goal/SKILL.md +22 -4
  113. package/skills/ll-goal/references/goal-template.md +57 -0
  114. package/skills/ll-implement/SKILL.md +25 -22
  115. package/skills/ll-implement/references/briefs.md +2 -1
  116. package/skills/ll-implement/references/decision-policy.md +22 -12
  117. package/skills/ll-implement/references/phase-conversation.md +20 -12
  118. package/skills/ll-implement/references/phase-plan.md +23 -0
  119. package/skills/ll-oncall/SKILL.md +3 -2
  120. package/skills/ll-refine/SKILL.md +3 -2
  121. package/skills/ll-research/SKILL.md +3 -2
  122. package/skills/ll-resume/SKILL.md +9 -4
  123. package/skills/ll-update/SKILL.md +6 -1
  124. package/skills/ll-verify/SKILL.md +2 -1
  125. package/skills/ll-verify/references/verifier-briefs.md +3 -0
@@ -1,13 +1,11 @@
1
1
  # Plan skeleton — PLAN.md, ROADMAP.md, decisions/, PROGRESS.md
2
2
 
3
- Read at project step 7. Templates are literal; text in `<…>` is filled, everything else stays.
4
- All four land at the repo root — `PLAN.md`, `ROADMAP.md`, `PROGRESS.md`, `decisions/`, alongside
5
- `BACKLOG.md`, `docs/decide/` and `phases/NN/`. Never under `docs/<project>/`: the hooks and
6
- `ll-tools.js state` expect the state at the git top, and a displaced tree is reported as
7
- `git_top ≠ root` and stops `ll-implement`. A root already occupied by a closed round is archived into
8
- `docs/history/<round-slug>/` first (SKILL.md step 0), with `decisions/` and `BACKLOG.md` left in
9
- place so the ids continue.
10
- PLAN.md has no length ceiling — it is the only file where length buys quality — but detail that
3
+ Read at project step 7. Templates are literal; text in `<…>` is filled, everything else stays. All four land at the
4
+ repo root — `PLAN.md`, `ROADMAP.md`, `PROGRESS.md`, `decisions/`, alongside `BACKLOG.md`, `docs/decide/` and
5
+ `phases/NN/`. Never under `docs/<project>/`: the hooks and `ll-tools.js state` expect the state at the git top, and a
6
+ displaced tree is reported as `git_top ≠ root` and stops `ll-implement`. A root already occupied by a closed round is
7
+ archived into `docs/history/<round-slug>/` first (SKILL.md step 0), with `decisions/` and `BACKLOG.md` left in place
8
+ so the ids continue. PLAN.md has no length ceiling — it is the only file where length buys quality — but detail that
11
9
  lives elsewhere enters by path, not by copy.
12
10
 
13
11
  ## PLAN.md
@@ -63,7 +61,7 @@ never proceeds alone. External block (balance, key, host, limit) = record the ex
63
61
  PROGRESS.md and stop without marking done. TDD on by default; exceptions: <UI/layout/config/glue/migration>.
64
62
 
65
63
  ## §8 Phases
66
- <pointer to ROADMAP.md, or the 1–3 phases inline: NN — name — REQs — 2–5 success criteria SC-nn>. Current phase: 01.
64
+ <pointer to ROADMAP.md when phases > 3; with ≤3 phases, the same table ROADMAP.md uses, inline: `| phase | name | depends_on | requirements | state |` header, then one row per phase, e.g. `| 01 | <…> | — | REQ-a | PLANNED |`>. Current phase: 01.
67
65
 
68
66
  ## §9 Environment · keys · materials (names, never values)
69
67
  <env var names, key names and where they live, fixtures, design files, credentials recipe by name>.
@@ -92,8 +90,7 @@ Success criteria (2–5, observable, "the user can…"): SC-01 <…> · SC-02 <
92
90
  These are the verifier's contract, above whatever the phase plan says.
93
91
  Deferred ideas: <…> (the scope of a phase is fixed; new ideas land here, never widen the phase)
94
92
  ```
95
- States: PLANNED · ACTIVE · DONE (docs/history/<delivery>) · BLOCKED. Numbering is continuous for
96
- the life of the project; after a milestone, done phases collapse into `<details>`.
93
+ States: PLANNED · ACTIVE · DONE (docs/history/<delivery>) · BLOCKED. Numbering is continuous for the life of the project; after a milestone, done phases collapse into `<details>`.
97
94
 
98
95
  ## decisions/DEC-NNNN-<slug>.md
99
96
  ```
@@ -112,9 +109,12 @@ the life of the project; after a milestone, done phases collapse into `<details>
112
109
  - superseded_by: — (append `superseded_by: DEC-0090 on <date>, reason: …`; never edit)
113
110
  - if decided by absence: [decided by absence — revisable] + the recommendation followed
114
111
  ```
115
- The id is `DEC-` + four digits + `-<slug>`, with no project or round prefix (`DEC-0007-cents-mismatch.md`,
116
- never `DEC-X-007`); one flat `decisions/` folder per repo, numbering continuous across rounds.
117
- The helper `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/ll-implement/scripts/ll-tools.js` is used only if it exists — this skill does not ship it; when it is absent, the id is the next number after the highest in the folder; with it, `dec-reserve <n>`. A number is never reused.
112
+ The id is `DEC-` + four digits + `-<slug>`, with no project or round prefix (`DEC-0007-cents-mismatch.md`, never `DEC-X-007`); one flat `decisions/` folder per repo, numbering continuous across rounds. The helper `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/ll-implement/scripts/ll-tools.js` is used only if it exists — this skill does not ship it; when it is absent, the id is the next number after the highest in the folder; with it, `dec-reserve <n>`. A number is never reused.
113
+
114
+ ### `status: WAITING` — what `ll-decide --no-talk` writes instead of asking a band-1 question
115
+ The same file, frozen at the question: `class: QUESTION`, `grounding` naming the owner reference this session could not read, the options table with the recommendation marked, and the two lines below. The recommendation is written, never applied — a WAITING DEC is not a decision.
116
+ - status: WAITING — not asked (`--no-talk`, <date>); band 1: money, irreversible outside the repo, price or promise, scope cut, the number the owner will look at, a recorded rule contradicted by new evidence
117
+ - stop: owner — <what stays blocked until the answer> · PLAN §3 lists the id with decision `— (WAITING)`, `ROADMAP.md` marks the first phase whose work depends on it with `stop: owner` in its section, and the closing report names each file by path. The contract is frozen with these open: the WAITING files, not the skill, are what stop the dependent work.
118
118
 
119
119
  ## decisions/README.md
120
120
  ```
@@ -1,9 +1,10 @@
1
- # Premise gate — the five questions
1
+ # Premise gate — the four questions
2
2
 
3
- Read at project step 1. Five questions, one block, before any subagent runs. Each answer re-prices
3
+ Read at project step 1. Four questions, one block, before any subagent runs. Each answer re-prices
4
4
  everything that follows, and none of them can be read from the repo — an unanswered one is
5
5
  inherited as a guess by every later step. Questions already answered in `docs/decide/OPENING.md`
6
- (its `PREMISES` line or a `D-00-kk` entry) are skipped; when all five are answered, no call is made.
6
+ (its `PREMISES` line or a `D-00-kk` entry) are skipped; when all four are answered, no call is made.
7
+ A fifth premise exists and is never asked: the constraint the session is inventing out of caution.
7
8
 
8
9
  ## The gate blocks
9
10
 
@@ -13,7 +14,7 @@ starts. A premise is closed when it carries one of three sources, written next t
13
14
  A premise with none of the three is a question, sent now, in one block of at most 4; until the
14
15
  block comes back — an answer, an "A", or ten minutes of silence on band-2/3 items — no premortem
15
16
  narrator, no judge, no subagent and no file is written. "Pode decidir tudo" does not open the gate:
16
- it turns band-2/3 premises into `ASM-n`, and leaves band-1 premises (PG-1, PG-2 and any premise
17
+ it turns band-2/3 premises into `ASM-n`, and leaves the owner-only ones (PG-1, PG-2 and any premise
17
18
  resting on a reference the session could not read) as questions.
18
19
 
19
20
  External references named in the request are read before the gate, by the route table in
@@ -23,10 +24,21 @@ question — "attach the file or paste the content" — never a premise guessed
23
24
  the request says "fiel ao protótipo", the prototype is a premise and its source is the content
24
25
  read, cited by artifact id or path.
25
26
 
26
- The tool takes four questions per call: 1–4 in the first call, 5 in the next, nothing in between.
27
- Format: the canonical one in `decision-policy.md` — `[PG-n] Question n/5 — <title> (impact HIGH ·
28
- revert: <cost>)`, `FACT:` with what the repo or the request already shows, the decision in
29
- business words ending with "?", 2–3 options, recommended first with its reason.
27
+ `--no-talk` sends no block at all. Each premise without a source takes the recommended option of
28
+ its question at once, written beside it as `ASM-n [decided by absence — revisable]`, and step 2
29
+ starts immediately. PG-1 and PG-2 are owner-only — as is any premise resting on a reference the
30
+ session could not read: they are recorded as premises and also as `decisions/DEC-NNNN-<slug>.md`
31
+ in state `WAITING`, so what the owner still owes is written down rather than dropped, and the
32
+ work that depends on a WAITING id is what stops later, never this step.
33
+
34
+ The four questions travel in one call — the tool's limit is four and there is never a fifth to
35
+ send after it. Format: the canonical one in `decision-policy.md`, on screen and in the owner's
36
+ language — `Pergunta n/4 — <title> (impacto ALTO|MEDIO|BAIXO · desfazer: <custo>)`, `FACT:` with
37
+ what the repo or the request already shows, the decision in business words ending with "?", 2–3
38
+ options, recommended first with its reason. The `PG-n` id names the section of this file and the
39
+ decision file only: it never appears in a header, an option or the closing line, and neither does
40
+ any band label — an owner-only item is called "só suas" on screen. The answer key is one line:
41
+ `Responda por letra (ex.: 1A 2A 3B 4A)`, free text welcome.
30
42
 
31
43
  ## PG-1 — The number that decides success, and what counts as FAILURE
32
44
  Why: without it an autonomous run reads a non-zero exit or a partial delivery as success; the
@@ -63,21 +75,23 @@ a reference". Asked only when a candidate pattern was found or the domain usuall
63
75
  (infra, CI/CD, repo layout, naming); when none was found, the option set says so.
64
76
  Lands in: PLAN §7 (execution protocol) and §2 when the pattern constrains the design.
65
77
 
66
- ## PG-5 — The constraint being invented out of caution
67
- Why: a prudence rule nobody asked for — "no customer data in logs", say — propagates into the
68
- server, the route tests, the documents and a deploy before anyone checks whether it was required.
69
- Form: state the constraint the plan is about to adopt on its own ("I intend to mask customer
70
- phones in internal logs") and ask whether it is the owner's rule. Options: "drop it — not my
71
- rule (Recommended when the owner's words or CLAUDE.md contain no such rule)" · "keep it as an
72
- invariant, with this source: <...>" · "keep it revisable: my constraint, review trigger <...>".
73
- The prudence constraints listed in `decision-policy.md` are proposed here, never assumed.
74
- Lands in: PLAN §5 (freedoms or reserved) or §2 with source; a kept-revisable one gets `[revisable]`.
78
+ ## The constraint invented out of caution — never a question
79
+ A prudence rule nobody asked for — "no customer data in logs", say — propagates into the server,
80
+ the route tests, the documents and a deploy before anyone checks whether it was required. It is
81
+ still not a question: asking the owner to rule on a constraint he never raised spends his one
82
+ block on the session's own caution. The session decides it alone, in one of two ways: drop it
83
+ when the owner's words and CLAUDE.md contain no such rule, or keep it as `ASM-n [revisable]` with
84
+ a one-line `Review trigger:` when dropping it would cost real rework. Either way it is named in
85
+ the final round as an assumption, in plain words ("mascarei X; reversível"), never as a question.
86
+ The prudence constraints listed in `decision-policy.md` are handled here by this rule.
87
+ Lands in: PLAN §5 (freedoms or reserved) or §2 with source; a kept one gets `[revisable]`.
75
88
 
76
89
  ## After the block
77
- Record the five answers (PG-1..PG-5) verbatim in `decisions/DEC-0001-<slug>.md` .. `DEC-0005-<slug>.md`
90
+ Record the four answers (PG-1..PG-4) verbatim in `decisions/DEC-0001-<slug>.md` .. `DEC-0004-<slug>.md`
78
91
  (or the reserved ids — four digits, no project prefix) and in the
79
92
  fixed block of `docs/decide/OPTIONS.html` (step 4). Each recorded premise names its source on its
80
- own line: `source: <file:line | "owner, <date>: '<quote>'" | ASM-n>`. Five sources present is the
81
- condition for step 2 to start. A free-text answer to any of them is a
93
+ own line: `source: <file:line | "owner, <date>: '<quote>'" | ASM-n>`. A kept caution constraint is
94
+ written beside them as `ASM-n [revisable]` with its review trigger, and counted as an assumption,
95
+ not as a question. Four sources present is the condition for step 2 to start. A free-text answer to any of them is a
82
96
  requirement: give it an ID and carry it into the interview queue. A "Claude decide" answer is
83
97
  `ASM-n` in PLAN §3 and is not asked again in any later step.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ll-goal
3
- description: Writes the `/goal` text that carries a phase to delivery with nobody watching — one objective with a number, literal proofs, the fixed invalidating rules, execution, budget, decisions and stop rule — and saves it as docs/GOAL.md, versioned. Use when the owner says "goal", "me dá o texto do goal", "roda de noite até entregar", at the end of an ll-decide project run, or before a phase that will run unattended. The owner pastes the output into `/goal` in a new session; to write the plan the goal points at, use ll-decide.
4
- argument-hint: "[phase-number]"
3
+ description: Writes the unattended-run text for /goal, with one numbered objective, literal proofs, invalidating rules, budget, decisions and a stop rule, saved as a versioned docs/GOAL.md; --autonomous covers the whole delivery.
4
+ argument-hint: "[phase-number | --autonomous [\"<objective>\"]]"
5
5
  disable-model-invocation: true
6
6
  ---
7
7
 
@@ -18,7 +18,7 @@ Reply to the owner in Portuguese; docs/GOAL.md is in English.
18
18
 
19
19
  | File | Role | Mutability |
20
20
  | --- | --- | --- |
21
- | `docs/GOAL.md` | frontmatter (`date`, `plan`, `phase`, `ceiling_usd`, `max_turns`) + the 9-part text | rewritten whole on each run, committed |
21
+ | `docs/GOAL.md` | frontmatter (`date`, `plan`, `phase`, `ceiling_usd` or `mode`, `max_turns`) + the 9-part text | rewritten whole on each run, committed |
22
22
  | the text in the conversation | what the owner copies into `/goal` | ≤4,000 chars, no fence, no commentary around it |
23
23
 
24
24
  The goal is a versioned file. A goal aimed at a published artifact or an untracked path has no
@@ -49,13 +49,31 @@ contract behind it: every path it names is tracked, or the goal is not emitted.
49
49
  (`docs: goal for phase NN`). Run the 10-line checklist at the end of the template; fix what it
50
50
  catches. Then paste the text into the conversation as plain lines, and print the next step.
51
51
 
52
+ ## Autonomous mode
53
+
54
+ `--autonomous ["<objective>"]` writes the text for the whole delivery instead of one phase — the
55
+ same five steps, with these differences:
56
+
57
+ 1. Pre-flight reads `PLAN.md` and `ROADMAP.md` at the git top; no phase plan is required, the run
58
+ writes the ones that are missing. The stages still owed come from
59
+ `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/ll-auto/scripts/ll-auto.js detect --json` when that
60
+ helper is installed, and from `ROADMAP.md` plus `PROGRESS.md` when it is not.
61
+ 2. Skipped: `--auto-decision` resolves each WAITING decision to its recommended option, and the text
62
+ says the end-of-run block lists every decision taken alone.
63
+ 3. Asks nothing when the invocation carries an objective or `PLAN.md` already holds one.
64
+ 4. Assembles the parts from the `## Autonomous variant` section of `references/goal-template.md`:
65
+ eight parts, no BUDGET, EXECUTION pointing at `ll-auto --auto-decision` until the delivery is
66
+ closed, and the three extra checklist lines.
67
+ 5. `docs/GOAL.md` carries `mode: autonomous` and `phase: all`; the commit message is
68
+ `docs: goal for the whole delivery`.
69
+
52
70
  ## Completion criterion
53
71
 
54
72
  `docs/GOAL.md` exists and is committed; the text is in the conversation at ≤4,000 chars (`wc -c`);
55
73
  the checklist passed. Close with:
56
74
 
57
75
  ```
58
- ▶ Next — `/clear`, then paste `/goal <text>`
76
+ ▶ Next — /clear, then /goal <text>
59
77
  ```
60
78
 
61
79
  ## References
@@ -88,3 +88,60 @@ project CLAUDE.md, in `settings.json` deny rules, or in a hook — written once,
88
88
  8. Every band-1 decision has an owner and a channel; nothing irreversible is left to absence.
89
89
  9. No paragraph of PLAN.md, ROADMAP.md or a decision file is repeated — each appears as a pointer.
90
90
  10. `wc -c` of the text ≤ 4000, and docs/GOAL.md carries the five frontmatter fields.
91
+ 11. Autonomous variant: EXECUTION names `ll-auto --auto-decision`; without it nothing restarts.
92
+ 12. Autonomous variant: no BUDGET part, and the frontmatter says `mode: autonomous`, not a ceiling.
93
+ 13. Autonomous variant: DONE WHEN ends at `docs/DELIVERY.md`, not at one phase's board.
94
+
95
+ ## Autonomous variant
96
+
97
+ The whole delivery instead of one phase. Frontmatter — still five fields: `date`, `plan: PLAN.md`,
98
+ `phase: all`, `mode: autonomous`, `max_turns`; no `ceiling_usd`. The parts are the nine above minus
99
+ BUDGET:
100
+
101
+ - OBJECTIVE: everything ROADMAP.md still lists, closed by `docs/DELIVERY.md`.
102
+ - READ FIRST: `PLAN.md` §0/§2/§3/§7, `ROADMAP.md`, `docs/AUTO.md` when it exists.
103
+ - DONE WHEN: `docs/DELIVERY.md` exists; `PROGRESS.md` carries the epilogue of the last ROADMAP
104
+ phase; every `phases/NN/VERIFICATION.md` of the run is APPROVED or APPROVED_WITH_RESERVATIONS;
105
+ every `docs/AUTO.md` roteiro row is done or skipped with `## Decisions taken alone` filled; the
106
+ build command exits 0; `git status --porcelain` empty.
107
+ - INVALIDATING: the fixed block above, verbatim.
108
+ - EXECUTION: `skill ll-auto --auto-decision` — plus `"<objective>"` and `--verify all` when given —
109
+ started again from this text whenever the session stops before DONE WHEN. The text never asks the
110
+ owner to paste a command: `ll-auto` carries the stages (`skills/ll-auto/SKILL.md`, Flow). Models
111
+ per role from PLAN.md §7.
112
+ - DECISIONS: every decision that stays inside the repository is taken, recorded `[decided by absence
113
+ — revisable]` and listed at the end; the run stops only for money leaving the account, production
114
+ data, credentials, anything irreversible.
115
+ - STATE: `docs/AUTO.md`, one log line per stage; `PROGRESS.md`, one block per wave.
116
+ - STOP: external block = record the exact state and stop, without marking done.
117
+
118
+ ## Autonomous example
119
+
120
+ Rendered for `scripts/fixtures/project`: phases 07 and 08 left, then close.
121
+
122
+ ```
123
+ /goal Deliver what ROADMAP.md still owes — phases 07 and 08 — to main, tested, per PLAN.md.
124
+
125
+ DONE WHEN: docs/DELIVERY.md exists; PROGRESS.md carries ## Epilogue — phase 08; phases/07 and
126
+ phases/08 VERIFICATION.md say APPROVED or APPROVED_WITH_RESERVATIONS; docs/AUTO.md has every roteiro
127
+ row done or skipped and ## Decisions taken alone filled; `npm test` exit 0; `git status --porcelain`
128
+ empty — each pasted here as its last output line. Or stop after 80 turns, saying what is missing.
129
+
130
+ READ FIRST: PLAN.md (§0, §2, §3, §7), ROADMAP.md phases 07 and 08, docs/AUTO.md when it exists.
131
+
132
+ INVALIDATING: deleting, weakening, skipping or marking as skip any test, acceptance or threshold;
133
+ self-validation instead of a clean-context verifier; a TODO or "phase 2" left in a milestone marked
134
+ done; partial delivery counted as done. Impossibility without an implemented alternative does not
135
+ complete the goal.
136
+
137
+ EXECUTION: skill ll-auto --auto-decision --verify all, started again from this text whenever the
138
+ session stops before DONE WHEN. Models per role from PLAN.md §7.
139
+
140
+ DECISIONS: everything that stays inside the repository is decided, recorded [decided by absence —
141
+ revisable] and listed at the end; money, production data and credentials never proceed alone.
142
+
143
+ STATE: docs/AUTO.md one log line per stage; PROGRESS.md one block per wave.
144
+
145
+ STOP: external block (key, host, rate limit, an answer only the owner has) = record the state in
146
+ PROGRESS.md and STOP without marking done.
147
+ ```
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: ll-implement
3
- description: "Runs one phase end to end in a single invocation — a skippable one-screen conversation, code scouting, a phase plan the session writes, one adversarial review, TDD waves with one executor per milestone and atomic commits, clean-context verification against the ROADMAP criteria, and an epilogue with the next command. Use when the request is \"implementa a fase N\", \"continua\", \"roda a fase\", when phases/NN/PLAN.md has a milestone with `passes: false`, or when the /goal text cites this skill. Without a project PLAN.md contract it stops and points to `ll-decide`; the phase conversation is skipped when `ll-brainstorm` already wrote phases/NN/DECISIONS.md. To audit a closed delivery, use `ll-verify`; to archive it, `ll-close`."
3
+ description: Runs one phase end to end, from code scouting and a phase plan through TDD waves with one executor per milestone and atomic commits, to clean-context verification against the ROADMAP criteria and an epilogue.
4
4
  argument-hint: "[phase-number] [--no-talk] [--wave N]"
5
+ disable-model-invocation: true
5
6
  allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/ll-tools.js *)
6
7
  ---
7
8
 
@@ -11,11 +12,12 @@ Current state: !`${CLAUDE_SKILL_DIR}/scripts/ll-tools.js state`
11
12
 
12
13
  One phase, one invocation: plan, execute and verify without handing the orchestration to anyone. The session writes the plan, dispatches one executor per milestone, runs the acceptances, marks `passes` and writes the epilogue; an executor commits per task and returns one fixed block. Only the session writes state files. When `state` answers `ok: false` and there is no project `PLAN.md`: say "no contract" and stop with `▶ Next — /clear, then ll-decide project`.
13
14
 
14
- Four boundaries hold for the whole run:
15
+ Five boundaries hold for the whole run:
15
16
  - **One phase.** `ll-implement N` writes only `phases/NN/PLAN.md` for N and dispatches only milestones of N. Never write, sketch or dispatch the plan or the milestones of another phase, however obvious the next one looks in ROADMAP: `waves` checks file overlap inside one phase only, so two phases in flight have no collision check and no clean verification between them. Cross-phase parallelism is not offered, not even when the owner asks how to go faster; the epilogue hands the next phase back to the owner.
16
17
  - **The session does not write code.** No edit to source, tests, fixtures or config by this session, no matter how small; every repair is a task for an executor. The session writes state files (`PROGRESS.md`, `phases/NN/`, `decisions/`, `BACKLOG.md`) and nothing else.
17
18
  - **The session does not exercise the product.** While executors run, the session orchestrates: it reads return blocks, writes PROGRESS and heartbeats, prepares the next briefs and answers `BLOCKED:`. Driving a browser, curling a running server or querying a database beyond the helper and the milestone's `acceptance:` belongs to `ll-reviewer` (UI, URL) or `ll-verifier` (phase), in a clean context and only for the phase being run.
18
19
  - **A helper verdict is never overridden.** `plan-lint`, `waves`, `spot-check`, `tdd-gate` answer with a verdict; the session's own reading of `git show`, `git log` or a diff does not replace it.
20
+ - **The helper is called, never read.** No `cat`, `sed`, `grep` or `Read` on `ll-tools.js`; its contract is the table in `references/phase-plan.md`. State is read with `Read` on one named file, never `cat phases/*` or `cat decisions/*`.
19
21
 
20
22
  Reply to the owner in Portuguese; every file you write is in English.
21
23
 
@@ -27,75 +29,76 @@ Reply to the owner in Portuguese; every file you write is in English.
27
29
  | `phases/NN/CODE-CONTEXT.md` | analogs with file:line, readers of changing symbols, traps, values with provenance | written once by `ll-scout` |
28
30
  | `phases/NN/PLAN.md` | `<!-- ll-milestones -->` block plus one `### M<n>` body per milestone | immutable after step 4; `## Errata` and `G-n` gaps appended |
29
31
  | `phases/NN/PLAN-REVIEW.md` | the adversarial verdict on the plan — `APPROVED` or `REJECTED`, no third verdict; its existence with `APPROVED`, or with `REJECTED` and every Gaps line already applied, is what opens wave 1 | one per phase, written by `ll-verifier` in step 4 |
30
- | `PROGRESS.md` | `<!-- ll-state -->` board, wave lines, `### M<n>` blocks, amendment lines, `## Epilogue` | append-only; only the session writes it; the board only via `passes` |
32
+ | `PROGRESS.md` | `<!-- ll-state -->` board, wave lines, `### M<n>` blocks, amendment lines, `## Epilogue` | append-only; only the session writes it; the board only via `passes` and `board-switch` |
31
33
  | `phases/NN/VERIFICATION.md` | phase verdict, per-criterion ledger, BLOCKS, gaps; `ll-verify NN` writes the same path, a delivery audit without a phase writes `VERIFICATION.md` at the repo root, and `ll-close` reads the newest of the two by mtime | one per verification, written by `ll-verifier` |
32
34
  | `decisions/DEC-NNNN-*.md` | decisions taken during waves, under ids from `dec-reserve` | append-only; never by an executor |
33
- | `BACKLOG.md` | rows `\| B-nnn \| born (phase / commit) \| type \| closing condition (executable) \| state OPEN\|CLOSED \|`; ids never reused | append-only; closed only by `backlog-reconcile --run` |
35
+ | `BACKLOG.md` | rows `\| B-nnn \| born (phase / commit) \| type \| closing condition (executable) \| note \| state \|`; the condition cell is exactly `` `<command>` exit N `` (or `` `<command>` = <stdout> ``), no prose, no `\|` — a pipe in the command becomes a script under `phases/NN/`; ids never reused | append-only; closed only by `backlog-reconcile --run` |
34
36
 
35
37
  ## Flow
36
38
 
37
- Helper: `${CLAUDE_SKILL_DIR}/scripts/ll-tools.js`, written `ll-tools.js` below. Read commands exit 0 and answer `{"ok":false,"reason":…}` on a broken input; `passes`, `heartbeat` and `dec-reserve` exit 1 on error. `ok` means "ran and parsed"; the verdict is its own field (`verdict`, `tdd`, `passes`).
39
+ Helper: `${CLAUDE_SKILL_DIR}/scripts/ll-tools.js`, written `ll-tools.js` below. Read commands exit 0 and answer `{"ok":false,"reason":…}` on a broken input; `passes`, `heartbeat`, `dec-reserve` and `board-switch` exit 1 on error. `ok` means "ran and parsed"; the verdict is its own field (`verdict`, `tdd`, `passes`).
38
40
 
39
41
  ### 0. State — and resume
40
42
  Read `ROADMAP.md` (the phase section: objective, success criteria), the project `PLAN.md` (§0 precedence, §2 invariants, §3 decisions, §7 protocol) and the `ll-state` block of `PROGRESS.md`. State comes from disk, never from memory or an earlier conversation.
41
43
  State lives at the git top: `PLAN.md`, `ROADMAP.md`, `PROGRESS.md`, `BACKLOG.md`, `decisions/`, `phases/NN/`, `docs/decide/`, never under `docs/<project>/` or any other subtree. Before step 1 run `ll-tools.js state`; when it answers that there is no `PROGRESS.md` at the git top, or that `git_top` differs from `root`, stop and print, in Portuguese, the reason plus the command that moves the tree — `git mv <root>/{PLAN.md,ROADMAP.md,PROGRESS.md,BACKLOG.md,decisions,phases,docs/decide} <git_top>/`, listing only what exists — and `▶ Next — /clear, then ll-implement NN`. Continue only after the move: nothing else runs from a displaced tree; do not move it yourself and do not mirror it.
42
44
  A milestone with `passes: false` on the board means resume. For each one: `ll-tools.js spot-check <M> --files <comma-separated files from PLAN>`, then run its `acceptance:`.
43
- - green, `verdict: pass`, `tdd: pass` (or `tdd: no` in the milestone) and `commits.count ≥ 1` → orphan report: append a `### M<n>` block built from `git log`, with the acceptance's last output line pasted in it, then run `ll-tools.js passes <M> true --commit <sha7>`.
45
+ - green, `verdict: pass`, `tdd: pass` (or `tdd: no` in the milestone) and `commits.count ≥ 1` → orphan report: append a `### M<n>` block built from `git log`, with the acceptance's last output line pasted in it, then run `ll-tools.js passes <M> true --commit <sha7> --phase NN`.
44
46
  - `commits.count = 0` → `verdict: fail` stands: the milestone returns to its wave, and the uncommitted work is recorded as a deviation.
45
47
  - red, or `files.missing` not empty → the milestone returns to its wave.
46
48
  `git status --porcelain`, `git worktree list` and `git branch --no-merged` complete the inventory; a dirty tree is reported, never stashed. `--wave N` starts step 5 at wave N with everything before it treated as above.
47
49
 
48
50
  ### 1. One-screen conversation
49
- Skipped when `phases/NN/DECISIONS.md` exists (`ll-brainstorm` wrote it) or with `--no-talk` (A ratified, only B asked — band 1 is never delegated — file written). Otherwise the phase route inline, no agent — `references/phase-conversation.md`: scout ≤10% of context, one map (A: I decide, each item with its repo analog at file:line · B: at most 4 owner calls · C: later); "ok" continues, "pode ir" / "você decide" closes A on the recommendations and B is still asked, one block of ≤4. Writes `phases/NN/DECISIONS.md` in the `ll-brainstorm` schema.
51
+ Skipped when `phases/NN/DECISIONS.md` exists (`ll-brainstorm` wrote it). With `--no-talk` nothing is asked: A is ratified on its recommendations, each owner-only item becomes its own `decisions/DEC-NNNN-<slug>.md` in state `WAITING` (id from `dec-reserve`), listed in DECISIONS.md under "waits", and every milestone whose work depends on it carries `stop: owner` in `phases/NN/PLAN.md`; the rest of the phase runs — scout, plan, review gate, waves — and the epilogue lists the waiting decisions with the command that resumes them. Otherwise the phase route inline, no agent — `references/phase-conversation.md`: scout ≤10% of context, one map (A: I decide, each item with its repo analog at file:line · B: at most 4 owner calls · C: later); "ok" continues, "pode ir" / "você decide" closes A on the recommendations and B is still asked, one block of ≤4. Writes `phases/NN/DECISIONS.md` in the `ll-brainstorm` schema.
50
52
 
51
53
  ### 2. Scouting
52
- One `ll-scout` (`model: sonnet`, effort medium — always, whatever the phase touches: scouting and repo reading never escalate to opus, and a public contract is a reason to spend opus on the executor and the verifier, not on the reading) with the scout brief from `references/briefs.md`: objective line, the files the phase creates or changes, symbols changing signature, absolute output path, 120-line cap. Output: `phases/NN/CODE-CONTEXT.md`. Its return has ≤10 lines; a `BLOCKED:` there is a brief gap, filled once.
54
+ One `ll-scout` (`model: sonnet`, effort medium — always, whatever the phase touches: scouting and repo reading never escalate to opus, and a public contract is a reason to spend opus on the executor and the verifier, not on the reading) with the scout brief from `references/briefs.md`: objective line, the files the phase creates or changes, symbols changing signature, absolute output path, 120-line cap. Output: `phases/NN/CODE-CONTEXT.md`. Print `scout rodando (sonnet) — phases/NN/CODE-CONTEXT.md` in the conversation before dispatching it. Its return has ≤10 lines; a `BLOCKED:` there is a brief gap, filled once.
53
55
 
54
56
  ### 3. Phase plan
55
57
  One file, one phase: `phases/NN/PLAN.md` for the N of the invocation. A milestone that belongs to a later phase is out of scope — leave it in ROADMAP, do not open `phases/MM/`.
56
58
  The session writes `phases/NN/PLAN.md` by `references/phase-plan.md`: tracer milestone first (the thinnest path through every layer, with a real acceptance); ≤3 tasks and ≤5 files per milestone; `read_first` with `file:lines` and the shape to copy; `action` with concrete values, no code; every `acceptance` with ≥1 automated command (when no test covers a criterion, the first milestone creates the test file); `tdd: yes` for behavior, `tdd: no` for UI, layout, config, glue and migrations; `exclusive` for serialized resources; `stop: owner` for what only the owner unblocks.
57
59
  Then `ll-tools.js plan-lint phases/NN/PLAN.md`: `verdict: fail` means errors — fix every one, and the warnings you can, before spending the reviewer.
58
- Then `ll-tools.js waves phases/NN/PLAN.md --json`: each entry in `defects` (`file_overlap`, `exclusive_conflict`, `unknown_depends_on`, `cycle`) goes back into the plan; `unscheduled` is a cycle, never ignored. Print the table `Wave | Milestones | Builds` from `waves[]` before dispatching anything.
60
+ Then `ll-tools.js waves phases/NN/PLAN.md --json`: each entry in `defects` (`file_overlap`, `exclusive_conflict`, `unknown_depends_on`, `cycle`) goes back into the plan; `unscheduled` is a cycle, never ignored. Print the table `Wave | Milestones | Builds` from `waves[]` before dispatching anything. Then `ll-tools.js board-switch NN --milestones <ids from waves[]>`, so the board's `phase:` and every `M*` line match this phase before the first `passes` write.
59
61
 
60
62
  ### 4. Adversarial review — one pass, and a gate
61
- One `ll-verifier` (`model: opus`) with the plan-review brief: mode plan, the 8 questions, the `plan-lint` output pasted so it is not repeated. In plan mode the verdict is `APPROVED` or `REJECTED` and nothing else; `REJECTED` carries `Gaps: G-n … acceptance: <cmd>` lines naming the milestone to amend. `REJECTED` or any `BLOCKS` → apply every Gaps line to the plan under `## Errata`, rerun `plan-lint` and `waves`, move on. No second review and no question to the owner. From here the plan changes only through `## Errata` and appended `G-n` milestones.
63
+ One `ll-verifier` (`model: opus`) with the plan-review brief: mode plan, the 8 questions, the `plan-lint` output pasted so it is not repeated. In plan mode the verdict is `APPROVED` or `REJECTED` and nothing else; `REJECTED` carries `Gaps: G-n … acceptance: <cmd>` lines naming the milestone to amend. `REJECTED` or any `BLOCKS` → apply every Gaps line to the plan under `## Errata`, rerun `plan-lint` and `waves`, move on. No second review and no question to the owner. From here the plan changes only through `## Errata` and appended `G-n` milestones. Print one line with the verdict and the number of gaps applied: `plan review: APPROVED|REJECTED — <n> gaps applied`.
62
64
  The gate: no executor is dispatched until `phases/NN/PLAN-REVIEW.md` is on disk; `APPROVED` opens wave 1; `REJECTED` opens it only after every Gaps line is applied to the plan under `## Errata` and `plan-lint` and `waves` rerun clean — no second review. Review first, wave 1 after, never in parallel; there is no `--no-review`. A request to skip the review is answered with the cost, and the review runs.
63
65
 
64
66
  ### 5. Waves
67
+ Every owner message that arrives during the phase is recorded as `ll-tools.js heartbeat "owner: <summary ≤ 80 chars>"` before acting on it.
65
68
  For each wave, in this order:
66
- 1. `ll-tools.js heartbeat "wave i/M — <what it builds>"`; print the same line in the conversation.
69
+ 1. `ll-tools.js heartbeat "wave i/M — <what it builds>"`; then, as a text line of its own before any Agent call, print `onda i/M — <milestone ids> rodando (<models>)` — the owner sees every wave start, not only the epilogue.
67
70
  2. `ll-tools.js dec-reserve <n>` with n = milestones in the wave; the returned `ids` fill each brief's `DEC RESERVED` line. Ids never come from an executor.
68
- 3. One `ll-executor` per milestone of this phase, one Agent call each, all calls of the wave in the same message, the 12-field brief from `references/briefs.md` (paths, not text). `model` from the milestone's `model:` field: `opus` for a contract milestone, `sonnet` for a mechanical one. A milestone whose `files` collide with another in the wave was a plan defect; when it stands, it moves to the next wave.
69
- 4. Wait with `TaskOutput {block:true}`; never read the executor's transcript. Append each `### M<n>` block verbatim to `PROGRESS.md` under `## Phase NN`. A `BLOCKED:` block is appended too, then `ll-tools.js passes <M> false --reason "<decision requested>" --state BLOCKED` (`--state` is one of `BLOCKED | ANSWERED_NO | DEFERRED | PRESENT_NO_BEHAVIOR`; done is `passes: true`); a `PARTIAL:` block gets one continuation with the same brief plus its `next:` line.
71
+ 3. One `ll-executor` per milestone of this phase, one Agent call each, all calls of the wave in the same message, the 12-field brief from `references/briefs.md` (paths, not text). `model` from the milestone's `model:` field: `opus` for a contract milestone, `sonnet` for a mechanical one. A milestone whose `files` collide with another in the wave was a plan defect; when it stands, it moves to the next wave. Print `onda i/M — M2, M3 rodando (opus, sonnet)` before dispatching the calls.
72
+ 4. Wait with `TaskOutput {block:true}`; never read the executor's transcript. Append each `### M<n>` block verbatim to `PROGRESS.md` under `## Phase NN`. A `BLOCKED:` block is appended too, then `ll-tools.js passes <M> false --reason "<decision requested>" --phase NN --state BLOCKED` (`--state` is one of `BLOCKED | ANSWERED_NO | DEFERRED | PRESENT_NO_BEHAVIOR`; done is `passes: true`); a `PARTIAL:` block gets one continuation with the same brief plus its `next:` line. Print `onda i/M — M2 ok (<acceptance last line>) · M3 BLOCKED: <what>` once every block of the wave has returned.
70
73
  Amending a running executor (`SendMessage`) is allowed only while `git log --oneline` shows no `feat(M<n>)` from it: the brief it is executing has not yet become a commit. Once the feat is committed, wait for the return block and open the change as a fix task in the next wave — a mid-run brief change after the commit rewrites work already proven. Every amendment sent becomes a PROGRESS line at the moment it is sent: `ll-tools.js heartbeat "M<n>: amendment — <what changed> (DEC-NNNN)"`, so compaction cannot lose it.
71
74
  5. Run each milestone's `acceptance:` yourself, then the build and the whole suite. A timeout, a skipped test or a non-zero exit is not green. That is the whole exercise the session performs: no browser, no `curl` against a running server, no ad-hoc database query, and never against a criterion of another phase — hand that to `ll-reviewer` in step 6 (UI, URL) or to `ll-verifier` (phase), which judge in a clean context. A manual check you did anyway lands in PROGRESS as `not verified by a clean context — <what you did, what you saw>`, never as "verified now", and never marks a `passes`.
72
75
  A test the phase did not write that goes red is a fix task, never an edit by the session: while the milestone's executor is still running and has not committed its `feat(M<n>)`, amend it (rule above); otherwise it is a milestone in the next wave, with the constraint "adapt the test's setup, never its assertion" in the brief and the failing output line as input. A red foreign test keeps its milestone at `passes: false`.
73
- 6. Per milestone: `ll-tools.js spot-check <M> --files <files>` (`verdict: pass` = every file in HEAD and ≥1 anchored commit) and, when `tdd: yes`, `ll-tools.js tdd-gate <M> --since <HEAD sha before the wave>` (`tdd: pass`). `ll-tools.js passes <M> true --commit <sha7>` needs all three, together: `tdd-gate` `pass` (or `tdd: no` in the milestone), `spot-check` `verdict: pass`, and the acceptance command's last output line pasted in the `### M<n>` block of PROGRESS. Two out of three is `passes: false`.
74
- A helper `fail` is never overridden by your own reading of `git show --stat`, `git log` or a diff. When the evidence says the helper is wrong, write it — `ll-tools.js heartbeat "M<n>: spot-check fail contradicted by <evidence>"` — and run `ll-tools.js passes <M> false --reason "helper disagreement"`, then continue the wave; step 6 decides with a clean context. Anything else red: `ll-tools.js passes <M> false --reason "<what is red>"`, and the milestone reruns once in the next wave with the failing output line in its brief.
75
- 7. `questions:` lines from the blocks: band 1 → one battery of at most 4, same subject, in the format of `references/decision-policy.md`; band 2 and 3 → decide, write the reserved `DEC-` file, continue. `backlog:` lines → one row each in `BACKLOG.md` (next free `B-nnn`, birth phase and commit, type, condition as `` `<command>` exit 0 ``, state `OPEN`); a band-1 answer of "no" marks the milestone `passes false --state ANSWERED_NO`. `deviations:` stay in the block.
76
+ 6. Per milestone: `ll-tools.js spot-check <M> --files <files>` (`verdict: pass` = every file in HEAD and ≥1 anchored commit) and, when `tdd: yes`, `ll-tools.js tdd-gate <M> --since <HEAD sha before the wave>` (`tdd: pass`). `ll-tools.js passes <M> true --commit <sha7> --phase NN` needs all three, together: `tdd-gate` `pass` (or `tdd: no` in the milestone), `spot-check` `verdict: pass`, and the acceptance command's last output line pasted in the `### M<n>` block of PROGRESS. Two out of three is `passes: false`.
77
+ A helper `fail` is never overridden by your own reading of `git show --stat`, `git log` or a diff. When the evidence says the helper is wrong, write it — `ll-tools.js heartbeat "M<n>: spot-check fail contradicted by <evidence>"` — and run `ll-tools.js passes <M> false --reason "helper disagreement" --phase NN`, then continue the wave; step 6 decides with a clean context. Anything else red: `ll-tools.js passes <M> false --reason "<what is red>" --phase NN`, and the milestone reruns once in the next wave with the failing output line in its brief.
78
+ 7. `questions:` lines from the blocks: band 1 → one battery of at most 4, same subject, in the format of `references/decision-policy.md`; band 2 and 3 → decide, write the reserved `DEC-` file, continue. `backlog:` lines → one row each in `BACKLOG.md` (next free `B-nnn`, birth phase and commit, type, condition cell exactly `` `<command>` exit 0 `` — a pipe in the command becomes a script under `phases/NN/` — note, state `OPEN`); a band 1 answer of "no" marks the milestone `passes false --phase NN --state ANSWERED_NO`. `deviations:` stay in the block.
76
79
  8. Sweep orphan background tasks before opening the next wave.
77
80
  Before the next wave: when the context is near its limit, run step 7 and stop with `▶ Next — /clear, then ll-implement NN --wave i+1`, instead of degrading mid-wave.
78
81
 
79
82
  ### 6. Clean-context verification
80
- One `ll-verifier` (`model: opus`) with the phase brief: mode phase, ROADMAP and PLAN paths, the success criteria pasted, the code slice (`<HEAD at step 0>..HEAD`), output `phases/NN/VERIFICATION.md`, PROGRESS closed until the verdict. It judges the ROADMAP criteria and the plan's `truths`, above whatever the milestone blocks claim.
81
- - `REJECTED` → each `G-n` line becomes a milestone appended to PLAN (acceptance from the gap line, `tdd: yes`), `ll-tools.js passes G-n false --reason "gap from verification"` creates its board line, and step 5 runs once more for those gaps only. A second `REJECTED` goes to the epilogue as left work.
83
+ One `ll-verifier` (`model: opus`) with the phase brief: mode phase, ROADMAP and PLAN paths, the success criteria pasted, the code slice (`<HEAD at step 0>..HEAD`), output `phases/NN/VERIFICATION.md`, PROGRESS closed until the verdict. It judges the ROADMAP criteria and the plan's `truths`, above whatever the milestone blocks claim. Print `verificador rodando (opus) — phase NN` before dispatch and one line with the verdict once it returns.
84
+ - `REJECTED` → each `G-n` line becomes a milestone appended to PLAN (acceptance from the gap line, `tdd: yes`), `ll-tools.js passes G-n false --reason "gap from verification" --phase NN` creates its board line, and step 5 runs once more for those gaps only. A second `REJECTED` goes to the epilogue as left work.
82
85
  - UI touched or a running product: `ll-reviewer` (`model: opus`) with the reviewer brief; its FAIL lines are gaps like the above, and only failures reach the owner.
83
86
  - Boot, database or migrations touched: cold-start smoke test — stop the service, start from an empty state, run the tracer's acceptance — before the verdict counts.
84
87
 
85
88
  ### 7. Epilogue
86
- `ll-tools.js epilogue NN --json` gives the data; the session writes `## Epilogue — phase NN — <date>` at the end of `PROGRESS.md`: `passed`; `left` with why; `waiting` decisions; new backlog ids with their condition; one block "actions that need you" with each command ready to paste; the count line `milestones passed X/Y · questions asked N / assumptions M / band-1 open K · amendments A · verification: phases/NN/VERIFICATION.md <verdict>` (amendments counted from the `amendment —` heartbeat lines); and `▶ Next — /clear, then <next_command>` (`ll-implement N+1` when ROADMAP has a next phase, otherwise `ll-close`; `ll-verify NN --external` first when the phase touched a public contract, money or customer data). Print the same lines in the conversation and stop. The next phase is the owner's next invocation in a clean context: do not start it, do not plan it, do not offer to run it in parallel with this one.
89
+ Before writing the epilogue, run `ll-tools.js backlog-reconcile` (dry run): any row it marks `unparsable-condition` is rewritten now, its condition cell fixed to the exact form above. `ll-tools.js epilogue NN --json` gives the data; the session writes `## Epilogue — phase NN — <date>` at the end of `PROGRESS.md`: `passed`; `left` with why; `waiting` decisions; new backlog ids with their condition; one block "actions that need you" with each command ready to paste; the count line `milestones passed X/Y · questions asked N / assumptions M / owner decisions open K · amendments A · verification: phases/NN/VERIFICATION.md <verdict>` (amendments counted from the `amendment —` heartbeat lines), printed to the owner as `marcos aprovados X/Y · perguntas N / assunções M / decisões só suas em aberto K · emendas A · verificação: <path> <verdict>` — never a decision id, the internal band label or the word `regime` on screen; and `▶ Next — /clear, then <next_command>` (`ll-implement N+1` when ROADMAP has a next phase, otherwise `ll-close`; `ll-verify NN --external` first when the phase touched a public contract, money or customer data). Print the same lines in the conversation and stop. The next phase is the owner's next invocation in a clean context: do not start it, do not plan it, do not offer to run it in parallel with this one.
87
90
 
88
91
  ## Completion criterion
89
92
 
90
93
  Every milestone of the phase has `passes: true` under the three conditions of step 5.6 — `tdd-gate` pass or `tdd: no`, `spot-check` pass, acceptance last line in PROGRESS — with the acceptance run in this session; `phases/NN/PLAN-REVIEW.md` and `phases/NN/VERIFICATION.md` exist, the second without BLOCKS; only `phases/NN/` was planned; `git status --porcelain` is empty; the epilogue is written. Every missing proof is named with the command that would close it.
91
94
  The epilogue's last count line, printed in the conversation and written to PROGRESS:
92
- `milestones passed X/Y · questions asked N / assumptions M / band-1 open K · amendments A · verification: phases/NN/VERIFICATION.md <verdict>`
93
- ▶ Next — `/clear`, then `ll-implement N+1`, or `ll-verify NN --external` / `ll-close` as the epilogue says.
95
+ `milestones passed X/Y · questions asked N / assumptions M / owner decisions open K · amendments A · verification: phases/NN/VERIFICATION.md <verdict>`
96
+ ▶ Next — /clear, then ll-implement N+1 (or ll-verify NN --external, or ll-close, as the epilogue says)
94
97
  The ▶ Next line is the last thing this invocation does: no review, plan, verifier or executor of another phase is started after it; the next phase exists when the owner pastes the command.
95
98
 
96
99
  ## Questions
97
100
 
98
- One skippable screen at the start (step 1) and one battery of at most 4 at the end of a wave, only for band-1 items that surfaced in `questions:` lines. Never asked: the ten items of `references/decision-policy.md` (who executes, a fact readable from the repo, which pattern when a house pattern exists, a reversible detail inside a closed contract, another session's decision, out-of-scope subjects, a question that changes no action, copy without a commercial promise, industry defaults, the same policy question twice). Band 2 and 3 are decided, recorded under a reserved `DEC-` id and flagged for review. No answer in 10 minutes → the recommendation, recorded as `[decided by absence — revisable]`; never for band 1, which stays `WAITING` while only its branch freezes.
101
+ One skippable screen at the start (step 1) and one battery of at most 4 at the end of a wave, only for band 1 items that surfaced in `questions:` lines. Never asked: the ten items of `references/decision-policy.md` (who executes, a fact readable from the repo, which pattern when a house pattern exists, a reversible detail inside a closed contract, another session's decision, out-of-scope subjects, a question that changes no action, copy without a commercial promise, industry defaults, the same policy question twice). Band 2 and 3 are decided, recorded under a reserved `DEC-` id and flagged for review. Under `--no-talk` no screen and no battery is sent at all: band 2 and 3 take their recommendation as `[decided by absence — revisable]`, each owner-only item is written as a `WAITING` decision under a reserved id, and only the milestones marked `stop: owner` freeze — the phase runs to its epilogue, which lists each waiting decision with the command that resumes it. No answer in 10 minutes → the recommendation, recorded as `[decided by absence — revisable]`; never for band 1, which stays `WAITING` while only its branch freezes.
99
102
 
100
103
  ## Models
101
104
 
@@ -78,7 +78,8 @@ MODEL contract milestone → opus/high | mechanical milestone → sonnet
78
78
  DEC RESERVED DEC-<nnnn>, DEC-<nnnn> (cite only these ids in questions:; never create a decision)
79
79
  INPUTS <path>, <path> (checked: exist) | none
80
80
  DO NOT write PROGRESS/PLAN/ROADMAP/BACKLOG/decisions; commit outside FILES; push; weaken a test;
81
- spawn an agent; cd; relative paths; grep a directory that holds a .env
81
+ spawn an agent; cd; relative paths; grep a directory that holds a .env; hardcode an
82
+ absolute path or `pkill`/`killall` in a committed script
82
83
  RETURN the `### M<n>` block in your fixed format (built, commits, commands, deviations, questions,
83
84
  backlog, not_verified), at most 1,500 tokens. Nothing before or after it.
84
85
  ```
@@ -39,14 +39,15 @@ instead of creating one. In an opening conversation these are the A items.
39
39
 
40
40
  ### Blanket delegation
41
41
  "Pode decidir tudo, me pergunta só o que for realmente necessário" delegates bands 2 and 3, never band 1:
42
- band-1 items are still asked, in one block of ≤4 with the recommendation marked. Zero questions plus a stack of assumptions has misread it.
42
+ owner-only items are still asked, in one block of ≤4 with the recommendation marked. Zero questions plus a stack of assumptions has misread it.
43
43
 
44
44
  ## Contact minimum
45
45
  Every planning skill (`ll-brainstorm`, `ll-decide`, the phase conversation of `ll-implement`) ends
46
- with a final round that shows `questions asked N / assumptions M / band-1 open K`, even when N = 0.
47
- Silence of 10 minutes ratifies the recommended list (A), never a blocking item (B).
46
+ with a final round that shows `questions asked N / assumptions M / owner decisions open K`
47
+ (printed to the owner in Portuguese as `perguntas N / assunções M · decisões só suas em aberto K`),
48
+ even when N = 0. Silence of 10 minutes ratifies the recommended list (A), never a blocking item (B).
48
49
 
49
- ## Never ask (10 items)
50
+ ## Never ask (11 items)
50
51
  1. Who executes — agent vs session, worktrees, model per wave. Decide it and record it.
51
52
  2. A fact readable from the repo, the database or the infra — look it up, including whether it was already done.
52
53
  3. Which pattern, when a house pattern exists — follow it.
@@ -57,10 +58,16 @@ Silence of 10 minutes ratifies the recommended list (A), never a blocking item (
57
58
  8. Copy without impact on a commercial promise. Route it to a blind judge instead.
58
59
  9. Industry defaults — data retention, performance target, error format, default auth. Recorded in Locked with backing.
59
60
  10. The same policy question a second time, however it is rephrased.
61
+ 11. A question whose options differ only in rigor — how strictly, how often or from where a check
62
+ is re-run: the strictest cheap option is taken and recorded as an assumption `[decided by
63
+ absence — revisable]`.
60
64
 
61
65
  ## Silence, delegation, directives
62
66
  - Silence for 10 minutes in the hot window (harness AFK timeout) ratifies option A of a band-2/3 item or
63
- list A of a map — never option B, never a band-1 item. Record `ratified by silence`; in a run, `[decided by absence — revisable]`.
67
+ list A of a map — never option B, never an owner-only item. Record `ratified by silence`; in a run, `[decided by absence — revisable]`.
68
+ - Under `--no-talk` the ten minutes are not waited for: the recommended option is taken at once and
69
+ recorded `[decided by absence — revisable]`. An owner-only item is never taken this way — it is written
70
+ as a decision in state `WAITING` and the work that depends on it stops there.
64
71
  - "Claude decide", "você decide", "pergunta pro time" are legitimate answers: record an assumption
65
72
  `ASM-n` (permanent; announced if changed later) or the delegation, and never ask that item again.
66
73
  - An order against the recommendation is a directive: one challenge with the cost named, then
@@ -93,19 +100,22 @@ the execution back to the owner: ask in one line and execute; transfer only what
93
100
  - Count the decisions before the first question; number `n/N`; never renumber; if the scope grows,
94
101
  say "+2 questions". At most 4 questions per call, one call per subject, ordered by impact, all
95
102
  inside the round's subject.
96
- - `header` ≤ 12 chars. `question` = `[D-NN-kk] Question n/N — <title> (impact HIGH|MED|LOW · revert:
97
- <cost>)` + `FACT:` with number and source + `CONTEXT: <term> = <plain words>` for any acronym + the
98
- decision in business words, ending with "?". Target ≤ 200 chars; over ~500, rewrite. Everything
99
- inside the field — text in the previous turn does not reach the owner.
103
+ - `header` ≤ 12 chars. `question` = `Pergunta n/N — <title in business words> (impacto
104
+ ALTO|MÉDIO|BAIXO · desfazer: <cost>)` + `FACT:` with number and source + `CONTEXT: <term> =
105
+ <plain words>` for any acronym + the decision in business words, ending with "?". Target ≤ 200
106
+ chars; over ~500, rewrite. Everything inside the field — text in the previous turn does not reach
107
+ the owner. The `D-NN-kk`/`DEC-NNNN` id is written only in the file that records the answer, never
108
+ in the header or in an option.
100
109
  - Options 2–3 (4 only multi-select); recommended first with `(Recommended)` and a traceable reason;
101
- each `description` = `<what becomes true> · <cost in R$/US$ or days> · <what is lost>`. Add "Claude
102
- decide" when the item is delegable. No "Other" — the tool provides it; free text is a new requirement.
110
+ each `description` = `<what becomes true> · <cost in R$/US$ or days> · <what is lost>`. An option
111
+ names the thing decided, never an id alone. Add "Claude decide" when the item is delegable. No
112
+ "Other" — the tool provides it; free text is a new requirement.
103
113
  - Recommend on the product axis; cost appears as a number in the option; above the ceiling the item
104
114
  is band 1. In a scope question the maximalist option is always on the table.
105
115
 
106
116
  Example:
107
117
  ```
108
- question: "[D-07-01] Question 1/2 — cents mismatch (impact HIGH · revert: 1 migration)
118
+ question: "Pergunta 1/2 — cents mismatch (impacto ALTO · desfazer: 1 migration)
109
119
  FACT: <share>% of <n> rows of the last close differ by ≤ <tolerance> (<path to the run
110
120
  output>); today the job stops at the first one.
111
121
  CONTEXT: reconciliation = matching provider payouts to our sales, row by row.
@@ -2,9 +2,14 @@
2
2
 
3
3
  The phase route of `ll-brainstorm`, condensed for use inside `ll-implement` when
4
4
  `phases/NN/DECISIONS.md` does not exist yet: same file, same schema, same closing conditions, no
5
- agent. Reduced to the battery with `--no-talk`, "pode ir", "você decide", "just do it" or a pasted
6
- complete plan: the map is skipped and A is ratified whole, B is still asked in one block of ≤4
7
- (band 1 is never delegated), the file is written, one line says what was locked.
5
+ agent. Reduced to the battery with "pode ir", "você decide", "just do it" or a pasted complete
6
+ plan: the map is skipped and A is ratified whole, B is still asked in one block of ≤4 (band 1 is
7
+ never delegated by a blanket phrase), the file is written, one line says what was locked.
8
+ With `--no-talk` nothing is asked and nothing waits on an answer: A is ratified on its
9
+ recommendations and each owner-only item becomes its own `decisions/DEC-NNNN-<slug>.md` in state
10
+ `WAITING` (id from `ll-tools.js dec-reserve`), listed in the Deferred section with its resume
11
+ condition, while every milestone whose work depends on it carries `stop: owner` in
12
+ `phases/NN/PLAN.md`; the file is written and step 2 of the skill runs.
8
13
 
9
14
  ## 1. Scout before speaking (≤10% of context)
10
15
 
@@ -21,7 +26,7 @@ C as one word, never into A, never into a plan for that phase. Then classify wit
21
26
  `references/decision-policy.md`:
22
27
  Mechanical (band 2) → A; Taste (band 3) → A marked `[revisable]` with the reason; Blocking (band 1:
23
28
  money above the ceiling, irreversible outside the repo, price or promise, scope cut, the number the
24
- owner will look at, a recorded rule contradicted by evidence) → B, at most 4, by impact. A band-1
29
+ owner will look at, a recorded rule contradicted by evidence) → B, at most 4, by impact. A band 1
25
30
  item in A is a bug. What earlier DECISIONS, PLAN §3 or an external document settled is cited by id.
26
31
 
27
32
  ## 3. The map (the first visible message, ≤35 lines)
@@ -46,9 +51,11 @@ Every A item cites its analog or says `[no analog — my call]` (→ revisable);
46
51
 
47
52
  ## 4. Battery B (once, ≤4) and the owner's replies
48
53
 
49
- No B items: no battery. Otherwise one AskUserQuestion call in the canonical format of
50
- `references/decision-policy.md` — `[D-NN-kk] Question n/N — <title> (impact · revert)`, the
51
- measured fact with its source, 2–3 options each with `<what becomes true> · <cost> · <what is
54
+ No B items, or `--no-talk`: no battery — under `--no-talk` each B item is recorded as a `WAITING`
55
+ decision instead of a question, and the phase goes on. Otherwise one AskUserQuestion call in the canonical format of
56
+ `references/decision-policy.md` — the header is `Pergunta n/N — <título> (impacto ALTO|MÉDIO|BAIXO
57
+ · desfazer: <custo>)`; the id (`D-NN-kk`) stays in the file, never in the header or the options.
58
+ The measured fact with its source, 2–3 options each with `<what becomes true> · <cost> · <what is
52
59
  lost>`, the recommended one first, a "Claude decides" option that records the delegation.
53
60
  - "ok" → A ratified in bulk, B as answered. "pode ir" / "você decide" → A closed on the
54
61
  recommendations and the delegation recorded; B still goes out, one block of ≤4, because band 1 is
@@ -60,9 +67,10 @@ lost>`, the recommended one first, a "Claude decides" option that records the de
60
67
 
61
68
  ## 5. Close
62
69
 
63
- Closes when: zero Blocking items open (answered or deferred by the owner); A ratified; every
64
- locked item has backing (`file:line`, a measurement, the owner's words) or sits under Revisable;
65
- names stable across the last two exchanges. Cap: two map rounds, then close A as it stands and
70
+ Closes when: zero Blocking items open (answered or deferred by the owner — under `--no-talk`,
71
+ every one of them is deferred as a `WAITING` decision and the milestones that depend on it get
72
+ `stop: owner`); A ratified; every locked item has backing (`file:line`, a measurement, the
73
+ owner's words) or sits under Revisable; names stable across the last two exchanges. Cap: two map rounds, then close A as it stands and
66
74
  carry the rest into execution as `stop: owner`.
67
75
 
68
76
  Write `phases/NN/DECISIONS.md` — under the repository root, beside `PROGRESS.md`, never in a
@@ -71,6 +79,6 @@ Write `phases/NN/DECISIONS.md` — under the repository root, beside `PROGRESS.m
71
79
  impact, revert, backing, decided by, consequences) · Implementer freedoms · Revisable with
72
80
  `Review trigger:` · Deferred with resume condition · Against the recommendation · Owner's free
73
81
  answers verbatim · Accepted risks. Append-only, ids never recycled, supersession by a new line;
74
- band-1 items also get `decisions/DEC-NNNN-<slug>.md` under an id from `ll-tools.js dec-reserve`.
75
- Print the score and, on its own line, the counter `questions asked N / assumptions M / band-1 open K`,
82
+ band 1 items also get `decisions/DEC-NNNN-<slug>.md` under an id from `ll-tools.js dec-reserve`.
83
+ Print the score and, on its own line, the counter `questions asked N / assumptions M / owner decisions open K`,
76
84
  then continue to step 2 of the skill.