daily-agenda-templates.md16.1 KBView on GitHub
# Daily agenda templates

The daily agenda agent picks tasks and lists them. That is all it does, and it is doing it
correctly — flatness is what three separate documents currently order it to produce. This doc
proposes replacing "one flat shortlist" with **a small set of named templates**, one of which is
the default, each declaring its own titled sections and ordering rule.

Related: [agenda wiki](wiki/agenda.md) · [agenda-current-future-restructure](agenda-current-future-restructure.md)

## Current state

### What the agent actually produced

`user/agendas/current` today (read live, 2026-08-30):

```text
# 2026-08-24
- [ ] {taskId:"fd744316…",dueDate:"2026-08-24",conversationId:"585d606b…",reason:"Overdue — partner agreement terms need confirmation…"} Reply to Jackson Hou's partner agreement…
- [ ] {taskId:"083c6795…",dueDate:"2026-08-24",…} Send build-vs-buy reframe email to Robert…
- [ ] {taskId:"482ba949…",dueDate:"2026-08-19",…} Coordinate lead pipeline automation with Jason and Jesse
… 25 more rows …
```

28 rows. No summary paragraph. No headings below the date. `dueDate` runs from `2026-08-18` to
`2026-08-27` interleaved in no date order. The date heading says `2026-08-24` while the document
was last touched on the 30th. Nothing in the document tells the reader what kind of work any row
is, what is new, or what is late.

### Why it looks like that

The agent is obeying its instructions. Three documents independently forbid structure:

| File | Instruction |
|---|---|
| `apps/server/.claude/skills/daily-agenda/SKILL.md` | "**Emit flat rows only.** `indentLevel: 0`, no group headers, no nesting, and **no task-group sections**" |
| `apps/server/.claude/skills/documents/agenda-format.md` | "No task-group sections… No conversation header rows… No nesting. Every row is `indentLevel: 0`." |
| `apps/server/src/services/playbook/agent-defaults/daily-agenda.ts` | "No `groupHeader` rows, no nesting, no wrapper of any kind. You author no card structure whatsoever." |

Flatness was imposed deliberately, to undo an earlier version that sliced the agenda into the
user's task-group lanes and buried the ranking. The reaction removed *all* structure rather than
the wrong structure, and left ordering as the only signal the agent can send — which the live
document shows it is not sending either.

### The constraint that actually bites

"Proper titles" is **not currently expressible in the schema.** Two section nodes survive, and
neither carries free text:

- `TaskGroupSectionNode` (`content: 'taskGroupHeader (agendaTask | paragraph)*'`) — its title is
  resolved from a real task-group record via the `taskGroupId` attr (`use-task-group-data.ts`).
- `AgendaBandSectionNode` (`content: 'agendaBandHeader (taskGroupSection | agendaTask)*'`) — its
  title comes from a fixed five-value enum, `AGENDA_BAND_LABELS` in `types/agenda.ts`
  (`Tomorrow` / `Day after` / `Next week` / `Next month` / `Later`), and it is Future-doc only.

So a section titled "Drafts ready to send" has nowhere to store that string. A new node is
required; this is not a prompt-only change.

### What customers actually asked for

Searched all 1,239 synced meetings carrying AI notes (`crm_meeting_events.ai_notes`) for agenda,
task-tracking, morning-routine, prioritisation and grouping language. The structure customers
describe is remarkably consistent, and it is sectioned:

| Meeting | Date | What they described |
|---|---|---|
| Cedar <> Payroll Integrations — Mid Market | Aug 26 | "Cedar sends a daily agenda covering **calendar, emails, upcoming and past meetings, and HubSpot follow-ups**" |
| Liam // Cedar onboarding | Aug 27 | "Morning sweep… reviews the full pipeline and calendar, **flags urgent items, lists drafted emails ready to review, and lays out the day's meetings**" |
| Upgrade Jesse's Cedar/Slack workflow | Aug 27 | "**#tasks** — morning daily brief of tasks due that day, plus a **3 PM** brief of any tasks **created and due that same day**" |
| Jesse <> Karishma (Anthropic) | Jul 31 | "daily brief is curated to her specific accounts — focused on **where things have dropped with the customer and P0 items before anything else**" |
| Hey Telo // Cedar enablement | Aug 13 | Key gaps: "tasks don't auto-complete when emails are sent, completed tasks still show in the list, **no grouping by customer**" |
| **Cedar | Zach Concentrate AI** | **Jul 24** | "wants tasks ordered by **when they're due** — specifically: **what needs to go out by end of day, and what's needed before upcoming meetings** — not by deal size or task group"; "**removing task groups entirely and replacing them with filter buttons**… so everything lives in one flat, time-ordered list"; "**never uses the agenda view** because… **tasks aren't in any meaningful order — he sees items due next week mixed in with urgent ones**" |
| Zach // Cedar enablement | Aug 27 | "tasks, next steps, and recommendations **overlap and it's unclear what belongs where**"; wants "a single task list with a date and status field"; "**task statuses should reflect real-world state** — e.g. \"awaiting response from security officer\"… not just done/not done"; "**completed tasks should stay visible, grayed out or checked**" |
| Zach // Cedar enablement | Jul 31 | "**The biggest ask: a single consolidated, ranked task view rather than the current grouped-section layout**"; wants "due dates with explicit labels (e.g. \"3 days overdue\")… ranked by priority — revenue impact and recency of calls are his top signals" |
| James Dominguez and Jesse Li | May 19 | "an AI-prioritized task list **sorted by deal stage, ACV, and close likelihood**, with drafts ready to send" |
| Hamming // Cedar check-in | May 24 | 5 AM agent "will look at his tasks and open deals, **triage by priority**" |
| Adina // Cedar catch up | Jun 11 | "a **daily prioritized task list with one-click draft access**, rather than having to remember who to follow up with" |
| Luis // Cedar onboarding | Aug 17 | standout feedback on "the interactive **action buttons (snooze, defer, draft)** in the morning hit list" |
| Alyssa Reese and Isabelle | Aug 14 | tracks deals by "**starring email threads in Gmail** and reviewing them daily, plus a **pen-and-paper to-do list**" |
| Reform // Cedar check in | May 12 | "Brock currently **pulls tasks from HubSpot based on next steps** to build his daily list" |
| Cedar // Aspire data review | Aug 19 | "the daily agenda will **flag overdue follow-ups**" |
| Matt <> Cedar - Enablement | Aug 21 | "Isabelle… confirmed **the daily agenda is getting a revamp soon to be more comprehensive**" |

Three findings drive the design:

1. **Every description is a list of named buckets**, and the buckets recur: what's new, today's
   meetings, drafts waiting, what's owed, what's slipping. Nobody described a ranked flat list.
2. **The asks genuinely conflict.** Christopher wants grouping by customer; Zach wants one simple
   list and says the current complexity risks churn; Karishma wants dropped-ball-and-P0 first.
   No single layout satisfies all three — which is the argument for templates rather than one
   better default.
3. **"New today at the top" is already a live workflow.** Jesse's own `#tasks` channel runs a
   second 3 PM brief specifically for *tasks created and due the same day*, because the morning
   agenda has no way to surface them. That is the gap this doc closes as a cross-template rule.

## Proposed changes

### 1. Order by when it has to go out

The organising axis is **time to act**, not work type and not deal value. Zach named it twice in
one call — "ordered by when they're due… what needs to go out by end of day, and what's needed
before upcoming meetings" — and the live document fails exactly this test: due dates from Aug 18
to Aug 27 interleaved in no order, which is his "items due next week mixed in with urgent ones"
verbatim.

Three bands, today-scoped, each self-evident and non-overlapping:

| Band | Holds |
|---|---|
| Before your next meeting | Tasks tied to a calendar event later today. |
| By end of day | Everything else due today, and anything overdue. |
| This week | Due in the next seven days. |

Anything further out belongs to `user/agendas/future` and stays there.

### 2. Grouping becomes a filter, not a layout

Zach's actual proposal: "removing task groups entirely and replacing them with **filter buttons**
(e.g. post-meeting follow-ups, top deals, priorities) so everything lives in one flat,
time-ordered list."

This resolves the conflict in the evidence. Christopher wants grouping by customer; Zach wants no
categorical grouping at all. As a **layout** these are irreconcilable. As a **filter** they are the
same feature: chips above the list — `post-meeting`, `top deals`, `priorities`, `by account` — that
narrow the one time-ordered list without restructuring it. Nobody's default changes to serve
someone else's.

Filters are view state. They do not touch the document, which means the agent keeps writing one
ordered list and the layout question stops being the agent's problem.

### 3. Every row carries its own age

"Follow up with Dana — **3 days ago**". Zach asked for outstanding-age on the row in July and
again for explicit overdue labels ("3 days overdue") in his next call. With the list ordered by
time this is what makes the ordering legible rather than merely correct — the reader can see *why*
a row sits where it does.

New-today rows carry the same marker in the other direction, and sort to the top of their band.
That is your "things coming in today at the top", expressed on the axis that already orders
everything else.

### 4. Completed stays

"Completed tasks should stay visible, grayed out or checked, so users know what was actually done —
right now they disappear and Zach can't tell if something happened." He wants a **show-completed
toggle** and to reach past tasks by **scrolling up inline**, not through a separate section.

### 5. Templates get much thinner

With grouping demoted to a filter, a template no longer defines a section taxonomy. It selects:

- the **ordering rule** (time-to-act by default; a `hit-list` variant that ranks a single top-ten
  with no bands at all),
- which **filter chips are pinned**,
- and whether bands render at all.

`by-account` and `pipeline-sweep` from the first draft are not templates any more. They are filter
presets.

### 6. What this means for the schema

The first draft called for a new free-text section node. Ordering by time removes most of that
need: `AgendaBandSectionNode` already exists, already renders collapsible titled bands from a fixed
enum, and is already parsed and serialized on both sides. The change is to extend
`AGENDA_BAND_LABELS` with the three today-scoped bands and admit the node into the Current
document, rather than to invent a node.

A free-text section node is only required if a grouping that cannot be expressed as a time band
ever has to live **in the document**. Filters keep that out of the document, so this drops out of
scope.

### 7. Retire the three flat-rows-only instructions

`SKILL.md`, `agenda-format.md` and `daily-agenda.ts` are updated to require the time bands and the
age markers. The reason flatness was originally imposed — the agenda must not be sliced into the
user's task-group lanes — survives intact and is in fact strengthened: task groups do not appear in
the agenda at all, in any form.

## Unresolved

**Does deal value rank anything?** Zach contradicts himself a week apart. Jul 24: "Deal size isn't
a reliable proxy for follow-up priority for Zach — he wants tasks ordered by when action is
actually due, not by deal value." Jul 31: ranked by priority, "revenue impact and recency of calls
are his top signals." The Jul 24 statement is the more specific and he made it twice in that call,
so this proposal orders on time and leaves deal value out. Worth putting to him directly.

## Critical files

**Schema and render (mail)**
- `apps/mail/modules/agentCanvas/extensions/AgendaSectionNode.tsx` — new node.
- `apps/mail/modules/agentCanvas/extensions/TaskGroupSectionNode.tsx` — the pattern to copy: header child, `defining: true`, empty-section placeholder plugin, delete-swallowing keyboard shortcuts.
- `apps/mail/modules/agentCanvas/extensions/AgendaBandSectionNode.tsx` — the pattern for collapsible section chrome.
- `apps/mail/modules/agentCanvas/utils/agenda-markdown.ts` — client serializer; `case 'taskGroupSection'` at :354 shows the token shape.
- `apps/mail/modules/agentCanvas/extensions/ConversationRunDecorations.ts` — :144 already walks rows nested inside sections; the new node must be added to that set or conversation cards break inside sections.
- `apps/mail/modules/agentCanvas/components/AgendaDocument.tsx` — :1241 special-cases `taskGroupSection`.

**Parse and sync (server)**
- `apps/server/src/services/agenda/agenda-markdown.ts` — authoritative parser.
- `apps/server/src/services/document-saving/hooks/agenda-to-tasks.ts` — the diff back to `user_tasks`. Sections must be transparent to it: a row's identity is its `taskId`, never its container.
- `apps/server/src/services/document-saving/hooks/agenda-integrity.ts` — invariant checks.
- `apps/server/src/services/agenda/tasks-to-agenda.ts` — subtractive read-path reconcile; must not delete a section whose rows are all still open, and must remove a section left empty.

**Prompt and templates (server)**
- `apps/server/.claude/skills/daily-agenda/SKILL.md` — Step 6.
- `apps/server/.claude/skills/daily-agenda/templates/*.md` — new.
- `apps/server/.claude/skills/documents/agenda-format.md` — grammar reference.
- `apps/server/src/mastra/skills/tasks/daily-agenda.ts` — `getContextualInstructions`, second placeholder.
- `apps/server/src/services/playbook/agent-defaults/daily-agenda.ts` — Stage D.

## Implementation plan

### Phase 1 — Bands in the Current document
- [ ] Extend `AGENDA_BAND_LABELS` with `before-meeting` / `end-of-day` / `this-week`.
- [ ] Admit `agendaBandSection` into the Current document schema (it is Future-only today).
- [ ] Round-trip `{agendaBandSection,band:"end-of-day"}` through both `agenda-markdown.ts` files.
- [ ] Add the new node to `ConversationRunDecorations`' container set, or conversation cards break inside bands.
- [ ] Tests: a three-band document parses, renders and re-serializes unchanged.

### Phase 2 — Sync safety
- [ ] `agenda-to-tasks.ts`: a row nested in a band syncs identically to a top-level row.
- [ ] `tasks-to-agenda.ts`: drop a band once its last row goes inactive; never drop one holding a live row.
- [ ] Tests: complete every task in one band, confirm it disappears and its siblings survive.

### Phase 3 — Ordering and markers
- [ ] Rewrite Stage D of `daily-agenda.ts`, Step 6 of `SKILL.md`, and `agenda-format.md` around the three bands.
- [ ] Age marker on every row; new-today sorts to the top of its band.
- [ ] Tests: a task due next week never lands in `end-of-day`; an overdue task does.

### Phase 4 — Filters and completed
- [ ] Filter chips above the list: `post-meeting`, `top deals`, `priorities`, `by account`. View state only.
- [ ] Show-completed toggle; completed rows render greyed in place rather than disappearing.

### Phase 5 — Run it
- [ ] Run the agent end to end and confirm the written document renders and edits still write through to `user_tasks`.

## Verification

```bash
# Server — parser and sync
timeout 300 pnpm --filter @zero/server exec vitest run src/services/agenda
timeout 300 pnpm --filter @zero/server exec vitest run src/services/document-saving/hooks/__tests__

# Mail — node schema and decorations
pnpm --filter @zero/mail test -- tests/modules/agentCanvas

# Types
timeout 300 pnpm --filter @zero/server run types
timeout 300 pnpm --filter @zero/mail run types

# Headless: the assertion surface is the Y.js tree, never the markdown mirror
CEDAR_API_URL=http://localhost:8790 pnpm cedar-cli agenda tree current
```

Manual checks:

1. The three bands render and collapse, and no row sits in the wrong band.
2. A task created today sorts to the top of its band and shows its marker.
3. Checking a row inside a band marks its `user_tasks` row `done` and leaves it visible, greyed.
4. Two rows sharing a `conversationId` inside one band still fold into a single deal card.
5. A filter chip narrows the list without rewriting the document.