Skill: Lint-catalog review on a PR
Run the infra/lint/ catalog review (./infra/pre-commit.py --review)
over a pull request's branch diff and surface every finding — as file:line
inline review comments where the finding's line is available, and as a
single fallback comment for the rest.
Your contract
You are running the review and reporting its output. You are read-only except
for posting comments: never edit, stage, commit, push, or "fix" anything, and
never run a state-changing git/gh command. The review's own lane agents are
already locked read-only.
Report the findings faithfully. The --review run (its lanes + composer) is
the authority on what is a finding: post each surviving finding verbatim —
one comment per finding. Do not drop, merge, reword the substance of, soften,
re-judge, or invent findings. Silently losing a real finding is the one
unforgivable error; so is fabricating one.
Steps
Idempotency guard (only with --comment). Check whether this skill has
already posted on the PR: look for the marker <!-- marin-lint-review --> in
both issue comments (gh pr view <PR> --json comments) and inline review
comments (gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate). If the
marker is present, stop now — the PR already has a lint pass and we do not want
duplicate comments. Otherwise continue.
Run the review. From the repo root:
head_sha="$(git rev-parse HEAD)"
MARIN_REVIEW_TRIGGER=ci \
MARIN_REVIEW_PR_NUMBER=<PR> \
MARIN_REVIEW_HEAD_SHA="$head_sha" \
./infra/pre-commit.py --review --agent-command='codex exec'
The command writes its raw per-arm prompts/outputs and the
combined findings under /tmp/marin-linter/<branch>/<timestamp>-<uniq>/ (path printed at the
end); read it if a run looks wrong.
Collect the findings. Each finding the command emits on stdout is one line
in the canonical catalog format:
<path>:<line>: ml-<code> (<confidence>) <message>
e.g. lib/iris/src/iris/foo.py:42: ml-cruft-dead-branch (0.85) Unreachable else after early return.
No findings vs. failed run. Distinguish two zero-finding cases:
- Clean — the command exited 0 and printed
Lint review: no findings. (or
emitted no finding lines). Post nothing: the green job check is the "lint
pass clean" signal, and a second "all clear" comment would only duplicate the
high-level review. State "Lint review: no findings." to the terminal and stop.
- Failed to run — the command exited non-zero or printed that every lane
failed / the agent was not found / the merge-base could not be resolved. Do
not report this as clean. State plainly in your final output that the lint
review could not run and why; post no comments. (A broken run is a job-log
signal, not a PR comment.)
(Without --comment: just print the findings, if any, to the terminal and stop
here regardless.)
Post inline comments. With --comment and findings present, for each
finding post one inline comment with
mcp__github_inline_comment__create_inline_comment, the
finding's path and line, and a body of exactly this shape:
`ml-<code>` · confidence <confidence>
<message>
<!-- marin-lint-review -->
The <message> is copied verbatim from the finding. Post one comment per
finding; never post two comments for the same finding.
Handle un-anchorable findings. The inline-comment tool rejects a line that
is not part of the PR diff (it raises a validation error). A finding can land
on such a line — e.g. the holistic meta lane anchors on context outside the
added hunks. When a post fails for that reason, do not abort: record that
finding and keep going through the rest.
Fallback summary. After attempting every inline comment, if any findings
could not be placed inline, post one issue comment with gh pr comment <PR>
so none are dropped. Format:
Lint review:
These infra/lint findings anchor on lines not in the PR diff, so they could not
be attached inline.
- <path>:<line>: ml-<code> (<confidence>) <message>
- ...
<!-- marin-lint-review -->
List every un-anchorable finding verbatim. If every finding was placed inline,
do not post this comment.
Notes
- Use the
gh CLI for GitHub; do not web-fetch.
- The review reads the branch diff against the merge base with
origin/main,
covering committed and uncommitted work. CI checks out the PR head and fetches
origin/main before invoking you, so the merge base resolves.
1---2name: lint-review3description: Run the read-only infra/lint PR reporter only when invoked by CI or explicitly requested; do not select it for the commit workflow's fix-and-respond review.4---56# Skill: Lint-catalog review on a PR78Run the `infra/lint/` catalog review (`./infra/pre-commit.py --review`)9over a pull request's branch diff and surface every finding — as `file:line`10inline review comments where the finding's line is available, and as a11single fallback comment for the rest.1213## Your contract1415You are running the review and reporting its output. You are **read-only except16for posting comments**: never edit, stage, commit, push, or "fix" anything, and17never run a state-changing `git`/`gh` command. The review's own lane agents are18already locked read-only.1920Report the findings **faithfully**. The `--review` run (its lanes + composer) is21the authority on what is a finding: post each surviving finding **verbatim** —22one comment per finding. Do **not** drop, merge, reword the substance of, soften,23re-judge, or invent findings. Silently losing a real finding is the one24unforgivable error; so is fabricating one.2526## Steps27281. **Idempotency guard (only with `--comment`).** Check whether this skill has29 already posted on the PR: look for the marker `<!-- marin-lint-review -->` in30 both issue comments (`gh pr view <PR> --json comments`) and inline review31 comments (`gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate`). If the32 marker is present, stop now — the PR already has a lint pass and we do not want33 duplicate comments. Otherwise continue.34352. **Run the review.** From the repo root:3637 ```bash38 head_sha="$(git rev-parse HEAD)"39 MARIN_REVIEW_TRIGGER=ci \40 MARIN_REVIEW_PR_NUMBER=<PR> \41 MARIN_REVIEW_HEAD_SHA="$head_sha" \42 ./infra/pre-commit.py --review --agent-command='codex exec'43 ```4445 The command writes its raw per-arm prompts/outputs and the46 combined findings under `/tmp/marin-linter/<branch>/<timestamp>-<uniq>/` (path printed at the47 end); read it if a run looks wrong.48493. **Collect the findings.** Each finding the command emits on stdout is one line50 in the canonical catalog format:5152 ```53 <path>:<line>: ml-<code> (<confidence>) <message>54 ```5556 e.g. `lib/iris/src/iris/foo.py:42: ml-cruft-dead-branch (0.85) Unreachable else after early return`.57584. **No findings vs. failed run.** Distinguish two zero-finding cases:5960 - **Clean** — the command exited 0 and printed `Lint review: no findings.` (or61 emitted no finding lines). Post **nothing**: the green job check is the "lint62 pass clean" signal, and a second "all clear" comment would only duplicate the63 high-level review. State "Lint review: no findings." to the terminal and stop.64 - **Failed to run** — the command exited non-zero or printed that every lane65 failed / the agent was not found / the merge-base could not be resolved. Do66 **not** report this as clean. State plainly in your final output that the lint67 review could not run and why; post no comments. (A broken run is a job-log68 signal, not a PR comment.)6970 (Without `--comment`: just print the findings, if any, to the terminal and stop71 here regardless.)72735. **Post inline comments.** With `--comment` and findings present, for **each**74 finding post one inline comment with75 `mcp__github_inline_comment__create_inline_comment`, the76 finding's `path` and `line`, and a body of exactly this shape:7778 ```79 `ml-<code>` · confidence <confidence>8081 <message>8283 <!-- marin-lint-review -->84 ```8586 The `<message>` is copied verbatim from the finding. Post one comment per87 finding; never post two comments for the same finding.88896. **Handle un-anchorable findings.** The inline-comment tool rejects a line that90 is not part of the PR diff (it raises a validation error). A finding can land91 on such a line — e.g. the holistic `meta` lane anchors on context outside the92 added hunks. When a post fails for that reason, **do not abort**: record that93 finding and keep going through the rest.94957. **Fallback summary.** After attempting every inline comment, if any findings96 could not be placed inline, post **one** issue comment with `gh pr comment <PR>`97 so none are dropped. Format:9899 ```100 Lint review:101102 These infra/lint findings anchor on lines not in the PR diff, so they could not103 be attached inline.104105 - <path>:<line>: ml-<code> (<confidence>) <message>106 - ...107108 <!-- marin-lint-review -->109 ```110111 List every un-anchorable finding verbatim. If every finding was placed inline,112 do not post this comment.113114## Notes115116- Use the `gh` CLI for GitHub; do not web-fetch.117- The review reads the **branch diff against the merge base with `origin/main`**,118 covering committed and uncommitted work. CI checks out the PR head and fetches119 `origin/main` before invoking you, so the merge base resolves.