liteagents 3.6.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/package.json +1 -1
  3. package/packages/ampcode/skills/branch-review/SKILL.md +20 -3
  4. package/packages/ampcode/skills/docs-builder/SKILL.md +168 -70
  5. package/packages/ampcode/skills/docs-builder/docs-builder.cjs +325 -70
  6. package/packages/ampcode/skills/release/SKILL.md +38 -8
  7. package/packages/ampcode/skills/remember/AGENT_RULES.md +14 -6
  8. package/packages/ampcode/skills/security/SKILL.md +6 -3
  9. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/package-lock.json +3 -3
  10. package/packages/claude/skills/branch-review/SKILL.md +20 -3
  11. package/packages/claude/skills/docs-builder/SKILL.md +168 -69
  12. package/packages/claude/skills/docs-builder/docs-builder.cjs +325 -70
  13. package/packages/claude/skills/release/SKILL.md +38 -8
  14. package/packages/claude/skills/remember/AGENT_RULES.md +14 -6
  15. package/packages/claude/skills/security/SKILL.md +6 -3
  16. package/packages/droid/commands/branch-review.md +20 -3
  17. package/packages/droid/commands/docs-builder/docs-builder.cjs +325 -70
  18. package/packages/droid/commands/docs-builder.md +168 -70
  19. package/packages/droid/commands/release.md +38 -8
  20. package/packages/droid/commands/remember/AGENT_RULES.md +14 -6
  21. package/packages/droid/commands/security.md +6 -3
  22. package/packages/opencode/command/branch-review.md +20 -3
  23. package/packages/opencode/command/docs-builder/docs-builder.cjs +325 -70
  24. package/packages/opencode/command/docs-builder.md +168 -70
  25. package/packages/opencode/command/release.md +38 -8
  26. package/packages/opencode/command/remember/AGENT_RULES.md +14 -6
  27. package/packages/opencode/command/security.md +6 -3
@@ -126,19 +126,49 @@ confirmed in Phase 0.5.
126
126
  summarize, escalate. Do not weigh it yourself.
127
127
  - **All clean** → continue.
128
128
 
129
- ## Phase 2 — Docs sweep
130
- Update what this feature actually changed, wherever those docs live in this
131
- project — match each file's existing format, touch nothing unrelated. Use
132
- `docs/index.md` when the project has one to find what exists.
133
-
134
- - **CHANGELOG.md** — new entry.
135
- - **README.md** — only if user-facing usage changed.
129
+ ## Phase 2 — Docs sweep (required — no skipping, no sampling)
130
+ Update what this branch changed, wherever those docs live in this project —
131
+ match each file's existing format, touch nothing unrelated. Use
132
+ `docs/index.md` when the project has one to find what exists. **All three
133
+ passes run on every release**; the size of the branch or the change never
134
+ cuts one.
135
+
136
+ 1. **List every change.** Read `git log --format='%h %s%n%b'
137
+ origin/main..HEAD` — the bodies, not just the subjects — and the diff.
138
+ Write one line per user-visible change: feature, command, flag, behaviour,
139
+ fix, dependency bump. A subject is a summary; the body is the list, and a
140
+ sweep built from subjects drops whatever only a body mentions.
141
+ 2. **CHANGELOG.md** — a new entry holding every line from pass 1, each under
142
+ the heading the file already uses for its kind (Added / Changed / Fixed /
143
+ Security). A new capability is **Added** even when it shipped in a `fix:`
144
+ commit. Then check it back: every pass-1 line maps to an entry, and the
145
+ semver level in Phase 3 agrees with the headings (an Added entry means at
146
+ least minor).
147
+ 3. **Grep for stale text.** For every string the diff removed or replaced
148
+ that a reader might have copied — a command line, flag, file name, recipe,
149
+ env var, printed message — search the docs for the old form:
150
+ `grep -rnF "<old string>" --include='*.md' .` (past CHANGELOG entries are
151
+ history; leave them). Every other hit is stale **because of this branch** —
152
+ update it. "It was already stale before this branch" is a claim: prove it
153
+ with `git show $(git merge-base origin/main HEAD):<source path>`. If the
154
+ base code already disagreed with the doc, report it as out of scope;
155
+ otherwise it is yours to fix.
156
+
157
+ Then judge each of these against the pass-1 list:
158
+ - **README.md** — if user-facing usage changed.
136
159
  - **PRD** — the feature's entry / status.
137
160
  - **Guide / context docs** — the project's standing context.
138
161
  - **Findings / learnings** — where the project keeps them.
139
162
  - **Any other frequently-updated doc** this change makes stale.
140
163
 
141
- If a doc needs no change, **say so** rather than editing it for its own sake.
164
+ Report **one row per doc**: file · changed / no change · the evidence (the
165
+ grep or diff you ran). A "no change" with no evidence is a skip, and a skip
166
+ fails this phase — it is not a pass. If a doc truly needs no change, say so
167
+ with the evidence rather than editing it for its own sake.
168
+
169
+ **The sweep is the worker's job, start to finish.** The orchestrator checks
170
+ the report; it does not redo or patch the sweep. A gap it finds goes back to
171
+ the worker, and it counts as a failed sweep, not a small follow-up.
142
172
 
143
173
  ## Phase 3 — Cut (local only)
144
174
  1. **Version bump** — pick the semver level from the change (patch / minor /
@@ -60,7 +60,7 @@ Not courtesies. These bind you as written, whether or not your tool enforces the
60
60
 
61
61
  - **Always** identify affected files before making changes, and explain what will change and why
62
62
  - **Ask first** — stop and get explicit sign-off — before modifying authentication systems, database schema or migrations, CI workflows, or `.claude/settings.json`
63
- - **Never** write secrets into the tree (`.env`/`*.env`, keys, credentials). They load from the environment at runtime; only a value-less `.env.example` is committed
63
+ - **Never** put secrets in the tree see [Security & Robustness Invariants §1](#security--robustness-invariants)
64
64
  - **Never** commit to `main`. Commit to a new branch (name doesn't matter), then propose `/branch-review` followed by `/release`; merging and releasing are my call, made by name — "approve", "good", or "go" on a draft is not that call
65
65
 
66
66
  ---
@@ -113,6 +113,7 @@ Before adding any external dependency, all of these must be true:
113
113
  - **Containerize only when necessary.** Start with a virtualenv or bare metal. Docker adds value for deployment parity and isolation — not for running a script
114
114
  - **Responsive web UI is mandatory in dev projects.** Any web UI must be usable on mobile by default — fluid layouts, viewport meta tag, breakpoints for narrow screens, no horizontal scroll. Test in DevTools device emulation before declaring a UI task done. POCs are exempt (validate the idea first), but the moment a POC graduates to a real project this becomes a hard requirement
115
115
  - **Surgical changes only.** Touch what the task requires; nothing else. Don't "improve" adjacent code, comments, or formatting. Match existing style even if you'd do it differently. Only clean up orphans your own change created. Dead code, nits, bugs you pass on the way: if it's inside or affects the code you're already changing, and the fix changes no behavior, fix it and say so. Otherwise report it — say what it costs to leave it. "It would be nicer" is not a cost. Every changed line traces to the request or to a fix you named
116
+ - **Meter the whole unit of work.** Usage and cost sum every call a unit of work makes; the last call's number is never the total, and one unpriced call makes the total unknown, not zero
116
117
 
117
118
  ### Red Flags — Stop and Flag These
118
119
  - Over-engineering simple problems
@@ -144,7 +145,7 @@ particular toolchain spells it.
144
145
 
145
146
  - **After the design stabilizes, not during exploration.** Do not test a prototype — you will write tests for code you delete tomorrow. First make it work (POC), then make it right (tests), then make it fast
146
147
  - **Tests first when you already know the contract.** Pure functions, algorithms, parsers, validators, data transformations — write the test, watch it fail, then implement. When you are still discovering the interface, that same discipline produces churn and false confidence
147
- - **Write tests for bugs.** Every fix ships a regression test that fails before the fix and passes after — the highest-value test there is
148
+ - **Write tests for bugs.** Every fix ships a regression test — the highest-value test there is
148
149
  - **Write tests before refactoring.** Characterization tests lock in current behavior first, then change the code
149
150
  - **Write tests when the code has users.** Called by other modules or exposed externally means it needs tests; a helper serving one caller does not need its own file
150
151
  - **Do not test glue code.** Something that only wires A to B to C is covered at the integration level
@@ -152,7 +153,7 @@ particular toolchain spells it.
152
153
  ### What makes a good test
153
154
 
154
155
  - **Tests real behavior.** Call the public interface, assert on observable output. Never reach into internals
155
- - **Fails for the right reason.** It breaks when the feature breaks, not when the implementation moves
156
+ - **Fails for the right reason — prove it.** It breaks when the feature breaks, not when the implementation moves. Revert the fix (or switch the check off), run the test, watch it go red, then restore it: a test you have never seen fail is unverified, however right it reads
156
157
  - **Reads like a spec.** Someone new to the code should learn what the feature does by reading it
157
158
  - **Self-contained.** Sets up its own state, runs, cleans up. No ordering dependencies, and no reliance on project directories, user config, or ambient environment
158
159
  - **Deterministic.** Flaky tests erode trust. A dependency on timing, network, or global state is a defect in the test
@@ -186,15 +187,22 @@ Throwaway POCs are exempt while you validate logic (per **POC first** above) —
186
187
  1. **No secrets in the repo.** Keys, tokens, and credentials load from the environment / a secret store at runtime — never hardcoded, never logged. `.env` is gitignored; only a value-less `.env.example` is committed. Scan history before trusting a repo. One leaked key is a breached database or a runaway bill.
187
188
  2. **Scope every data access to its owner.** Each record read or written is constrained to the requesting principal — via DB-level rules (RLS / row policies) and/or an application-layer ownership check. Never trust a client-supplied id without a gate. If the storage layer offers row-level policies, enabling them is not optional, and "on but too broad" still fails.
188
189
  3. **Bound every reachable endpoint.** Rate-limit public routes AND authenticated mutation/write routes AND abuse-prone inbound paths (mail, webhooks). An unbounded route is a free DoS and bill amplifier — a script in a loop should not be able to take the service down.
189
- 4. **Handle the unhappy path.** Every IO / network / DB / third-party call has an explicit failure path. Nothing fails silently. Internal detail (stack traces, queries, secrets) never reaches the client. Async/background work carries its own catch.
190
+ 4. **Handle the unhappy path.** Every IO / network / DB / third-party call has an explicit failure path. Nothing fails silently. Internal detail (stack traces, queries, secrets) never reaches the client. Async/background work carries its own catch. A warning nobody has to act on is not a check — either it halts / reds the run, or it is counted and surfaced where a human reads it. Record what you asked a dependency for and what you got back. Read and record the stop/finish reason of every external or model call — a cut-off answer (length/max_tokens) is never the same as no answer.
190
191
  5. **Authorization is not authentication.** "Logged in" never implies "allowed". Every state-changing or privileged action checks ownership AND role/permission. If swapping an id in a request would expose or mutate someone else's data, it's a bug — return 403.
191
192
  6. **Data access scales.** No queries inside loops, no per-render repeated round-trips, indexes on every filtered/joined column. Code that's fine at 10 users and collapses at 1,000 is a latent outage.
192
193
 
193
- Also hold the line on: input validation at every trust boundary (untrusted uploads, inbound mail, webhooks, and spoofable headers like `X-Forwarded-For` — trust them only behind a vetted proxy); parameterized queries (never string-built SQL); vetted libraries for crypto / auth / sanitization (never roll your own); and least-privilege binding (loopback, not `0.0.0.0`, unless the port is deliberately public).
194
+ Also hold the line on:
195
+
196
+ - **Validate input at every trust boundary.** Untrusted uploads, inbound mail, webhooks, and spoofable headers like `X-Forwarded-For` — trust the latter only behind a vetted proxy.
197
+ - **Model output is untrusted input too.** Validate it against a schema and key every decision on a typed field — never regex-parse the model's prose for a number, id, or verdict.
198
+ - **Guard lookups keyed by an external string.** Look the key up only among the map's own entries, never inherited ones — an inherited member can otherwise answer for a key the map never had, so "not found → throw" is bypassed.
199
+ - **Parameterize every query.** Never string-build SQL.
200
+ - **Use vetted libraries for security-critical code** — see [External Dependency Checklist](#external-dependency-checklist).
201
+ - **Bind least-privilege.** Loopback, not `0.0.0.0`, unless the port is deliberately public.
194
202
 
195
203
  **Verify at two moments, not one.**
196
204
  - **While building** — this list shapes the code as it's written.
197
- - **Before deploy/merge** — run **`/branch-review`**, whose second stage runs **`/security`** in full; `/release` then runs **`/ship`** as the mechanical pre-deploy gate. A Critical/High finding blocks the ship; lower-severity findings get logged and triaged, not silently shipped. Proactively remind the user to run them whenever a change touches auth, data access, endpoints, secrets, or untrusted input.
205
+ - **Before deploy/merge** — see [Operating Flow §2](#operating-flow). A Critical/High finding blocks the ship; lower-severity findings get logged and triaged, not silently shipped. Proactively remind the user to run `/branch-review` whenever a change touches auth, data access, endpoints, secrets, or untrusted input.
198
206
 
199
207
  ---
200
208
 
@@ -23,9 +23,12 @@ These show up in nearly every quickly-built app regardless of stack:
23
23
 
24
24
  1. **Secrets in the repo.** Tokens / API keys / `.env` files committed to
25
25
  tracked files or anywhere in git history. Verify `.env` is gitignored and
26
- only a value-less `.env.example` is tracked; scan history (`git log -p`,
27
- `git grep`) for leaked keys. Secrets must load from env / a secret store at
28
- runtime never hardcoded, never logged.
26
+ only a value-less `.env.example` is tracked. Scan ALL history, every
27
+ branch a range or target never narrows this with:
28
+ `git log --all -p | grep -nE '(sk-[A-Za-z0-9_-]{16,}|AKIA[0-9A-Z]{16}|gh[pousr]_[A-Za-z0-9]{30,}|xox[abprs]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{35}|-----BEGIN [A-Z ]*PRIVATE KEY)'`
29
+ plus any key shape specific to this project's providers. Report each hit
30
+ as real or a known test fixture. Secrets must load from env / a secret
31
+ store at runtime — never hardcoded, never logged.
29
32
  2. **Data-access authorization (tenant isolation).** Every record read or
30
33
  written must be scoped to the requesting principal — via DB-level rules
31
34
  (RLS / row policies) and/or application-layer ownership checks. Flag any
@@ -137,6 +137,13 @@ governs **stage 1 only**:
137
137
  - **high / max** — broader coverage; uncertain findings are allowed, but each
138
138
  must be labelled uncertain.
139
139
 
140
+ **No shortcuts.** The level decides how many findings you report, never which
141
+ checks you run. Every check this file calls required runs at every level —
142
+ never cut or sample one "given the effort level", the branch size, or time. If
143
+ a check truly cannot run, write `NOT RUN: <reason>` for it on the `checks:`
144
+ line of the report and the review record. That is a visible gap, not a
145
+ blocker and not a pass.
146
+
140
147
  **Stage 2 (security) always runs full, at every level.** A shallow security
141
148
  pass is worse than none — it reads as coverage while missing the class of bug
142
149
  that costs the most.
@@ -186,7 +193,10 @@ carries the reproduction.
186
193
  location outside the repo; the tree must still be clean at exit. A test that
187
194
  passes against both the buggy and the fixed source is a tautology and proves
188
195
  nothing. Flag every one you find, and say so explicitly when the tests are
189
- the branch's only evidence for its claims.
196
+ the branch's only evidence for its claims. **Required, every test file the
197
+ diff adds or changes — one red run per file is enough; checking a sample of
198
+ the files is a skip.** Count them as `fail-first N/M files` on the
199
+ `checks:` line.
190
200
  - **Maintainability.** Complexity, naming, duplication — only when material.
191
201
 
192
202
  ## Stage 2 — Security (always full)
@@ -201,7 +211,10 @@ If `security.md` cannot be found, run what you can from the list above and
201
211
 
202
212
  This stage is repo- and history-scoped, not diff-scoped: a key committed forty
203
213
  commits ago, an unbounded route the diff never touched, or a missing row
204
- policy on a table the new code now reads are all in scope.
214
+ policy on a table the new code now reads are all in scope. **The review range
215
+ never narrows this stage** — even when you were handed `main..HEAD`, the
216
+ secrets scan covers every commit on every branch (`security.md` item 1 has
217
+ the command).
205
218
 
206
219
  ## Stage 3 — Verify (adversarial)
207
220
  Findings are claims, not facts. **Try to break each one, not to confirm it** —
@@ -289,7 +302,10 @@ uncertain).
289
302
 
290
303
  Then a coverage line: stage 1 at level `<level>`, stage 2 full, stage 3 —
291
304
  each `ran ✓/✗` with its evidence. A stage you did not actually run is a **✗**, never an
292
- assumed pass.
305
+ assumed pass. Then a `checks:` line for the two checks most often cut short:
306
+ `fail-first N/M files` and `secrets-history all-branches` (or `NOT RUN:
307
+ <reason>` for either). An N below M, or a NOT RUN, is reported as-is — it
308
+ does not block.
293
309
 
294
310
  **Write the review record** to `.factory/remember/last-review.md`, overwriting
295
311
  it. `/release` reads this file; a SHA that lives only in a chat message is
@@ -308,6 +324,7 @@ level: <low | medium | high | max>
308
324
  verdict: <ready | blocked>
309
325
  date: <YYYY-MM-DD>
310
326
  coverage: stage1 <ran|NOT RUN>, stage2 <ran|NOT RUN>, stage3 <ran|NOT RUN>
327
+ checks: fail-first <N/M files|NOT RUN: reason>, secrets-history <all-branches|NOT RUN: reason>
311
328
  blockers:
312
329
  - <file:line> · <one-sentence claim, no scenario, no suggested fix>
313
330
  ```