liteagents 2.19.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/README.md +4 -4
- package/package.json +1 -1
- package/packages/ampcode/AGENT.md +4 -4
- package/packages/ampcode/agents/code-developer.md +2 -2
- package/packages/ampcode/agents/quality-assurance.md +1 -1
- package/packages/ampcode/commands/branch-review.md +123 -0
- package/packages/ampcode/commands/release.md +108 -79
- package/packages/ampcode/commands/remember/AGENT_RULES.md +26 -26
- package/packages/ampcode/commands/remember.md +4 -4
- package/packages/ampcode/commands/security.md +34 -18
- package/packages/ampcode/commands/ship.md +29 -26
- package/packages/ampcode/commands/stash.md +12 -6
- package/packages/claude/CLAUDE.md +4 -4
- package/packages/claude/agents/code-developer.md +2 -2
- package/packages/claude/agents/quality-assurance.md +1 -1
- package/packages/claude/commands/branch-review.md +123 -0
- package/packages/claude/commands/release.md +108 -79
- package/packages/claude/commands/remember/AGENT_RULES.md +26 -26
- package/packages/claude/commands/remember.md +4 -4
- package/packages/claude/commands/security.md +34 -18
- package/packages/claude/commands/ship.md +29 -26
- package/packages/claude/commands/stash.md +12 -6
- package/packages/droid/AGENTS.md +4 -4
- package/packages/droid/commands/branch-review.md +123 -0
- package/packages/droid/commands/release.md +108 -79
- package/packages/droid/commands/remember/AGENT_RULES.md +26 -26
- package/packages/droid/commands/remember.md +4 -4
- package/packages/droid/commands/security.md +34 -18
- package/packages/droid/commands/ship.md +29 -26
- package/packages/droid/commands/stash.md +12 -6
- package/packages/droid/droids/code-developer.md +2 -2
- package/packages/droid/droids/quality-assurance.md +1 -1
- package/packages/opencode/AGENTS.md +4 -4
- package/packages/opencode/agent/code-developer.md +2 -2
- package/packages/opencode/agent/quality-assurance.md +1 -1
- package/packages/opencode/command/branch-review.md +123 -0
- package/packages/opencode/command/release.md +108 -79
- package/packages/opencode/command/remember/AGENT_RULES.md +26 -26
- package/packages/opencode/command/remember.md +4 -4
- package/packages/opencode/command/security.md +34 -18
- package/packages/opencode/command/ship.md +29 -26
- package/packages/opencode/command/stash.md +12 -6
- package/packages/opencode/opencode.jsonc +6 -6
- package/packages/subagentic-manual.md +5 -5
- package/packages/ampcode/commands/diff-review.md +0 -78
- package/packages/claude/commands/diff-review.md +0 -78
- package/packages/droid/commands/diff-review.md +0 -78
- package/packages/opencode/command/diff-review.md +0 -78
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
7. [Development Workflow](#development-workflow)
|
|
11
11
|
8. [Twelve-Factor Checklist](#twelve-factor-checklist)
|
|
12
12
|
9. [CLAUDE.md Stub](#claudemd-stub)
|
|
13
|
-
10. [AI Agent Instructions](#ai-agent-instructions)
|
|
14
13
|
|
|
15
14
|
---
|
|
16
15
|
|
|
@@ -18,10 +17,25 @@
|
|
|
18
17
|
|
|
19
18
|
Every task runs through three layers. Do not skip ahead to code.
|
|
20
19
|
|
|
21
|
-
1. **Spec —
|
|
22
|
-
|
|
20
|
+
1. **Spec — the interview must happen; its shape is yours.** Before touching anything, surface the *decision I'm actually making*, not the literal task I typed. Ask what you need to know — no more; how you ask is your call. Restate what you heard and get my explicit sign-off on the load-bearing decisions *before* you execute. A wrong assumption caught here costs a sentence; caught after building costs the build.
|
|
21
|
+
|
|
22
|
+
Write the outcome down as a **PRD**. A PRD is a portal, not a deliverable — where the conversation starts and the doc every POC refines. Minimum content, whatever the form:
|
|
23
|
+
- **Problem & goal** — what we're solving and why now
|
|
24
|
+
- **Go / no-go** — the 1–2 capabilities the product stands or falls on; usually module 0's riskiest assumption (e.g. "can a phone camera read the ID?"). Fails → stop
|
|
25
|
+
- **Out of scope** — what we're explicitly not doing
|
|
26
|
+
- **Modules** — the pieces to build, in order (see [*One module at a time*](#validate-before-you-build))
|
|
27
|
+
- **Open questions** — unknowns that don't block; never silently assumed
|
|
28
|
+
|
|
29
|
+
Every POC result updates the PRD; one that flips the go/no-go or a module's assumption is a spec change, not a footnote.
|
|
30
|
+
2. **Verify — define "good" up front, then prove it.** Write down what success looks like *before* changing code. Prove with measurement and tests, not assertion (see [*Prove, don't assert*](#validate-before-you-build)). Gate security-sensitive work with `/security` and pre-deploy with `/ship`. When the work is done, propose `/code-review` and then `/release` — you never merge or release on your own (see [Required Safeguards](#required-safeguards-always--ask--never)). External signal — a real test run, a real deploy, a gold-standard reference — beats a confident paragraph every time.
|
|
23
31
|
3. **Environment — the standing context.** This file primes every session. Critical-path protections (secrets, auth, schema, CI) are stated as **Always / Ask / Never** below and bind you as written. Where your tool offers a permission allow/ask/deny list, mirror them there so they are enforced and not merely requested.
|
|
24
32
|
|
|
33
|
+
**Execution order — work the way a program runs, in this order, nothing skipped:**
|
|
34
|
+
1. **Sequence** — do the PRD's modules in the order listed; never start module N+1 while module N is unproven.
|
|
35
|
+
2. **Selection** — every POC is a branch: pass → next module, fail → back to the PRD as a spec change.
|
|
36
|
+
3. **Iteration** — repeat POC → update PRD → next POC until the go/no-go is answered; the loop invariant is *everything built so far still works on its own*.
|
|
37
|
+
4. **Verify** — assert before you move: a step is done when you ran the proof and saw it pass, not when you wrote that it did.
|
|
38
|
+
|
|
25
39
|
> The model is brilliant at execution and blind to intent. You can outsource the typing; you cannot outsource the understanding. Surface assumptions — don't bury them.
|
|
26
40
|
|
|
27
41
|
---
|
|
@@ -29,16 +43,14 @@ Every task runs through three layers. Do not skip ahead to code.
|
|
|
29
43
|
## Communication Protocol
|
|
30
44
|
|
|
31
45
|
### Core Rules
|
|
32
|
-
- **Spec
|
|
33
|
-
- **Checkpoint before executing**: State the load-bearing structural and logic decisions and get my explicit sign-off *before* you write code. Never run ahead on an unverified assumption — flag it and stop
|
|
46
|
+
- **Spec first, then checkpoint**: see [Operating Flow §1](#operating-flow). Never run ahead on an unverified assumption — flag it and stop
|
|
34
47
|
- **Fact-Based**: Base all recommendations on verified, current information. Prefer external signal (a real run, a real source) over a confident guess
|
|
35
48
|
- **Simplicity Advocate**: Call out overcomplications and suggest simpler alternatives
|
|
36
|
-
- **Safety First**: Never modify critical systems without explicit understanding and approval
|
|
37
49
|
|
|
38
50
|
### User Profile
|
|
39
51
|
- **Technical Level**: Non-coder but technically savvy
|
|
40
52
|
- **Learning Style**: Understands concepts, needs executable instructions
|
|
41
|
-
- **Expects**: Step-by-step guidance
|
|
53
|
+
- **Expects**: Step-by-step guidance, ready-to-run commands, and the *why* behind each recommendation
|
|
42
54
|
- **Comfortable with**: Command-line operations and scripts
|
|
43
55
|
- **Builds a lot of web apps** — assume any UI work will be consumed on phones as well as desktop
|
|
44
56
|
|
|
@@ -49,6 +61,7 @@ Not courtesies. These bind you as written, whether or not your tool enforces the
|
|
|
49
61
|
- **Always** identify affected files before making changes, and explain what will change and why
|
|
50
62
|
- **Ask first** — stop and get explicit sign-off — before modifying authentication systems, database schema or migrations, CI workflows, or `.claude/settings.json`
|
|
51
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
|
|
64
|
+
- **Never** commit to `main`. Commit to a new branch (name doesn't matter), then propose `/code-review` followed by `/release`; merging and releasing are my call, made by name — "approve", "good", or "go" on a draft is not that call
|
|
52
65
|
|
|
53
66
|
---
|
|
54
67
|
|
|
@@ -57,12 +70,12 @@ Not courtesies. These bind you as written, whether or not your tool enforces the
|
|
|
57
70
|
### Validate Before You Build
|
|
58
71
|
|
|
59
72
|
- **POC everything first.** Before committing to a design, build a quick proof-of-concept (~15 min) that validates the core logic. Keep it stupidly simple — manual steps are fine, hardcoded values are fine, no tests needed yet
|
|
60
|
-
- **POC scope:** Cover the happy path, 2-3 common edge cases, **and the riskiest assumption (see below) — not just the parts that are easy to check**. If those hold, the idea is sound
|
|
61
73
|
- **Graduation criteria:** POC validates logic and covers most common scenarios → stop, design properly, then build with structure, tests, and error handling. Never ship the POC — rewrite it
|
|
62
|
-
- **Aim the POC at the load-bearing claim — not the easy part.**
|
|
74
|
+
- **Aim the POC at the load-bearing claim — not the easy part.** Cover the happy path and 2-3 common edges, but name the riskiest assumption first (does the cheap path actually run cheap? does the library really do X? does the perf hold?), then point the spike straight at *that*. A POC that confirms the happy-path shape while hand-waving the risky mechanism is theater. If you catch yourself writing "production would do X" instead of *doing* X in the spike, the POC has not validated X — go do X
|
|
63
75
|
- **Prove, don't assert — a POC's output is evidence you ran, not prose you wrote.** Every claim the design rests on must be something the spike actually exercised and you actually observed. **Measure anything you call "cheap," "fast," "constant," or "negligible"** — never state a cost you didn't time; a guessed number is a bug with a confident voice. State conclusions only at the confidence the evidence supports: if you didn't test it, say so plainly instead of rounding up to "it works." Better a small honest finding than a big-mouthed claim that measurement later falsifies
|
|
64
76
|
- **The test must be able to FAIL — pre-flight check, not an afterthought.** Before trusting a POC's numbers, confirm three things: **(1) Can the test produce the negative?** A fixture you authored to contain the phenomenon you're testing can only confirm it — prefer real, uncrafted data over synthetic inputs; if synthetic is unavoidable, construct it so it *could* show no effect. **(2) Is the harness free of confounds?** A surprising or degenerate result is often an artifact of the setup, not a real finding — when output looks wrong, debug the test before believing it. **(3) Did the test actually exercise the variable?** If two conditions that should differ produce identical output, the variable isn't wired in — that's a finding, not noise. Run this checklist every time, especially when a result confirms what you hoped
|
|
65
|
-
- **
|
|
77
|
+
- **One module at a time.** Build the PRD's modules in order, never several at once. Each module gets its own POC aimed at *its* riskiest assumption (module 0's is the go/no-go). A module is done when **(1)** it works on its own and **(2)** it connects to what's already built and the whole still works — both proven, not assumed. Only then start the next
|
|
78
|
+
- **No fitting to pass.** Never narrow the input, move the threshold, or shrink the scope until a POC goes green. Report the failure and take it back to the PRD
|
|
66
79
|
|
|
67
80
|
### Dependency Hierarchy
|
|
68
81
|
|
|
@@ -106,6 +119,7 @@ Before adding any external dependency, all of these must be true:
|
|
|
106
119
|
- Skipping POC validation for unproven ideas
|
|
107
120
|
- POC-ing only the easy part while hand-waving the risky mechanism, or claiming a cost ("cheap"/"fast"/"constant") you never measured
|
|
108
121
|
- Authoring a fixture/corpus that *guarantees* the result (a test that can't return the negative), or trusting a degenerate-looking number without auditing the harness for confounds — use real uncrafted data; the test must be able to fail
|
|
122
|
+
- Fitting a POC to pass (narrowed input, moved threshold, shrunk scope) instead of reporting the failure; starting module N+1 while module N is unproven
|
|
109
123
|
|
|
110
124
|
---
|
|
111
125
|
|
|
@@ -269,9 +283,9 @@ Copy this to any project's CLAUDE.md. These are mandatory rules, not suggestions
|
|
|
269
283
|
```markdown
|
|
270
284
|
## Dev Rules
|
|
271
285
|
|
|
272
|
-
**
|
|
286
|
+
**Spec first.** Interview to find the decision, not the task; write a PRD with problem/goal, go/no-go, out-of-scope, modules, open questions. POCs refine it.
|
|
273
287
|
|
|
274
|
-
**
|
|
288
|
+
**POC first, one module at a time.** Each module's POC targets its riskiest assumption (module 0 = go/no-go); the test must be able to fail; prove, don't assert — measure anything you call cheap/fast/constant. No fitting to pass. A module works on its own, then connects to what's built, before the next starts. Never ship the POC.
|
|
275
289
|
|
|
276
290
|
**Dependency hierarchy — follow strictly:** vanilla language → standard library → external (only when stdlib can't do it in <100 lines). External deps must be maintained, lightweight, and widely adopted. Exception: always use vetted libraries for security-critical code (crypto, auth, sanitization).
|
|
277
291
|
|
|
@@ -283,17 +297,3 @@ Copy this to any project's CLAUDE.md. These are mandatory rules, not suggestions
|
|
|
283
297
|
|
|
284
298
|
For full development and testing standards, see `.claude/remember/AGENT_RULES.md`.
|
|
285
299
|
```
|
|
286
|
-
|
|
287
|
-
---
|
|
288
|
-
|
|
289
|
-
## AI Agent Instructions
|
|
290
|
-
|
|
291
|
-
When working with this user:
|
|
292
|
-
1. **Interview before building** — extract the real goal and surface load-bearing decisions for sign-off before you execute (see [Operating Flow](#operating-flow))
|
|
293
|
-
2. **Provide step-by-step** instructions with clear explanations
|
|
294
|
-
3. **Include ready-to-run** scripts and commands
|
|
295
|
-
4. **Explain the "why"** behind technical recommendations
|
|
296
|
-
5. **Flag potential issues** before they become problems — name the assumption, don't bury it
|
|
297
|
-
6. **Suggest simpler alternatives** when appropriate
|
|
298
|
-
7. **Ask first** before touching auth, DB schema/migrations, CI, or settings; **never** commit secrets
|
|
299
|
-
8. **Always identify** which files will be affected by changes
|
|
@@ -10,10 +10,10 @@ Run friction analysis, then consolidate session stashes + friction antigens into
|
|
|
10
10
|
- Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
|
|
11
11
|
- Keep changes tightly scoped to the requested outcome.
|
|
12
12
|
- **Precision over recall for hot memory.** A false antigen loaded into `@MEMORY.md` steers every future session. When unsure, do not promote — leave it to recurrence (a ledger `observing` entry at 2 sessions, nothing at 1).
|
|
13
|
-
- **Mid-tier model, not hardcoded.** Steps 2/3/4a delegate to
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
vendor-specific model name.
|
|
13
|
+
- **Mid-tier model, not hardcoded.** Steps 2/3/4a delegate to your tool's balanced default
|
|
14
|
+
tier — judgment-capable, cheaper and faster than your top reasoning tier. **Not the
|
|
15
|
+
cheapest/fastest tier**: on judgment work it measurably degrades (misclassification rates
|
|
16
|
+
several times higher). Never hardcode a vendor-specific model name.
|
|
17
17
|
- **Batch stashes, don't fan out.** Step 2 gives each extraction agent **up to 5 stashes**
|
|
18
18
|
and uses as few agents as possible (3 stashes → 1 agent, 7 → 2). One agent reading several
|
|
19
19
|
sessions sees the same lesson recur and writes it once; one agent per stash writes it once
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security
|
|
3
|
-
description:
|
|
3
|
+
description: Security audit — recurring six, injection, auth, trust boundaries
|
|
4
4
|
usage: /security
|
|
5
5
|
argument-hint: [file, directory, or leave empty for full scan]
|
|
6
|
-
allowed-tools: Read,
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Bash(git log:*), Bash(git grep:*), Bash(rg:*)
|
|
7
7
|
---
|
|
8
|
-
Audit $ARGUMENTS for security vulnerabilities.
|
|
9
|
-
|
|
8
|
+
Audit $ARGUMENTS for security vulnerabilities. **Reports, never edits** — it
|
|
9
|
+
verifies every claim, then hands the findings to whoever asked.
|
|
10
|
+
|
|
11
|
+
**Runs identically standalone or as stage 2 of `/branch-review`.** The only
|
|
12
|
+
difference is where the report goes: to the orchestrator when called as a
|
|
13
|
+
stage, to you when you run it directly. Same checks, same verify pass, same
|
|
14
|
+
escalation. It does **not** spawn a worker of its own — run it inline; when
|
|
15
|
+
`/branch-review` calls it, it is already inside that command's worker.
|
|
16
|
+
|
|
17
|
+
Adapt scope to what the target actually is — a library, CLI, web app, and service won't all have every
|
|
10
18
|
category. Skip what genuinely doesn't apply; never invent findings to fill a
|
|
11
19
|
section.
|
|
12
20
|
|
|
@@ -58,22 +66,23 @@ End with: which of the six classes were checked and found **clean**, and any
|
|
|
58
66
|
marked **N/A** for this target — so the scan's coverage is auditable, not just
|
|
59
67
|
its hits.
|
|
60
68
|
|
|
61
|
-
## After the scan — verify, then
|
|
69
|
+
## After the scan — verify, then escalate
|
|
62
70
|
|
|
63
|
-
Findings are claims, not facts. Validate before
|
|
71
|
+
Findings are claims, not facts. Validate every one before reporting it; an
|
|
72
|
+
unverified finding wastes more time than a missed one.
|
|
64
73
|
|
|
65
|
-
**Verify each claim.** Re-read the cited `file:line` in
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
**Verify each claim — adversarially.** Re-read the cited `file:line` in full
|
|
75
|
+
context and **try to break the claim, not to confirm it**: is there a gate
|
|
76
|
+
upstream, a framework default, a caller that already validates? A pass that
|
|
77
|
+
sets out to confirm reliably misses what an adversarial pass finds. Mark each
|
|
78
|
+
**confirmed**, **false positive** (with reason), or **uncertain** (with what
|
|
79
|
+
would settle it).
|
|
68
80
|
|
|
69
|
-
**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
breaking nearby logic. A fix isn't done until you've grounded it the same way
|
|
73
|
-
you grounded the claim.
|
|
81
|
+
**Never fix.** Not even a confirmed, one-line, obvious fix. Describe the
|
|
82
|
+
minimal remediation and hand it back — applying it is a separate, separately
|
|
83
|
+
authorized action.
|
|
74
84
|
|
|
75
|
-
**
|
|
76
|
-
here):
|
|
85
|
+
**Flag these explicitly** — they need a human decision, not a recommendation:
|
|
77
86
|
- the finding is **uncertain** after grounding (you'd need info you don't have),
|
|
78
87
|
- the fix has **multiple reasonable shapes** (e.g. reject-vs-sanitize,
|
|
79
88
|
index-vs-paginate) — present options with tradeoffs, not a chosen path,
|
|
@@ -82,5 +91,12 @@ here):
|
|
|
82
91
|
- it touches **auth / crypto / session / token** primitives — even an "obvious"
|
|
83
92
|
fix here warrants confirmation.
|
|
84
93
|
|
|
85
|
-
Final report: **confirmed
|
|
86
|
-
· **false
|
|
94
|
+
Final report: **confirmed** (with remediation described) · **needs a decision**
|
|
95
|
+
(why + the options and their tradeoffs) · **false positive** (why) ·
|
|
96
|
+
**uncertain** (what is needed to decide).
|
|
97
|
+
|
|
98
|
+
**Escalate, never assume.** Anything you cannot decide, cannot verify, or that
|
|
99
|
+
this spec does not cover → say so plainly in the report rather than guessing.
|
|
100
|
+
When running as a stage of `/branch-review`, that report goes to the
|
|
101
|
+
orchestrator; standalone, it goes to the user. Never widen scope, never fix a
|
|
102
|
+
side issue you noticed along the way.
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ship
|
|
3
|
-
description:
|
|
3
|
+
description: Mechanical pre-deploy gate — tests, build, tree state
|
|
4
4
|
usage: /ship
|
|
5
5
|
allowed-tools: Read, Grep, Glob, Bash(git:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(pytest:*), Bash(python:*), Bash(go:*), Bash(cargo:*), Bash(make:*)
|
|
6
6
|
---
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
Mechanical pre-deploy / pre-merge gate. Every item here is answerable by
|
|
8
|
+
**running a command** and reading its exit code — no code judgment. Code
|
|
9
|
+
judgment belongs to `/branch-review` (which runs `/security` in full as its
|
|
10
|
+
second stage); this gate does not duplicate it.
|
|
11
|
+
|
|
12
|
+
**Detect the stack first** (look for `package.json`,
|
|
13
|
+
`pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`, `Makefile`) and run only
|
|
14
|
+
the checks that actually exist — never assume a script (`lint`, `build`,
|
|
15
|
+
`migrate`) is present.
|
|
16
|
+
|
|
17
|
+
## Evidence rule
|
|
18
|
+
Report each item as **pass / fail / N/A**, and record **the exact command and
|
|
19
|
+
its exit code**. A check you did not run is a **fail**, never a pass. **N/A
|
|
20
|
+
requires a stated reason** ("no build script in `package.json`") — N/A must
|
|
21
|
+
never stand in for "didn't get to it."
|
|
12
22
|
|
|
13
23
|
## Checklist
|
|
14
24
|
- [ ] **Tests pass** — run the project's real test command (`npm test`,
|
|
@@ -17,24 +27,17 @@ script (`lint`, `build`, `migrate`) is present. Report each item as
|
|
|
17
27
|
- [ ] **Build succeeds** — only if the project has a build step.
|
|
18
28
|
- [ ] **No debug leftovers** — stray `console.log` / `print` / `debugger` /
|
|
19
29
|
`dbg!` / commented-out blocks / blocker `TODO`s in the changed files.
|
|
20
|
-
- [ ] **No hardcoded secrets** —
|
|
21
|
-
|
|
22
|
-
is
|
|
23
|
-
|
|
24
|
-
failure
|
|
25
|
-
- [ ] **
|
|
26
|
-
|
|
27
|
-
- [ ] **
|
|
28
|
-
|
|
29
|
-
- [ ] **
|
|
30
|
-
|
|
31
|
-
unindexed scans on hot paths.
|
|
32
|
-
- [ ] **Migrations ready** — only if the project has a schema / migrations.
|
|
33
|
-
- [ ] **Docs & config in sync** — `.env.example`, README, and any
|
|
34
|
-
threat-model / PRD updated for new config or new attack surface.
|
|
35
|
-
- [ ] **Clean tree, correct branch, in sync with `origin`.**
|
|
36
|
-
|
|
37
|
-
For any security-sensitive change in the diff, run **`/security`** on the
|
|
38
|
-
changed files before shipping.
|
|
30
|
+
- [ ] **No hardcoded secrets** — grep the diff for keys, tokens, credentials;
|
|
31
|
+
confirm `.env` is gitignored and only a value-less `.env.example` is
|
|
32
|
+
tracked. *This is the one check `/security` also makes, kept
|
|
33
|
+
deliberately: it is a grep with a binary answer, and a leaked key is the
|
|
34
|
+
one failure worth catching twice.*
|
|
35
|
+
- [ ] **Migrations ready** — only if the project has a schema / migrations:
|
|
36
|
+
they apply cleanly and are ordered.
|
|
37
|
+
- [ ] **Docs & config in sync** — `.env.example`, README, and any PRD /
|
|
38
|
+
context doc updated for new config or new usage.
|
|
39
|
+
- [ ] **Clean tree, correct branch, in sync with `origin`** — and never on
|
|
40
|
+
`main`.
|
|
39
41
|
|
|
40
|
-
Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items
|
|
42
|
+
Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items and the
|
|
43
|
+
command output that proves each one.
|
|
@@ -8,12 +8,18 @@ argument-hint: [optional stash name]
|
|
|
8
8
|
Save session context for compaction recovery or handoffs.
|
|
9
9
|
|
|
10
10
|
**Guardrails**
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
- **Write only what the brief contains.** The subagent expands the brief into a file; it does
|
|
12
|
+
not research, re-derive, or infer. Every fact, number, SHA, path, and identifier in the
|
|
13
|
+
stash comes from the brief verbatim — never invent, never round, never fill a gap with a
|
|
14
|
+
plausible guess. Missing detail stays missing.
|
|
15
|
+
- **Escalate, never assume.** Anything the subagent cannot do, cannot verify, or that this
|
|
16
|
+
spec does not cover → report it back to the orchestrator (the main session) rather than
|
|
17
|
+
improvising. Never widen scope beyond writing the file and counting the backlog.
|
|
18
|
+
- **Mid-tier model, not hardcoded.** Run the worker on your tool's balanced default tier —
|
|
19
|
+
judgment-capable, cheaper and faster than your top reasoning tier. **Not the
|
|
20
|
+
cheapest/fastest tier**: on judgment work it measurably degrades (misclassification rates
|
|
21
|
+
several times higher). Never hardcode a vendor-specific model name; use whatever your tool
|
|
22
|
+
designates as that default.
|
|
17
23
|
- **Background dispatch where supported.** Run the write-up subagent in the background
|
|
18
24
|
(non-blocking) so the session isn't held up waiting on formatting/file I/O. Fall back to
|
|
19
25
|
writing inline (today's behavior) if your tool has no subagent or background-dispatch
|
package/packages/droid/AGENTS.md
CHANGED
|
@@ -32,11 +32,11 @@ These subagents are available when using Claude Code CLI. Droid can reference th
|
|
|
32
32
|
| optimize | Analyze and optimize performance issues | /optimize <target-area> | - |
|
|
33
33
|
| refactor | Refactor code while maintaining behavior and tests | /refactor <code-section> | - |
|
|
34
34
|
| remember | Consolidate stashes + friction into project memory | /remember | - |
|
|
35
|
-
|
|
|
35
|
+
| branch-review | Pre-merge review: general review + full security audit, verify pass, no fixes | /branch-review [target] [level] | - |
|
|
36
36
|
| trace-back | Systematically traces bugs backward through call stack to identify source | /trace-back <issue-description> | false |
|
|
37
|
-
| security | Security
|
|
38
|
-
| ship |
|
|
39
|
-
| release |
|
|
37
|
+
| security | Security audit — recurring six, injection, auth, trust boundaries; reports, never fixes | /security [target] | - |
|
|
38
|
+
| ship | Mechanical pre-deploy gate — tests, build, tree state | /ship | - |
|
|
39
|
+
| release | Verify, sweep docs, cut a version — then hand back the merge/tag/publish sequence | /release | - |
|
|
40
40
|
| skill-creator | Guide for creating effective skills and extending Claude capabilities | /skill-creator <skill-type> <skill-description> | false |
|
|
41
41
|
| stash | Save session context for compaction recovery or handoffs | /stash ["optional-name"] | - |
|
|
42
42
|
| debug-method | Four-phase debugging framework - investigate root cause before any fixes | /debug-method <bug-or-error-description> | false |
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: branch-review
|
|
3
|
+
description: Review a branch before merge [target] [level]
|
|
4
|
+
usage: /branch-review [target] [low|medium|high|max]
|
|
5
|
+
argument-hint: [file, branch (e.g. main), range (main..HEAD), or empty] [effort level]
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Agent, Bash(git diff *), Bash(git log *), Bash(git show *), Bash(git status *), Bash(git grep *), Bash(git rev-parse *), Bash(git merge-base *), Bash(rg *)
|
|
7
|
+
---
|
|
8
|
+
Pre-merge review gate. Two stages — **general review** then a **full security
|
|
9
|
+
audit** — followed by an adversarial verify pass. It **never edits code**: it
|
|
10
|
+
reports findings and hands them back. Fixing is a separate, separately
|
|
11
|
+
authorized action.
|
|
12
|
+
|
|
13
|
+
Run this **before** `/release`. `/release` will refuse to run without a review
|
|
14
|
+
at the current HEAD SHA.
|
|
15
|
+
|
|
16
|
+
## Guardrails
|
|
17
|
+
- **Spawn a worker on a mid-tier model, not hardcoded.** The review runs in a
|
|
18
|
+
subagent on your tool's balanced default tier — judgment-capable, cheaper and
|
|
19
|
+
faster than your top reasoning tier. **Not the cheapest/fastest tier**: on
|
|
20
|
+
judgment work it measurably degrades (misclassification rates several times
|
|
21
|
+
higher). Never hardcode a vendor-specific model name. Fall back to running
|
|
22
|
+
inline if your tool has no subagent mechanism.
|
|
23
|
+
- **Escalate, never assume.** Anything you cannot decide, cannot verify, or
|
|
24
|
+
that this spec does not cover → **stop and report it to the orchestrator**
|
|
25
|
+
(the main session). Never improvise, never widen scope, never fix a side
|
|
26
|
+
issue you noticed along the way.
|
|
27
|
+
- **No edits.** You have no authorization to change code, even for a finding
|
|
28
|
+
you are certain about. Report it.
|
|
29
|
+
|
|
30
|
+
## Target — interpret `$ARGUMENTS` in this order
|
|
31
|
+
1. **Empty** → the current branch vs its merge-base with `main`
|
|
32
|
+
(`git diff $(git merge-base main HEAD)..HEAD`). If that is empty, the
|
|
33
|
+
staged diff; if that is empty too, the working tree.
|
|
34
|
+
2. **A range** like `main..HEAD` or `origin/main...HEAD` → `git diff <range>`.
|
|
35
|
+
3. **A single ref** (branch / tag / SHA — confirm with `git rev-parse
|
|
36
|
+
--verify`) → that ref's merge-base against `HEAD`.
|
|
37
|
+
4. **A file or directory path** → that target.
|
|
38
|
+
5. Otherwise → ask.
|
|
39
|
+
|
|
40
|
+
Record the **HEAD SHA** you reviewed. `/release` checks it, and any commit
|
|
41
|
+
made after the review makes the review stale.
|
|
42
|
+
|
|
43
|
+
## Effort level
|
|
44
|
+
`low | medium | high | max` — default **medium** if not given. The level
|
|
45
|
+
governs **stage 1 only**:
|
|
46
|
+
- **low / medium** — fewer findings, only ones you are confident in.
|
|
47
|
+
- **high / max** — broader coverage; uncertain findings are allowed, but each
|
|
48
|
+
must be labelled uncertain.
|
|
49
|
+
|
|
50
|
+
**Stage 2 (security) always runs full, at every level.** A shallow security
|
|
51
|
+
pass is worse than none — it reads as coverage while missing the class of bug
|
|
52
|
+
that costs the most.
|
|
53
|
+
|
|
54
|
+
## Stage 1 — General review
|
|
55
|
+
The diff is the subject, but **read the whole file around every hunk** — a
|
|
56
|
+
hunk-only read cannot see that a caller further down the same file is now
|
|
57
|
+
wrong. For multi-commit ranges, skim `git log <range>` for intent before
|
|
58
|
+
judging.
|
|
59
|
+
|
|
60
|
+
- **Bugs needing a fix.** Logic errors, off-by-one, null/undefined paths,
|
|
61
|
+
races, wrong defaults, broken edge cases.
|
|
62
|
+
- **Dead code.** Unreferenced functions / vars / imports / params, unreachable
|
|
63
|
+
branches, commented-out blocks, legacy paths the diff just obsoleted.
|
|
64
|
+
`git grep` the symbol before flagging — easy to be wrong.
|
|
65
|
+
- **Loose ends.** TODO / FIXME / XXX added by this diff, half-finished
|
|
66
|
+
branches, silently swallowed errors, stub bodies, mocked-out paths,
|
|
67
|
+
"temporary" names, abandoned feature flags.
|
|
68
|
+
- **Correctness.** Edge cases, error handling, type / contract violations,
|
|
69
|
+
broken invariants.
|
|
70
|
+
- **Performance.** N+1, blocking calls in hot paths, unbounded loops, indexes
|
|
71
|
+
the diff actually touches.
|
|
72
|
+
- **Maintainability.** Complexity, naming, duplication — only when material.
|
|
73
|
+
|
|
74
|
+
## Stage 2 — Security (always full)
|
|
75
|
+
**Delegate; do not re-implement.** Locate and **read** the installed
|
|
76
|
+
`security.md` and run its actual checklist — the recurring six (secrets in the
|
|
77
|
+
repo *and in git history*, data-access authorization / tenant isolation, rate
|
|
78
|
+
limiting, unhappy-path error handling, authorization beyond authentication,
|
|
79
|
+
inefficient data access) plus injection, auth/session, and trust boundaries.
|
|
80
|
+
|
|
81
|
+
If `security.md` cannot be found, run what you can from the list above and
|
|
82
|
+
**flag that the full checklist was unavailable** — never report it as passed.
|
|
83
|
+
|
|
84
|
+
This stage is repo- and history-scoped, not diff-scoped: a key committed forty
|
|
85
|
+
commits ago, an unbounded route the diff never touched, or a missing row
|
|
86
|
+
policy on a table the new code now reads are all in scope.
|
|
87
|
+
|
|
88
|
+
## Stage 3 — Verify (adversarial)
|
|
89
|
+
Findings are claims, not facts. **Try to break each one, not to confirm it** —
|
|
90
|
+
a pass that sets out to confirm reliably misses what an adversarial pass
|
|
91
|
+
finds.
|
|
92
|
+
|
|
93
|
+
- Re-read the cited `file:line` in full context.
|
|
94
|
+
- `git grep` the name across the repo before trusting any dead-code or
|
|
95
|
+
unused-symbol claim.
|
|
96
|
+
- Mark each **confirmed**, **false positive** (with the reason), or
|
|
97
|
+
**uncertain** (with what would settle it).
|
|
98
|
+
|
|
99
|
+
**Every surviving finding must carry a concrete failure scenario**: specific
|
|
100
|
+
inputs or state → the wrong output, crash, or exposure that results. If you
|
|
101
|
+
cannot write that sentence, the finding is not ready — drop it or mark it
|
|
102
|
+
uncertain. No vibes.
|
|
103
|
+
|
|
104
|
+
## Report — then escalate
|
|
105
|
+
Order findings most severe first.
|
|
106
|
+
|
|
107
|
+
### 🚨 Critical (blocks merge)
|
|
108
|
+
### ⚠️ Warnings (should fix)
|
|
109
|
+
### 💡 Suggestions (nice to have)
|
|
110
|
+
|
|
111
|
+
Each finding: **Location** (`file:line`) · **What's wrong** · **Failure
|
|
112
|
+
scenario** (inputs/state → result) · **Why it matters** · **Suggested fix**
|
|
113
|
+
(described, not applied) · **Verdict** (confirmed / uncertain).
|
|
114
|
+
|
|
115
|
+
Then a coverage line: stage 1 at level `<level>`, stage 2 full — each `ran ✓/✗`
|
|
116
|
+
with its evidence. A stage you did not actually run is a **✗**, never an
|
|
117
|
+
assumed pass.
|
|
118
|
+
|
|
119
|
+
End with:
|
|
120
|
+
- **Reviewed at HEAD `<sha>` on `<branch>`.**
|
|
121
|
+
- One-line verdict: **Ready to merge? Yes / No / Not until these are fixed.**
|
|
122
|
+
- **Escalate to the orchestrator** with the findings. It decides what gets
|
|
123
|
+
fixed and by whom. Say plainly what you could not verify.
|