metaphor/marketplace

skill · built into metaphor

/ai-pr

Budgeted whole-PR critique via the pr subagent — map diff, evidence findings, return a pr_review_draft for the Agent Review canvas

  • Built in
  • Slash command
try it

you ›/ai-pr

metaphor ›Loaded the ai-pr skill. What should I work on?

What the agent is told

This is the skill's SKILL.md, exactly what Metaphor reads before the task.

Use when the ask is a pull request / branch review in chat (not a CI-only ask).

Prefer to delegate: task({ subagent_type: "pr", description, prompt }) runs the ladder in the background; await_subagent before you answer. Then call pr_review with the child's pr_review_draft so the Agent Review canvas opens — the human edits and publishes from there.

Structured Agent Review (/review @pr:N or the Agent Review CTA) already attaches the PR package — do not review on the primary. First turn: spawn pr (and security / a perf pr when those skills are active) in parallel, await_subagent, then one pr_review. Pass @state/pull-requests/pr-N/ so children skip gh pr diff and test suites.

Ladder (inside the pr subagent)

  1. Scope — pin PR number / repo / branch before reading the diff.
  2. Map — on-disk package (summary.json, all.diff, files/) when the parent names it; otherwise gh pr view + gh pr diff. Never run test suites. 2b. Graph — call code_graph({ action: "review" }) after MAP (pass paths when known). Use impact for blast radius before walking more of all.diff. Fall back to grep/read if status is unavailable/skipped.
  3. Checks — skip when a package was provided; otherwise one gh pr checks for context. CI-only asks belong to ci.
  4. Critique — correctness, boundaries, blast radius, contracts, tests; prefer graph hotspots, then targeted read/grep on tip when available (not diff_only).
  5. Evidence — path + lines + short snippet per concrete finding.
  6. Conclude — Verdict prose + pr_review_draft JSON for the parent.

Parent handoff

After await_subagent returns a draft:

  1. Call pr_review once with that payload (canvas opens).
  2. Keep the chat reply to one line — do not paste the full review into chat.
  3. Do not post to GitHub from the agent.

Budget

Cap at about 12 bash/gh calls. Batch independent calls in the same turn. Large diffs spill under @state/tool-output/ — aggregate; never paste the full diff.

Agents that use it

Questions

What is the ai-pr skill?

Budgeted whole-PR critique via the pr subagent — map diff, evidence findings, return a pr_review_draft for the Agent Review canvas

How do I use ai-pr in Metaphor?

It is built into Metaphor. Type /ai-pr in the composer, or describe the task and the agent loads the skill when it fits.

What is a skill?

A skill is a set of written instructions the agent reads before it starts a kind of task. It changes how the agent works, not what it is allowed to do.

More built-in skills