Pull Request Review Skill
pr_review.aim · intent pr_review · kind intent
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
---aim: pr_reviewkind: intentnature: subject---# Pull Request Review Skill## SummaryAn 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: ReviewAgent### LabelReview 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](aim:pr_review#Process:RunCodeReview)- Checks CI status and diff scope — [invokes](aim:pr_review#Operation:CheckBuildAndScope)- Audits changes against team standards — [invokes](aim:pr_review#Operation:AuditDiff)- Posts the final review summary — [invokes](aim:pr_review#Operation:PostReviewSummary)- Produces the structured review — [produces](aim:pr_review#Result:ReviewSummary)## 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](aim:pr_review#Operation:ClearRiskGate)## Knowledge: TeamStandards### LabelShared Team Review Standards### SummaryAuthoritative 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### SummaryThe pull request currently under review by the skill.### Schema```schemaid: string required unique keyrepo: string requiredauthor: string requiredchecksGreen: boolean requiredtouchesSensitiveArea: boolean requiredstatus: enum(Queued, Reviewing, AwaitingMaintainer, Posted, Blocked) required default(Queued)```### Immutable- `id`- `repo`- `author`## Record: Finding### SummaryOne concrete issue discovered during the diff audit, backed by file location and risk explanation.### Schema```schemaid: string required unique keyprId: ref(pr_review#PullRequest.id) requiredfilePath: string requiredlineRange: string requiredseverity: enum(blocker, warning, note) requiredrisk: string required```## State: ReviewLifecycle### SummaryTracks 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: CheckBuildAndScope### LabelCheck Build & Scope### SummaryVerifies that automated checks pass and the diff is in scope before spending tokens auditing code.### Input```schemaprId: ref(pr_review#PullRequest.id) required```### Ensures- Updates the pull request status based on CI health — [reads](aim:pr_review#Record:PullRequest), [mutates](aim:pr_review#Record:PullRequest), [satisfies](aim:pr_review#Requirements[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```criteriaReady when checksGreen = trueotherwise Blocked```## Operation: AuditDiff### LabelAudit Diff Against Standards### SummaryInspects changed files against shared team standards, records evidence-backed findings, and checks whether sensitive areas require human sign-off.### Input```schemaprId: ref(pr_review#PullRequest.id) required```### Ensures- Applies shared team policies without copy-pasted prompt rules — [consults](aim:pr_review#Knowledge:TeamStandards)- Records only file-and-line cited findings — [reads](aim:pr_review#Record:PullRequest), [mutates](aim:pr_review#Record:Finding), [mutates](aim:pr_review#Record:PullRequest), [satisfies](aim:pr_review#Requirements[EVIDENCE-ONLY])### Decides- **Standard** — no sensitive paths touched; gate clears immediately — [emits](aim:pr_review#Event:RiskGateCleared)- **HighRisk** — touches auth, billing, or migrations; escalates to maintainer — [emits](aim:pr_review#Event:MaintainerSignOffRequested), [satisfies](aim:pr_review#Requirements[HUMAN-ON-RISK])### Criteria```criteriaHighRisk when touchesSensitiveArea = trueotherwise Standard```## Operation: ClearRiskGate### LabelMaintainer Risk Sign-Off### SummaryA human maintainer reviews high-risk findings and clears the pull request so the agent can publish the review summary.### Input```schemaprId: ref(pr_review#PullRequest.id) required```### Ensures- Records human clearance on sensitive changes — [reads](aim:pr_review#Record:PullRequest), [reads](aim:pr_review#Record:Finding), [mutates](aim:pr_review#Record:PullRequest), [emits](aim:pr_review#Event:RiskGateCleared), [satisfies](aim:pr_review#Requirements[HUMAN-ON-RISK])## Operation: PostReviewSummary### LabelPost Review Summary### SummaryPublishes the structured review comment with cited findings and verdict without merging or approving on a human's behalf.### Input```schemaprId: ref(pr_review#PullRequest.id) required```### Expects- The formatted review summary is ready — [needs](aim:pr_review#Result:ReviewSummary)### Ensures- Publishes the review and closes the run without silent merge — [reads](aim:pr_review#Record:PullRequest), [reads](aim:pr_review#Record:Finding), [mutates](aim:pr_review#Record:PullRequest), [emits](aim:pr_review#Event:ReviewPosted), [satisfies](aim:pr_review#Requirements[NO-SILENT-MERGE])## Result: ReviewSummary### LabelStructured Review Summary### SummaryA 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](aim:pr_review#Record:Finding), [satisfies](aim:pr_review#Requirements[EVIDENCE-ONLY])- States recommendation only, never merges automatically — [satisfies](aim:pr_review#Requirements[NO-SILENT-MERGE])## Process: RunCodeReview### LabelRun Pull Request Review### SummaryEnd-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.### Steps1. Check CI status and diff scope — [invokes](aim:pr_review#Operation:CheckBuildAndScope) — continues: Ready2. Audit the diff against shared team standards — [invokes](aim:pr_review#Operation:AuditDiff) — continues: Standard, HighRisk3. Wait for risk-gate clearance (automatic on standard PRs, maintainer sign-off on high-risk paths) — [subscribes](aim:pr_review#Event:RiskGateCleared)4. Post the structured review summary — [invokes](aim:pr_review#Operation:PostReviewSummary)## Event: MaintainerSignOffRequested### SummaryA high-risk pull request was escalated to a human maintainer for inspection.## Event: RiskGateCleared### SummaryRisk checks passed automatically or a maintainer signed off on high-risk paths.## Event: ReviewPosted### SummaryThe structured pull request review summary was posted.## Trigger: PullRequestOpened### LabelPull Request Opened or Updated### SummaryActivates the review skill whenever a pull request is opened or receives new commits.### Kind- webhook### Fires- [triggers](aim:pr_review#Process:RunCodeReview)