# Calendar clash

*Two things landed at the same time. Your agent found the fix; you tap it.*

**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 `schedule-clash` · Right now · uses Calendar · for: Agents with calendar and email access.

## Goal

A clash gets fixed in one tap, before anyone has to ask about it.

## When to offer it

A new invite overlaps something, or tomorrow's calendar has a clash.

## What the user gets

- Spots overlaps as soon as a new invite lands
- Checks who can move and offers the one fix that works
- Moves the meeting and tells people after your tap

## What each size shows

- **Small**: metric: Overlap = 30 min.
- **Medium**: metric: Overlap = 30 min; text (body): "Design review and Sam's 1:1. Sam is free at 4."; buttons: Move Sam (`move`), Decline (`decline`), Keep (`keep`).
- **Large**: metric: Overlap = 30 min; text (body): "Design review and Sam's 1:1. Sam is free at 4."; buttons: Move Sam (`move`), Decline (`decline`), Keep (`keep`); list: The two meetings (2 rows).

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

```json
{"slug": "schedule-clash", "look": {"style": "bold", "accent": "orange", "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:

- Meetings that must never move
- Working hours

**Search words:** calendar, clash, conflict, overlap, meeting, reschedule, move, invite.


## Before you build

- Check `droplet_get_phone_context`: the phone must share calendar. If something is off, ask the user to turn it on in Droplet.ai, Settings, Phone access.
- You need: Agents with calendar and email access.
- Ask once: Before writing to more than one or two people.

## Fill it with real data

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

| Block | Real value |
|---|---|
| 0 · metric | How long the overlap is. |
| 1 · text | Which two things, and the fix you found. |
| 2 · buttons | Move names the person; Decline and Keep are the alternatives. |
| 3 · list | The two meetings. |

Sources:
- Today's and tomorrow's events (calendar connector, or Phone access).
- Each attendee's free time, if your calendar tool has it.
- Which meeting is easier to move: fewer people, recurring, or you own it.

## 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": "schedule-clash",
  "title": "Clash at 3:00",
  "symbol": "calendar.badge.exclamationmark",
  "accent": "#FF9F0A",
  "blocks": [
    {"type": "metric", "label": "Overlap", "value": "30 min"},
    {"type": "text", "text": "Design review and Sam's 1:1. Sam is free at 4.", "style": "body"},
    {"type": "buttons", "items": [{"id": "move", "label": "Move Sam", "symbol": "arrow.right.circle.fill"}, {"id": "decline", "label": "Decline", "symbol": "xmark"}, {"id": "keep", "label": "Keep", "symbol": "checkmark"}]},
    {"type": "list", "title": "The two meetings", "items": [{"title": "Design review", "detail": "3:00, 6 people"}, {"title": "1:1 with Sam", "detail": "3:00, moves to 4:00"}]}
  ],
  "sizes": {"medium": [0, 1, 2], "large": [0, 1, 2, 3]}
}
```

## Keep it fresh

When a new invite lands, and each morning. Go back to your last widget when it's solved.

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

**Move Sam** (`move`)

```json
{"widget": "schedule-clash", "kind": "button", "target": "move", "value": {"label": "Move Sam"}}
```

Move the meeting to the time shown, tell the other person, then show 'Moved. Sam's fine with 4:00'.

**Decline** (`decline`)

```json
{"widget": "schedule-clash", "kind": "button", "target": "decline", "value": {"label": "Decline"}}
```

Decline the meeting named, with a short note, and show the result.

**Keep** (`keep`)

```json
{"widget": "schedule-clash", "kind": "button", "target": "keep", "value": {"label": "Keep"}}
```

Do nothing. Don't bring this clash up again.

## Ask first

Before writing to more than one or two people.

For example:

```json
{"question": "Decline the design review? 6 people are going.", "kind": "decision", "options": ["Decline", "Keep it"], "risk": "medium"}
```

## Phone actions

Add the new time with a phone action only if you have no calendar connector.

## Edge cases

- No time works for both: offer the two least bad options instead.
- You can't see other people's calendars: say so, and offer to ask them.

## Never

Never move a meeting you don't own without telling the owner.

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