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
|
@@ -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
|
|
@@ -157,21 +157,21 @@
|
|
|
157
157
|
"template": "{file:./command/refactor.md}",
|
|
158
158
|
"description": "Refactor code while maintaining behavior and tests"
|
|
159
159
|
},
|
|
160
|
-
"
|
|
161
|
-
"template": "{file:./command/
|
|
162
|
-
"description": "
|
|
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
|
|
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": "
|
|
170
|
+
"description": "Mechanical pre-deploy gate — tests, build, tree state"
|
|
171
171
|
},
|
|
172
172
|
"release": {
|
|
173
173
|
"template": "{file:./command/release.md}",
|
|
174
|
-
"description": "
|
|
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,
|
|
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
|
-
- `
|
|
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` -
|
|
129
|
+
- `release` - Prepare a release: verify → docs → bump → commit, 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,
|
|
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
|
-
- `/
|
|
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.
|