@punks/cli 2.1.6 → 2.1.9

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.
@@ -94,11 +94,11 @@ After `dp update`, inspect `.devpunks/scaffold-manifest.json` and the update sum
94
94
 
95
95
  Use `dp report` when reusable Harness friction should enter maintainer triage: stale generated guidance, confusing CLI output, missing docs, broken setup, or shared tooling issues.
96
96
 
97
- Do not use reports as the default destination for project product backlog. `dp report` opens GitHub issues in `wearedevpunks/harness-intelligence`; pass `--type`, `--severity`, `--area`, `--skill-pack`, `--command`, `--expected`, `--actual`, `--steps`, and `--labels` so maintainers can triage the issue from GitHub/backoffice without replaying the whole session.
97
+ Do not use reports as the default destination for project product backlog. `dp report` submits reusable Harness friction to internal backoffice triage; pass `--type`, `--severity`, `--area`, `--skill-pack`, `--command`, `--expected`, `--actual`, `--steps`, and `--labels` so maintainers can triage it without replaying the whole session.
98
98
 
99
- Reports are GitHub-backed. Backoffice fetches `harness-report` issues from GitHub and treats GitHub state/labels as the triage source of truth. Legacy API-persisted reports are migration/local-smoke context only.
99
+ Public CLI report submissions are stored internally. GitHub issue creation is reserved for authenticated backoffice operator flows that can safely use API-held credentials.
100
100
 
101
- `dp report` emits product telemetry only after the GitHub issue is created. If issue creation fails, do not claim the report was submitted; capture the blocker and suggest the exact GitHub auth/config missing.
101
+ `dp report` emits product telemetry only after the API accepts the report. If API submission fails, do not claim the report was submitted; capture the blocker and the exact API/config problem.
102
102
 
103
103
  ## Upgrade
104
104
 
@@ -54,7 +54,7 @@ Useful classification flags:
54
54
  - `--steps <text>`
55
55
  - `--labels <comma-separated-labels>`
56
56
 
57
- The report path is GitHub-backed. The CLI creates an issue with `harness-report` metadata and labels, then emits report-submitted telemetry only after issue creation succeeds. Backoffice reads GitHub issues for report triage.
57
+ Public CLI reports are API-backed and stored internally for backoffice triage. Authenticated backoffice operator flows may create GitHub issues with `harness-report` metadata and labels. The CLI emits report-submitted telemetry only after the API accepts the report.
58
58
 
59
59
  ## `dp upgrade`
60
60
 
@@ -49,7 +49,7 @@ After `dp scaffold init`:
49
49
 
50
50
  After `dp report`:
51
51
 
52
- - Confirm the command created a GitHub issue URL before saying the report was submitted.
52
+ - Confirm the API accepted the report before saying it was submitted. A GitHub issue URL is present only for authenticated backoffice-created reports.
53
53
  - Include the issue URL, labels, affected command, affected skill pack, and remaining blocker if creation failed.
54
54
  - Do not duplicate project product backlog into Harness reports unless maintainers explicitly promote it.
55
55
 
@@ -10,7 +10,7 @@ description: Create a SPEC.md file for a new feature, product, or system using t
10
10
  - **Role:** higher-order spec authoring skill
11
11
  - **Entrypoint type:** public entrypoint
12
12
  - **Upstream:** new idea, feature request, epic/capability issue, or problem statement
13
- - **Delegates to:** `$parallel-research` for split-friendly readonly discovery; `$requirements-grill` when discovery leaves meaningful spec-affecting unknowns; `$write-backlog` when grill outcomes change epic/story scope
13
+ - **Delegates to:** `$parallel-research` for split-friendly readonly discovery; `$requirements-grill` when discovery leaves meaningful spec-affecting unknowns; `$write-backlog` when the spec objective or grill outcomes change epic/story scope
14
14
  - **Downstream:** reviewed `SPEC.md`, then usually `create-plan` or `implement-spec`
15
15
  - **Entry conditions:** wiki root exists and a primary spec domain or project area can be resolved from existing specs, routed project docs, backlog context, or the user's request
16
16
  - **Stop conditions:** `SPEC.md`, wiki index, and wiki log are updated, then wait for user review
@@ -30,7 +30,7 @@ The output lives at `apps/wiki/specs/<domain>/<folder-name>/SPEC.md`.
30
30
  5. If the user did not provide a concrete request, ask for a rough description first.
31
31
  6. Read `references/questioning.md` and ask only the lightweight clarifying questions needed to identify whether a grill phase is required.
32
32
  7. If draft `Open Questions` would affect spec trust, read `references/grill-phase.md` and run a bounded `$requirements-grill` phase before writing.
33
- 8. If the grill changes accepted scope, child stories, deferred scope, or story order, read `references/backlog-sync.md` and run `$write-backlog` to sync the backlog automatically.
33
+ 8. If the requested objective, discovery, or grill changes accepted scope, child stories, deferred scope, story wording, or story order, read `references/backlog-sync.md` and run `$write-backlog` to sync the backlog automatically before final drafting.
34
34
  9. Read `references/folder-naming.md` to resolve the domain and spec folder path.
35
35
  10. Read `assets/SPEC-TEMPLATE.md` and write the spec.
36
36
  11. Read `references/spec-quality-bar.md` before saving.
@@ -46,7 +46,7 @@ The output lives at `apps/wiki/specs/<domain>/<folder-name>/SPEC.md`.
46
46
  3. Use `$parallel-research` when readonly orientation can be split cleanly across independent evidence sources; keep synthesis and spec decisions local.
47
47
  4. When an epic has child stories, harvest and preserve each story's requirements before drafting.
48
48
  5. Use `$requirements-grill` for meaningful spec-affecting unknowns; do not replace that phase with ad hoc `Open Questions` prompts.
49
- 6. After a grill phase, use `$write-backlog` automatically when accepted decisions imply backlog changes.
49
+ 6. Use `$write-backlog` automatically before final drafting when accepted spec direction implies backlog changes, whether that direction came from the user's objective, discovery, or a grill phase.
50
50
  7. Keep the spec free of implementation detail.
51
51
  8. Use the template structure exactly, then remove all template scaffolding.
52
52
  9. Update wiki bookkeeping in the same run.
@@ -1,14 +1,16 @@
1
1
  # Backlog Sync
2
2
 
3
- Use after `$requirements-grill` and before final spec drafting.
3
+ Use before final spec drafting when backlog context exists and the accepted spec direction changes the assigned epic or stories.
4
4
 
5
5
  ## Trigger
6
6
 
7
- Run `$write-backlog` automatically when grill outcomes change:
7
+ Run `$write-backlog` automatically when the user's objective, discovery, or grill outcomes change:
8
8
 
9
9
  - the epic/capability boundary
10
+ - the parent epic title, problem statement, outcome, non-goals, or acceptance posture
10
11
  - child-story acceptance signals, scope, or canonical terms
11
12
  - missing, parked, moved, or future-scope stories
13
+ - story descriptions that now conflict with the spec objective
12
14
  - story ordering, blockers, or parent/child relationships
13
15
 
14
16
  Skip only for wording clarifications that do not change backlog scope, story meaning, or ordering.
@@ -30,6 +32,7 @@ If grill artifacts exist, read:
30
32
 
31
33
  - The parent epic remains the spec anchor.
32
34
  - Child stories remain product-facing slices beneath that epic.
35
+ - The assigned epic or story may be refactored when it no longer matches the accepted spec objective.
33
36
  - Derive backlog changes only from accepted decisions and locked direction.
34
37
  - Preserve parked branches as deferred scope, follow-up epic/story candidates, or backlog notes.
35
38
  - Keep unresolved still-open items out of committed story scope unless explicitly marked.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: implement-spec
3
- description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOTES.md`, `PLAN.md`, and spec-linked tech debt in sync. Use when a reviewed spec already has a `PLAN.md` and execution should proceed either sequentially in one thread or in parallel with explicit worker orchestration.
3
+ description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOTES.md`, `PLAN.md`, and spec-linked tech debt in sync. Use when a reviewed spec already has a `PLAN.md` and execution should proceed through the default single-worker sequential path or explicit parallel worker waves.
4
4
  ---
5
5
 
6
6
  # Implement Spec
@@ -10,7 +10,7 @@ description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOT
10
10
  - **Role:** higher-order execution orchestrator
11
11
  - **Entrypoint type:** public entrypoint
12
12
  - **Upstream:** reviewed spec folder with `SPEC.md` and `PLAN.md`
13
- - **Delegates to:** `$tdd`, `$simplify`, and internal worker orchestration in parallel mode
13
+ - **Delegates to:** `$tdd`, `$simplify`, tiny `$requirements-phase` sessions for debt ambiguity, and internal worker orchestration in sequential and parallel modes
14
14
  - **Downstream:** `docs-ingest-phase` when the resulting spec folder should be ingested into domain knowledge
15
15
  - **Entry conditions:** existing reviewed spec folder; stop and use `create-plan` if `PLAN.md` is missing
16
16
  - **Stop conditions:** shared acceptance audit complete, final manual review checklist written, spec folder finalized, blocked work reported honestly
@@ -21,6 +21,12 @@ description: Implement an approved spec folder while keeping `IMPLEMENTATION-NOT
21
21
  - MUST use `$simplify`
22
22
  Use `$agent-browser` when any task `review_mode` is `browser` or `mixed`.
23
23
 
24
+ ## Sequential responsibilities
25
+
26
+ When `implement-spec` runs in `sequential` mode, it must follow [references/sequential.md](references/sequential.md).
27
+
28
+ That means `implement-spec` itself owns orchestration and validation, while exactly one implementation worker owns the sequential coding loop. This keeps the parent context small and adds a parent review gate after worker handoff.
29
+
24
30
  ## Parallel responsibilities
25
31
 
26
32
  When `implement-spec` runs in `parallel` mode, it must follow [references/parallel.md](references/parallel.md) as the full orchestration contract.
@@ -39,13 +45,15 @@ That means `implement-spec` itself owns all of the following in parallel mode:
39
45
  1. Resolve the target spec folder under `apps/wiki/specs/<domain>/<spec>/`.
40
46
  2. Read `references/lifecycle.md` and follow the shared execution contract exactly.
41
47
  3. Choose the execution mode explicitly:
42
- - Read `references/sequential.md` for one-thread execution.
48
+ - Read `references/sequential.md` for default single-worker sequential execution.
43
49
  - Read `references/parallel.md` for wave-based worker execution.
44
50
  4. Record the chosen mode under **Execution mode** in `IMPLEMENTATION-NOTES.md` before coding.
45
51
  5. Execute only the chosen mode. Do not mix modes inside one run.
46
52
  6. After each completed task or wave, update `PLAN.md`, `IMPLEMENTATION-NOTES.md`, and spec-linked tech debt before advancing.
47
- 7. If backlog sync is in scope, keep epic/story bodies product-facing and use native metadata or comments instead of execution handoff rewrites.
48
- 8. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract.
53
+ 7. Resolve implementation debt as soon as it appears. Do not leave "later" work, TODOs, temporary compromises, or vague follow-up debt.
54
+ 8. If a debt item needs a product/scope decision outside the active goal, stop and run a very small `$requirements-phase` clarification before continuing.
55
+ 9. If backlog sync is in scope, keep epic/story bodies product-facing and use native metadata or comments instead of execution handoff rewrites.
56
+ 10. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract.
49
57
 
50
58
  ## Mode selection
51
59
 
@@ -53,7 +61,8 @@ Choose `sequential` when:
53
61
 
54
62
  - the user wants single-threaded execution
55
63
  - tasks are tightly coupled
56
- - worker handoff cost would outweigh parallelism
64
+ - parallel worker handoff cost would outweigh parallelism
65
+ - the user did not choose a mode
57
66
 
58
67
  Choose `parallel` when:
59
68
 
@@ -61,7 +70,7 @@ Choose `parallel` when:
61
70
  - the plan contains independent waves
62
71
  - disjoint write scopes make worker fan-out safe
63
72
 
64
- If the user already chose a mode, honor it. If not, make the smallest safe choice and state it.
73
+ If the user already chose a mode, honor it. If not, choose `sequential` and state that it uses one implementation worker plus parent validation.
65
74
 
66
75
  ## Advanced features
67
76
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  It routes to one of two approaches:
8
8
 
9
- - `sequential` — one thread, no workers
9
+ - `sequential` — one implementation worker, parent orchestration, parent validation
10
10
  - `parallel` — wave-based execution with explicit worker orchestration
11
11
 
12
12
  Do not recreate wrapper skills for these modes. Keep the routing here and load only the needed mode reference.
@@ -62,12 +62,28 @@ Persistent implementation drift belongs in:
62
62
 
63
63
  `docs/reference/tech-debt/<domain>/<spec>.md`
64
64
 
65
- Use it only for durable drift that should inform later work on the same spec:
65
+ This file is not a dumping ground for avoidable "later" work.
66
66
 
67
- - scoped compromises
68
- - unresolved gaps
69
- - pre-existing debt discovered during execution
70
- - cleanup intentionally deferred by the current spec
67
+ Default rule: resolve debt immediately when it appears.
68
+
69
+ Forbidden debt language:
70
+
71
+ - "do this later"
72
+ - "temporary workaround"
73
+ - "future implementation"
74
+ - "follow-up cleanup"
75
+ - vague TODOs without an owner, decision, and blocker
76
+
77
+ Use the ledger only for debt that cannot be resolved inside the current run because it is outside the active goal, requires a human product/scope decision, or is blocked by an external dependency.
78
+
79
+ For every ledger entry, record:
80
+
81
+ - exact debt
82
+ - why it cannot be resolved now
83
+ - decision needed or external blocker
84
+ - owner or next action
85
+
86
+ If the debt is inside the active goal, fix it before advancing. If the debt is outside the active goal but affects the implementation decision, stop and run a tiny `$requirements-phase` clarification with one narrow question and a recommended answer. Continue only after the branch is closed, parked explicitly, or converted into an accepted scope change.
71
87
 
72
88
  Do not create the file when nothing durable must survive the run.
73
89
 
@@ -75,10 +91,14 @@ Do not create the file when nothing durable must survive the run.
75
91
 
76
92
  - Mode is manual. The chosen approach decides the execution path.
77
93
  - Do not switch modes mid-run unless the user explicitly redirects.
94
+ - Default to `sequential` when the user does not choose a mode.
95
+ - In `sequential`, keep implementation work inside one worker; the parent coordinates, reviews, validates, and finalizes.
78
96
  - Treat every `tdd_target` as required RED-first behavior, never optional guidance.
79
97
  - Treat every `review_mode` as required validation routing, never optional metadata.
80
98
  - Keep an operator-visible execution board in the conversation so progress is obvious.
81
- - Keep scope discipline. Out-of-scope findings go to `IMPLEMENTATION-NOTES.md`, not silent scope creep.
99
+ - Keep scope discipline. Out-of-scope findings that do not affect the current implementation go to `IMPLEMENTATION-NOTES.md`, not silent scope creep.
100
+ - Never leave sloppy debt, TODO placeholders, temporary compromises, or "later" implementation notes for in-goal work.
101
+ - When unclear debt affects the current implementation and the answer is not already in the spec/plan/backlog, pause for a tiny `$requirements-phase` clarification instead of guessing.
82
102
  - If backlog sync is part of the run, keep epic and story bodies product-facing.
83
103
  - Execution-time backlog sync may use comments, links, native status, and native relations.
84
104
  - Never rewrite epic or story bodies with task ids, TDD targets, validation commands, or file lists.
@@ -91,7 +111,8 @@ After each completed task or wave:
91
111
  - append a concise execution log in `PLAN.md`
92
112
  - record touched files in `PLAN.md`
93
113
  - update `IMPLEMENTATION-NOTES.md` with non-obvious decisions, surprises, or deviations
94
- - update the spec-linked tech-debt file when durable drift appears
114
+ - resolve any in-goal debt before advancing
115
+ - update the spec-linked tech-debt file only for blocked or explicitly parked debt with exact owner/next action
95
116
  - if backlog sync is in scope, prefer native metadata changes or concise comments over body rewrites
96
117
 
97
118
  ## 8. Handle blockers honestly
@@ -99,7 +120,7 @@ After each completed task or wave:
99
120
  If a task is blocked:
100
121
 
101
122
  1. record it in `IMPLEMENTATION-NOTES.md`
102
- 2. update the spec-linked tech-debt file when the blocker is durable
123
+ 2. update the spec-linked tech-debt file only when the blocker creates durable unresolved debt
103
124
  3. skip only tasks truly blocked by it
104
125
  4. finish all remaining reachable work
105
126
  5. report blocked tasks clearly at the end
@@ -154,6 +175,8 @@ Before reporting back:
154
175
  - ensure **Sanity checks** lists only commands actually run
155
176
  - ensure **Manual Review Checklist** has at least one concrete row, or one explicit non-applicability row
156
177
  - ensure **Remaining work** matches any unmet or blocked criteria
178
+ - ensure no in-goal debt remains as TODO, follow-up cleanup, or vague later-work text
179
+ - ensure every tech-debt ledger entry has exact blocker/decision/owner/next action
157
180
  - set `SPEC.md` frontmatter `status: implemented`
158
181
  - set `PLAN.md` `**Status:** Complete` when that line exists
159
182
 
@@ -32,7 +32,9 @@ Each worker brief should require:
32
32
  7. not weakening or removing tests unless requirements changed
33
33
  8. implementing only the assigned task scope and satisfying all acceptance criteria
34
34
  9. running the exact task validation evidence before returning, plus extra plan validation when feasible
35
- 10. updating the plan entry with status, log, touched files, and gotchas before handoff closes
35
+ 10. resolving any in-goal debt immediately instead of leaving TODOs, temporary workarounds, or "later" notes
36
+ 11. stopping for parent clarification when a debt item requires a product/scope decision outside the assigned task
37
+ 12. updating the plan entry with status, log, touched files, and gotchas before handoff closes
36
38
 
37
39
  ## Worker output contract
38
40
 
@@ -44,7 +46,7 @@ Require the worker to return:
44
46
  - verification evidence: RED -> GREEN for testable tasks, or the exact non-testable alternative that was run
45
47
  - validation evidence performed
46
48
  - validation intentionally deferred
47
- - anything deferred, blocked, or risky
49
+ - anything blocked or risky, with exact reason and required decision
48
50
 
49
51
  ## Scope rule
50
52
 
@@ -1,13 +1,13 @@
1
1
  # Parallel Execution
2
2
 
3
- Use this approach when execution should fan out across independent tasks or waves.
3
+ Use this approach only when execution should fan out across independent tasks or waves.
4
4
 
5
5
  When `implement-spec` chooses `parallel` mode, this reference is the full contract for parallel execution.
6
6
 
7
7
  ## Parallel contract
8
8
 
9
9
  - **Mode:** `parallel`
10
- - **Worker policy:** spawn workers only for currently unblocked work
10
+ - **Worker policy:** spawn multiple workers only for currently unblocked independent work
11
11
  - **Execution board:** completed, in progress, unblocked next, blocked, current wave
12
12
 
13
13
  ## Adoption rule
@@ -24,7 +24,7 @@ That includes:
24
24
  6. updating plan logs and execution notes
25
25
  7. repeating until all reachable tasks are complete or a real blocker remains
26
26
 
27
- Do not treat worker spawning as the whole job. The orchestration loop is part of this mode.
27
+ Do not treat worker spawning as the whole job. Parallel mode adds multi-worker wave orchestration on top of the default parent validation responsibilities.
28
28
 
29
29
  ## Quick start
30
30
 
@@ -1,28 +1,38 @@
1
1
  # Sequential Execution
2
2
 
3
- Use this approach when execution should stay in one thread without worker fan-out.
3
+ Use this approach when execution should stay serial while avoiding main-context implementation churn.
4
4
 
5
5
  ## Sequential contract
6
6
 
7
7
  - **Mode:** `sequential`
8
- - **Worker policy:** do not spawn workers
8
+ - **Worker policy:** spawn exactly one implementation worker
9
9
  - **Execution board:** completed, in progress, next, blocked
10
10
 
11
11
  ## Quick start
12
12
 
13
13
  1. Load the shared lifecycle from `lifecycle.md`.
14
14
  2. Record `sequential` under **Execution mode** in `IMPLEMENTATION-NOTES.md`.
15
- 3. Execute one task at a time in dependency order.
16
- 4. After every task, run the task-level validation gate before marking it done.
17
- 5. Update plan status, logs, touched files, notes, and tech debt immediately.
15
+ 3. Read `.agents/subagents/manifest.mjs` when present and choose the best specialist for the whole sequential implementation.
16
+ 4. Spawn one worker with the full spec folder, plan, lifecycle rules, required skills, task order, and update obligations.
17
+ 5. Require the worker to execute one task at a time in dependency order.
18
+ 6. After worker handoff, review the diff, plan updates, notes, and validation evidence before finalization.
19
+ 7. Run any parent-level acceptance or smoke checks needed to trust the worker output.
18
20
 
19
21
  ## Task loop
20
22
 
21
- For every task:
23
+ The worker owns this loop for every task:
22
24
 
23
25
  1. start from `tdd_target`
24
26
  2. validate through the task's public interface
25
27
  3. run the task-level validation gate before marking it done
26
28
  4. update the execution board before advancing
27
29
 
30
+ The parent owns:
31
+
32
+ - worker brief quality
33
+ - post-handoff review
34
+ - acceptance-criteria audit
35
+ - manual review checklist
36
+ - final spec-folder status
37
+
28
38
  Stop only when all reachable tasks are complete or a real blocker remains.
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: autoreview
3
+ description: "Auto Review closeout. Codex review is the default when no engine is set and is the recommended reviewer."
4
+ ---
5
+
6
+ # Auto Review
7
+
8
+ Run the bundled structured review helper as a closeout check. This is code review, not Guardian `auto_review` approval routing.
9
+
10
+ Codex review is the default when no engine is set. It usually delivers the best review results and should remain the normal final closeout engine.
11
+
12
+ Use when:
13
+
14
+ - user asks for Codex review / Claude review / autoreview / second-model review
15
+ - after non-trivial code edits, before final/commit/ship
16
+ - reviewing a local branch or PR branch after fixes
17
+
18
+ ## Contract
19
+
20
+ - Treat review output as advisory. Never blindly apply it.
21
+ - Verify every finding by reading the real code path and adjacent files.
22
+ - Read dependency docs/source/types when the finding depends on external behavior.
23
+ - Reject unrealistic edge cases, speculative risks, broad rewrites, and fixes that over-complicate the codebase.
24
+ - Prefer small fixes at the right ownership boundary; no refactor unless it clearly improves the bug class.
25
+ - Keep going until structured review returns no accepted/actionable findings.
26
+ - If a review-triggered fix changes code, rerun focused tests and rerun the structured review helper.
27
+ - For security-audit suppression changes, verify accepted findings remain auditable: suppressed findings stay in structured output, active output keeps an unsuppressible suppression notice, and aggregate findings cannot hide unrelated active risk.
28
+ - Never switch or override the requested review engine/model. If the review hits model capacity, retry the same command a few times with the same engine/model.
29
+ - Be patient with large bundles. Structured review can take up to 30 minutes while the model call is active, especially with Codex tools or web search.
30
+ - Treat heartbeat lines like `review still running: ... elapsed=... pid=...` as healthy progress, not a hang. Let the helper continue while heartbeats are advancing. Pass `--stream-engine-output` when live engine text is useful; Codex and Claude filter tool/file chatter, other engines pass raw output through.
31
+ - Do not kill a review just because it has been quiet for 2-5 minutes, or because it is still running under the 30-minute window. Inspect the process only after missing multiple expected heartbeats, after 30 minutes, or after an obviously failed subprocess; prefer letting the same helper command finish.
32
+ - Tools are useful in review mode. The helper allows read-only inspection tools and web search by default so reviewers can check dependency contracts, upstream docs, and current behavior.
33
+ - Security perspective is always included, but it should not cripple legitimate functionality. Report security findings only when the change creates a concrete, actionable risk or removes an important safety check.
34
+ - For regression provenance, keep roles separate: blamed code author, blamed PR author, PR merger/committer, current PR author, and PR/date. If no blamed PR is traceable, use the blamed commit as the provenance: commit SHA, date, and author username. Do not guess a merger or frame missing PR metadata as a separate finding.
35
+ - If the blamed PR was merged by `clawsweeper[bot]` or another automation, identify the human trigger when practical. Check timeline/comments first; if rate-limited, use gitcrawl/cache or public PR HTML. Look for maintainer commands such as `@clawsweeper automerge`, `/landpr`, or labels/status comments that armed automerge. Report `automerge triggered by @login`; if not found, say trigger unknown.
36
+ - Do not invoke built-in `codex review`, nested reviewers, or reviewer panels from inside the review. The helper builds one bundle, calls one selected engine, validates one structured result, and stops.
37
+ - Stop as soon as the helper exits 0 with no accepted/actionable findings. Do not run an extra review just to get a nicer "clean" line, a second opinion, or clearer closeout wording.
38
+ - Treat the helper's successful exit plus absence of actionable findings as the clean review result, even if the underlying Codex CLI output is terse.
39
+ - Multi-reviewer panels are opt-in only. Use them when explicitly requested or when risk justifies the extra spend; the main agent still verifies every accepted finding before fixing.
40
+ - If rejecting a finding as intentional/not worth fixing, add a brief inline code comment only when it explains a real invariant or ownership decision that future reviewers should know.
41
+ - If `gh`/Gitcrawl reports `database disk image is malformed`, run `gitcrawl doctor --json` once to let the portable cache repair before retrying review; do not bypass the shim unless repair fails and freshness requires live GitHub.
42
+ - If Gitcrawl reports a portable manifest mismatch, source/runtime DB health error, or stale portable-store checkout, run `gitcrawl doctor --json` and inspect `source_db_health`, `runtime_db_health`, and `portable_store_status` before falling back to live GitHub.
43
+ - Do not push just to review. Push only when the user requested push/ship/PR update.
44
+
45
+ ## Pick Target
46
+
47
+ Dirty local work:
48
+
49
+ ```bash
50
+ <autoreview-helper> --mode local
51
+ ```
52
+
53
+ Use this only when the patch is actually unstaged/staged/untracked in the
54
+ current checkout. For committed, pushed, or PR work, point the helper at the commit
55
+ or branch diff instead; do not force `--mode local` / `--uncommitted` just
56
+ because the helper docs mention dirty work first. A clean local review
57
+ only proves there is no local patch.
58
+
59
+ Branch/PR work:
60
+
61
+ ```bash
62
+ <autoreview-helper> --mode branch --base origin/main
63
+ ```
64
+
65
+ Optional review context is first-class:
66
+
67
+ ```bash
68
+ <autoreview-helper> --mode branch --base origin/main --prompt-file /tmp/review-notes.md --dataset /tmp/evidence.json
69
+ ```
70
+
71
+ If an open PR exists, use its actual base:
72
+
73
+ ```bash
74
+ base=$(gh pr view --json baseRefName --jq .baseRefName)
75
+ <autoreview-helper> --mode branch --base "origin/$base"
76
+ ```
77
+
78
+ Committed single change:
79
+
80
+ ```bash
81
+ <autoreview-helper> --mode commit --commit HEAD
82
+ ```
83
+
84
+ or with the helper:
85
+
86
+ ```bash
87
+ /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode commit --commit HEAD
88
+ ```
89
+
90
+ Use commit review for already-landed or already-pushed work on `main`. Reviewing
91
+ clean `main` against `origin/main` is usually an empty diff after push. For a
92
+ small stack, review each commit explicitly or review the branch before merging
93
+ with `--base`.
94
+
95
+ ## Parallel Closeout
96
+
97
+ Format first if formatting can change line locations. Then it is OK to run tests and review in parallel:
98
+
99
+ ```bash
100
+ scripts/autoreview --parallel-tests "<focused test command>"
101
+ ```
102
+
103
+ Tradeoff: tests may force code changes that stale the review. If tests or review lead to code edits, rerun the affected tests and rerun review until no accepted/actionable findings remain. Once that rerun exits cleanly, stop; do not spend another long review cycle on redundant confirmation.
104
+
105
+ ## Review Panels
106
+
107
+ Run multiple reviewers against one frozen bundle:
108
+
109
+ ```bash
110
+ <autoreview-helper> --reviewers codex,claude
111
+ ```
112
+
113
+ `--panel` is shorthand for Codex plus Claude unless `--engine` changes the first reviewer:
114
+
115
+ ```bash
116
+ <autoreview-helper> --panel
117
+ ```
118
+
119
+ Set reviewer models and thinking/effort explicitly:
120
+
121
+ ```bash
122
+ <autoreview-helper> --reviewers codex,claude --model codex=gpt-5.1 --thinking codex=high --model claude=sonnet --thinking claude=max
123
+ ```
124
+
125
+ Inline syntax is also supported:
126
+
127
+ ```bash
128
+ <autoreview-helper> --reviewers codex:gpt-5.1:high,claude:sonnet:max
129
+ ```
130
+
131
+ Codex maps thinking to `model_reasoning_effort` and accepts `low`, `medium`,
132
+ `high`, or `xhigh`. Claude maps thinking to `--effort` and also accepts `max`.
133
+ Engines without a real thinking knob reject `--thinking`.
134
+
135
+ ## Context Efficiency
136
+
137
+ Run the helper directly so target selection, engine choice, structured validation, and exit status all stay in one path. If output is noisy, summarize the completed helper output after it returns; do not ask another agent or reviewer to rerun the review.
138
+
139
+ ## Helper
140
+
141
+ OpenClaw repo-local helper:
142
+
143
+ ```bash
144
+ .agents/skills/autoreview/scripts/autoreview --help
145
+ ```
146
+
147
+ `agent-scripts` checkout helper:
148
+
149
+ ```bash
150
+ skills/autoreview/scripts/autoreview --help
151
+ ```
152
+
153
+ Global helper from `agent-scripts`:
154
+
155
+ ```bash
156
+ ~/.codex/skills/agent-scripts/autoreview/scripts/autoreview --help
157
+ ```
158
+
159
+ If installed from `agent-scripts`, path is:
160
+
161
+ ```bash
162
+ /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --help
163
+ ```
164
+
165
+ The helper:
166
+
167
+ - chooses dirty local changes first
168
+ - otherwise uses current PR base if `gh pr view` works
169
+ - otherwise uses `origin/main` for non-main branches
170
+ - supports `--engine codex`, `claude`, `droid`, and `copilot`; default is `AUTOREVIEW_ENGINE` or `codex`; Codex should remain the default when nothing is set
171
+ - use `--mode commit --commit <ref>` for already-committed work, especially clean `main` after landing
172
+ - should be left in `--mode auto` or forced to `--mode branch` for PR/branch work; do not force `--mode local` after committing
173
+ - writes only to stdout unless `--output`, `--json-output`, or live streamed engine stderr is set
174
+ - supports `--dry-run`, `--parallel-tests`, `--prompt`, `--prompt-file`, `--dataset`, `--no-tools`, `--no-web-search`, and commit refs
175
+ - supports `--stream-engine-output` or `AUTOREVIEW_STREAM_ENGINE_OUTPUT=1` for live engine text while preserving structured validation; Codex and Claude hide tool/file event details, emit compact activity summaries, and report usage at turn completion
176
+ - supports opt-in review panels with `--panel` / `--reviewers`, plus per-engine `--model` and `--thinking`
177
+ - allows read-only tools and web search by default where the selected CLI supports them; forbids nested review in the prompt; Codex is run through `codex exec` with read-only sandbox and structured output
178
+ - prints `review still running: <engine> elapsed=<seconds>s pid=<pid>` to stderr at long-running intervals while waiting for the selected review engine, unless streamed output or compact Codex activity has been visible recently
179
+ - prints `autoreview clean: no accepted/actionable findings reported` when the selected review command exits 0
180
+ - exits nonzero when accepted/actionable findings are present
181
+
182
+ ## Final Report
183
+
184
+ Include:
185
+
186
+ - review command used
187
+ - tests/proof run
188
+ - findings accepted/rejected, briefly why
189
+ - the clean review result from the final helper/review run, or why a remaining finding was consciously rejected
190
+
191
+ Do not run another review solely to improve the final report wording. If the final helper run exited 0 and produced no accepted/actionable findings, report that exact run as clean.