# Riv Brief — Kade Infrastructure

**From:** Larry
**To:** Riv
**Date:** 2026-05-21
**Workspace:** Operate from `Team Inbox/`.

---

## Context

Kade is the new Personal Ops Assistant (replaced Qordinate). His persona is live at `Team/Kade/profile.md`. Read that first.

Master spec: `Team Inbox/2026-05-21 - Larry - Kade Build Master Spec.md`.

You have THREE workstreams. They can run in parallel. The Slack bridge depends on Atlas's API contract; the other two don't.

Atlas is building the tasks table + project FK + UI in parallel. Coordinate with him on the API shape — he'll post the contract within his first hour of work.

---

## Workstream 1 — Qordinate API Exporter

**Goal:** One-time tool that pulls everything out of Qordinate and seeds Atlas.

**Pull:**
- All open tasks (title, due date, recurring rule, priority, notes, created_at)
- All completion history (for adherence pattern analysis later)
- All recurring reminder definitions
- Any DND/quiet-hours config

**Map to Atlas schema** (see Atlas brief for fields). Set `source = "qordinate-import"` on every imported task.

**Project linking:** Try fuzzy match on task title against existing Atlas projects. Where matched, populate `project_id`. Where not matched, leave null and produce a "review unmatched" report for Jimmie.

**Credentials:** Jimmie will drop Qordinate API credentials in `Team Inbox/` (or share at next session). Not blocking until you reach this step.

**Optional safety net:** During the 14-day burn-in, run as a one-way sync — pull Qordinate changes into Atlas every hour. Switches off at cutover.

---

## Workstream 2 — Slack Bridge

**Goal:** Wire Kade's persona to actual Slack DMs with Jimmie.

**Functions to build:**

| Function | Slack mechanism | Atlas API used |
|---|---|---|
| Text message in DM → parse → write task | Slack Events API (`message` event) | `POST /tasks` |
| Voice memo → transcript → parse → write task | Slack file_share + Whisper or Slack's built-in transcript | `POST /tasks` |
| "X, Y, Z done" → batch complete | Message parsing | `POST /tasks/bulk-complete` |
| `/today` slash command | Slack slash command | `GET /tasks?status=open&...` |
| `/listfromhell` slash command | Slack slash command | `GET /tasks?status=open` (no cap) |
| `/done <task>` slash command | Slack slash command | `PATCH /tasks/:id` |
| Project inference | Pre-call to `GET /projects?match=...` before task create | both |

**The agent layer:** When Jimmie messages Kade, route the message into a Claude API call with Kade's system prompt (from `.claude/commands/kade.md`). Kade decides:
- Is this a new task? → write to Atlas
- Is this a completion? → mark done
- Is this a list request? → fetch and format
- Is this conversation? → respond in voice
- Project inference: which project, or create new

**Use prompt caching aggressively** — Kade's system prompt is large; cache it.

---

## Workstream 3 — Scheduler

**Goal:** Reliable delivery of recurring reminders, kick-in-the-pants nudges, and meds.

**Components:**

### Fixed-schedule reliability (the critical bar)
- Medications: Adderall morning, Adderall 11:45, Adderall afternoon, Buspar (twice), Metformin 5:30 PM
- Use **Slack /remind** for these — it's battle-tested and survives any custom-code issue
- Belt-and-suspenders: ALSO write these to your custom scheduler. If both fire, dedupe at delivery.

### Custom scheduler (for what /remind can't do)
- Multi-tier deadline nudging: 30d / 7d / 1d / day-of based on `due_date`
- DND-aware delivery: respect quiet windows, except for `dnd_critical = true`
- Recurring rules from `tasks.recurring_rule` JSON
- Pattern detection: "moved this 3 weeks running" → surface to Kade for nudge

### DND state
- Store DND state per user (`dnd_until` timestamp + scope)
- Kade can set via natural language ("shut up till 10pm except critical")
- Scheduler reads before every delivery

### Medication adherence tracking
- Log every med reminder fire + Jimmie's acknowledgment
- Surface pattern reports (weekly summary) when adherence dips
- Never auto-notify provider; just surface to Jimmie

---

## API Contract Dependency

Atlas posts the API contract to `Team Inbox/2026-05-22 - Atlas to Riv - Tasks API Contract.md` in his first hour. Wait for that before final-shaping the Slack bridge's task-write logic. The Qordinate exporter and scheduler scaffolding don't depend on it — start there.

---

## Acceptance Criteria

- Qordinate full export complete → Atlas seeded → unmatched-review report delivered to Jimmie
- Slack DM → task create works for text + voice memo
- Slash commands operational
- Scheduler fires meds reliably for 14 consecutive days during burn-in
- DND windows respected
- Voice register held (Kade sounds like Kade, not a templated bot)

---

## Status Updates

File status updates as:
`Team Inbox/2026-05-XX - Riv to Larry - Kade Infrastructure Status.md`

Flag blockers immediately. Especially flag anything affecting medication reliability — that's the gating criterion for cutover.

Kickoff: next session.

— Larry
