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
In this repository4 other files it gives its agents.
- skills/layered-review/references/agents.mdAGENTS.md
- explain-sliceSkill
- layered-reviewSkill
- review-evalSkill
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
- Distinctive: line 62
Never overwrite an existing file.
- Distinctive: line 63
Keep actions pinned to commit SHAs with the version in a comment, and permissions minimal.
- Very specific: line 64
Do not put PR titles, bodies or branch names into run: scripts (script injection).
- Distinctive: line 68
Write only the files the user approved.
≈ “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.
Files
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.
| # | Layer | Look for |
| 1 | Work verified before review | CLAUDE.md that is short and lists runnable build/lint/type/test commands; formatter/linter hooks in .claude/settings.json; REVIEW.md written by owners |
| 2 | AI review on every PR | a workflow using anthropics/claude-code-action, or managed Code Review for Claude Code (ask the user — it is not visible in the repo) |
| 3 | Security review that can block | a security-review workflow; open review threads block merge (required_review_thread_resolution) |
| 4 | Required CI | workflows running lint, types, tests, build; those checks required on the default branch; PR template asking for Testing, Risk, How to revert |
| 5 | Approval 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 |
| 6 | Merge queue, flags, gradual release | merge queue rule; a feature-flag system in use; internal or pre-release channel before stable |
| 7 | Fast detection and rollback | one-step revert or flag-off path; on-call or owner who watches; revert/incident tracking (ask) |
| 8 | Reviewer gets better | an eval set built from past reverts and incidents (review-eval skill); tracking of how authors answer findings |
| 9 | Shared context | a 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 falseShow 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.
| File | Template | Notes |
REVIEW.md | templates/REVIEW.md | Short. What failure looks like here, what to skip, nit cap, evidence rule, count-first summary |
CLAUDE.md | templates/CLAUDE.md.snippet | Add a Checks section; keep the file short and point to other docs |
.github/pull_request_template.md | templates/pull_request_template.md | Testing, Risk, How to revert |
.claude/review-policy.json | templates/review-policy.json | zero_human_low_risk stays false at first |
CODEOWNERS | templates/CODEOWNERS.snippet | Always-human paths need a real owner |
.github/workflows/claude-review.yml | templates/workflows/claude-review.yml | Needs ANTHROPIC_API_KEY secret |
.github/workflows/security-review.yml | templates/workflows/security-review.yml | Needs 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.
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.

