# 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):

```markdown
---
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.
```
