# Automation Flow — iOS Shortcut Design

**Study:** Desirable Difficulty — Behavioral Design for Health Compliance
**Date:** 2024-01-15
**Design Outputs:** DO-001 (ritual protocol), DO-003 (SEQ capture), DO-008 (automation interaction design)

---

## Design Rationale

The pour-over ritual requires 9 sequential steps with variable durations. Two iOS Shortcuts were designed to keep the participant's hands free throughout the entire process — from grinding through logging.

### Interaction pattern: hybrid timer + voice checkpoint

| Mechanism                         | Used for                                                         | Why                                            |
| --------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------- |
| `Speak` (TTS)                     | Step instructions                                                | Hands are occupied with kettle, grinder, scale |
| `Wait` (fixed timer)              | Known-duration steps (grinding ≈ 180s, bloom ≈ 60s, pours ≈ 90s) | Prevents premature advancement                 |
| `Dictate Text` (voice checkpoint) | Variable-duration steps (weighing, rinsing, drawdown)            | Participant says "ready" when actually done    |

Fixed timers alone would either rush or stall the participant. Dictation checkpoints alone would skip the meditative wait that makes pour-over distinct. The hybrid gives structure to the steps that have natural timing and flexibility to the steps that don't.

### Shortcut chaining: Brew a Cup → Log a Cup

```
┌─────────────┐      ┌─────────────┐
│ Brew a Cup  │─────▶│ Log a Cup   │
│             │      │             │
│ 9 guided    │      │ 🎤 SEQ 1-5  │
│ brew steps  │      │ 🎤 Context  │
│ + CSV log   │      │ 🎤 Method   │
└─────────────┘      └─────────────┘
       │                    │
       ▼                    ▼
  brew-log.csv        cup-seq-log.csv
  (timestamp,         (timestamp,
   cup count)          context, method,
                       SEQ rating)
```

"Brew a Cup" handles the ritual and appends a row to `brew-log.csv` with the date and running cup count. It then chains to "Log a Cup" which captures the satisfaction rating (SEQ), context, and method via voice dictation — fully hands-free. Both shortcuts use Speak + Dictate Text exclusively; no taps required.

---

## Brew a Cup — Step Flow

```mermaid
flowchart TD
    START([Brew a Cup]) --> READ[Get file: brew-log.csv]
    READ --> COUNT[Count lines → totalCups]
    COUNT --> DATE[Current Date → today]
    DATE --> GREET>🔊 Lets go. Youve brewed totalCups so far.]

    GREET --> S1>🔊 Step 1: Start gooseneck boiler to 200°F]
    S1 --> D1{{🎤 Dictate: say ready}}

    D1 --> S2>🔊 Step 2: Weigh 20g whole bean]
    S2 --> W2[⏱ Wait 30s]
    W2 --> D2{{🎤 Dictate: say ready}}

    D2 --> S3>🔊 Step 3: Grind medium-coarse]
    S3 --> W3[⏱ Wait 180s]
    W3 --> D3{{🎤 Dictate: say ready}}

    D3 --> S4>🔊 Step 4: Rinse filter, prep dripper]
    S4 --> W4[⏱ Wait 30s]
    W4 --> D4{{🎤 Dictate: say ready}}

    D4 --> S5>🔊 Step 5: Add grounds, tare scale]
    S5 --> D5{{🎤 Dictate: say ready}}

    D5 --> S6>🔊 Step 6: Bloom — 40g water]
    S6 --> W6[⏱ Wait 60s]
    W6 --> D6{{🎤 Dictate: say ready}}

    D6 --> S7>🔊 Step 7: First pour to 130g at 1g/s]
    S7 --> W7[⏱ Wait 90s]
    W7 --> D7{{🎤 Dictate: say ready}}

    D7 --> S8>🔊 Step 8: Second pour to 320g at 2-3g/s]
    S8 --> W8[⏱ Wait 90s]
    W8 --> D8{{🎤 Dictate: say ready}}

    D8 --> S9>🔊 Step 9: Drawdown — watch it finish]
    S9 --> W9[⏱ Wait 120s]
    W9 --> D9{{🎤 Dictate: say ready}}

    D9 --> DONE>🔊 Done. Remove filter. Enjoy.]
    DONE --> LOG[Append to brew-log.csv]
    LOG --> CONFIRM>🔊 Cup number newTotal logged.]
    CONFIRM --> CHAIN([▶ Run: Log a Cup])
```

### Step detail

| Step | Action                                      | Timer | Checkpoint | 16:1 target |
| ---- | ------------------------------------------- | ----- | ---------- | ----------- |
| 1    | Start gooseneck boiler to 200°F             | —     | 🎤 Dictate | —           |
| 2    | Weigh 20g whole bean coffee                 | 30s   | 🎤 Dictate | 20g dose    |
| 3    | Grind medium-coarse (manual grinder)        | 180s  | 🎤 Dictate | —           |
| 4    | Rinse paper filter, discard, prep dripper   | 30s   | 🎤 Dictate | —           |
| 5    | Add grounds to filter, shake level, tare    | —     | 🎤 Dictate | —           |
| 6    | Bloom: pour 40g water (2× coffee weight)    | 60s   | 🎤 Dictate | 40g bloom   |
| 7    | First pour: slow circles center-out to 130g | 90s   | 🎤 Dictate | 130g        |
| 8    | Second pour: double rate to 320g            | 90s   | 🎤 Dictate | 320g total  |
| 9    | Drawdown: hands off, watch bed level        | 120s  | 🎤 Dictate | —           |

**Total target water:** 320g over 20g coffee = 16:1 ratio

---

## Log a Cup — Data Flow

Triggered automatically after "Brew a Cup" completes, or run standalone for non-pour-over cups. Fully voice-driven — no taps required.

```mermaid
flowchart TD
    START([Log a Cup]) --> DATE[Current Date]
    DATE --> FMT[Format → currentDateFormatted]
    FMT --> TS[Set timestamp]

    TS --> R>🔊 Rate this cup 1 to 5]
    R --> DR{{🎤 Dictate → seq}}

    DR --> C>🔊 Where? Home, work, or out.]
    C --> DC{{🎤 Dictate → context}}

    DC --> M>🔊 Method? Automatic, pour-over, or café.]
    M --> DM{{🎤 Dictate → method}}

    DM --> ROW[Text: timestamp, context, method, seq]
    ROW --> APPEND[Append to cup-seq-log.csv]
    APPEND --> CONFIRM>🔊 Logged. seq out of 5.]

    style START fill:#4A90D9,color:#fff,stroke:none
    style CONFIRM fill:#2D8A56,color:#fff,stroke:none
    style R fill:#2D8A56,color:#fff,stroke:none
    style C fill:#2D8A56,color:#fff,stroke:none
    style M fill:#2D8A56,color:#fff,stroke:none
```

| Step | Speak prompt                             | Captures               |
| ---- | ---------------------------------------- | ---------------------- |
| 1    | "Rate this cup 1 to 5"                   | `seq` (1–5 SEQ rating) |
| 2    | "Where? Home, work, or out."             | `context`              |
| 3    | "Method? Automatic, pour-over, or café." | `method`               |

Output row: `timestamp, context, method, seq` → appended to `cup-seq-log.csv`

---

## iCloud Install Links

| Shortcut   | Link                                                              |
| ---------- | ----------------------------------------------------------------- |
| Brew a Cup | https://www.icloud.com/shortcuts/b2189a9c309740f5b515dd5d55304907 |
| Log a Cup  | https://www.icloud.com/shortcuts/8194c38ee0fb4728ae3dbd6b2be83915 |
