code-review-skill
AGENTS.md8 starsChanged 2 months agoApache-2.0View on GitHub
This is the canonical, runtime-neutral, repository-wide entrypoint for development of this repository. Every implementation task — regardless of which runtime executes it — starts here, then follows the routing below into the focused policy that owns the task's detailed rules. This repository hosts two portable Code Review Agent Skills that share one review standard: - skills/local-code-review/SKILL.md — reviews local Git implementation state and returns findings; - skills/github-pr-review/SKILL.md — reviews GitHub Pull Requests and, when active, publishes findings and a final…
- Deletes or force-pushes
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- github-pr-reviewSkill
- local-code-reviewSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
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
- Distinctive: line 110
Clean task exit: Every task finishes in a known clean state — the right branch, intended work committed, no unrelated modifications, no …
- Very specific: line 116
No packaged Skill resource (SKILL.md, a packaged policy, runbook, template, or shared/-packaged resource) may depend on this repository's …
- Distinctive: line 134
File size is a review trigger, not a limit: When a production file (a Skill resource, policy, runbook, template, script, workflow, or …
- Distinctive: line 216
When instructions overlap, the more specific and more authoritative source wins, in this order:
- Distinctive: line 251
Read this file's Global invariants and Instruction precedence for any task.
- Distinctive: line 303
Keep in this file only genuinely global material: repository-wide safety invariants, instruction precedence, the canonical-vs-explanatory …
- Very specific: line 307
Put a substantial, independently ownable policy domain in its own focused file under policies/, and add a routing row above.
- Distinctive: line 317
Add a rule to this file's Global invariants only when it truly applies to *every* repository task and is short enough to state as an …
- Distinctive: line 320
Never create a second normative copy of a rule.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
AGENTS.md
This is the canonical, runtime-neutral, repository-wide entrypoint for development of this repository. Every implementation task — regardless of which runtime executes it — starts here, then follows the routing below into the focused policy that owns the task's detailed rules.
This repository hosts two portable Code Review Agent Skills that share one review standard:
skills/local-code-review/SKILL.md— reviews local Git implementation state and returns findings;skills/github-pr-review/SKILL.md— reviews GitHub Pull Requests and, when active, publishes findings and a final decision.
Both consume the same shared review rules in
shared/policies/ and
shared/templates/, so P0/P1/P2 review semantics
never diverge between them — see docs/ARCHITECTURE.md for
the module map.
This file, and the policies/ it routes to, govern
development of this repository itself (branching, commits, PRs, merges,
validation, documentation, and how the Skills are orchestrated). That is
distinct from how either Skill reviews an external repository — that
behavior is defined in each Skill's own SKILL.md.
Entry gate: branch validation precondition
Before anything else — before routing to a task-specific policy below
and before any tool call that modifies an implementation or documentation
file — confirm the work is on an appropriate dedicated task branch per
policies/repository-workflow.md. That
policy's required order (inspect state, verify/sync the base, preserve any
existing work, create the task branch, switch to it) must reach its final
step before a single implementation or documentation file may be edited.
This precondition gates every task in this repository; it is not one item
to weigh alongside the Global invariants below, and no task routing rule
or policy file relaxes it.
Core Vocabulary: Agent via Skill
Agent
= stable software-engineering role
(e.g. "Code Review Agent")
defined by responsibility and scope, not by implementation
Skill
= portable operational definition of the Agent
(instructions, policies, templates, runbooks)
authored once, consumed by any runtime
Subagent / Worker
= optional internal execution mechanism used by an Agent
(a runtime-specific way of parallelizing or delegating work)
an implementation detail, never the definition of the Agent itself
Runtime
= environment consuming/executing the Skill
(Claude Code, Codex, Cursor, or any other agent runtime)Canonical principle:
Agent via SkillEach Code Review Agent is defined by its own SKILL.md. Neither is
defined as a Claude-specific subagent, a Codex-specific agent, a
Cursor-specific agent, an Anthropic API workflow, or any runtime-specific
worker syntax. Runtime adapters (e.g. CLAUDE.md) may exist separately,
but never redefine an Agent — they only bootstrap a runtime into reading
the canonical Skills.
Global invariants
These apply to every task in this repository, regardless of which policy file below owns the detail. Each is a short invariant here; the canonical, detailed rule lives in the policy named after it.
- Runtime neutrality. Canonical repository behavior — this file,
policies/,shared/, and each Skill's ownSKILL.md— must not depend on Claude-, Anthropic-, Codex-, or Cursor-specific tools, APIs, or subagent-orchestration syntax. Runtime adapters may exist separately but never fork these rules. Canonical:policies/skill-development-policy.md. - Dedicated task branch. See the Entry gate above, which states
this as a mandatory precondition rather than one invariant among many:
every materially separate task runs on a freshly created task branch off
synchronized
main, never directly onmainor a previous task's branch, and never by discarding or blending unrelated local work. This is an agent workflow check, not something recorded as evidence in repository history (no empty commits, PR checklist items, or file comments asserting it). Canonical:policies/repository-workflow.md. - Read-only Git safety. Destructive Git shortcuts (
git reset --hard,git clean -fd, force push, ancestry-hiding branch deletion, history rewriting for convenience) are prohibited; on unexpected state, preserve → inspect → report → do not guess. Canonical:policies/git-pr-merge-policy.md. - Clean task exit. Every task finishes in a known clean state — the
right branch, intended work committed, no unrelated modifications, no
stray generated artifacts or Python cache, no destructive cleanup used
to manufacture that state. Canonical:
policies/validation-and-clean-exit.md. - Packaged Skills are independent of repository-level instructions.
No packaged Skill resource (
SKILL.md, a packaged policy, runbook, template, orshared/-packaged resource) may depend on this repository's ownAGENTS.mdorpolicies/; a distributed archive never contains them. Canonical:policies/skill-development-policy.md. - Reviewer/author separation and opt-in local review. An implementing
Agent never invokes
github-pr-reviewon the PR it just opened or updated, andlocal-code-reviewis never invoked automatically — every invocation needs fresh, explicit user approval. Canonical:policies/review-orchestration-policy.md. - Python Authoring. Repository-owned Python (
scripts/**/*.py,tests/**/*.py) followspolicies/python_scripts_coding_policy.md: concise, intent-focused comments; durable explanation lives indocs/,policies/, orshared/policies/, not in module prose. - One canonical home per rule. A normative rule has exactly one canonical location. Other files (this one included) summarize and link; they do not restate a rule in a way that can drift independently.
- File size is a review trigger, not a limit. When a production file
(a Skill resource, policy, runbook, template, script, workflow, or
reference doc) grows past roughly 300 lines, treat that as a prompt to
check whether it owns more than one responsibility, restates a contract
that is canonical elsewhere, mixes orchestration with implementation, or
has a natural extraction boundary. If one applies, decompose along that
boundary while preserving behavior, public contracts, and packaging; if
none applies and the file is genuinely cohesive, a large file is fine.
Line count alone is never a CI-enforced limit. The current inventory and
decomposition sequence live in
docs/large-file-decomposition.md. - Thin, layered documentation. README files are orientation and
navigation surfaces, not capability encyclopedias: the root
README.mdgives the product overview, Skill selection, high-level capability categories, and links onward; each SkillREADME.mdgives that Skill's purpose, basic usage, a compact capability/difference summary, key boundaries, and links onward;docs/features/README.mdis the capability catalog (which Skill supports each optional/advanced feature and how it is activated);docs/features/pages explain one capability's usage;docs/ARCHITECTURE.mdis the concise system map;policies/and runbooks own exact semantics. Prefer a link to the smallest appropriate layer over copying an explanation into several READMEs, and do not grow a README merely to make a capability discoverable. READMEs and feature guides are explanatory — a canonical policy or runbook wins any conflict. A capability change — adding, removing, or renaming a capability, changing which Skill supports it, its default / conditional / requested state, how it is invoked or enabled, its user-visible limits, or its canonical semantics — requires a documentation-impact check that updates the smallest affected layer; an implementation change with no user-visible effect requires no README change. Canonical:policies/documentation-policy.md. - Concise, layered PR descriptions. Pull-request descriptions are concise
change summaries and navigation surfaces, not duplicate specifications;
detailed requirements and semantics stay in their canonical Issues, docs,
policies, or runbooks. Canonical:
policies/github-issue-pr-authoring.md. - Agent-authored PRs use the canonical PR template. A Pull Request an
agent creates, or materially updates, starts from
.github/PULL_REQUEST_TEMPLATE.md, fills its intended fields/sections, and removes or replaces its placeholder/guidance content — never an independently invented body structure. Canonical:policies/github-issue-pr-authoring.md. - CHANGELOG categories express SemVer intent. Compatible corrections and
refinements use
Fixed; intentional backward-compatible behavior or capability changes useChangedorAdded. Canonical:policies/release-changelog-policy.md. - Release intent belongs in the PR body, checked before opening it.
A release-worthy change must declare
Release category:/Release entry:lines in the pull request description — CHANGELOG.md is never edited directly. Before runninggh pr createorgh pr edit, validate the drafted body locally with the same deterministic checker CI runs (scripts/release/release_worthiness.py assess --require-release-intent) instead of waiting for CI to catch a missing or invalid category. Canonical:policies/github-issue-pr-authoring.md, "Validate release intent before opening or updating a PR". - Contribution ownership and Issue classification. An agent that creates
or materially restructures GitHub Issues considers ownership and blast
radius, classifies contributor suitability (maintainer-led / good first
issue / contributor-owned), and consults the canonical contribution
policy. It never marks sensitive core review behavior as beginner work
merely because the implementation looks small, considers extracting safe
contributor child Issues from larger Epics, and preserves maintainer
ownership of semantic and architectural contracts. Canonical:
policies/contribution-ownership-policy.md. - Native GitHub relationships for declared Issue dependencies. An
agent that creates or materially restructures an Issue's declared
Parent:/Children:/Depends on:/Blocks:fields also creates the matching native GitHub parent/sub-issue or dependency relationship in the same operation, verifies it by re-fetching afterward, never represents a dependency as a parent/sub-issue relationship (or vice versa), and leaves a genericRelated:reference or an ambiguous/ cyclic/missing-Issue relationship as prose only. Canonical:policies/github-issue-pr-authoring.md, "Native GitHub relationships".
Instruction precedence
When instructions overlap, the more specific and more authoritative source wins, in this order:
- The user's / calling task's explicit instructions for the task at hand.
- This file's Global invariants, and the canonical
policies/file the task routes to. Where a Global invariant above is only a summary, the routed policy's full text is authoritative. - Shared and Skill-level canonical sources —
shared/policies/,shared/templates/, eachSKILL.md, and each Skill's ownpolicies/,runbooks/, andtemplates/— for Skill behavior. - Explanatory documentation —
README.md,docs/, and each Skill'sREADME.md— which explains, navigates, and models, but never overrides a canonical source.
Canonical vs. explanatory. AGENTS.md, everything under policies/
and shared/policies/, each SKILL.md, and each Skill's own
policies/, runbooks/, and templates/ are canonical (they define
behavior). README.md, everything under docs/, and each Skill's
README.md are explanatory (they describe and navigate). An
explanatory file that appears to conflict with a canonical one is a
documentation bug to fix, not a competing rule.
Runtime adapters (e.g. CLAUDE.md) only bootstrap a runtime into
reading these canonical rules. They never duplicate or override them.
For precedence between instruction files inside a repository being
reviewed (a target repo's AGENTS.md vs. its CLAUDE.md), see
shared/policies/repository-instructions.md
— that is packaged Skill behavior, not this section.
Task routing
Read this file's Global invariants and Instruction precedence for any
task. Then read the one canonical policy that owns your task. For a short
directory map of the routed policies, see
policies/README.md (navigational only — not
normative).
| Task / concern | Canonical instruction source |
| Any repository task | this file — Global invariants + Instruction precedence |
| Task-branch creation, base synchronization, dirty-tree / stash handling, branch naming, resuming a task branch | policies/repository-workflow.md |
| Commit, push, PR creation and assignment, merge strategy, merge safety, squash cleanup, destructive-Git prohibitions | policies/git-pr-merge-policy.md |
| Clean task end state, Python cache/bytecode cleanup, shell/PowerShell script parity, running repository validation & packaging | policies/validation-and-clean-exit.md |
Repository documentation (README.md, docs/, Skill README.md) — structure and reading experience | policies/documentation-policy.md |
Content of agent-authored GitHub Issues and Pull Requests — how much detail belongs in the body, per-field size guidance, PR summary shape, summarized validation, linking canonical docs instead of duplicating them, the local release-intent pre-flight check before gh pr create / gh pr edit, creating and verifying native GitHub parent/sub-issue and dependency relationships for declared Parent/Children/Depends on/Blocks fields | policies/github-issue-pr-authoring.md |
Filing a maintainer-identified engineering defect (.github/ISSUE_TEMPLATE/engineering-bug.yml) — contract/invariant mismatches, incorrect execution semantics, security-boundary violations, and similar defects a maintainer has already diagnosed, as distinct from the general-purpose bug-report.yml chooser entry | policies/github-issue-pr-authoring.md |
| Ownership and contributor-suitability classification of GitHub Issues — contribution classes, classification criteria (blast radius, not patch size), assignment behavior, Epic decomposition, sensitive areas excluded from first issues, handling ambiguous cases | policies/contribution-ownership-policy.md |
| CHANGELOG category selection and its deterministic SemVer intent | policies/release-changelog-policy.md |
| Skill behavior, Skill packaging, runbook / policy / template ownership, runtime adapters, portability of packaged resources | policies/skill-development-policy.md |
Review orchestration — implementer/reviewer separation, the local-code-review approval gate, review ownership, Skill-consumer branch discipline, human-facing review publication | policies/review-orchestration-policy.md |
Repository-owned Python (scripts/**/*.py, tests/**/*.py) | policies/python_scripts_coding_policy.md |
An agent should never have to grep the whole repository to guess which rules apply: if a task is not covered by a row above, it is governed by the Global invariants alone, and a new focused policy should be added (see Maintainability and extension below) rather than expanding this file with detailed procedure.
Repository development vs. packaged Skill runtime
Everything in this file and under policies/ is repository-development
instruction: it governs how this source repository is built,
reviewed, packaged, and documented. It is never shipped.
A distributed Skill archive contains only SKILL.md, that Skill's
packaged policies/, runbooks/, templates/, metadata/, and its
shared/-packaged resources. If a rule must survive packaging, its
canonical portable form belongs inside one of those packaged resource
types — not in a repository-level policies/ file introduced to keep
this file short. The full boundary, including target-repository
instruction discovery (which is valid packaged behavior), is owned by
policies/skill-development-policy.md.
Maintainability and extension
This file must stay a stable entrypoint and routing layer. Do not let it regrow into a monolith. The criterion is not a line limit — it is responsibility.
- Keep in this file only genuinely global material: repository-wide safety invariants, instruction precedence, the canonical-vs-explanatory distinction, the task-routing table, the packaged-Skill independence boundary, and this maintainability rule.
- Put a substantial, independently ownable policy domain in its own
focused file under
policies/, and add a routing row above. Prefer a small number of meaningful domains over many tiny files. - Give every directory people navigate directly to find policies,
contracts, or guidance a concise navigational README entrypoint (this
applies to
policies/,shared/policies/,tests/, anddocs/features/today — not to every directory). The canonical rule is inpolicies/documentation-policy.md, "Navigational README for user-facing policy/guidance directories." - Add a rule to this file's Global invariants only when it truly applies to every repository task and is short enough to state as an invariant. Otherwise it belongs in a routed policy.
- Never create a second normative copy of a rule. When a concise invariant must appear here, phrase it as a summary and route to the canonical policy; do not paste the detailed rule into both.
- Optimize for discoverability and low cognitive load: a new coding agent should read this file first and immediately know the global invariants, which policy to read next, what is canonical, what is explanatory, what applies to repository development, and what applies to packaged Skill runtime.
Map
CLAUDE.md (or any other runtime adapter)
↓
AGENTS.md (this file — global invariants, precedence, routing)
↓
policies/ (repository-development policy domains, routed from this file)
↓
shared/ (review policies/templates common to both Skills)
↓
skills/local-code-review/SKILL.md
skills/github-pr-review/SKILL.mdRuntime adapters bootstrap a specific runtime into these canonical rules.
They must never duplicate or override them. The detailed layering rule is
owned by
policies/skill-development-policy.md,
"Relationship to Runtime Adapters and the Skills."
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.

