Pull Request Review Skill
An agent skill for reviewing pull requests against shared team standards.
A common AI agent skill — reviewing a pull request — written in pure AIM v8.0 Core instead of a 180-line prose SKILL.md.
- Who
- Review agent · Maintainer
- Steps
- 4
- Rules
- 4
- Lifecycle
- Queued → Reviewing → Awaiting maintainer → Posted → Blocked
What must hold
The rules of this model, in its own words, and the step that keeps each one.
Requirements traceability
4 / 4 satisfied (100%)- TESTS-FIRSTNever review a broken build; stop and report failing checks before auditing the diff.✓ Operation:CheckBuildAndScope
- EVIDENCE-ONLYEvery finding cites a file path, line range, and concrete risk — never vague style nitpicks.✓ Operation:AuditDiff✓ Result:ReviewSummary
- HUMAN-ON-RISKChanges touching authentication, billing, or database migrations require maintainer clearance before the review posts.✓ Operation:AuditDiff✓ Operation:ClearRiskGate
- NO-SILENT-MERGEThe skill posts a structured review summary and never approves or merges on a maintainer's behalf.✓ Operation:PostReviewSummary✓ Result:ReviewSummary
Use it with your agent
Connect AIM to the agent you already use, then ask it to start your own version:
Read the AIM context "Pull Request Review Skill" at https://intentmodel.org/registry/reference/pr-review/ and start our own version of it for our team.
Browse the model
RunCodeReview
View workflow sourceFacets by type
File
AGENTS.md
Agents
This context defines a Pull Request Review agent skill in AIM v8.0 Core — no packages required.
- Read the specification first: https://intentmodel.org/specification.md
- Authoritative skill model:
aim/pr_review/pr_review.aim - Any agent (Claude Code, Codex, Gemini CLI, Cursor) can run this skill directly by pointing a short
SKILL.mdataim/pr_review/pr_review.aimor reading it live over MCP.
subject
Pull Request Review Skill
Summary
An agent skill for reviewing pull requests against shared team standards. Checks CI and scope first, audits the diff with concrete file-and-line evidence, pauses for a human maintainer on sensitive areas, and posts a structured review summary without silently merging.
Requirements
- TESTS-FIRST — Never review a broken build; stop and report failing checks before auditing the diff.
- EVIDENCE-ONLY — Every finding cites a file path, line range, and concrete risk — never vague style nitpicks.
- HUMAN-ON-RISK — Changes touching authentication, billing, or database migrations require maintainer clearance before the review posts.
- NO-SILENT-MERGE — The skill posts a structured review summary and never approves or merges on a maintainer's behalf.
Persona
Review Agent
Role
- Executes the pull request review skill, inspects the diff against shared team standards, and drafts evidence-backed findings.
Access
- Runs the review workflow — invokes · Run Pull Request Review
- Checks CI status and diff scope — invokes · Check Build & Scope
- Audits changes against team standards — invokes · Audit Diff Against Standards
- Posts the final review summary — invokes · Post Review Summary
- Produces the structured review — produces · Structured Review Summary
Persona
Maintainer
Role
- Human owner responsible for clearing high-risk changes and deciding whether a pull request merges.
Access
- Clears high-risk changes after human inspection — invokes · Maintainer Risk Sign-Off
Knowledge
Shared Team Review Standards
Authoritative security, correctness, and backwards-compatibility checklist shared across all engineering skills so policies live in one place instead of being copy-pasted into every prompt.
Record
PullRequest
The pull request currently under review by the skill.
Schema
id: string required unique key
repo: string required
author: string required
checksGreen: boolean required
touchesSensitiveArea: boolean required
status: enum(Queued, Reviewing, AwaitingMaintainer, Posted, Blocked) required default(Queued)Immutable
idrepoauthor
Record
Finding
One concrete issue discovered during the diff audit, backed by file location and risk explanation.
Schema
id: string required unique key
prId: ref(pr_review#PullRequest.id) required
filePath: string required
lineRange: string required
severity: enum(blocker, warning, note) required
risk: string requiredState
ReviewLifecycle
Tracks a pull request from review request through auditing, optional maintainer sign-off, and final summary or early block.
Of
pr_review#Record:PullRequest.status
States
- Queued — initial
- Reviewing
- AwaitingMaintainer
- Posted — final
- Blocked — final
Moves
- Queued → Reviewing — [pr_review#Operation:CheckBuildAndScope]
- Queued → Blocked — [pr_review#Operation:CheckBuildAndScope]
- Reviewing → AwaitingMaintainer — [pr_review#Operation:AuditDiff]
- AwaitingMaintainer → Reviewing — [pr_review#Operation:ClearRiskGate]
- Reviewing → Posted — [pr_review#Operation:PostReviewSummary]
Operation
Check Build & Scope
Verifies that automated checks pass and the diff is in scope before spending tokens auditing code.
Input
prId: ref(pr_review#PullRequest.id) requiredEnsures
- Updates the pull request status based on CI health — reads · PullRequest, mutates · PullRequest, satisfies · TESTS-FIRST
Decides
- Ready — automated checks are green and the diff is ready for audit
- Blocked — automated checks failed; report the failure and stop
Criteria
Ready when checksGreen = true
otherwise BlockedOperation
Audit Diff Against Standards
Inspects changed files against shared team standards, records evidence-backed findings, and checks whether sensitive areas require human sign-off.
Input
prId: ref(pr_review#PullRequest.id) requiredEnsures
- Applies shared team policies without copy-pasted prompt rules — consults · Shared Team Review Standards
- Records only file-and-line cited findings — reads · PullRequest, mutates · Finding, mutates · PullRequest, satisfies · EVIDENCE-ONLY
Decides
- Standard — no sensitive paths touched; gate clears immediately — emits · RiskGateCleared
- HighRisk — touches auth, billing, or migrations; escalates to maintainer — emits · MaintainerSignOffRequested, satisfies · HUMAN-ON-RISK
Criteria
HighRisk when touchesSensitiveArea = true
otherwise StandardOperation
Maintainer Risk Sign-Off
A human maintainer reviews high-risk findings and clears the pull request so the agent can publish the review summary.
Input
prId: ref(pr_review#PullRequest.id) requiredEnsures
- Records human clearance on sensitive changes — reads · PullRequest, reads · Finding, mutates · PullRequest, emits · RiskGateCleared, satisfies · HUMAN-ON-RISK
Operation
Post Review Summary
Publishes the structured review comment with cited findings and verdict without merging or approving on a human's behalf.
Input
prId: ref(pr_review#PullRequest.id) requiredExpects
- The formatted review summary is ready — needs · Structured Review Summary
Ensures
- Publishes the review and closes the run without silent merge — reads · PullRequest, reads · Finding, mutates · PullRequest, emits · ReviewPosted, satisfies · NO-SILENT-MERGE
Result
Structured Review Summary
A concise pull request comment grouping blockers, warnings, and notes with exact file paths, line ranges, and concrete risks.
Format
- markdown — verdict, test status, and cited findings grouped by severity
Ensures
- Cites every recorded finding with file and line evidence — reads · Finding, satisfies · EVIDENCE-ONLY
- States recommendation only, never merges automatically — satisfies · NO-SILENT-MERGE
Process
Run Pull Request Review
End-to-end execution of the pull request review skill: gate on green CI, audit against shared standards, wait for risk-gate clearance, and post the summary.
Steps
- Check CI status and diff scope — invokes · Check Build & Scope — continues: Ready
- Audit the diff against shared team standards — invokes · Audit Diff Against Standards — continues: Standard, HighRisk
- Wait for risk-gate clearance (automatic on standard PRs, maintainer sign-off on high-risk paths) — subscribes · RiskGateCleared
- Post the structured review summary — invokes · Post Review Summary
Event
MaintainerSignOffRequested
A high-risk pull request was escalated to a human maintainer for inspection.
Event
RiskGateCleared
Risk checks passed automatically or a maintainer signed off on high-risk paths.
Event
ReviewPosted
The structured pull request review summary was posted.
Trigger
Pull Request Opened or Updated
Activates the review skill whenever a pull request is opened or receives new commits.
Kind
- webhook
Fires
File
README.md
Pull Request Review (Agent Skill)
A common AI agent skill — reviewing a pull request — written in pure AIM v8.0 Core instead of a 180-line prose SKILL.md.
Why write an agent skill in AIM instead of prose?
Most teams write agent skills as long Markdown prompts that mix activation triggers, security rules, branching exceptions, and output formatting into one wall of text. As skills grow, agents skim middle paragraphs, rules contradict each other, and teams copy-paste the same policies into every skill.
Writing the same skill in AIM fixes all four failure modes at once:
Problem in prose SKILL.md |
How AIM (pr_review.aim) solves it |
|---|---|
| "Stop if CI is red, and ask a maintainer on auth changes" buried on line 140 | Explicit Decides gates (Ready / Blocked, Standard / HighRisk) and a structural subscribes wait on Event:RiskGateCleared. |
| Security and style policies copy-pasted across 15 skill files | One shared Knowledge:TeamStandards node linked via [consults] — update it once and every skill gets it live. |
| Rigid imperative prompt scripts waste tokens and lower judgment | Declares intent (Requirements, Expects, Ensures, Result), leaving the agent free to inspect the code intelligently. |
| Impossible to audit or visualize | The flowchart, state lifecycle, and 100% requirement coverage bar are generated straight from the file. |
Using this skill with any agent
In Claude Code, Codex, Gemini CLI, or Cursor, a SKILL.md only needs to point to the live context (in Git or over MCP):
---
name: pr-review
description: Review a pull request against team standards with human sign-off on high-risk areas.
---
Follow `aim/pr_review/pr_review.aim` (`Process:RunCodeReview`) and satisfy every requirement listed there.
For developers: packages, files and how to check them
AIM Core only
Why write an agent skill in AIM instead of prose?#
Most teams write agent skills as long Markdown prompts that mix activation triggers, security rules, branching exceptions, and output formatting into one wall of text. As skills grow, agents skim middle paragraphs, rules contradict each other, and teams copy-paste the same policies into every skill.
Writing the same skill in AIM fixes all four failure modes at once:
Problem in prose SKILL.md |
How AIM (pr_review.aim) solves it |
|---|---|
| "Stop if CI is red, and ask a maintainer on auth changes" buried on line 140 | Explicit Decides gates (Ready / Blocked, Standard / HighRisk) and a structural subscribes wait on Event:RiskGateCleared. |
| Security and style policies copy-pasted across 15 skill files | One shared Knowledge:TeamStandards node linked via [consults] — update it once and every skill gets it live. |
| Rigid imperative prompt scripts waste tokens and lower judgment | Declares intent (Requirements, Expects, Ensures, Result), leaving the agent free to inspect the code intelligently. |
| Impossible to audit or visualize | The flowchart, state lifecycle, and 100% requirement coverage bar are generated straight from the file. |
Using this skill with any agent#
In Claude Code, Codex, Gemini CLI, or Cursor, a SKILL.md only needs to point to the live context (in Git or over MCP):
---
name: pr-review
description: Review a pull request against team standards with human sign-off on high-risk areas.
---
Follow `aim/pr_review/pr_review.aim` (`Process:RunCodeReview`) and satisfy every requirement listed there.