claude-dev-env 8.11.1 → 8.13.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/.agents/skills/e-code-review/SKILL.md +24 -71
- package/.agents/skills/e-code-review/reference/fix.md +7 -78
- package/.agents/skills/e-code-review/reference/high.md +129 -0
- package/.agents/skills/e-code-review/reference/low.md +20 -51
- package/.agents/skills/e-code-review/reference/max.md +169 -0
- package/.agents/skills/e-code-review/reference/medium.md +7 -191
- package/.agents/skills/e-code-review/reference/xhigh.md +47 -91
- package/.agents/skills/pull-request/scripts/test_pull_request.py +1 -1
- package/.agents/skills-archived/pr-converge/scripts/test_check_convergence.py +4 -4
- package/_shared/advisor/reference/astra-rung.md +7 -7
- package/_shared/advisor/reference/third-party-bind.md +2 -2
- package/_shared/advisor/scripts/codex_astra_advisor.py +33 -26
- package/_shared/advisor/scripts/codex_astra_preflight.py +57 -55
- package/_shared/advisor/scripts/config/advisor_scripts_constants/astra_advisor_constants.py +8 -8
- package/_shared/advisor/scripts/tests/test_codex_astra_advisor.py +69 -23
- package/_shared/advisor/scripts/tests/test_codex_astra_preflight.py +4 -4
- package/_shared/pr-loop/scripts/check_convergence.py +54 -49
- package/_shared/pr-loop/scripts/codex_review_scripts_constants/run_constants.py +4 -0
- package/_shared/pr-loop/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +10 -1
- package/_shared/pr-loop/scripts/run_codex_review.py +4 -6
- package/_shared/pr-loop/scripts/test_check_convergence.py +6 -6
- package/_shared/pr-loop/scripts/test_check_convergence_codex.py +73 -31
- package/_shared/pr-loop/scripts/test_check_convergence_contract.py +2 -2
- package/_shared/pr-loop/scripts/tests/test__claude_permissions_common.py +2 -2
- package/bin/git_hooks_installer.test.mjs +1 -1
- package/bin/install-constants.mjs +1 -6
- package/bin/install.agents-home.test.mjs +9 -9
- package/bin/install.cursor-rules.test.mjs +24 -51
- package/bin/install.mjs +16 -70
- package/commands/sr-loop.md +3 -1
- package/docs/codex-accounts.md +79 -0
- package/hooks/blocking/test_duplicate_rmtree_helper_blocker.py +5 -5
- package/hooks/blocking/test_pii_scanner.py +1 -1
- package/hooks/blocking/test_pytest_testpaths_orphan_blocker.py +2 -2
- package/hooks/git-hooks/conftest.py +16 -0
- package/hooks/git-hooks/git_hooks_constants/verification_notice_constants.py +1 -1
- package/hooks/git-hooks/test_post_commit.py +1 -1
- package/hooks/git-hooks/test_pre_commit.py +1 -1
- package/hooks/git-hooks/test_pre_push.py +2 -2
- package/hooks/git-hooks/test_verification_start.py +1 -1
- package/hooks/git-hooks/verification_notice.py +2 -2
- package/hooks/git-hooks/verification_notice_context.py +21 -2
- package/hooks/git-hooks/verification_start.py +2 -3
- package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -1
- package/package.json +1 -1
- package/rules/durable-post-artifacts.md +4 -3
- package/scripts/claude_account_profile.py +21 -9
- package/scripts/codex_account_choice.py +396 -0
- package/scripts/codex_account_meters.py +372 -0
- package/scripts/dev_env_scripts_constants/codex_account_constants.py +141 -0
- package/scripts/dev_env_scripts_constants/private_term_constants.py +17 -2
- package/scripts/private_term_scan.py +6 -2
- package/scripts/repository_checks/config/constants.py +1 -0
- package/scripts/repository_checks/tracked_private_terms.py +7 -0
- package/scripts/test_claude_account_profile.py +12 -0
- package/scripts/test_codex_account_choice.py +276 -0
- package/scripts/test_codex_account_meters.py +205 -0
- package/scripts/tests/test_automatic_advisory.py +3 -3
- package/scripts/tests/test_automatic_advisory_polling.py +1 -1
- package/scripts/tests/test_automatic_advisory_recovery.py +1 -1
- package/scripts/tests/test_closed_pr_label.py +1 -1
- package/scripts/tests/test_private_term_scan.py +28 -0
- package/scripts/tests/test_review_closure.py +2 -2
- package/scripts/tests/test_review_closure_model.py +2 -2
- package/scripts/tests/test_rules.py +2 -83
- package/scripts/tests/test_tracked_private_terms.py +15 -0
- package/scripts/tests/test_verification_notice.py +29 -13
- package/.agents/skills/cert-classification-rule/SKILL.md +0 -224
- package/.agents/skills/cert-classification-rule/scripts/resort_cert_folders.py +0 -158
- package/.agents/skills/e-code-review/preflight-proposal.contract.test.mjs +0 -20
- package/.agents/skills/e-code-review/reference/effort-evaluation.md +0 -35
- package/.agents/skills/e-code-review/reference/loop.md +0 -261
- package/.agents/skills/e-code-review/reference/mode-contract.test.mjs +0 -67
- package/.agents/skills/e-code-review/reference/preflight-proposal.md +0 -75
- package/.agents/skills/e-code-review/reference/runner-selection.md +0 -40
- package/.agents/skills/e-code-review/scripts/config/e_code_review_effort_constants/__init__.py +0 -41
- package/.agents/skills/e-code-review/scripts/config/e_code_review_effort_constants/effort_constants.py +0 -40
- package/.agents/skills/e-code-review/scripts/e_code_review_scripts_constants/__init__.py +0 -1
- package/.agents/skills/e-code-review/scripts/e_code_review_scripts_constants/finding_pipeline_constants.py +0 -49
- package/.agents/skills/e-code-review/scripts/e_code_review_scripts_constants/grok_code_review_constants.py +0 -55
- package/.agents/skills/e-code-review/scripts/effort_defaults_evidence.json +0 -186
- package/.agents/skills/e-code-review/scripts/effort_evaluation.py +0 -362
- package/.agents/skills/e-code-review/scripts/finding_pipeline.py +0 -140
- package/.agents/skills/e-code-review/scripts/fixtures/demanding.json +0 -26
- package/.agents/skills/e-code-review/scripts/fixtures/easy.json +0 -14
- package/.agents/skills/e-code-review/scripts/fixtures/medium.json +0 -20
- package/.agents/skills/e-code-review/scripts/grok_code_review.py +0 -230
- package/.agents/skills/e-code-review/scripts/test_effort_evaluation.py +0 -180
- package/.agents/skills/e-code-review/scripts/test_finding_pipeline.py +0 -197
- package/.agents/skills/e-code-review/scripts/test_grok_code_review.py +0 -289
- package/_shared/pr-loop/scripts/codex_review_scripts_constants/codex_usage_probe_constants.py +0 -82
- package/_shared/pr-loop/scripts/codex_usage_probe.py +0 -573
- package/_shared/pr-loop/scripts/test_codex_usage_probe.py +0 -683
- package/scripts/sync_to_cursor/AGENTS.md +0 -1
- package/scripts/sync_to_cursor/CLAUDE.md +0 -1
- package/scripts/sync_to_cursor/__init__.py +0 -13
- package/scripts/sync_to_cursor/canonical_docs.py +0 -66
- package/scripts/sync_to_cursor/config/__init__.py +0 -8
- package/scripts/sync_to_cursor/engine.py +0 -219
- package/scripts/sync_to_cursor/hashing.py +0 -7
- package/scripts/sync_to_cursor/paths.py +0 -18
- package/scripts/sync_to_cursor/rules.py +0 -494
- package/scripts/sync_to_cursor.py +0 -22
- package/scripts/tests/test_engine.py +0 -101
- package/scripts/tests/test_sync_to_cursor.py +0 -315
|
@@ -1,90 +1,43 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: e-code-review
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/e-code-review, /e-code-review low, /e-code-review medium,
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
Code review at one of five effort levels that match the built-in
|
|
5
|
+
/code-review recipes step for step: low, medium, high, xhigh, max.
|
|
6
|
+
Triggers: /e-code-review, /e-code-review low, /e-code-review medium,
|
|
7
|
+
/e-code-review high, /e-code-review xhigh, /e-code-review max, and any
|
|
8
|
+
level with --fix.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# e-code-review
|
|
12
12
|
|
|
13
|
-
**Pick a level,
|
|
13
|
+
**Pick a level, load its file, run it.** Each file has the same steps, angles, caps, and fields as the built-in `/code-review` recipe for that level. Only the wording differs, where this repo's prose rules require it.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Proposal mode selects the review level and records finding outcomes. The downstream owner records selected proposal IDs before reapplication. Each new finding gets a new ID.
|
|
23
|
-
|
|
24
|
-
## Gotchas
|
|
25
|
-
|
|
26
|
-
- **`low` stays single-pass.** No subagents, no full-file reads: one read pass per target item, one findings pass.
|
|
27
|
-
- **Collection reports every finding.** Keep every CONFIRMED or PLAUSIBLE finding at its assigned severity (`blocker`, `high`, `medium`, `low`, `nit`). Do not drop low or nit findings during collection. Severity or action filtering is a separate consumer stage after the collection record is complete (`scripts/finding_pipeline.py`).
|
|
28
|
-
- **`medium` favors precision, `xhigh` favors recall.** At `medium` (8 angles) assign severity carefully so a later filter can pick maintainer-action findings. At `xhigh` (10 angles plus a gap sweep) a single non-REFUTED vote carries the finding; do not drop on uncertainty.
|
|
29
|
-
- **Every retained finding carries `severity` and `verdict`.** Severity is one of `blocker`, `high`, `medium`, `low`, `nit`. Verdict is `CONFIRMED` or `PLAUSIBLE`. Drop REFUTED candidates only; never emit an unclassified retained finding.
|
|
30
|
-
- **`--fix` applies findings once.** Load `reference/fix.md` and follow it. That file owns the fix agent, the code-rules gate, skip logging, and outcome reporting. Commits are lead-owned; fix agents never commit or push.
|
|
31
|
-
- **`loop` never asks.** A round with bug findings validates them with an advisor, fixes, and re-reviews. Terminals are exactly `clean`, `nits_fixed`, and `advisor_blocked`. There is no reviewed-head count limit; a new head increments the count once, a re-review of the same head does not. Load `reference/loop.md` and follow it.
|
|
32
|
-
- **`--fix` and `loop` combine.** With both, each loop round runs the level file, and the round's fixing happens inside `reference/loop.md`'s gate sequence, which loads `reference/fix.md` for the mechanics. There is no separate fix pass around the round.
|
|
33
|
-
|
|
34
|
-
## When this skill applies
|
|
15
|
+
| Level | File | Shape |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `low` | [reference/low.md](reference/low.md) | 1 diff pass, no verify, at most 4 findings |
|
|
18
|
+
| `medium` | [reference/medium.md](reference/medium.md) | 1 careful diff pass, at most 15 findings |
|
|
19
|
+
| `high` | [reference/high.md](reference/high.md) | 8 inline angles, dedup with no verify, at most 10 findings |
|
|
20
|
+
| `xhigh` | [reference/xhigh.md](reference/xhigh.md) | 10 inline angles, dedup, gap sweep, at most 15 findings |
|
|
21
|
+
| `max` | [reference/max.md](reference/max.md) | 10 subagent angles, 1-vote verify, gap sweep, at most 15 findings |
|
|
35
22
|
|
|
36
|
-
|
|
23
|
+
## Level
|
|
37
24
|
|
|
38
|
-
|
|
25
|
+
With no level, or an unknown one, run `high`.
|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
## Target
|
|
41
28
|
|
|
42
|
-
|
|
29
|
+
A PR number, branch name, or file path after the level is the review target. With no target, the review reads the current diff.
|
|
43
30
|
|
|
44
|
-
|
|
31
|
+
## Report
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|---|---|---|
|
|
48
|
-
| easy | `medium` | `scripts/effort_defaults_evidence.json` → `skill_defaults.default_by_band.easy` |
|
|
49
|
-
| medium | `xhigh` | same file → `medium` (maps evaluation `high`) |
|
|
50
|
-
| demanding | `xhigh` | same file → `demanding` (maps evaluation `max`) |
|
|
33
|
+
Each level file reports through the ReportFindings tool. When the host has no ReportFindings tool, print the findings in its place, most severe first, one per line as `file:line — summary`. `--fix` reports its outcomes the same way, with the outcome at the end of each line.
|
|
51
34
|
|
|
52
|
-
|
|
35
|
+
## --fix
|
|
53
36
|
|
|
54
|
-
|
|
37
|
+
`--fix` works with every level. It lives in one file, [reference/fix.md](reference/fix.md). No level file carries its own fix steps.
|
|
55
38
|
|
|
56
39
|
## The process
|
|
57
40
|
|
|
58
|
-
1. Read
|
|
59
|
-
2.
|
|
60
|
-
3.
|
|
61
|
-
4. If `loop` is set, load `reference/loop.md` and follow it with that cycle's findings still unfixed. Round 1's findings are the ones step 2 already produced; from the second round on, the round re-runs that same level file end to end. End to end means the level file's review phases, up to and including its findings report. Skip that file's *Looping* section, which hands control to `loop.md` and would re-enter the loop the round is already inside. `loop.md`'s gate sequence owns when the round fixes.
|
|
62
|
-
5. Without `--fix` or `loop`, return the cycle findings and stop.
|
|
63
|
-
|
|
64
|
-
## File index
|
|
65
|
-
|
|
66
|
-
| File | Purpose |
|
|
67
|
-
|---|---|
|
|
68
|
-
| `SKILL.md` | Route by level; dispatch `--fix` and `loop` |
|
|
69
|
-
| `reference/low.md` | low review procedure: 1 diff pass per target item, no verify |
|
|
70
|
-
| `reference/medium.md` | medium review procedure: 8 angles, 1-vote verify |
|
|
71
|
-
| `reference/xhigh.md` | xhigh review procedure: 10 angles, 1-vote verify, gap sweep |
|
|
72
|
-
| `reference/fix.md` | Fix application, code-rules gate, skip logging, outcome reporting |
|
|
73
|
-
| `reference/loop.md` | Repeat review/fix rounds until clean |
|
|
74
|
-
| `reference/preflight-proposal.md` | Isolated local review, immutable SHAs, proposal evidence, and mutation boundary |
|
|
75
|
-
| `reference/effort-evaluation.md` | Effort evaluation fixtures, evidence, and skill defaults |
|
|
76
|
-
| `reference/runner-selection.md` | Runner selection map |
|
|
77
|
-
| `scripts/finding_pipeline.py` | Collect every finding; filter severity only later |
|
|
78
|
-
| `scripts/test_finding_pipeline.py` | Collection and filter-stage behavioral tests |
|
|
79
|
-
| `scripts/e_code_review_scripts_constants/finding_pipeline_constants.py` | Named constants for the collect-then-filter pipeline |
|
|
80
|
-
| `scripts/effort_evaluation.py` | Effort rows, recommendation, skill default resolver |
|
|
81
|
-
| `scripts/effort_defaults_evidence.json` | Committed evaluation rows + e-code-review skill defaults |
|
|
82
|
-
| `scripts/grok_code_review.py` | Grok medium-review discovery and verification |
|
|
83
|
-
| `scripts/test_grok_code_review.py` | Behavioral tests for the Grok medium-review module |
|
|
84
|
-
| `scripts/e_code_review_scripts_constants/` | Skill-local constants (unique package name; avoids bare `config` import shadow) |
|
|
85
|
-
|
|
86
|
-
## Folder map
|
|
87
|
-
|
|
88
|
-
- `SKILL.md`: route and dispatch.
|
|
89
|
-
- `reference/`: level procedures, fix/loop, effort evaluation, runner selection.
|
|
90
|
-
- `scripts/`: collect-then-filter finding pipeline, effort evaluation, Grok medium-review module, tests, and `e_code_review_scripts_constants/`.
|
|
41
|
+
1. Read the level and the optional `--fix` flag. Load the level file.
|
|
42
|
+
2. Run it end to end, ending in its ReportFindings call.
|
|
43
|
+
3. With `--fix`, load `reference/fix.md` and run it on those findings.
|
|
@@ -1,80 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# --fix
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runs after any level's review, once its findings are reported.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
For each finding, resume the same Agent-tool agent instance that originally
|
|
12
|
-
surfaced it. That agent applies all relevant fixes, which you provide guidance
|
|
13
|
-
on in your resume prompt.
|
|
14
|
-
|
|
15
|
-
At `low`, and any time the Agent tool is unavailable, no finder agent exists
|
|
16
|
-
to resume. Apply the fixes yourself, sequentially, in this context, holding to
|
|
17
|
-
every rule below.
|
|
18
|
-
|
|
19
|
-
## Code-rules gate
|
|
20
|
-
|
|
21
|
-
Before returning, the resumed agent runs the code-rules gate with the same bare
|
|
22
|
-
call every other surface in this skill uses:
|
|
23
|
-
|
|
24
|
-
1. Run `python ~/.claude/_shared/pr-loop/scripts/code_rules_gate.py --repo-root
|
|
25
|
-
<repo root>` with no file paths and no `--only-under` prefix. The `python`
|
|
26
|
-
prefix is required. On Windows a bare `.py` path opens the file in Cursor,
|
|
27
|
-
which then crashes on the gate flags.
|
|
28
|
-
2. If the gate reports violations **on lines this fix already owns** (the files
|
|
29
|
-
and added lines the fix changed), fix them and re-run the exact same command.
|
|
30
|
-
3. A violation on a path or added line outside this fix's own work is reported
|
|
31
|
-
or skipped. It is not force-fixed into unrelated files. Log each skip with
|
|
32
|
-
the path and reason, then continue.
|
|
33
|
-
4. Repeat until every violation on this fix's own work is clean (or skipped with
|
|
34
|
-
a logged reason for out-of-scope hits).
|
|
35
|
-
5. Only after that result does the agent return control and report its outcome.
|
|
36
|
-
|
|
37
|
-
A file path named on the command line puts the gate in whole-file scope and can
|
|
38
|
-
churn on untouched lines; keep the call bare.
|
|
39
|
-
|
|
40
|
-
This gate commits nothing. The fix lands in the working tree and stays
|
|
41
|
-
uncommitted. **Commit ownership is lead-only:** a fix agent, patch worker, or
|
|
42
|
-
resumed finding agent never runs `git commit` or `git push`. The lead that owns
|
|
43
|
-
the branch creates the commit after gates pass. The bare code-rules call covers
|
|
44
|
-
the merge-base surface and staged added lines only. Working-tree-only lines
|
|
45
|
-
enter that scope after the lead stages or commits them.
|
|
46
|
-
|
|
47
|
-
Under a bare `--fix` (this document invoked without `loop`), nothing
|
|
48
|
-
downstream commits either. A one-shot fix pass leaves its fixes uncommitted in
|
|
49
|
-
the working tree for the lead to review and commit (stage first if you re-run
|
|
50
|
-
the gate on those lines). Under `loop`, the round tail in `reference\loop.md`
|
|
51
|
-
stages and runs required checks; the lead still owns the commit and push.
|
|
52
|
-
|
|
53
|
-
## Skip candidates
|
|
54
|
-
|
|
55
|
-
Skip a finding when fixing it would change intended behavior, require changes
|
|
56
|
-
well outside the reviewed diff, or the finding itself is judged a false
|
|
57
|
-
positive.
|
|
58
|
-
|
|
59
|
-
Every logged skip surfaces exactly once, batched together, in a single
|
|
60
|
-
list presented to the user at the end of the fix pass, after every other
|
|
61
|
-
finding has been fixed, marked not-needed, or skipped, and never before.
|
|
62
|
-
|
|
63
|
-
## Reporting outcomes
|
|
64
|
-
|
|
65
|
-
After fixes land, report the same findings list again through the structured
|
|
66
|
-
findings-report call, the call that renders this review's results as a typed
|
|
67
|
-
list in the host UI, with each finding now carrying an `outcome`:
|
|
68
|
-
`fixed`, `no_change_needed` (the finding was wrong or already handled), or
|
|
69
|
-
`skipped` (the finding stands but no fix was applied). Do not repeat the findings as text in the
|
|
70
|
-
response body; the structured call is the record the host UI reads, and the
|
|
71
|
-
batched skip list from above goes in the prose that follows it.
|
|
72
|
-
|
|
73
|
-
## If findings are fixed later
|
|
74
|
-
|
|
75
|
-
Whenever a reported finding is fixed later in the session, because the user
|
|
76
|
-
asks for the fix or later work fixes it incidentally, call the structured
|
|
77
|
-
findings-report call again with the same findings, each carrying an
|
|
78
|
-
`outcome` (`fixed`, `no_change_needed`, or `skipped`). Do not repeat the
|
|
79
|
-
findings as text. Make that call immediately after the fixes land, before any
|
|
80
|
-
prose summary.
|
|
5
|
+
1. Take the findings the review just reported, most severe first.
|
|
6
|
+
2. Apply each one to the working tree. Keep each edit to the finding's own lines.
|
|
7
|
+
3. Make no commit and no push. The edits stay uncommitted for the user.
|
|
8
|
+
4. When a finding cannot be fixed, or the fix would change behavior the finding did not name, leave the code and mark it `skipped`.
|
|
9
|
+
5. Report the same findings again, each with an `outcome`: `fixed`, `no_change_needed` (the finding was wrong or already handled), or `skipped`.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
`high effort → 8 inline angles → dedup (no verify) → ≤10 findings`
|
|
2
|
+
|
|
3
|
+
You are reviewing for **recall** at high effort: catch every bug a careful
|
|
4
|
+
reviewer would catch in one sitting. At this level, surface a finding even when
|
|
5
|
+
it may be a false positive. Err on the side of surfacing.
|
|
6
|
+
|
|
7
|
+
## Phase 0 — Gather the diff
|
|
8
|
+
|
|
9
|
+
Run `git diff @{upstream}...HEAD` (or `git diff main...HEAD` / `git diff HEAD~1`
|
|
10
|
+
if there's no upstream) to get the unified diff under review. If there are
|
|
11
|
+
uncommitted changes, or the range diff is empty, also run `git diff HEAD` and
|
|
12
|
+
include the working-tree changes in scope — the review often runs before the
|
|
13
|
+
commit. If a PR number, branch name, or file path was passed as an argument,
|
|
14
|
+
review that target instead. Treat this diff as the review scope.
|
|
15
|
+
|
|
16
|
+
## Phase 1 — Find candidates (3 correctness angles + 3 cleanup angles + 1 altitude angle + 1 conventions angle, up to 6 each)
|
|
17
|
+
|
|
18
|
+
Run **8 independent finder angles** in sequence yourself, in THIS context — do NOT spawn subagents for them. Each
|
|
19
|
+
surfaces **up to 6 candidate findings** with `file`, `line`, a one-line
|
|
20
|
+
`summary`, and a concrete `failure_scenario`.
|
|
21
|
+
|
|
22
|
+
### Angle A — line-by-line diff scan
|
|
23
|
+
|
|
24
|
+
Read every hunk in the diff, line by line. Then Read the enclosing function for
|
|
25
|
+
each hunk — bugs in unchanged lines of a touched function are in scope (the PR
|
|
26
|
+
re-exposes or fails to fix them). For every line ask: what input, state, timing,
|
|
27
|
+
or platform makes this line wrong? Look for inverted/wrong conditions,
|
|
28
|
+
off-by-one, null/undefined deref, missing `await`, falsy-zero checks,
|
|
29
|
+
wrong-variable copy-paste, error swallowed in catch, unescaped regex metachars.
|
|
30
|
+
|
|
31
|
+
### Angle B — removed-behavior auditor
|
|
32
|
+
|
|
33
|
+
For every line the diff DELETES or rewrites, name the invariant or behavior it
|
|
34
|
+
enforced, then search the new code for where that invariant is re-established.
|
|
35
|
+
If you can't find it, that's a candidate: a removed guard, a dropped error
|
|
36
|
+
path, a narrowed validation, a deleted test that was covering a live case.
|
|
37
|
+
|
|
38
|
+
### Angle C — cross-file tracer
|
|
39
|
+
|
|
40
|
+
For each function the diff changes, find its callers (Grep for the symbol) and
|
|
41
|
+
check whether the change breaks any call site: a new precondition, a changed
|
|
42
|
+
return shape, a new exception, a timing/ordering dependency. Also check callees:
|
|
43
|
+
does a parallel change in the same PR make a call unsafe?
|
|
44
|
+
|
|
45
|
+
### Reuse
|
|
46
|
+
|
|
47
|
+
The angles above hunt for bugs; this one and the next two hunt for cleanup in
|
|
48
|
+
the changed code. Flag new code that re-implements something the codebase
|
|
49
|
+
already has — Grep shared/utility modules and files adjacent to the change,
|
|
50
|
+
and name the existing helper to call instead.
|
|
51
|
+
|
|
52
|
+
### Simplification
|
|
53
|
+
|
|
54
|
+
Flag unnecessary complexity the diff adds: redundant or derivable state,
|
|
55
|
+
copy-paste with slight variation, deep nesting, dead code left behind. Name
|
|
56
|
+
the simpler form that does the same job.
|
|
57
|
+
|
|
58
|
+
### Efficiency
|
|
59
|
+
|
|
60
|
+
Flag wasted work the diff introduces: redundant computation or repeated I/O,
|
|
61
|
+
independent operations run sequentially, blocking work added to startup or
|
|
62
|
+
hot paths. Also flag long-lived objects built from closures or captured
|
|
63
|
+
environments — they keep the entire enclosing scope alive for the object's
|
|
64
|
+
lifetime (a memory leak when that scope holds large values); prefer a
|
|
65
|
+
class/struct that copies only the fields it needs. Name the cheaper
|
|
66
|
+
alternative.
|
|
67
|
+
|
|
68
|
+
### Altitude
|
|
69
|
+
|
|
70
|
+
Check that each change fixes the root cause at the right depth. A fix that
|
|
71
|
+
patches a symptom with a fragile bandaid is a finding. Special cases layered on shared
|
|
72
|
+
infrastructure are a sign the fix isn't deep enough — prefer the simpler, more
|
|
73
|
+
general change to the underlying mechanism over adding special cases, and name
|
|
74
|
+
that change.
|
|
75
|
+
|
|
76
|
+
### Conventions (CLAUDE.md)
|
|
77
|
+
|
|
78
|
+
Find the CLAUDE.md files that govern the changed code: the user-level
|
|
79
|
+
~/.claude/CLAUDE.md, the repo-root CLAUDE.md, plus any CLAUDE.md or
|
|
80
|
+
CLAUDE.local.md in a directory that is an ancestor of a changed file (a
|
|
81
|
+
directory's CLAUDE.md only applies to files at or below it). Read each one
|
|
82
|
+
that exists, then check the diff for clear violations of the rules they state.
|
|
83
|
+
|
|
84
|
+
Only flag a violation when you can quote the exact rule and the exact line
|
|
85
|
+
that breaks it — no style preferences, no vague "spirit of the doc"
|
|
86
|
+
inferences. In the finding, name the CLAUDE.md path and quote the rule so the
|
|
87
|
+
report can cite it. If no CLAUDE.md applies, return nothing for this angle.
|
|
88
|
+
|
|
89
|
+
Cleanup, altitude, and conventions candidates use the same
|
|
90
|
+
`file`/`line`/`summary` shape; in `failure_scenario`, state the concrete
|
|
91
|
+
cost (what is duplicated, wasted, harder to maintain, or which CLAUDE.md rule
|
|
92
|
+
is broken) in the place a crash would go. Correctness bugs always outrank cleanup,
|
|
93
|
+
altitude, and conventions findings when the output cap forces a cut.
|
|
94
|
+
|
|
95
|
+
Pass every candidate with a nameable failure scenario through — finders that
|
|
96
|
+
silently drop half-believed candidates are the dominant cause of misses.
|
|
97
|
+
|
|
98
|
+
## Phase 2 — Dedup only (no verify)
|
|
99
|
+
|
|
100
|
+
Pool all candidates. Dedup near-duplicates only (same defect, same location, same reason → keep one). Do NOT run verifiers; do NOT re-judge. Sort by severity.
|
|
101
|
+
|
|
102
|
+
## Output
|
|
103
|
+
|
|
104
|
+
Target **at least 5 findings**. If fewer findings exist, emit what you have — do not invent to hit the floor.
|
|
105
|
+
|
|
106
|
+
Call the ReportFindings tool once to report this review's results
|
|
107
|
+
with `{level, findings}`. `findings` is at most 10 entries ranked
|
|
108
|
+
most-severe first; each entry has `file`, `line`, `summary`,
|
|
109
|
+
`short_summary` — the claim compressed to ≤60 characters, no rationale
|
|
110
|
+
or consequence clause — `failure_scenario`, and `category` — a short kebab-case slug for the angle
|
|
111
|
+
that produced it (`correctness`, `simplification`, `efficiency`,
|
|
112
|
+
`reuse`, `altitude`, `conventions`, or a more specific slug like
|
|
113
|
+
`test-coverage` when one fits better) — plus `verdict` when a verify pass
|
|
114
|
+
produced one. If more than 10 survive, keep the 10 most severe. If
|
|
115
|
+
nothing survives, call it with an empty array. Do not also print
|
|
116
|
+
the findings as text, and do not create or publish an artifact of the review -
|
|
117
|
+
the tool call is the report.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## If findings are fixed later
|
|
121
|
+
|
|
122
|
+
Whenever reported findings get fixed later in this session - the user asks you
|
|
123
|
+
to fix them, or later work fixes them incidentally - you MUST call ReportFindings again with the same findings, each
|
|
124
|
+
carrying an `outcome`: `fixed`, `no_change_needed` (the finding was wrong or
|
|
125
|
+
already handled), or `skipped` (valid but not applied). Do not repeat the
|
|
126
|
+
findings as text.
|
|
127
|
+
Make that call immediately after the fixes land, before any prose summary; the
|
|
128
|
+
host UI's per-finding status updates only from it, and without it the findings
|
|
129
|
+
stay marked unresolved.
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
`low effort → 1 diff pass
|
|
1
|
+
`low effort → 1 diff pass → no verify → ≤4 findings`
|
|
2
2
|
|
|
3
3
|
## Turn 1 — read
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
One tool call: read the unified diff (`git diff @{upstream}...HEAD; git diff HEAD`
|
|
6
6
|
to cover both committed and uncommitted changes, or `git diff main...HEAD` /
|
|
7
|
-
the target passed as an argument).
|
|
8
|
-
|
|
9
|
-
read named above, which is what this step reads when no target is passed — and
|
|
10
|
-
it may mix those forms. A loop round widens a target by adding a path to whatever it
|
|
11
|
-
started as, and it names `default-range` as an item whenever the round it
|
|
12
|
-
widened was given no target argument, so the original scope stays under review.
|
|
13
|
-
When a target names more than one item, read each item's diff and review their
|
|
14
|
-
union — a shared hunk counted once, an empty one adding nothing. Skip
|
|
15
|
-
test/fixture hunks (`test/`, `spec/`, `__tests__/`, `*_test.*`, `*.test.*`,
|
|
7
|
+
the target passed as an argument). Skip test/fixture
|
|
8
|
+
hunks (`test/`, `spec/`, `__tests__/`, `*_test.*`, `*.test.*`,
|
|
16
9
|
`fixtures/`, `testdata/`) — test-file changes are not reviewed at this level.
|
|
17
|
-
|
|
10
|
+
No subagents, no full-file reads.
|
|
18
11
|
|
|
19
12
|
## Turn 2 — findings
|
|
20
13
|
|
|
@@ -28,48 +21,24 @@ helper visible in the diff context, and dead code the diff leaves behind.
|
|
|
28
21
|
Do **not** flag style, naming, perf, missing tests, or anything outside the
|
|
29
22
|
hunk.
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
call
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
changed file and on any **removed** code blocks. Make that call with an empty
|
|
37
|
-
findings array only if the diff is trivially correct after that pass. Do not
|
|
38
|
-
also print the findings as text.
|
|
24
|
+
Report at most **4 findings**, most-severe first, in one
|
|
25
|
+
ReportFindings call with `{level, findings}` — each entry has
|
|
26
|
+
`file`, `line`, `summary`, `short_summary` (≤60 characters), and
|
|
27
|
+
`failure_scenario`. If nothing qualifies, call it with an empty findings
|
|
28
|
+
array. Do not also print the findings as text.
|
|
39
29
|
|
|
40
|
-
## Applying fixes (--fix)
|
|
41
|
-
|
|
42
|
-
The `--fix` flag was passed. Follow `reference\fix.md` (relative
|
|
43
|
-
to this skill's folder) for the exact fix, code-rules-gate, and skip-handling
|
|
44
|
-
behavior — it governs which agent applies each fix, how the code-rules gate
|
|
45
|
-
runs, how a skip is logged, and how outcomes get reported. Do not repeat the
|
|
46
|
-
findings as text; follow that document's reporting rules once fixes land.
|
|
47
|
-
|
|
48
|
-
When `loop` is also set, skip this section.
|
|
49
30
|
|
|
50
31
|
## If findings are fixed later
|
|
51
32
|
|
|
52
|
-
Whenever
|
|
53
|
-
to fix
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
as text.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
The `loop` arg was passed. Follow `reference\loop.md` (relative to this
|
|
62
|
-
skill's folder) for how to re-run Turn 1 (read) and Turn 2 (findings)
|
|
63
|
-
repeatedly — including its exit condition and re-invocation rules. Schedule no
|
|
64
|
-
fix pass of your own here: when `--fix` is also present, `reference\loop.md`'s
|
|
65
|
-
gate sequence owns the round's fixing and loads `reference\fix.md` for the
|
|
66
|
-
mechanics. Do not treat a single pass through this document as complete while
|
|
67
|
-
`loop` is active; hand control to that document, and do not stop at Turn 2.
|
|
33
|
+
Whenever reported findings get fixed later in this session - the user asks you
|
|
34
|
+
to fix them, or later work fixes them incidentally - you MUST call ReportFindings again with the same findings, each
|
|
35
|
+
carrying an `outcome`: `fixed`, `no_change_needed` (the finding was wrong or
|
|
36
|
+
already handled), or `skipped` (valid but not applied). Do not repeat the
|
|
37
|
+
findings as text.
|
|
38
|
+
Make that call immediately after the fixes land, before any prose summary; the
|
|
39
|
+
host UI's per-finding status updates only from it, and without it the findings
|
|
40
|
+
stay marked unresolved.
|
|
68
41
|
|
|
69
|
-
That hand-off applies when this document is entered directly. When a loop round
|
|
70
|
-
is already running and has handed this document its target, the round owns the
|
|
71
|
-
loop: end at Turn 2 with the findings report and return those findings to
|
|
72
|
-
`reference\loop.md`'s gate sequence, rather than handing control to that
|
|
73
|
-
document again from here.
|
|
74
42
|
|
|
75
|
-
|
|
43
|
+
After you finish the review, end your response with this exact line on its own:
|
|
44
|
+
Tip: For a deeper cloud-based review, try /ultrareview next time.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
`max effort → 5+5 angles × 8 candidates → 1-vote verify → sweep → ≤15 findings`
|
|
2
|
+
|
|
3
|
+
You are reviewing for **recall** at maximum effort: catch every bug. At
|
|
4
|
+
this level, surface a finding even when it may be a false positive. A
|
|
5
|
+
missed bug ships. Err on the side of surfacing.
|
|
6
|
+
|
|
7
|
+
## Phase 0 — Gather the diff
|
|
8
|
+
|
|
9
|
+
Run `git diff @{upstream}...HEAD` (or `git diff main...HEAD` / `git diff HEAD~1`
|
|
10
|
+
if there's no upstream) to get the unified diff under review. If there are
|
|
11
|
+
uncommitted changes, or the range diff is empty, also run `git diff HEAD` and
|
|
12
|
+
include the working-tree changes in scope — the review often runs before the
|
|
13
|
+
commit. If a PR number, branch name, or file path was passed as an argument,
|
|
14
|
+
review that target instead. Treat this diff as the review scope.
|
|
15
|
+
|
|
16
|
+
## Phase 1 — Find candidates (5 correctness angles + 3 cleanup angles + 1 altitude angle + 1 conventions angle, up to 8 each)
|
|
17
|
+
|
|
18
|
+
Run **10 independent finder angles** via the Agent tool. Each
|
|
19
|
+
surfaces **up to 8 candidate findings**. Do NOT let one angle's conclusions
|
|
20
|
+
suppress another's — if two angles flag the same line for different reasons,
|
|
21
|
+
record both. If the Agent tool is not available in your current tool set, do not error — perform each angle (and each verification) yourself, sequentially, in this context.
|
|
22
|
+
|
|
23
|
+
### Angle A — line-by-line diff scan
|
|
24
|
+
|
|
25
|
+
Read every hunk in the diff, line by line. Then Read the enclosing function for
|
|
26
|
+
each hunk — bugs in unchanged lines of a touched function are in scope (the PR
|
|
27
|
+
re-exposes or fails to fix them). For every line ask: what input, state, timing,
|
|
28
|
+
or platform makes this line wrong? Look for inverted/wrong conditions,
|
|
29
|
+
off-by-one, null/undefined deref, missing `await`, falsy-zero checks,
|
|
30
|
+
wrong-variable copy-paste, error swallowed in catch, unescaped regex metachars.
|
|
31
|
+
|
|
32
|
+
### Angle B — removed-behavior auditor
|
|
33
|
+
|
|
34
|
+
For every line the diff DELETES or rewrites, name the invariant or behavior it
|
|
35
|
+
enforced, then search the new code for where that invariant is re-established.
|
|
36
|
+
If you can't find it, that's a candidate: a removed guard, a dropped error
|
|
37
|
+
path, a narrowed validation, a deleted test that was covering a live case.
|
|
38
|
+
|
|
39
|
+
### Angle C — cross-file tracer
|
|
40
|
+
|
|
41
|
+
For each function the diff changes, find its callers (Grep for the symbol) and
|
|
42
|
+
check whether the change breaks any call site: a new precondition, a changed
|
|
43
|
+
return shape, a new exception, a timing/ordering dependency. Also check callees:
|
|
44
|
+
does a parallel change in the same PR make a call unsafe?
|
|
45
|
+
|
|
46
|
+
### Angle D — language-pitfall specialist
|
|
47
|
+
|
|
48
|
+
Scan for the classic pitfalls of the diff's language/framework — for example:
|
|
49
|
+
JS falsy-zero, `==` coercion, closure-captured loop var; Python mutable default
|
|
50
|
+
args, late-binding closures; Go nil-map write, range-var capture; SQL injection;
|
|
51
|
+
timezone/DST drift; float equality. Flag any instance the diff introduces.
|
|
52
|
+
|
|
53
|
+
### Angle E — wrapper/proxy correctness
|
|
54
|
+
|
|
55
|
+
When the PR adds or modifies a type that wraps another (cache, proxy, decorator,
|
|
56
|
+
adapter): check that every method routes to the wrapped instance and not back
|
|
57
|
+
through a registry/session/global — e.g. a caching provider holding a
|
|
58
|
+
`delegate` field that resolves IDs via `session.get(...)` where it should call
|
|
59
|
+
`delegate.get(...)` will re-enter the cache or recurse. Also check that the
|
|
60
|
+
wrapper forwards all the methods the callers use.
|
|
61
|
+
|
|
62
|
+
### Reuse
|
|
63
|
+
|
|
64
|
+
The angles above hunt for bugs; this one and the next two hunt for cleanup in
|
|
65
|
+
the changed code. Flag new code that re-implements something the codebase
|
|
66
|
+
already has — Grep shared/utility modules and files adjacent to the change,
|
|
67
|
+
and name the existing helper to call instead.
|
|
68
|
+
|
|
69
|
+
### Simplification
|
|
70
|
+
|
|
71
|
+
Flag unnecessary complexity the diff adds: redundant or derivable state,
|
|
72
|
+
copy-paste with slight variation, deep nesting, dead code left behind. Name
|
|
73
|
+
the simpler form that does the same job.
|
|
74
|
+
|
|
75
|
+
### Efficiency
|
|
76
|
+
|
|
77
|
+
Flag wasted work the diff introduces: redundant computation or repeated I/O,
|
|
78
|
+
independent operations run sequentially, blocking work added to startup or
|
|
79
|
+
hot paths. Also flag long-lived objects built from closures or captured
|
|
80
|
+
environments — they keep the entire enclosing scope alive for the object's
|
|
81
|
+
lifetime (a memory leak when that scope holds large values); prefer a
|
|
82
|
+
class/struct that copies only the fields it needs. Name the cheaper
|
|
83
|
+
alternative.
|
|
84
|
+
|
|
85
|
+
### Altitude
|
|
86
|
+
|
|
87
|
+
Check that each change fixes the root cause at the right depth. A fix that
|
|
88
|
+
patches a symptom with a fragile bandaid is a finding. Special cases layered on shared
|
|
89
|
+
infrastructure are a sign the fix isn't deep enough — prefer the simpler, more
|
|
90
|
+
general change to the underlying mechanism over adding special cases, and name
|
|
91
|
+
that change.
|
|
92
|
+
|
|
93
|
+
### Conventions (CLAUDE.md)
|
|
94
|
+
|
|
95
|
+
Find the CLAUDE.md files that govern the changed code: the user-level
|
|
96
|
+
~/.claude/CLAUDE.md, the repo-root CLAUDE.md, plus any CLAUDE.md or
|
|
97
|
+
CLAUDE.local.md in a directory that is an ancestor of a changed file (a
|
|
98
|
+
directory's CLAUDE.md only applies to files at or below it). Read each one
|
|
99
|
+
that exists, then check the diff for clear violations of the rules they state.
|
|
100
|
+
|
|
101
|
+
Only flag a violation when you can quote the exact rule and the exact line
|
|
102
|
+
that breaks it — no style preferences, no vague "spirit of the doc"
|
|
103
|
+
inferences. In the finding, name the CLAUDE.md path and quote the rule so the
|
|
104
|
+
report can cite it. If no CLAUDE.md applies, return nothing for this angle.
|
|
105
|
+
|
|
106
|
+
Cleanup, altitude, and conventions candidates use the same
|
|
107
|
+
`file`/`line`/`summary` shape; in `failure_scenario`, state the concrete
|
|
108
|
+
cost (what is duplicated, wasted, harder to maintain, or which CLAUDE.md rule
|
|
109
|
+
is broken) in the place a crash would go. Correctness bugs always outrank cleanup,
|
|
110
|
+
altitude, and conventions findings when the output cap forces a cut.
|
|
111
|
+
|
|
112
|
+
## Phase 2 — Verify (1-vote, 3-state)
|
|
113
|
+
|
|
114
|
+
Dedup candidates that point at the same line/mechanism, keeping the one with
|
|
115
|
+
the most concrete failure scenario. For each remaining candidate, run **one
|
|
116
|
+
verifier** via the Agent tool: give it the diff, the relevant
|
|
117
|
+
file(s), and the candidate, and have it return exactly one of:
|
|
118
|
+
|
|
119
|
+
- **CONFIRMED** — can name the inputs/state that trigger it and the wrong
|
|
120
|
+
output or crash. Quote the line.
|
|
121
|
+
- **PLAUSIBLE** — mechanism is present, trigger is uncertain (timing, env,
|
|
122
|
+
config). State what would confirm it.
|
|
123
|
+
- **REFUTED** — factually wrong (code doesn't say that) or guarded elsewhere.
|
|
124
|
+
Quote the line that proves it.
|
|
125
|
+
|
|
126
|
+
Keep candidates where the vote is CONFIRMED or PLAUSIBLE.
|
|
127
|
+
|
|
128
|
+
This is recall mode — a single non-REFUTED vote carries the finding. Do NOT
|
|
129
|
+
drop on uncertainty.
|
|
130
|
+
|
|
131
|
+
## Phase 3 — Sweep for gaps
|
|
132
|
+
|
|
133
|
+
Run **one more finder** as a fresh reviewer who has the verified list. Re-read
|
|
134
|
+
the diff and enclosing functions looking ONLY for defects not already listed.
|
|
135
|
+
Do not re-derive or re-confirm anything already there — the job is gaps. Focus
|
|
136
|
+
on what the first pass tends to miss: moved/extracted code that dropped a guard
|
|
137
|
+
or anchor; second-tier footguns (dataclass default evaluated once, `hash()`
|
|
138
|
+
non-determinism, lock-scope shrink, predicate methods with side effects);
|
|
139
|
+
setup/teardown asymmetry in tests; config defaults flipped.
|
|
140
|
+
|
|
141
|
+
Surface **up to 8 additional candidates**, each naming a defect not already on
|
|
142
|
+
the list. If nothing new, return an empty sweep — do not pad.
|
|
143
|
+
|
|
144
|
+
## Output
|
|
145
|
+
|
|
146
|
+
Call the ReportFindings tool once to report this review's results
|
|
147
|
+
with `{level, findings}`. `findings` is at most 15 entries ranked
|
|
148
|
+
most-severe first; each entry has `file`, `line`, `summary`,
|
|
149
|
+
`short_summary` — the claim compressed to ≤60 characters, no rationale
|
|
150
|
+
or consequence clause — `failure_scenario`, and `category` — a short kebab-case slug for the angle
|
|
151
|
+
that produced it (`correctness`, `simplification`, `efficiency`,
|
|
152
|
+
`reuse`, `altitude`, `conventions`, or a more specific slug like
|
|
153
|
+
`test-coverage` when one fits better) — plus `verdict` when a verify pass
|
|
154
|
+
produced one. If more than 15 survive, keep the 15 most severe. If
|
|
155
|
+
nothing survives verification, call it with an empty array. Do not also print
|
|
156
|
+
the findings as text, and do not create or publish an artifact of the review -
|
|
157
|
+
the tool call is the report.
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## If findings are fixed later
|
|
161
|
+
|
|
162
|
+
Whenever reported findings get fixed later in this session - the user asks you
|
|
163
|
+
to fix them, or later work fixes them incidentally - you MUST call ReportFindings again with the same findings, each
|
|
164
|
+
carrying an `outcome`: `fixed`, `no_change_needed` (the finding was wrong or
|
|
165
|
+
already handled), or `skipped` (valid but not applied). Do not repeat the
|
|
166
|
+
findings as text.
|
|
167
|
+
Make that call immediately after the fixes land, before any prose summary; the
|
|
168
|
+
host UI's per-finding status updates only from it, and without it the findings
|
|
169
|
+
stay marked unresolved.
|