ci: add @claude /focus to point human reviewers at the sections that need them - #404
Conversation
…s that need them A maintainer-only, on-demand sibling of @claude /review. Instead of looking for bugs, it triages the diff for a human reviewer: it posts up to N (default 3, clamped to 1..10) inline comments on the architectural, structural, or hard-to-reason-about sections, each framed as questions to answer before approving, plus a summary naming what is safe to skim. It carries over every boundary of the review workflow: the author_association gate, a comment body that is tested but never forwarded (only N is extracted, as digits), a read-only allowlist with no git or gh api, the PR-ref checkout without persisted credentials, and a verify step that fails a run which posted nothing.
|
@claude /review |
|
Claude finished @thecodedrift's task in 6m 2s —— View job Review mode: incremental — read 0 prior review thread(s) before reviewing.
SummaryThis is a careful port of [New] One finding, posted inline on line 261: the ~130-line "verify the run actually posted" step is duplicated almost verbatim from the sibling review workflow (only the Nothing else risen to the level of a finding: permissions, the GraphQL thread-fetch scoping, the checkout ref, and the tool allowlist are all consistent with the already-established sibling pattern, and the PR's own limitation notice (this can't be exercised until merge, since |
…re not shared A local composite action loads from the checkout, which in both workflows is the PR's contributor-authored tree, so sharing the step that way would run PR-controlled code with the job's write token. Each copy now names the other so a fix to the detection logic reaches both.
Adds
@claude /focus [N], an on-demand sibling of@claude /review. It doesn't look for bugs. It triages the diff for a human reviewer: diffs move a lot of code and human attention is finite, so it picks the N sections (default 3, clamped to 1–10) where human judgement adds the most, and posts each one as an inline review comment.What it posts
Focus area K of M: <title>, why it needs a human, 2–4 questions to answer before approving (questions, not findings or suggested code), and related locations to also read.Focus areas: K of N requested, the ranked list withpath:line, and a Safe to skim section naming the parts of the diff that need little attention.It targets architecture and boundaries, contracts (API, CLI output, formats, schemas), persisted or migrated state, trust boundaries, and code that is hard to reason about locally. It skips renames, generated files, moved-but-unchanged code and routine tests. It posts fewer than N rather than padding the list.
Combined with
/review's inline trigger, a reviewer can reply@claude /reviewon a focus thread to pull Claude into that specific area.Carried over from
/reviewauthor_associationgate), PR conversation only.git, nogh api, nocontents: write.refs/pull/N/headwithpersist-credentials: false, the pairing that makesReadsafe..prior-review.json. An area with an open human thread already has attention, and a re-run doesn't re-post unresolved areas from an earlier/focus.Focus areas:marker. It is inline rather than a shared script because the checkout is contributor-authored and the job holds a write token.Testing
N parsing was checked locally against edge cases:
/focus→ 3,/focus 5→ 5,/focus 08→ 8,/focus 0→ 1,/focus 123→ 10,/focusing 5→ 3, a number on the next line → 3. Prettier andpnpm lintpass.This can't be exercised on this PR.
issue_commentworkflows run from the default branch, so the first real run is after merge. The/reviewworkflow is untouched.