# Ship status

*Builds, failing tests and the fix, all one tap from your agent.*

**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 `ship-status` · Agent at work · uses nothing on the phone · for: Coding agents with repo and CI access.

## Goal

The user knows the state of their code at a glance and can unblock it without opening a laptop.

## When to offer it

The user has a repository with CI. Offer it to developers who ask 'is main green?' or get pinged about broken builds.

## What the user gets

- Shows if main is green, what broke and who it affects
- Tap to have your agent fix, re-run or revert
- Turns green again on its own when it's fixed

## What each size shows

- **Small**: metric: Build = Failing.
- **Medium**: metric: Build = Failing; text (body): "Tax off by 1¢ on EUR carts"; buttons: Fix it (`fix`), Re-run (`rerun`), Revert (`revert`).
- **Large**: metric: Build = Failing; text (body): "Tax off by 1¢ on EUR carts"; buttons: Fix it (`fix`), Re-run (`rerun`), Revert (`revert`); list: Last runs (2 rows).
- **Lock Screen**: inline "main is failing".

## 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 **red**. To restyle a widget you already saved, send only the look:

```json
{"slug": "ship-status", "look": {"style": "bold", "accent": "red", "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 repo and branch
- Which buttons: fix, re-run, revert

**Search words:** ci, build, tests, github, pull request, deploy, broken, main, code.


## Before you build

- You need: Coding agents with repo and CI access.
- Ask once: Before merging, pushing to main or reverting.

## Fill it with real data

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

| Block | Real value |
|---|---|
| 0 · metric | `value` Passing or Failing, `trend` up when green, down when red. |
| 1 · text | The first failing test and its cause in under 35 characters, or 'All checks passed'. |
| 2 · buttons | Keep ids `fix`, `rerun`, `revert`; drop `revert` when green. |
| 3 · list | The last 2-3 runs: short sha + message, detail = passed or failed. |

Sources:
- CI status of the default branch (gh run list, your CI API).
- The first failing test and a one-line cause you found by reading the log.
- Recent runs with their commit message.

## 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": "ship-status",
  "title": "main",
  "symbol": "hammer.fill",
  "accent": "#FF453A",
  "blocks": [
    {"type": "metric", "label": "Build", "value": "Failing", "trend": "down"},
    {"type": "text", "text": "Tax off by 1¢ on EUR carts", "style": "body"},
    {"type": "buttons", "items": [{"id": "fix", "label": "Fix it", "symbol": "wrench.and.screwdriver.fill"}, {"id": "rerun", "label": "Re-run", "symbol": "arrow.clockwise"}, {"id": "revert", "label": "Revert", "symbol": "arrow.uturn.backward"}]},
    {"type": "list", "title": "Last runs", "items": [{"title": "a41c9 checkout rounding", "detail": "failed"}, {"title": "9f02e pricing page", "detail": "passed"}]}
  ],
  "sizes": {"medium": [0, 1, 2], "large": [0, 1, 2, 3]},
  "lock": {"inline": "main is failing", "circular": 0}
}
```

## Keep it fresh

On every CI run finishing (webhook or poll every 5 min while red), and when your fix lands.

## 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.

**Fix it** (`fix`)

```json
{"widget": "ship-status", "kind": "button", "target": "fix", "value": {"label": "Fix it"}}
```

Investigate and fix on a branch, run the tests, then show 'Fix ready: PR #212' with a 'Merge' button. Merging is consequential: approval first.

**Re-run** (`rerun`)

```json
{"widget": "ship-status", "kind": "button", "target": "rerun", "value": {"label": "Re-run"}}
```

Re-run the failed job, show 'Re-running…', then the result.

**Revert** (`revert`)

```json
{"widget": "ship-status", "kind": "button", "target": "revert", "value": {"label": "Revert"}}
```

Prepare the revert of the culprit commit, then droplet_ask 'Revert a41c9 on main?' before pushing.

## Ask first

Before merging, pushing to main or reverting.

For example:

```json
{"question": "Revert a41c9 on main?", "kind": "decision", "options": ["Revert it", "Keep it"], "risk": "high"}
```

## Phone actions

None.

## Edge cases

- Green: replace the buttons with a link button to the latest deploy.
- Flaky test (passes on re-run): say so in the text after `rerun`.
- No CI access: tell the user what you need instead of showing a stale state.

## Never

Never push to the default branch without a yes.

## 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.
- [PR review](pr-review.md): Your agent read the pull request. You get the verdict and merge with a tap.
- [Production issue](incident.md): Something broke in production. Your agent already looked, and offers the fix.
