# PR review

*Your agent read the pull request. You get the verdict and merge with a tap.*

**Type: [Act](types/act.md).** Where things stand, and the three things you'd want to do about it. This is one good use of it; the same widget serves a failing build, a production issue, a pull request, an email that needs you and more. Switch the subject when something else matters more.

Template id `pr-review` · Agent at work · uses nothing on the phone · for: Coding agents with repo access.

## Goal

Review stops being what holds the team up, without anything risky slipping through.

## When to offer it

The user reviews pull requests, or their agents open them.

## What the user gets

- Reads each PR, the diff and the tests before you see it
- Gives you the risk and what changed in one line
- Merges or asks for changes after your tap

## What each size shows

- **Small**: metric: Risk = Low.
- **Medium**: metric: Risk = Low; text (body): "Adds webhook retries. Tests pass. Looks right to me."; buttons: Merge (`merge`), Changes (`changes`), Next (`next`).
- **Large**: metric: Risk = Low; text (body): "Adds webhook retries. Tests pass. Looks right to me."; buttons: Merge (`merge`), Changes (`changes`), Next (`next`); list: Also waiting (2 rows).
- **Lock Screen**: inline "3 PRs need you".

## Make it theirs

**Look.** Send `look` instead of `theme` and `accent`; every combination is designed to read well:

- `style`: `glass` (default: see-through, adapts to dark mode), `soft` (a calm pale tint) or `bold` (a vivid gradient with dark buttons).
- `accent`: blue, indigo, purple, pink, red, orange, green, teal, graphite, or a hex.
- `font`: default, rounded, serif or mono.

This template's own accent is **green**. To restyle a widget you already saved, send only the look:

```json
{"slug": "pr-review", "look": {"style": "bold", "accent": "green", "font": "rounded"}}
```

Preview a look without saving: `droplet_preview_widget` with the slug and `look`. When the user says "make it greener", "calmer" or "bolder", change the look; keep the content.

**Their choices.** Ask once (droplet_ask) or use what you know:

- Which repos
- What counts as low risk
- Merge method

**Search words:** pr, pull request, review, merge, github, code review, diff.


## Before you build

- You need: Coding agents with repo access.
- Ask once: If the PR changed after your read, ask again rather than merging.

## Fill it with real data

Start from the template (`droplet_library` with `id: "pr-review"`), keep the design, and replace each sample value:

| Block | Real value |
|---|---|
| 0 · metric | Your honest risk call. |
| 1 · text | What changed and your verdict, in one line. |
| 2 · buttons | Merge, ask for changes, or move on. |
| 3 · list | The rest of the queue, with risk. |

Sources:
- Open PRs waiting on the user (gh pr list, your Git host's API).
- Your own read of the diff, the tests and CI.
- A real risk call: anything touching auth, money or data is never Low.

## The widget

Sample values; send it with `droplet_set_widget` on your widget's slug (or a new slug with `new_widget: true` if the user asked for a separate widget). Preview it and fix every warning first.

```json
{
  "slug": "pr-review",
  "title": "PR #212",
  "symbol": "arrow.triangle.pull",
  "accent": "#30D158",
  "blocks": [
    {"type": "metric", "label": "Risk", "value": "Low"},
    {"type": "text", "text": "Adds webhook retries. Tests pass. Looks right to me.", "style": "body"},
    {"type": "buttons", "items": [{"id": "merge", "label": "Merge", "symbol": "arrow.triangle.merge"}, {"id": "changes", "label": "Changes", "symbol": "text.bubble.fill"}, {"id": "next", "label": "Next", "symbol": "chevron.right"}]},
    {"type": "list", "title": "Also waiting", "items": [{"title": "#218 Billing page copy", "detail": "low"}, {"title": "#220 Auth session change", "detail": "read this"}]}
  ],
  "sizes": {"medium": [0, 1, 2], "large": [0, 1, 2, 3]},
  "lock": {"inline": "3 PRs need you", "circular": 0}
}
```

## Keep it fresh

When a PR is opened or updated, or every hour in working hours.

## Handle the taps

Each tap reaches you once on `droplet_get_events` (keep a waker running, SKILL.md Process C). Answer within seconds by updating the widget.

**Merge** (`merge`)

```json
{"widget": "pr-review", "kind": "button", "target": "merge", "value": {"label": "Merge"}}
```

Merge exactly this PR if nothing changed since you read it, then show the next one.

**Changes** (`changes`)

```json
{"widget": "pr-review", "kind": "button", "target": "changes", "value": {"label": "Changes"}}
```

Ask what to change with droplet_ask (input), post the review, then show the next one.

**Next** (`next`)

```json
{"widget": "pr-review", "kind": "button", "target": "next", "value": {"label": "Next"}}
```

Show the next PR. Keep this one in the list.

## Ask first

If the PR changed after your read, ask again rather than merging.

For example:

```json
{"question": "Merge #220? It changes how sessions work.", "kind": "decision", "options": ["Merge", "Hold"], "risk": "high"}
```

## Phone actions

None.

## Edge cases

- CI is still running: say so and hold the Merge button back.
- The queue is empty: show the last merge or go back to your normal widget.

## Never

Never merge a High risk PR from a single tap: use droplet_ask with risk high and name it.

## Done when

- [ ] Every sample value is replaced with real data (no "Dr. Lee" on a real widget).
- [ ] `droplet_preview_widget` shows no warnings at the sizes the user placed (`placed` in `droplet_whoami`).
- [ ] Every button has a handler and a waker is running.
- [ ] Refresh is set up as above.
- [ ] You told the user in one line what it does on its own and what it asks first.

## Same widget, other uses

- [Meeting prep](meeting-prep.md): Before every meeting: who, why, and your notes ready.
- [Calendar clash](schedule-clash.md): Two things landed at the same time. Your agent found the fix; you tap it.
- [Worth your time](news-brief.md): One story that matters to your work, why it matters, and what to do about it.
- [Smart buttons](smart-buttons.md): The buttons you need right now. Your agent changes them by time, place and what's next.
- [Meeting controls](meeting-controls.md): Only around a meeting: join it, say you're late, then send the recap when it ends.
- [Home controls](home-scenes.md): At home, the controls for this moment: leaving, evening or bedtime.
- [Release room](release-room.md): A small app for one job: everything about a release, with the controls, built by your agent.
- [Needs a reply](inbox-zero.md): Your agent drafts the replies. You tap send.
- [Follow up](follow-up.md): Someone never replied. Your agent noticed and wrote the nudge.
- [Ship status](ship-status.md): Builds, failing tests and the fix, all one tap from your agent.
- [Production issue](incident.md): Something broke in production. Your agent already looked, and offers the fix.
