cursordoctrine 0.2.0 → 0.2.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.
- package/README.md +1 -1
- package/linux/hooks/anti-slop-audit.sh +8 -11
- package/linux/hooks/anti-slop.md +54 -56
- package/linux/hooks/final-review.md +19 -13
- package/linux/hooks/final-review.sh +7 -7
- package/linux/hooks/subagent-stop-review.sh +1 -1
- package/package.json +2 -2
- package/skills/anti-slop/SKILL.md +15 -8
- package/windows/hooks/anti-slop-audit.ps1 +8 -11
- package/windows/hooks/anti-slop.md +54 -56
- package/windows/hooks/final-review.md +19 -13
- package/windows/hooks/final-review.ps1 +7 -7
- package/windows/hooks/subagent-stop-review.ps1 +1 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ No Node? Open `INSTALL.md`, paste its contents into a Cursor agent chat on the t
|
|
|
59
59
|
|
|
60
60
|
Prerequisites: `git` everywhere; `pwsh` on Windows; `bash` plus `jq` or `python3` on Linux.
|
|
61
61
|
|
|
62
|
-
The anti-slop skill (`skills/anti-slop/` — SKILL.md and the duplication scanner) installs to `~/.cursor/skills/anti-slop/`. The
|
|
62
|
+
The anti-slop skill (`skills/anti-slop/` — SKILL.md and the duplication scanner) installs to `~/.cursor/skills/anti-slop/`. The hook checklist (`~/.agents/hooks/anti-slop.md`, 13 items) is the canonical slop detector for both per-edit advisories and final-review axis 4. The final review runs the scanner from the skill path first when available.
|
|
63
63
|
|
|
64
64
|
## Tuning and kill switches
|
|
65
65
|
|
|
@@ -154,17 +154,14 @@ checklist_file="$HOME/.agents/hooks/anti-slop.md"
|
|
|
154
154
|
checklist=""
|
|
155
155
|
[ -f "$checklist_file" ] && checklist="$(cat "$checklist_file")"
|
|
156
156
|
if [ -z "$checklist" ]; then
|
|
157
|
-
checklist='ANTI-SLOP
|
|
158
|
-
1
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
8. Cargo cult - delete any construct whose reason you cannot state.
|
|
166
|
-
9. Architecture - respect the project'"'"'s layering and boundaries.
|
|
167
|
-
10. Redundant comments restating code - delete; keep only WHY.'
|
|
157
|
+
checklist='ANTI-SLOP — read ~/.agents/hooks/anti-slop.md (13 items). Fallback if missing:
|
|
158
|
+
1–10: edge cases, duplication, conventions, deps, premature abstraction,
|
|
159
|
+
accidental complexity, tests (no tautologies), cargo cult, architecture,
|
|
160
|
+
redundant comments / prompt residue.
|
|
161
|
+
11: semantic contracts (behavior change without name/signature change).
|
|
162
|
+
12: operational slop (retry w/o backoff, await-in-loop, telemetry spam).
|
|
163
|
+
13: change surface (too many files for a simple request).
|
|
164
|
+
Fix guilty items now. Never revert what the user asked for.'
|
|
168
165
|
fi
|
|
169
166
|
|
|
170
167
|
flag_block=""
|
package/linux/hooks/anti-slop.md
CHANGED
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
ANTI-SLOP SELF-REVIEW — you just edited a file
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
not a
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Hard constraints: never revert
|
|
54
|
-
|
|
55
|
-
targeted edits, then stop. The bar: would this pass a senior review at a top
|
|
56
|
-
engineering org without a single "why is this here?" comment.
|
|
1
|
+
ANTI-SLOP SELF-REVIEW — you just edited a file (or you are auditing the
|
|
2
|
+
session diff at final review). Code that runs but should not ship.
|
|
3
|
+
|
|
4
|
+
Intent trace (Tier 0 — hallucinated requirements, scope drift) runs FIRST at
|
|
5
|
+
stop via final-review axis 0, not here. This checklist covers code-shape and
|
|
6
|
+
cost slop. Apply every item; if guilty, FIX with Edit — delete, inline, drop.
|
|
7
|
+
Do not explain. If clean, say nothing.
|
|
8
|
+
|
|
9
|
+
1. EDGE CASES — Happy path only? Check null / empty / zero / boundary / error
|
|
10
|
+
inputs the task implies.
|
|
11
|
+
|
|
12
|
+
2. DUPLICATION — Logic that already exists in this repo? Call it; do not
|
|
13
|
+
re-implement. Same function in many files (isRecord-class) → one source.
|
|
14
|
+
|
|
15
|
+
3. CONVENTIONS — Match the FILE's style, naming, structure, error-handling,
|
|
16
|
+
imports. Not your defaults.
|
|
17
|
+
|
|
18
|
+
4. DEPENDENCIES — New library for something stdlib or an existing dep covers?
|
|
19
|
+
Remove it. A dependency must earn its place.
|
|
20
|
+
|
|
21
|
+
5. PREMATURE ABSTRACTION — Factory / Repository / Mediator / Strategy / Builder /
|
|
22
|
+
CQRS / Event Sourcing / DDD: is there a REAL problem with 2–3 call sites
|
|
23
|
+
TODAY? "Future flexibility" is not a reason. Delete and write direct code.
|
|
24
|
+
|
|
25
|
+
6. ACCIDENTAL COMPLEXITY — Could a junior read this in 30 seconds? Flatten
|
|
26
|
+
indirection, generics, config, layers that do not earn their keep.
|
|
27
|
+
|
|
28
|
+
7. TESTS (epistemic slop) — Assert real OUTCOMES and edge cases, not "it runs",
|
|
29
|
+
not a mirror of the implementation, not expect(true).toBe(true). A test
|
|
30
|
+
that cannot fail is slop.
|
|
31
|
+
|
|
32
|
+
8. CARGO CULT — Can you state WHY each non-obvious construct is there? Remove
|
|
33
|
+
what you cannot justify. A shape you have seen ≠ a shape you need.
|
|
34
|
+
|
|
35
|
+
9. ARCHITECTURE — Respect layering and boundaries. No reaching across layers,
|
|
36
|
+
no business logic in the wrong place, no breaking project constraints.
|
|
37
|
+
|
|
38
|
+
10. REDUNDANT COMMENTS — Delete comments that restate the code ("// increment
|
|
39
|
+
i"). Keep only WHY, never WHAT. No prompt residue ("in a real app...").
|
|
40
|
+
|
|
41
|
+
11. SEMANTIC CONTRACTS (Tier 1) — Did any existing function's BEHAVIOR change
|
|
42
|
+
without its name, signature, or docstring changing? Names are contracts.
|
|
43
|
+
deleteUser() that now soft-deletes is silent contract break.
|
|
44
|
+
|
|
45
|
+
12. OPERATIONAL SLOP (Tier 3) — Retry loops without backoff/sleep/jitter?
|
|
46
|
+
await fetch / ctx.db / prisma inside a for/while/map? Six or more
|
|
47
|
+
console.log / print added in one edit? Token burn with no user value →
|
|
48
|
+
remove or bound.
|
|
49
|
+
|
|
50
|
+
13. CHANGE SURFACE (Tier 5) — Did a simple request touch many files? Every
|
|
51
|
+
file in the diff must trace to the task. Trim unrelated hunks.
|
|
52
|
+
|
|
53
|
+
Hard constraints: never revert what the USER asked for — slop is what got added
|
|
54
|
+
on top. At most a few targeted edits, then stop.
|
|
@@ -45,17 +45,23 @@ is present — sandboxed verify run, no transcript — skip this axis.)
|
|
|
45
45
|
- Add the missing tests; delete tautological ones.
|
|
46
46
|
|
|
47
47
|
## 4. Anti-slop
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Axis 0 already caught intent drift. This axis catches code-shape and cost slop
|
|
49
|
+
across the whole session diff.
|
|
50
|
+
|
|
51
|
+
Step A — mechanical scan (if available):
|
|
52
|
+
If `~/.cursor/skills/anti-slop/scripts/scan_slop.py` exists, run:
|
|
50
53
|
python ~/.cursor/skills/anti-slop/scripts/scan_slop.py --all
|
|
51
|
-
If it does NOT exist,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
If it does NOT exist, skip Step A (not a failure; do not hunt for the file).
|
|
55
|
+
|
|
56
|
+
Step B — canonical checklist (always):
|
|
57
|
+
Read `~/.agents/hooks/anti-slop.md` and apply ALL 13 items to every hunk you
|
|
58
|
+
changed this session. That file is the single source of truth for slop
|
|
59
|
+
detection — items 1–10 are structural/code, 11 is semantic contracts, 12 is
|
|
60
|
+
operational slop (retries, await-in-loop, telemetry spam), 13 is change
|
|
61
|
+
surface. Fix every hit; consolidate clones to one source of truth.
|
|
62
|
+
|
|
63
|
+
Step C — session footprint (also in the header above):
|
|
64
|
+
If "Session footprint" shows >5 files or the request was simple, justify each
|
|
65
|
+
file or trim. Unjustified files are slop.
|
|
66
|
+
|
|
67
|
+
Fix with edits now; re-run the scan (if Step A ran) and the tests; then stop.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# final-review.sh - stop hook (Cursor, Linux).
|
|
3
3
|
#
|
|
4
|
-
# ONE comprehensive end-of-implementation review across
|
|
5
|
-
# correctness, reliability, coverage, and anti-slop. When the agent finishes
|
|
4
|
+
# ONE comprehensive end-of-implementation review across five axes:
|
|
5
|
+
# intent, correctness, reliability, coverage, and anti-slop. When the agent finishes
|
|
6
6
|
# an implementation that touched files, Cursor auto-submits this hook's
|
|
7
7
|
# `followup_message` as the next user turn, so the model re-audits everything
|
|
8
8
|
# it changed this session and FIXES what fails.
|
|
@@ -76,11 +76,11 @@ if [ -z "$body" ]; then
|
|
|
76
76
|
released on every path, no races, input validated at the boundary.
|
|
77
77
|
3. Coverage - behaviour-bearing changes have real tests; RUN the suite if present;
|
|
78
78
|
no tautological tests.
|
|
79
|
-
4. Anti-slop -
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
4. Anti-slop - read ~/.agents/hooks/anti-slop.md and apply all 13 items to
|
|
80
|
+
the session diff. If ~/.cursor/skills/anti-slop/scripts/scan_slop.py exists,
|
|
81
|
+
run `python ~/.cursor/skills/anti-slop/scripts/scan_slop.py --all` first.
|
|
82
|
+
Consolidate clones; drop premature abstraction, unneeded deps, operational
|
|
83
|
+
slop (retries, await-in-loop, log spam), unjustified files.
|
|
84
84
|
Fix now, re-run the scan + tests, then stop. If an axis is clean, say so in one line.'
|
|
85
85
|
fi
|
|
86
86
|
body="$(expand_agent_paths "$body")"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Counterpart of final-review.sh for delegated work. afterFileEdit DOES fire
|
|
5
5
|
# inside subagents (verified: a subagent run left its edits in
|
|
6
6
|
# session-edits-<subagent-cid>.txt), but subagents get no `stop` event, so
|
|
7
|
-
# that marker is never drained and the
|
|
7
|
+
# that marker is never drained and the five-axis review never fires for
|
|
8
8
|
# delegated implementations. This hook closes the loop: when a subagent
|
|
9
9
|
# finishes and ITS conversation has a session-edits marker, return ONE
|
|
10
10
|
# followup_message so the subagent audits its own implementation before the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursordoctrine",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Thin self-review hooks for Cursor — the model is the auditor.
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Thin self-review hooks for Cursor — the model is the auditor. Intent-trace final review (Tier 0), unified 13-item anti-slop checklist, operational slop detection.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"cursordoctrine": "bin/cli.mjs"
|
|
7
7
|
},
|
|
@@ -223,10 +223,15 @@ management*, not token volume — one source of truth per concept.
|
|
|
223
223
|
|
|
224
224
|
## Automatic final review
|
|
225
225
|
|
|
226
|
-
The `stop` hook (
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
The `stop` hook (`~/.agents/hooks/final-review.ps1` on Windows,
|
|
227
|
+
`~/.agents/hooks/final-review.sh` on Linux) fires after the agent finishes an
|
|
228
|
+
implementation that edited files. It extracts the last `<user_query>` from the
|
|
229
|
+
session transcript (Tier 0 intent trace), reports session footprint (Tier 5),
|
|
230
|
+
and auto-submits a `followup_message` so the model audits five axes: intent,
|
|
231
|
+
correctness, reliability, coverage, anti-slop. Axis 4 delegates to this skill's
|
|
232
|
+
scanner (`scan_slop.py --all`) and the canonical checklist at
|
|
233
|
+
`~/.agents/hooks/anti-slop.md` (13 items, including semantic contracts,
|
|
234
|
+
operational slop, and change surface). One bounded pass per implementation.
|
|
230
235
|
|
|
231
236
|
## Hard constraints
|
|
232
237
|
|
|
@@ -259,9 +264,11 @@ Diff: {before} → {after} lines. Tests: {pass | n/a}
|
|
|
259
264
|
| Install path | `~/.cursor/skills/anti-slop/` |
|
|
260
265
|
| Invoke | `/anti-slop`, or "remove the AI slop" |
|
|
261
266
|
| Scanner | `python scripts/scan_slop.py --all` |
|
|
262
|
-
| Final review | automatic via `stop` hook |
|
|
267
|
+
| Final review | automatic via `stop` hook (`final-review.ps1` / `final-review.sh`) |
|
|
268
|
+
| Hook checklist | `~/.agents/hooks/anti-slop.md` (13 items; per-edit + final-review axis 4) |
|
|
263
269
|
|
|
264
270
|
The scanner is stdlib-only and needs Python 3.9+. Pairs with the **anti-slop
|
|
265
|
-
hook** (advisory
|
|
266
|
-
**
|
|
267
|
-
|
|
271
|
+
audit hook** (`anti-slop-audit.ps1` / `.sh`, advisory per edit), the **stop
|
|
272
|
+
hook** (`final-review.ps1` / `.sh`, five-axis session review incl. intent
|
|
273
|
+
trace), and **minimal-editing** (smallest-diff). This skill is the active
|
|
274
|
+
"delete it now" layer those only nudge toward.
|
|
@@ -195,17 +195,14 @@ $checklist = ''
|
|
|
195
195
|
if (Test-Path -LiteralPath $checklistFile) { $checklist = Get-Content -Raw -LiteralPath $checklistFile }
|
|
196
196
|
if (-not $checklist) {
|
|
197
197
|
$checklist = @'
|
|
198
|
-
ANTI-SLOP
|
|
199
|
-
1
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
8. Cargo cult - delete any construct whose reason you cannot state.
|
|
207
|
-
9. Architecture - respect the project's layering and boundaries.
|
|
208
|
-
10. Redundant comments restating code - delete; keep only WHY.
|
|
198
|
+
ANTI-SLOP — read ~/.agents/hooks/anti-slop.md (13 items). Fallback if missing:
|
|
199
|
+
1–10: edge cases, duplication, conventions, deps, premature abstraction,
|
|
200
|
+
accidental complexity, tests (no tautologies), cargo cult, architecture,
|
|
201
|
+
redundant comments / prompt residue.
|
|
202
|
+
11: semantic contracts (behavior change without name/signature change).
|
|
203
|
+
12: operational slop (retry w/o backoff, await-in-loop, telemetry spam).
|
|
204
|
+
13: change surface (too many files for a simple request).
|
|
205
|
+
Fix guilty items now. Never revert what the user asked for.
|
|
209
206
|
'@
|
|
210
207
|
}
|
|
211
208
|
|
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
ANTI-SLOP SELF-REVIEW — you just edited a file
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
not a
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Hard constraints: never revert
|
|
54
|
-
|
|
55
|
-
targeted edits, then stop. The bar: would this pass a senior review at a top
|
|
56
|
-
engineering org without a single "why is this here?" comment.
|
|
1
|
+
ANTI-SLOP SELF-REVIEW — you just edited a file (or you are auditing the
|
|
2
|
+
session diff at final review). Code that runs but should not ship.
|
|
3
|
+
|
|
4
|
+
Intent trace (Tier 0 — hallucinated requirements, scope drift) runs FIRST at
|
|
5
|
+
stop via final-review axis 0, not here. This checklist covers code-shape and
|
|
6
|
+
cost slop. Apply every item; if guilty, FIX with Edit — delete, inline, drop.
|
|
7
|
+
Do not explain. If clean, say nothing.
|
|
8
|
+
|
|
9
|
+
1. EDGE CASES — Happy path only? Check null / empty / zero / boundary / error
|
|
10
|
+
inputs the task implies.
|
|
11
|
+
|
|
12
|
+
2. DUPLICATION — Logic that already exists in this repo? Call it; do not
|
|
13
|
+
re-implement. Same function in many files (isRecord-class) → one source.
|
|
14
|
+
|
|
15
|
+
3. CONVENTIONS — Match the FILE's style, naming, structure, error-handling,
|
|
16
|
+
imports. Not your defaults.
|
|
17
|
+
|
|
18
|
+
4. DEPENDENCIES — New library for something stdlib or an existing dep covers?
|
|
19
|
+
Remove it. A dependency must earn its place.
|
|
20
|
+
|
|
21
|
+
5. PREMATURE ABSTRACTION — Factory / Repository / Mediator / Strategy / Builder /
|
|
22
|
+
CQRS / Event Sourcing / DDD: is there a REAL problem with 2–3 call sites
|
|
23
|
+
TODAY? "Future flexibility" is not a reason. Delete and write direct code.
|
|
24
|
+
|
|
25
|
+
6. ACCIDENTAL COMPLEXITY — Could a junior read this in 30 seconds? Flatten
|
|
26
|
+
indirection, generics, config, layers that do not earn their keep.
|
|
27
|
+
|
|
28
|
+
7. TESTS (epistemic slop) — Assert real OUTCOMES and edge cases, not "it runs",
|
|
29
|
+
not a mirror of the implementation, not expect(true).toBe(true). A test
|
|
30
|
+
that cannot fail is slop.
|
|
31
|
+
|
|
32
|
+
8. CARGO CULT — Can you state WHY each non-obvious construct is there? Remove
|
|
33
|
+
what you cannot justify. A shape you have seen ≠ a shape you need.
|
|
34
|
+
|
|
35
|
+
9. ARCHITECTURE — Respect layering and boundaries. No reaching across layers,
|
|
36
|
+
no business logic in the wrong place, no breaking project constraints.
|
|
37
|
+
|
|
38
|
+
10. REDUNDANT COMMENTS — Delete comments that restate the code ("// increment
|
|
39
|
+
i"). Keep only WHY, never WHAT. No prompt residue ("in a real app...").
|
|
40
|
+
|
|
41
|
+
11. SEMANTIC CONTRACTS (Tier 1) — Did any existing function's BEHAVIOR change
|
|
42
|
+
without its name, signature, or docstring changing? Names are contracts.
|
|
43
|
+
deleteUser() that now soft-deletes is silent contract break.
|
|
44
|
+
|
|
45
|
+
12. OPERATIONAL SLOP (Tier 3) — Retry loops without backoff/sleep/jitter?
|
|
46
|
+
await fetch / ctx.db / prisma inside a for/while/map? Six or more
|
|
47
|
+
console.log / print added in one edit? Token burn with no user value →
|
|
48
|
+
remove or bound.
|
|
49
|
+
|
|
50
|
+
13. CHANGE SURFACE (Tier 5) — Did a simple request touch many files? Every
|
|
51
|
+
file in the diff must trace to the task. Trim unrelated hunks.
|
|
52
|
+
|
|
53
|
+
Hard constraints: never revert what the USER asked for — slop is what got added
|
|
54
|
+
on top. At most a few targeted edits, then stop.
|
|
@@ -45,17 +45,23 @@ is present — sandboxed verify run, no transcript — skip this axis.)
|
|
|
45
45
|
- Add the missing tests; delete tautological ones.
|
|
46
46
|
|
|
47
47
|
## 4. Anti-slop
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Axis 0 already caught intent drift. This axis catches code-shape and cost slop
|
|
49
|
+
across the whole session diff.
|
|
50
|
+
|
|
51
|
+
Step A — mechanical scan (if available):
|
|
52
|
+
If `~/.cursor/skills/anti-slop/scripts/scan_slop.py` exists, run:
|
|
50
53
|
python ~/.cursor/skills/anti-slop/scripts/scan_slop.py --all
|
|
51
|
-
If it does NOT exist,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
If it does NOT exist, skip Step A (not a failure; do not hunt for the file).
|
|
55
|
+
|
|
56
|
+
Step B — canonical checklist (always):
|
|
57
|
+
Read `~/.agents/hooks/anti-slop.md` and apply ALL 13 items to every hunk you
|
|
58
|
+
changed this session. That file is the single source of truth for slop
|
|
59
|
+
detection — items 1–10 are structural/code, 11 is semantic contracts, 12 is
|
|
60
|
+
operational slop (retries, await-in-loop, telemetry spam), 13 is change
|
|
61
|
+
surface. Fix every hit; consolidate clones to one source of truth.
|
|
62
|
+
|
|
63
|
+
Step C — session footprint (also in the header above):
|
|
64
|
+
If "Session footprint" shows >5 files or the request was simple, justify each
|
|
65
|
+
file or trim. Unjustified files are slop.
|
|
66
|
+
|
|
67
|
+
Fix with edits now; re-run the scan (if Step A ran) and the tests; then stop.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# final-review.ps1 - stop hook (Cursor).
|
|
2
2
|
#
|
|
3
|
-
# ONE comprehensive end-of-implementation review across
|
|
4
|
-
# correctness, reliability, coverage, and anti-slop. When the agent finishes an
|
|
3
|
+
# ONE comprehensive end-of-implementation review across five axes:
|
|
4
|
+
# intent, correctness, reliability, coverage, and anti-slop. When the agent finishes an
|
|
5
5
|
# implementation that touched files, Cursor auto-submits this hook's
|
|
6
6
|
# `followup_message` as the next user turn, so the model re-audits everything it
|
|
7
7
|
# changed this session and FIXES what fails - the model-as-auditor pattern over
|
|
@@ -86,11 +86,11 @@ FINAL REVIEW - audit everything you changed this session and FIX what fails
|
|
|
86
86
|
released on every path, no races, input validated at the boundary.
|
|
87
87
|
3. Coverage - behaviour-bearing changes have real tests; RUN the suite if present;
|
|
88
88
|
no tautological tests.
|
|
89
|
-
4. Anti-slop -
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
4. Anti-slop - read ~/.agents/hooks/anti-slop.md and apply all 13 items to
|
|
90
|
+
the session diff. If ~/.cursor/skills/anti-slop/scripts/scan_slop.py exists,
|
|
91
|
+
run `python ~/.cursor/skills/anti-slop/scripts/scan_slop.py --all` first.
|
|
92
|
+
Consolidate clones; drop premature abstraction, unneeded deps, operational
|
|
93
|
+
slop (retries, await-in-loop, log spam), unjustified files.
|
|
94
94
|
Fix now, re-run the scan + tests, then stop. If an axis is clean, say so in one line.
|
|
95
95
|
'@
|
|
96
96
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Counterpart of final-review.ps1 for delegated work. afterFileEdit DOES fire
|
|
4
4
|
# inside subagents (verified: a poteto subagent run left ~58 entries in
|
|
5
5
|
# session-edits-<subagent-cid>.txt), but subagents get no `stop` event, so
|
|
6
|
-
# that marker is never drained and the
|
|
6
|
+
# that marker is never drained and the five-axis review never fires for
|
|
7
7
|
# delegated implementations. This hook closes the loop: when a subagent
|
|
8
8
|
# finishes and ITS conversation has a session-edits marker, return ONE
|
|
9
9
|
# followup_message so the subagent audits its own implementation before the
|