agentleFS
legendtkllegendtkl/layered-code-review/skills/review-adopt/SKILL.md

review-adopt

Skill0 starsChanged 26 days agoMITView on GitHub

Audit a repository against a layered code-review process built for agent-written code, and scaffold what is missing. Use when the user wants to set up or improve code review for a repo or team, asks "how do we review code at agent volume", wants a REVIEW.md, a PR template with Testing/Risk/How-to-revert, risk tiers and always-human paths, CODEOWNERS for sensitive code, an AI reviewer or security review in CI, or branch-protection/merge-queue settings. Produces a scorecard of the layers with evidence, then proposes files and settings as a dry run; writes nothing and changes no GitHub settings without explicit confirmation.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never overwrite an existing file.

    line 62
  2. Distinctive:

    Keep actions pinned to commit SHAs with the version in a comment, and permissions minimal.

    line 63
  3. Very specific:

    Do not put PR titles, bodies or branch names into run: scripts (script injection).

    line 64
  4. Distinctive:

    Write only the files the user approved.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Adopt layered review in a repository

Goal: most changes get reviewed by machines, human time goes where the risk is, and reverts and incidents don't go up. Start strict; loosen only with evidence.

Templates are in this skill's templates/ directory.

Step 1 — Scorecard (read-only)

Inspect the repo and, if gh is authenticated, the GitHub settings. For each row record present / partial / missing and the evidence (file path, setting value, or "could not check"). Never guess a setting you could not read.

#LayerLook for
1Work verified before reviewCLAUDE.md that is short and lists runnable build/lint/type/test commands; formatter/linter hooks in .claude/settings.json; REVIEW.md written by owners
2AI review on every PRa workflow using anthropics/claude-code-action, or managed Code Review for Claude Code (ask the user — it is not visible in the repo)
3Security review that can blocka security-review workflow; open review threads block merge (required_review_thread_resolution)
4Required CIworkflows running lint, types, tests, build; those checks required on the default branch; PR template asking for Testing, Risk, How to revert
5Approval scaled by risk.claude/review-policy.json (tiers, always-human paths, trusted authors); CODEOWNERS covering CI workflows, auth, billing, release, installers; required reviews; code-owner review; stale approvals dismissed on push; GitHub Actions not allowed to approve PRs
6Merge queue, flags, gradual releasemerge queue rule; a feature-flag system in use; internal or pre-release channel before stable
7Fast detection and rollbackone-step revert or flag-off path; on-call or owner who watches; revert/incident tracking (ask)
8Reviewer gets betteran eval set built from past reverts and incidents (review-eval skill); tracking of how authors answer findings
9Shared contexta habit of explainers for the slice you're changing (explain-slice skill); work in open channels (ask)

Useful read-only commands:

gh api repos/{owner}/{repo}/rules/branches/{default_branch}        # effective rulesets: reviews, threads, merge queue, checks
gh api repos/{owner}/{repo}/branches/{default_branch}/protection   # classic protection (needs admin; 404 = none)
gh api repos/{owner}/{repo}/actions/permissions/workflow           # can_approve_pull_request_reviews should be false

Show the scorecard as a table, then the three gaps that would cut the most risk per hour of work. Typical order: required CI and a PR template, then AI + security review on one repo, then risk tiers with CODEOWNERS and branch protection.

Step 2 — Propose (dry run)

List every file you would create or change, with its full content or a diff. Fill templates with real values from this repo: actual check commands, actual sensitive directories (search for paths containing auth, billing, payment, install, updater, release, migration, deploy, secret), actual owners if CODEOWNERS or git history shows them. Leave {placeholders} only where you cannot know the value, and say so.

FileTemplateNotes
REVIEW.mdtemplates/REVIEW.mdShort. What failure looks like here, what to skip, nit cap, evidence rule, count-first summary
CLAUDE.mdtemplates/CLAUDE.md.snippetAdd a Checks section; keep the file short and point to other docs
.github/pull_request_template.mdtemplates/pull_request_template.mdTesting, Risk, How to revert
.claude/review-policy.jsontemplates/review-policy.jsonzero_human_low_risk stays false at first
CODEOWNERStemplates/CODEOWNERS.snippetAlways-human paths need a real owner
.github/workflows/claude-review.ymltemplates/workflows/claude-review.ymlNeeds ANTHROPIC_API_KEY secret
.github/workflows/security-review.ymltemplates/workflows/security-review.ymlNeeds ANTHROPIC_API_KEY secret

Rules:

  • Never overwrite an existing file. If it exists, propose a merge as a diff.
  • Keep actions pinned to commit SHAs with the version in a comment, and permissions minimal.
  • Do not put PR titles, bodies or branch names into run: scripts (script injection).

Step 3 — Apply on confirmation

Write only the files the user approved. Then print, but do not run, the settings changes:

  • Require the CI checks, the review workflow and the security workflow on the default branch.
  • Require conversation resolution before merge.
  • Require at least 1 approving review and code-owner review; dismiss stale approvals on new commits (an approval covers one commit).
  • Turn off "Allow GitHub Actions to create and approve pull requests" — a bot approval never fills a human slot.
  • Enable the merge queue if the repo merges often enough for main to break from combinations.

Change GitHub settings only if the user explicitly asks you to run those commands.

Step 4 — Roll out

Recommend: one repo first; tune REVIEW.md for a few weeks by moving repeated review comments into it (or into a lint rule); then widen. Write the risk tiers down, set from the change, not the author. Allow zero-human merges for Low only after the repo has a flag/revert path, a reviewer eval set, and a few weeks of revert and incident rates that did not rise. Measure human time (approvals per PR, human comments, time a PR waits on a person) with revert and incident rates as the guardrail.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.