code-review-skills
AGENTS.md1 starsChanged 4 days agoApache-2.0View on GitHub
Plugin of agent skills for AI code review: a GitLab MR reviewer, a GitHub PR reviewer with a composite GitHub Action, a risk-tiered review panel and a security diff review, for Claude Code, Codex and other harnesses. The plugin provides four skills and one GitHub Action. Each SKILL.md orchestrates. Deterministic work lives in scripts, and prompts and formats live in references/. gitlab-code-review performs a single-pass, structured AI code review of a GitLab merge request. Its SKILL.md instructs the agent to…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- code-review-panelSkill
- github-code-reviewSkill
- gitlab-code-reviewSkill
- security-diff-reviewSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 86
Every uses: in action.yml is a full commit SHA
- Very specific: line 87
Every new step keeps the - name: / if: / VAR: ${{ expr }} layout the static tests parse, and no run: holds ${{ }}
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
code-review-skills
Plugin of agent skills for AI code review: a GitLab MR reviewer, a GitHub PR reviewer with a composite GitHub Action, a risk-tiered review panel and a security diff review, for Claude Code, Codex and other harnesses.
Repository Structure
.claude-plugin/plugin.json Plugin packaging metadata
action.yml Composite GitHub Action that reviews a pull request
action/review-pr.sh The action's steps (check, prepare, standdown, review, post, export, relay, cleanup)
action/usage.py Token and cost totals of a run's OTEL log, run with agentic-ci by the review step
docs/github-app.md Guide to posting as a GitHub App and running reviews from a reusable workflow
skills/ Skill directories (each contains SKILL.md, plus scripts/ or references/)
gitlab-code-review/ GitLab code review skill
SKILL.md Skill definition and review instructions
scripts/review.py Review posting and display script
references/org-rules.md Fetch block and apply contract for the org review rules
github-code-review/ GitHub PR review skill, run by the action
SKILL.md Reads a precomputed diff, writes the review JSON, never posts
code-review-panel/ Risk-tiered review panel
SKILL.md Orchestration: triage, finders, skeptics, report
references/ Finder brief, skeptic prompts, report formats, REVIEW.md guide
lenses/ One persona per lens
scripts/panel.py Triage and report script
security-diff-review/ Security-only diff review
SKILL.md Finder, per-finding filters, report
references/finder.md Security finder persona
references/filter.md Exclusion rules (E1..), precedents (P1..), REVIEW.md grammar
LICENSE-MIT License of the adapted upstream text
tests/ unittest suite for panel.py, review.py and the action (make test), run against throwaway git reposArchitecture
The plugin provides four skills and one GitHub Action. Each SKILL.md orchestrates. Deterministic work lives in scripts, and prompts and formats live in references/.
gitlab-code-review performs a single-pass, structured AI code review of a GitLab merge request. Its SKILL.md instructs the agent to review the git diff, produce structured JSON output, and invoke the posting script. review.py handles all deterministic work: JSON parsing and validation, chill-mode filtering, platform detection (GitLab CI or local; GitHub PRs only with --platform github), posting inline comments and summaries to GitLab MRs and GitHub PRs, and terminal display for local use.
github-code-review is the GitHub counterpart, driven by the root action.yml and action/review-pr.sh. The README's GitHub Action section is the consumer guide and docs/github-app.md the App and reusable workflow guide.
- Steps.
check(no token) skips forks, Dependabot, drafts and runs without a harness credential, and validates the mode,bot_loginand, with the recommendation,deep_review_label.standdowncomes next, inRUNNER_TEMPand before the checkout, and holdsgithub.tokenonly to read; every later step butcleanupis skipped when it stands down. The checkout of the PR head goes to.ai-review-head, outside the mount, without persisted credentials.prepare(no token) writes the merge-base diff and exports the working tree to.ai-review/repo, next to a copy of the plugin.reviewruns the agent with every token and OIDC variable blanked. The optionalapp-tokenstep mints the posting token.postvalidates the one output file (no symlinks, at most 1 MiB), copies it toRUNNER_TEMP/ai-review-post.*and posts the copy withreview.py post --platform github.exportandrelay(no GitHub token) run after a failed review too, but not after a cancel or a stand-down, and send the telemetry to MLflow directly or through the review-telemetry relay (below).cleanupalways runs and removes the workdirs, the triage plan, the usage directory and theai-review-tmp.*,ai-review-otel.*andai-review-post.*directories. - Container repo.
preparegives the export a fresh.gitin both modes: an empty-templategit init, the full history of the base and the head fetched from the checkout under a clean git config, HEAD detached at the head, and no remote, credentials, hooks, alternates, reflogs or host paths. The container never sees the checkout's.gitor a token, and the host never runs git in.ai-reviewafter the review step starts, because the agent can rewrite that.git. - Backends.
backend: openshell(the default) runsquay.io/aipcc/agentic-ci/openshell:<agentic_ci_version>, where the version may be<tag>@sha256:<digest>to pin the image (openshell_image_refbuilds the reference for the agent run and the cleanup alike), as adocker run --rm --privileged --initcontainer that mounts only.ai-reviewand a per-run storage volume. Its bundled agentic-ci runs the agent in an OpenShell sandbox from the*-sandboximage, at/sandbox/.ai-review. The image pulls are bounded on their own, the agent gets an outertimeout -s INT(agentic-ci's--timeoutdoes not bound OpenShell), a short container gives root-owned files back to the runner user, andcleanupremoves containers and volumes by theai-review.workdirlabel. The storage volume is per run on purpose, so concurrent jobs never share a nested Podman store, and every run pulls the sandbox images.backend: podmanruns agentic-ci on the runner throughuvxwith the*-runnerimage, mounted at/workspace; the sandbox images do not work under Podman. Credentials reach the agent as-e NAMEfrom an allowlist per harness (OPENAI_API_KEYfor codex;ANTHROPIC_API_KEY,CLAUDE_CODE_OAUTH_TOKENor Vertex for claude-code), never as inputs. Both backends setAGENT_ENABLED_PLUGINS=code-review-skills: openshell passes it with-e, and podman'suvx agentic-ciinherits it. - Harnesses. Codex is the default. It has no plugin flag and loads the skills from the skills-registry copy in its image, so the image decides the skill revision. Claude Code loads the action's plugin copy with
--plugin-dir. The runner side always uses the action's copy:review.pyposts, and the recommendation's triage runs the action'spanel.py. So with codex the image tag must match the action's release, or the triage, the review JSON contract and the skills can drift apart; the default images are pinned to theagentic_ci_versionrelease for that reason. - Modes.
mode: standardruns this skill.mode: deepruns code-review-panel, which writes gitlab-code-review JSON to the same output file with--gitlab-json; per-repo review instructions are not passed (REVIEW.md at the base ref supersedes them), while the caller-supplied org policy rules (org_review_rules) reach both modes, gated to the claude-code harness until the codex images ship the updated skill text. Both post under the same summary marker. - Stand-down.
review.py stand-downruns in thestanddownstep before the agent, andpost --moderepeats the check before it deletes old threads and before it writes the summary. A standard review stands down when a job matchingdeep_review_job(exact name,<name> / ...under a reusable workflow, or<name> (...)for a matrix) has started or succeeded for the same head; a deep review stands down when the PR head moved. It reads the Actions API, so it needsactions: read, and it fails open with one warning. - Recommendation. With
recommend_deep_review,preparerunspanel.py triageon the agent's copy before any agent exists, underenv -i,python3 -Iand a 60 second timeout, andpostpasses the plan toreview.py, which adds one line under the summary heading when the tier is deep. - Usage and telemetry. agentic-ci runs with OTEL on (a collector that cannot start fails the review step, as on GitLab) and copies
claude-otel.jsonlto aGITHUB_WORKSPACEthe review step points away from the checkout (.ai-review/telemetrywith openshell,$RUNNER_TEMP/ai-review-otel.*with podman).collect_usagetreats it as untrusted (no links or non-files, at most 64 MiB), copies it to$RUNNER_TEMP/ai-review-usage/claude-otel.jsonland runs a copy ofaction/usage.pythere in the pulled agentic-ci image, never a package index (resolve_tool_image: openshell image via docker, or the podman agent's;run_agentic_ci_tool: only the usage directory mounted with:Z, runner uid,--init, named and removed on timeout,--pull never,--network none, every proxy variable blanked;check_tool_versionwarns when the image's agentic-ci differs fromagentic_ci_version;python3 -E -P: RHEL's Python skips /usr/local under-I); usage.py writesusage.jsonand appends acode-review-usagespan (ci.job.nameis<GITHUB_JOB>-<mode>).postpasses--usage-file; review.py adds the<sub>Usage: ...</sub>line after the footer.exportrunsagentic-ci mlflow-pushthere too (--network host, the runner's proxies and MLflow variables by-e NAME, CA bundles as copies) whenmlflow_experiment_nameandMLFLOW_TRACKING_URIare set; agentic-ci 0.5.16 exits 0 even on a failed or partial push, so only a last linePushed N payload(s) ... (0 failed), N > 0, is success (the relay's rule); anything else warns once. Tool output is printed with commands stopped and secrets masked. The MLflow and relay variables never reach the agent (blanked in the review step and run_podman_agent, unset in run_openshell_agent). Every failure here only warns. - Relay upload.
relayuploads the log copy, then ameta.json, to the review-telemetry relay's GitLab generic package (RELAY_API,RELAY_PACKAGE; the project id comes fromREVIEW_TELEMETRY_PROJECT, so none is in this repository), version<GITHUB_RUN_ID>.<GITHUB_RUN_ATTEMPT>.<GITHUB_JOB>-<mode>(the mode separates a reusable workflow's standard and deep callers; jobs with one key and mode in one attempt still collide). It needsmlflow_experiment_nameand all threeREVIEW_TELEMETRY_*variables (a partial set warns once), checks every value against the relay's patterns, and runscurl -qwith the deploy token on standard input, HTTPS only, no redirects. - Suggestions. With
suggest_reviewers,postrunsreview.py suggest-reviewers --platform githubafter a standard review posted. It comments once with up to five @mentions from the base branch's GraphQL history of the changed files. A failure only warns. - Identity. The post token is
github_token, else the token theapp-tokenstep mints fromapp_idandapp_private_key(scoped to the repository, revoked at job end), elsegithub.token.AI_REVIEW_BOT_LOGINtellsreview.pythe posting login; comments bygithub-actions[bot]with the marker still count as ours, and the summary PATCH only targets the current identity's summary.
Its isolation is the sandbox plus the separation of the checkout from the mount, not a tool allowlist.
code-review-panel runs a risk-tiered panel. panel.py triage resolves the diff range, classifies every changed path, sets the tier (quick, standard, deep) and the approval hint, picks the lenses (five core plus detected domains) and their skeptics, and reads REVIEW.md and the repo rules from the base ref. The SKILL.md spawns one finder subagent per lens with that lens's persona, then skeptic subagents for each finding. panel.py report maps security rows, assigns stable ids, votes, ranks, and prints the Markdown report; it can also write gitlab-code-review JSON and the known findings file for the next round.
security-diff-review has no script. One finder subagent reads references/finder.md and references/filter.md, then one filter subagent per finding scores it against the exclusion rules and precedents, and the report keeps findings scoring 8 or more. The panel's security lens reads these two references by path and adds its own impact and reproduce checks.
Conventions
- The skills review committed diffs only (no uncommitted changes)
panel.pyuses the Python standard library only, runs withpython3, and finds its files relative to its own path- Skill directories hold regular files only: no symlinks, and no SKILL.md below a skill root
- Personas and prompt text live as Markdown under
references/ - A skill reads a sibling skill's files only when both ship in this plugin, and fails closed when they are missing
- The version in .claude-plugin/plugin.json is bumped together with the skills-registry entry when a release is cut, never in a feature PR, so a feature PR needs no registry change to stay in sync
- Markdown code blocks for Python snippets and prompt text use
textfences, notpython, because ruff formatspythonblocks; shell commands may usebash - Each SKILL.md stays within 12,000 characters and each description within 800
- A change to
panel.pybehavior comes with a test intests/, which checks report.md's and skeptics.md's rules against the script;make testruns it on Python 3.10 and later
gitlab-code-review
- Review output is written to
/tmp/ai-review-output.jsonfollowing a strict schema - The posting script is invoked directly (not via
python) to use the uv shebang CHILL_MODE(default: true) filters suggestion-level commentsINLINE_FIXES(default: true) renders optionalfixobjects as applicable GitLab suggestion blocks- Unresolved AI review discussions without human responses are deleted before posting new ones (GitLab)
- Comments on unchanged code are deduplicated across review iterations
github-code-review
allowed-toolshas no Bash and no Write or Edit, so a local user gets a normal permission prompt. In the action, agentic-ci runs the agent with every tool enabled inside the container, so the container, the checkout kept out of the mount and the post step's validation of the one output file are what hold- The action never calls
claudeorcodexdirectly: it runsagentic-ci, the one bundled in the openshell image taggedagentic_ci_version, or with Podman the same version throughuvx - The output path is an argument. The skill never posts, and in the action it runs no commands
- Posting is
review.pyby absolute path withUV_NO_CONFIG=1, run only by the action's post step, never by the agent - Every
uses:inaction.ymlis a full commit SHA - Every new step keeps the
- name:/if:/VAR: ${{ expr }}layout the static tests parse, and norun:holds${{ }}
Change Together
- Review JSON schema. The
inline_comments,fixand summary rules are written out in skills/gitlab-code-review/SKILL.md and skills/github-code-review/SKILL.md, and enforced byparse_review_jsonin review.py. - Agent version and images. The
agentic-ci runflags live in action/review-pr.sh (cmd_review,run_openshell_agent,run_podman_agent). The defaultagentic_ci_versionlives in action.yml, the inputs table in README.md andVERIFIED_AGENTIC_CI_VERSIONin tests/test_github_action.py, and a test keeps the three equal. The same version is the tag of the openshell image (OPENSHELL_IMAGE_REPO), so the image and the agentic-ci it bundles move together. The images the emptyimageinput resolves to live in action/review-pr.sh (CLAUDE_SANDBOX_IMAGE,CODEX_SANDBOX_IMAGEfor openshell,CLAUDE_RUNNER_IMAGE,CODEX_RUNNER_IMAGEfor Podman), and the image tests: they carry the same agentic-ci release tag as theagentic_ci_versiondefault, and a test keeps them equal. Renovate (renovate.json) opens one grouped pull request that bumps the image constants and theagentic_ci_versiondefault (each found by the# renovate: datasource=dockercomment above it: do not remove those comments), the READMEagentic_ci_versionrow andVERIFIED_AGENTIC_CI_VERSION. The E2E workflow runs the action from that pull request, standard and deep, withOPENAI_API_KEY, and fails unless each posted its summary: that run, not a person, is the check that the new release works. Keep the README's other mentions of the version generic, since Renovate does not edit them. The minimum image for Codex is stated in the README and in thecompatibilityline of skills/github-code-review/SKILL.md. - Triage file.
preparein action/review-pr.sh (run_triage) writes the raw stdout ofpanel.py triageto$RUNNER_TEMP/ai-review-triage/plan.json(a mode 700 directory, at most 1 MiB),cmd_postpasses it as--deep-recommendation-planonly in standard mode, withrecommend_deep_reviewon and a regular non-symlink file, andcleanupremoves it. review.py reads onlytier.nameandtier.evidencefrom it, so a change to the triage plan's tier keys in panel.py changes all three. - Org rules cap.
MAX_RULES_BYTESin action/review-pr.sh and the102400in the central workflow's fetch step in docs/github-app.md are the same limit: change them together, or copied workflows keep dropping rules the action would accept. - Deep job name and label. The
deep_review_jobdefault in action.yml,DEFAULT_DEEP_JOBin action/review-pr.sh, the deep job's key andname:in the README Setup workflow and the callers in the README and docs/github-app.md are alldeep-review. The label in those jobs'if:isdeep-review, the default of thedeep_review_labelinput and ofDEFAULT_DEEP_LABEL, whichpostpasses to review.py as--deep-labelfor the recommendation line;checkapplies review.py's limits to it early (not blank, at most 50 characters, no control characters). The README-coupled tests intests/test_github_action_deep.pycheck the sample job. Rename them together, or the standard review stops finding the deep one. - Token allow-list. Only the
standdownstep (github.token, reads only) and thepoststep (github_token, else the minted App token, elsegithub.token) receiveGITHUB_TOKEN; the review step blanksGITHUB_TOKEN,GH_TOKENand the OIDC variables;app_idandapp_private_keyappear only in theapp-tokenstep'swith:;github_token,bot_loginand the mint's outputs only in the post step'senv:. tests/test_github_action.py enforces each of these, and the App guide's permission table and thepermission-*lines of the mint step list the same four permissions. - review.py dependencies.
review.py.locknext to review.py locks the dependencies of its/// scriptblock. The action runs review.py withUV_LOCKED=1and refuses to run without the lock, so after changing that block runuv lock --script skills/gitlab-code-review/scripts/review.py. A test fails on a stale lock, and a stale lock would also fail the GitLab job where the skill directory is read-only. The lock also fixes the versions the GitLab job gets, so a security fix inrequestsor its dependencies needs a re-lock. The uv the action installs is pinned in theSet up uvstep: check the lock with a new uv (uv lock --script ... --check) before bumping it. - Usage file.
usage.json(four token counts andestimated_cost_usd, a number or null),_github_usage_linein review.py andtests/test_github_action_usage.pychange together, and the line's format stays equal to the GitLab job'ssummary_line(). - Relay upload contract. The package name, version format, file names and order,
meta.jsonkeys and patterns and size limits incmd_relayare the review-telemetry relay's contract (its README andrelay.py); the tests copy its patterns. Change both projects together, and keep project ids and experiment names in callers' variables. - Telemetry log path. Later steps read the run's OTEL log at
$RUNNER_TEMP/ai-review-usage/claude-otel.jsonluntilcleanup; it exists only when the review step ran an agent. - Poster path.
skills/gitlab-code-review/scripts/review.pyis shared by the gitlab skill, the github skill,action/review-pr.shandtests/test_github_action.py: moving it means changing all four. - Cross-skill contracts. The panel consumes security-diff-review's references: the E and P rule ids in
filter.md, the output JSON offinder.mdand the verdict JSON offilter.md(the keys of their one JSON example each, listed inFINDER_KEYSandVERDICT_KEYSinpanel.py), and the 1 to 10 scale and the keep cutoff infilter.md(8), whichpanel.py(KEEP_CONFIDENCE) and the security SKILL.md also state.finder.mdalso serves as the security lens persona, so it keeps exactly the four persona headings (## Stance,## Grounding,## Checklist,## Output).panel.py triagechecks the ids, the example keys, the scale and cutoff sentences and the headings, and exits 3 on a mismatch. The panel also runs the org-rules fetch block from gitlab-code-review'sreferences/org-rules.mdfor the GitLab opt-in (ORG_REVIEW_RULES), stops with an incomplete-install report when it is missing, and a test intests/test_gitlab_review.pyresolves the path. The panel also produces gitlab-code-review JSON: check it withreview.py displayafter changing either side. - Shared sentences. The three sentences (read only, data under review, review settings) are identical in skills/security-diff-review/SKILL.md, skills/code-review-panel/references/finder-brief.md and skills/code-review-panel/references/skeptics.md, each on one unwrapped line.
- Per-path diffs. No agent puts a file name with a quote, a backslash, a control or invisible formatting character, or bytes that are not UTF-8 into a per-path diff command:
unusual_name()in panel.py, the specs it writes tochanged.quoted_pathspecs(also withheld for non-ASCII names, since the plan is ASCII-escaped JSON), finder-brief.md, skeptics.md and the path rule in skills/security-diff-review/SKILL.md. - Known findings. The
still_presentandfixedlists and theopenflag on known items are the same in finder-brief.md (finder output), SKILL.md step 5 (the merge, which adds eachfixedentry's lens), report.md andpanel.py. - Renames in GitLab positions.
panel.pypairs renames as GitLab's MR diff does (RENAME_SIMILARITY, Gitaly's--find-renames=30%) to decide which lines take an inline comment, and review.py resolvesold_pathfor renamed files when it posts them: keep both on GitLab's pairing. - Base and diff. The base resolution order, the head default, and the diff command's git options and flag set are the same in skills/security-diff-review/SKILL.md and panel.py.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

