liteagents 2.20.0 → 2.21.1

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 (49) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +4 -4
  3. package/package.json +1 -1
  4. package/packages/ampcode/AGENT.md +4 -4
  5. package/packages/ampcode/agents/code-developer.md +2 -2
  6. package/packages/ampcode/agents/quality-assurance.md +1 -1
  7. package/packages/ampcode/commands/branch-review.md +123 -0
  8. package/packages/ampcode/commands/release.md +108 -79
  9. package/packages/ampcode/commands/remember/AGENT_RULES.md +3 -3
  10. package/packages/ampcode/commands/remember.md +4 -4
  11. package/packages/ampcode/commands/security.md +34 -18
  12. package/packages/ampcode/commands/ship.md +29 -26
  13. package/packages/ampcode/commands/stash.md +12 -6
  14. package/packages/claude/CLAUDE.md +4 -4
  15. package/packages/claude/agents/code-developer.md +2 -2
  16. package/packages/claude/agents/quality-assurance.md +1 -1
  17. package/packages/claude/commands/branch-review.md +123 -0
  18. package/packages/claude/commands/release.md +108 -79
  19. package/packages/claude/commands/remember/AGENT_RULES.md +3 -3
  20. package/packages/claude/commands/remember.md +4 -4
  21. package/packages/claude/commands/security.md +34 -18
  22. package/packages/claude/commands/ship.md +29 -26
  23. package/packages/claude/commands/stash.md +12 -6
  24. package/packages/droid/AGENTS.md +4 -4
  25. package/packages/droid/commands/branch-review.md +123 -0
  26. package/packages/droid/commands/release.md +108 -79
  27. package/packages/droid/commands/remember/AGENT_RULES.md +3 -3
  28. package/packages/droid/commands/remember.md +4 -4
  29. package/packages/droid/commands/security.md +34 -18
  30. package/packages/droid/commands/ship.md +29 -26
  31. package/packages/droid/commands/stash.md +12 -6
  32. package/packages/droid/droids/code-developer.md +2 -2
  33. package/packages/droid/droids/quality-assurance.md +1 -1
  34. package/packages/opencode/AGENTS.md +4 -4
  35. package/packages/opencode/agent/code-developer.md +2 -2
  36. package/packages/opencode/agent/quality-assurance.md +1 -1
  37. package/packages/opencode/command/branch-review.md +123 -0
  38. package/packages/opencode/command/release.md +108 -79
  39. package/packages/opencode/command/remember/AGENT_RULES.md +3 -3
  40. package/packages/opencode/command/remember.md +4 -4
  41. package/packages/opencode/command/security.md +34 -18
  42. package/packages/opencode/command/ship.md +29 -26
  43. package/packages/opencode/command/stash.md +12 -6
  44. package/packages/opencode/opencode.jsonc +6 -6
  45. package/packages/subagentic-manual.md +5 -5
  46. package/packages/ampcode/commands/diff-review.md +0 -78
  47. package/packages/claude/commands/diff-review.md +0 -78
  48. package/packages/droid/commands/diff-review.md +0 -78
  49. package/packages/opencode/command/diff-review.md +0 -78
@@ -1,12 +1,20 @@
1
1
  ---
2
2
  name: security
3
- description: Scan security [target]
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, Edit, Grep, Glob, Bash(git log *), Bash(git grep *), Bash(rg *)
6
+ allowed-tools: Read, Grep, Glob, Bash(git log *), Bash(git grep *), Bash(rg *)
7
7
  ---
8
- Audit $ARGUMENTS for security vulnerabilities. Adapt scope to what the target
9
- actually is — a library, CLI, web app, and service won't all have every
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 fix
69
+ ## After the scan — verify, then escalate
62
70
 
63
- Findings are claims, not facts. Validate before acting; validate again after.
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 context. Confirm the
66
- risk actually holds here not in the abstract. Mark each **confirmed**, **false
67
- positive** (with reason), or **uncertain**.
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
- **Fix what's confirmed and unambiguous** — minimal shape, one obvious way, no
70
- change to a public API / response / caller contract. Apply directly. After
71
- each edit, re-read the changed region and confirm it closes the gap without
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
- **Stop and ask** when any of these hold (HITL gates — not all the time, only
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-and-fixed** · **confirmed-but-asking** (why + options)
86
- · **false-positive** (why) · **uncertain** (what's needed to decide).
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: Check pre-deployment
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
- Pre-deploy / pre-merge gate. **Detect the stack first** (look for
8
- `package.json`, `pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`,
9
- `Makefile`) and run only the checks that actually exist never assume a
10
- script (`lint`, `build`, `migrate`) is present. Report each item as
11
- **pass / fail / N/A**.
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** — scan the diff. Secrets load from env / a
21
- secret store; `.env` is gitignored and only a value-less `.env.example`
22
- is tracked.
23
- - [ ] **Error handling complete** every new IO / network / DB call has a
24
- failure path; nothing fails silently; no internal detail leaks to clients.
25
- - [ ] **Authorization** — new endpoints/actions check **ownership + role**,
26
- not just authentication (no IDOR via id-swapping).
27
- - [ ] **Rate limiting** — new externally reachable routes, including
28
- authenticated writes, are bounded.
29
- - [ ] **Data access scoped & scales** new queries are constrained to the
30
- requesting principal (no cross-tenant leak) and avoid obvious N+1 /
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
- - Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
12
- - Keep changes tightly scoped to the requested outcome.
13
- - **Mid-tier model, not hardcoded.** The write-up subagent (step 2) uses a mid-tier model
14
- capable of semantic judgment, cheaper/faster than your top reasoning tier (e.g. Claude's
15
- Sonnet vs Opus). Use whatever your tool designates as that balanced default; never hardcode
16
- a vendor-specific model name.
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
@@ -157,21 +157,21 @@
157
157
  "template": "{file:./command/refactor.md}",
158
158
  "description": "Refactor code while maintaining behavior and tests"
159
159
  },
160
- "diff-review": {
161
- "template": "{file:./command/diff-review.md}",
162
- "description": "Comprehensive code review including quality, tests, and architecture"
160
+ "branch-review": {
161
+ "template": "{file:./command/branch-review.md}",
162
+ "description": "Pre-merge review: general review + full security audit, verify pass, no fixes"
163
163
  },
164
164
  "security": {
165
165
  "template": "{file:./command/security.md}",
166
- "description": "Security vulnerability scan and analysis"
166
+ "description": "Security audit recurring six, injection, auth, trust boundaries; reports, never fixes"
167
167
  },
168
168
  "ship": {
169
169
  "template": "{file:./command/ship.md}",
170
- "description": "Pre-deployment verification checklist"
170
+ "description": "Mechanical pre-deploy gate — tests, build, tree state"
171
171
  },
172
172
  "release": {
173
173
  "template": "{file:./command/release.md}",
174
- "description": "Deliver a feature end-to-end: verify, docs, merge, tag (publish stays manual)"
174
+ "description": "Verify, sweep docs, cut a version then hand back the merge/tag/publish sequence"
175
175
  },
176
176
  "remember": {
177
177
  "template": "{file:./command/remember.md}",
@@ -56,7 +56,7 @@ Install for your platform:
56
56
  - brainstorming, debug-method, live-canvas, skill-creator, trace-back
57
57
 
58
58
  **10 Commands** - Workflow helpers
59
- - docs-builder, optimize, refactor, remember, diff-review, security, ship, release, stash, test-generate
59
+ - docs-builder, optimize, refactor, remember, branch-review, security, ship, release, stash, test-generate
60
60
 
61
61
  **Orchestration System**
62
62
  - Automatic intent matching to 9 workflow patterns
@@ -123,10 +123,10 @@ Install for your platform:
123
123
  - `optimize` - Performance analysis
124
124
  - `refactor` - Maintain behavior while improving code
125
125
  - `remember` - Consolidate stashes + friction into project memory
126
- - `diff-review` - Review a file, branch, or range; verifies findings before fixing
126
+ - `branch-review` - Review a branch + full security audit; verifies findings, reports without fixing
127
127
  - `security` - Vulnerability scanning
128
128
  - `ship` - Pre-deployment checklist
129
- - `release` - Deliver a feature end-to-end: verify → docs → merge → tag (publish stays manual)
129
+ - `release` - Prepare a release: verify → docs → bumpcommit, then report the merge/tag/publish sequence for you to authorize
130
130
  - `stash` - Save session context for compaction recovery or handoffs
131
131
  - `test-generate` - Test suite generation
132
132
 
@@ -139,7 +139,7 @@ Same functionality as skills+commands, but:
139
139
 
140
140
  **Command Categories**:
141
141
  - **Development & Testing (6)**: tdd-flow, test-traps, test-generate, debug-method, trace-back, verify-done
142
- - **Code Operations (6)**: refactor, optimize, diff-review, security, ship, release
142
+ - **Code Operations (6)**: refactor, optimize, branch-review, security, ship, release
143
143
  - **Session & Memory (5)**: brainstorming, skill-creator, docs-builder, stash, remember
144
144
  - **Design (1)**: live-canvas
145
145
 
@@ -236,7 +236,7 @@ Each pattern includes conditional decision points requiring user approval.
236
236
  ### Droid/OpenCode: Direct Command Invocation
237
237
 
238
238
  No orchestrator - invoke commands directly:
239
- - `/diff-review <file-or-branch>`
239
+ - `/branch-review <file-or-branch> [level]`
240
240
  - `/refactor <code-section>`
241
241
  - `/tdd-flow <feature>`
242
242
 
@@ -1,78 +0,0 @@
1
- ---
2
- name: diff-review
3
- description: Review diff [file, branch, or range]
4
- usage: /diff-review
5
- argument-hint: [file, branch (e.g. main), range (main..HEAD), or empty]
6
- allowed-tools: Read, Edit, Grep, Glob, 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
- Review $ARGUMENTS. Interpret in this order:
9
- 1. **Empty** → staged diff (`git diff --staged`); if empty, working-tree diff
10
- (`git diff`).
11
- 2. **A range** like `main..HEAD` or `origin/main...HEAD` → `git diff <range>`.
12
- 3. **A single ref** (branch / tag / SHA — confirm with `git rev-parse
13
- --verify`) → diff that ref's merge-base against `HEAD` (i.e. everything on
14
- the current branch since it diverged: `git diff $(git merge-base <ref>
15
- HEAD)..HEAD`). This is the common "review my branch before merging" path.
16
- 4. **A file or directory path** → that target.
17
- 5. Otherwise → ask.
18
-
19
- The diff is the subject; widen to surrounding code only as needed to judge a
20
- hunk. For multi-commit ranges, also skim `git log <range>` to understand
21
- intent before judging.
22
-
23
- ## Check For
24
- - **Bugs needing a fix.** Logic errors, off-by-one, null/undefined paths,
25
- races, wrong defaults, broken edge cases. Concrete failure modes only — not
26
- vibes.
27
- - **Dead code.** Unreferenced functions / vars / imports / params, unreachable
28
- branches, commented-out blocks, legacy paths the diff just obsoleted.
29
- `git grep` the symbol before flagging — easy to be wrong.
30
- - **Loose ends.** TODO / FIXME / XXX added by this diff, half-finished
31
- branches, silently swallowed errors, stub bodies, mocked-out paths,
32
- "temporary" names, abandoned feature flags.
33
- - **Correctness.** Edge cases, error handling, type / contract violations,
34
- broken invariants.
35
- - **Security.** OWASP Top 10, auth, data exposure. (`/security` for depth.)
36
- - **Performance.** N+1, blocking calls in hot paths, unbounded loops, indexes
37
- the diff actually touches.
38
- - **Maintainability.** Complexity, naming, duplication — only when material.
39
-
40
- ## Output Format
41
- ### 🚨 Critical (blocks merge)
42
- ### ⚠️ Warnings (should fix)
43
- ### 💡 Suggestions (nice to have)
44
-
45
- Each finding: **Location** (`file:line`), **What's wrong**, **Why it matters**,
46
- **Concrete fix** — not "consider improving".
47
-
48
- ## After the review — verify, then fix
49
-
50
- Findings are claims, not facts. Validate before acting; validate again after.
51
-
52
- **Verify each claim.** Re-read the cited `file:line` in context. For
53
- dead-code or unused-symbol claims, `git grep` the name across the repo before
54
- trusting it. Mark each **confirmed**, **false positive** (with reason), or
55
- **uncertain**.
56
-
57
- **Fix what's confirmed and unambiguous** — minimal shape, one obvious way, no
58
- change to a public API / response / caller contract. Apply directly. After
59
- each edit, re-read the changed region and confirm it does what you intended
60
- without breaking nearby logic. A fix isn't done until you've grounded it the
61
- same way you grounded the claim.
62
-
63
- **Stop and ask** when any of these hold (HITL gates — not all the time, only
64
- here):
65
- - the finding is **uncertain** after grounding,
66
- - the fix has **multiple reasonable shapes** (e.g. delete-vs-keep-behind-flag,
67
- extract-vs-inline, patch-vs-rewrite) — present options with tradeoffs, not a
68
- chosen path,
69
- - it **affects downstream** (signatures, response shape, schema, any caller
70
- contract) or removes a public/exported symbol, or
71
- - the "dead code" looks intentionally kept (stub for upcoming work, framework
72
- hook, documented extension point) — confirm before deleting.
73
-
74
- Final report: **confirmed-and-fixed** · **confirmed-but-asking** (why +
75
- options) · **false-positive** (why) · **uncertain** (what's needed to decide).
76
-
77
- End with a one-line verdict: **Ready to merge? Yes / No / With fixes** — and
78
- the reason in a sentence.
@@ -1,78 +0,0 @@
1
- ---
2
- name: diff-review
3
- description: Review diff [file, branch, or range]
4
- usage: /diff-review
5
- argument-hint: [file, branch (e.g. main), range (main..HEAD), or empty]
6
- allowed-tools: Read, Edit, Grep, Glob, 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
- Review $ARGUMENTS. Interpret in this order:
9
- 1. **Empty** → staged diff (`git diff --staged`); if empty, working-tree diff
10
- (`git diff`).
11
- 2. **A range** like `main..HEAD` or `origin/main...HEAD` → `git diff <range>`.
12
- 3. **A single ref** (branch / tag / SHA — confirm with `git rev-parse
13
- --verify`) → diff that ref's merge-base against `HEAD` (i.e. everything on
14
- the current branch since it diverged: `git diff $(git merge-base <ref>
15
- HEAD)..HEAD`). This is the common "review my branch before merging" path.
16
- 4. **A file or directory path** → that target.
17
- 5. Otherwise → ask.
18
-
19
- The diff is the subject; widen to surrounding code only as needed to judge a
20
- hunk. For multi-commit ranges, also skim `git log <range>` to understand
21
- intent before judging.
22
-
23
- ## Check For
24
- - **Bugs needing a fix.** Logic errors, off-by-one, null/undefined paths,
25
- races, wrong defaults, broken edge cases. Concrete failure modes only — not
26
- vibes.
27
- - **Dead code.** Unreferenced functions / vars / imports / params, unreachable
28
- branches, commented-out blocks, legacy paths the diff just obsoleted.
29
- `git grep` the symbol before flagging — easy to be wrong.
30
- - **Loose ends.** TODO / FIXME / XXX added by this diff, half-finished
31
- branches, silently swallowed errors, stub bodies, mocked-out paths,
32
- "temporary" names, abandoned feature flags.
33
- - **Correctness.** Edge cases, error handling, type / contract violations,
34
- broken invariants.
35
- - **Security.** OWASP Top 10, auth, data exposure. (`/security` for depth.)
36
- - **Performance.** N+1, blocking calls in hot paths, unbounded loops, indexes
37
- the diff actually touches.
38
- - **Maintainability.** Complexity, naming, duplication — only when material.
39
-
40
- ## Output Format
41
- ### 🚨 Critical (blocks merge)
42
- ### ⚠️ Warnings (should fix)
43
- ### 💡 Suggestions (nice to have)
44
-
45
- Each finding: **Location** (`file:line`), **What's wrong**, **Why it matters**,
46
- **Concrete fix** — not "consider improving".
47
-
48
- ## After the review — verify, then fix
49
-
50
- Findings are claims, not facts. Validate before acting; validate again after.
51
-
52
- **Verify each claim.** Re-read the cited `file:line` in context. For
53
- dead-code or unused-symbol claims, `git grep` the name across the repo before
54
- trusting it. Mark each **confirmed**, **false positive** (with reason), or
55
- **uncertain**.
56
-
57
- **Fix what's confirmed and unambiguous** — minimal shape, one obvious way, no
58
- change to a public API / response / caller contract. Apply directly. After
59
- each edit, re-read the changed region and confirm it does what you intended
60
- without breaking nearby logic. A fix isn't done until you've grounded it the
61
- same way you grounded the claim.
62
-
63
- **Stop and ask** when any of these hold (HITL gates — not all the time, only
64
- here):
65
- - the finding is **uncertain** after grounding,
66
- - the fix has **multiple reasonable shapes** (e.g. delete-vs-keep-behind-flag,
67
- extract-vs-inline, patch-vs-rewrite) — present options with tradeoffs, not a
68
- chosen path,
69
- - it **affects downstream** (signatures, response shape, schema, any caller
70
- contract) or removes a public/exported symbol, or
71
- - the "dead code" looks intentionally kept (stub for upcoming work, framework
72
- hook, documented extension point) — confirm before deleting.
73
-
74
- Final report: **confirmed-and-fixed** · **confirmed-but-asking** (why +
75
- options) · **false-positive** (why) · **uncertain** (what's needed to decide).
76
-
77
- End with a one-line verdict: **Ready to merge? Yes / No / With fixes** — and
78
- the reason in a sentence.
@@ -1,78 +0,0 @@
1
- ---
2
- name: diff-review
3
- description: Review diff [file, branch, or range]
4
- usage: /diff-review
5
- argument-hint: [file, branch (e.g. main), range (main..HEAD), or empty]
6
- allowed-tools: Read, Edit, Grep, Glob, 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
- Review $ARGUMENTS. Interpret in this order:
9
- 1. **Empty** → staged diff (`git diff --staged`); if empty, working-tree diff
10
- (`git diff`).
11
- 2. **A range** like `main..HEAD` or `origin/main...HEAD` → `git diff <range>`.
12
- 3. **A single ref** (branch / tag / SHA — confirm with `git rev-parse
13
- --verify`) → diff that ref's merge-base against `HEAD` (i.e. everything on
14
- the current branch since it diverged: `git diff $(git merge-base <ref>
15
- HEAD)..HEAD`). This is the common "review my branch before merging" path.
16
- 4. **A file or directory path** → that target.
17
- 5. Otherwise → ask.
18
-
19
- The diff is the subject; widen to surrounding code only as needed to judge a
20
- hunk. For multi-commit ranges, also skim `git log <range>` to understand
21
- intent before judging.
22
-
23
- ## Check For
24
- - **Bugs needing a fix.** Logic errors, off-by-one, null/undefined paths,
25
- races, wrong defaults, broken edge cases. Concrete failure modes only — not
26
- vibes.
27
- - **Dead code.** Unreferenced functions / vars / imports / params, unreachable
28
- branches, commented-out blocks, legacy paths the diff just obsoleted.
29
- `git grep` the symbol before flagging — easy to be wrong.
30
- - **Loose ends.** TODO / FIXME / XXX added by this diff, half-finished
31
- branches, silently swallowed errors, stub bodies, mocked-out paths,
32
- "temporary" names, abandoned feature flags.
33
- - **Correctness.** Edge cases, error handling, type / contract violations,
34
- broken invariants.
35
- - **Security.** OWASP Top 10, auth, data exposure. (`/security` for depth.)
36
- - **Performance.** N+1, blocking calls in hot paths, unbounded loops, indexes
37
- the diff actually touches.
38
- - **Maintainability.** Complexity, naming, duplication — only when material.
39
-
40
- ## Output Format
41
- ### 🚨 Critical (blocks merge)
42
- ### ⚠️ Warnings (should fix)
43
- ### 💡 Suggestions (nice to have)
44
-
45
- Each finding: **Location** (`file:line`), **What's wrong**, **Why it matters**,
46
- **Concrete fix** — not "consider improving".
47
-
48
- ## After the review — verify, then fix
49
-
50
- Findings are claims, not facts. Validate before acting; validate again after.
51
-
52
- **Verify each claim.** Re-read the cited `file:line` in context. For
53
- dead-code or unused-symbol claims, `git grep` the name across the repo before
54
- trusting it. Mark each **confirmed**, **false positive** (with reason), or
55
- **uncertain**.
56
-
57
- **Fix what's confirmed and unambiguous** — minimal shape, one obvious way, no
58
- change to a public API / response / caller contract. Apply directly. After
59
- each edit, re-read the changed region and confirm it does what you intended
60
- without breaking nearby logic. A fix isn't done until you've grounded it the
61
- same way you grounded the claim.
62
-
63
- **Stop and ask** when any of these hold (HITL gates — not all the time, only
64
- here):
65
- - the finding is **uncertain** after grounding,
66
- - the fix has **multiple reasonable shapes** (e.g. delete-vs-keep-behind-flag,
67
- extract-vs-inline, patch-vs-rewrite) — present options with tradeoffs, not a
68
- chosen path,
69
- - it **affects downstream** (signatures, response shape, schema, any caller
70
- contract) or removes a public/exported symbol, or
71
- - the "dead code" looks intentionally kept (stub for upcoming work, framework
72
- hook, documented extension point) — confirm before deleting.
73
-
74
- Final report: **confirmed-and-fixed** · **confirmed-but-asking** (why +
75
- options) · **false-positive** (why) · **uncertain** (what's needed to decide).
76
-
77
- End with a one-line verdict: **Ready to merge? Yes / No / With fixes** — and
78
- the reason in a sentence.
@@ -1,78 +0,0 @@
1
- ---
2
- name: diff-review
3
- description: Review diff [file, branch, or range]
4
- usage: /diff-review
5
- argument-hint: [file, branch (e.g. main), range (main..HEAD), or empty]
6
- allowed-tools: Read, Edit, Grep, Glob, 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
- Review $ARGUMENTS. Interpret in this order:
9
- 1. **Empty** → staged diff (`git diff --staged`); if empty, working-tree diff
10
- (`git diff`).
11
- 2. **A range** like `main..HEAD` or `origin/main...HEAD` → `git diff <range>`.
12
- 3. **A single ref** (branch / tag / SHA — confirm with `git rev-parse
13
- --verify`) → diff that ref's merge-base against `HEAD` (i.e. everything on
14
- the current branch since it diverged: `git diff $(git merge-base <ref>
15
- HEAD)..HEAD`). This is the common "review my branch before merging" path.
16
- 4. **A file or directory path** → that target.
17
- 5. Otherwise → ask.
18
-
19
- The diff is the subject; widen to surrounding code only as needed to judge a
20
- hunk. For multi-commit ranges, also skim `git log <range>` to understand
21
- intent before judging.
22
-
23
- ## Check For
24
- - **Bugs needing a fix.** Logic errors, off-by-one, null/undefined paths,
25
- races, wrong defaults, broken edge cases. Concrete failure modes only — not
26
- vibes.
27
- - **Dead code.** Unreferenced functions / vars / imports / params, unreachable
28
- branches, commented-out blocks, legacy paths the diff just obsoleted.
29
- `git grep` the symbol before flagging — easy to be wrong.
30
- - **Loose ends.** TODO / FIXME / XXX added by this diff, half-finished
31
- branches, silently swallowed errors, stub bodies, mocked-out paths,
32
- "temporary" names, abandoned feature flags.
33
- - **Correctness.** Edge cases, error handling, type / contract violations,
34
- broken invariants.
35
- - **Security.** OWASP Top 10, auth, data exposure. (`/security` for depth.)
36
- - **Performance.** N+1, blocking calls in hot paths, unbounded loops, indexes
37
- the diff actually touches.
38
- - **Maintainability.** Complexity, naming, duplication — only when material.
39
-
40
- ## Output Format
41
- ### 🚨 Critical (blocks merge)
42
- ### ⚠️ Warnings (should fix)
43
- ### 💡 Suggestions (nice to have)
44
-
45
- Each finding: **Location** (`file:line`), **What's wrong**, **Why it matters**,
46
- **Concrete fix** — not "consider improving".
47
-
48
- ## After the review — verify, then fix
49
-
50
- Findings are claims, not facts. Validate before acting; validate again after.
51
-
52
- **Verify each claim.** Re-read the cited `file:line` in context. For
53
- dead-code or unused-symbol claims, `git grep` the name across the repo before
54
- trusting it. Mark each **confirmed**, **false positive** (with reason), or
55
- **uncertain**.
56
-
57
- **Fix what's confirmed and unambiguous** — minimal shape, one obvious way, no
58
- change to a public API / response / caller contract. Apply directly. After
59
- each edit, re-read the changed region and confirm it does what you intended
60
- without breaking nearby logic. A fix isn't done until you've grounded it the
61
- same way you grounded the claim.
62
-
63
- **Stop and ask** when any of these hold (HITL gates — not all the time, only
64
- here):
65
- - the finding is **uncertain** after grounding,
66
- - the fix has **multiple reasonable shapes** (e.g. delete-vs-keep-behind-flag,
67
- extract-vs-inline, patch-vs-rewrite) — present options with tradeoffs, not a
68
- chosen path,
69
- - it **affects downstream** (signatures, response shape, schema, any caller
70
- contract) or removes a public/exported symbol, or
71
- - the "dead code" looks intentionally kept (stub for upcoming work, framework
72
- hook, documented extension point) — confirm before deleting.
73
-
74
- Final report: **confirmed-and-fixed** · **confirmed-but-asking** (why +
75
- options) · **false-positive** (why) · **uncertain** (what's needed to decide).
76
-
77
- End with a one-line verdict: **Ready to merge? Yes / No / With fixes** — and
78
- the reason in a sentence.