---
name: kickoff
description: Morning briefing — gathers open tasks, emails, unpaid invoices, timer status. Sends detailed email + short Telegram summary. Run daily or on demand.
allowed-tools: Bash(task-cli:*), Bash(idoklad-cli:*), mcp__gmail__*, mcp__nanoclaw__send_message
---

# Morning Kickoff Briefing

Compile a daily briefing from all work sources and deliver it as a detailed email + short Telegram summary.

## Step 1: Gather Data (run in parallel)

### Open Tasks

```bash
task-cli list -s todo,doing
```

Group by client. Tasks with status `doing` are in-progress; `todo` are queued.

### Email (last 24 hours)

```
mcp__gmail__search_emails(query: "newer_than:1d -label:arthur/processed", maxResults: 20)
```

For each result, note: sender, subject, thread ID, snippet. Build Gmail links: `https://mail.google.com/mail/u/0/#inbox/<thread_id>`

### Unpaid Invoices

```bash
idoklad-cli invoices --unpaid
```

Flag overdue invoices (past due date). Note total outstanding amount.

### Timer Status

```bash
task-cli current
task-cli summary -s $(date +%Y-%m-%d) -e $(date +%Y-%m-%d)
```

Check if a timer is already running and what it's tracking. Show today's time summary.

### Yesterday's Notes

Read `daily-notes/` for the most recent file to check for carry-over items.

## Step 2: Compile & Prioritize

From gathered data, build a priority list:

1. **Overdue invoices** — money waiting to be collected
2. **In-progress tasks** (`doing`) — currently active work
3. **Queued tasks** (`todo`) — sorted by client
4. **Unread emails** needing response
5. **Carry-over items** from yesterday's notes

## Step 3: Send Email

Use `mcp__gmail__create_draft` then `mcp__gmail__send_draft` to send an HTML email:

- **To:** `sutarik.peter@gmail.com`
- **Subject:** `Morning Briefing — YYYY-MM-DD`
- **Content type:** `text/html`

### Email Structure

```html
<h2>Top Priorities</h2>
<ol>
  <li><strong>Priority item</strong> — brief context</li>
</ol>

<h2>Open Tasks</h2>
<table>
  <tr><th>Client</th><th>Task</th><th>Status</th><th>Tags</th></tr>
  <tr>
    <td>ClientName</td>
    <td>Task title</td>
    <td>doing</td>
    <td>audit, implementation</td>
  </tr>
</table>

<h2>Inbox</h2>
<table>
  <tr><th>From</th><th>Subject</th><th>Received</th></tr>
  <tr>
    <td>sender@example.com</td>
    <td><a href="https://mail.google.com/mail/u/0/#inbox/THREAD_ID">Subject line</a></td>
    <td>Yesterday 3pm</td>
  </tr>
</table>

<h2>Unpaid Invoices</h2>
<table>
  <tr><th>Client</th><th>Invoice</th><th>Amount</th><th>Due</th><th>Status</th></tr>
  <tr>
    <td>ClientName</td>
    <td>#12345</td>
    <td>€2,400</td>
    <td>2026-02-15</td>
    <td><strong style="color:red">OVERDUE</strong></td>
  </tr>
</table>
<p><strong>Total outstanding:</strong> €X,XXX</p>

<h2>Timer</h2>
<p>Currently tracking: [description] for [client] (Xh Xm) — or "No timer running"</p>
```

Keep it scannable. Bold overdue items. Use red for overdue invoices. Omit empty sections.

## Step 4: Send Telegram Summary

Use `mcp__nanoclaw__send_message` to send a short summary:

```
*Morning Briefing — YYYY-MM-DD*

*Top priorities:*
• Priority 1
• Priority 2
• Priority 3

📬 X unread emails
🎫 X open tasks (Y in progress)
💰 X unpaid invoices (Y overdue)

Full briefing in your inbox ✉️
```

5-10 lines max. Only top 3-5 priorities.

## Step 5: Write Daily Note

Save to `daily-notes/YYYY-MM-DD.md`:

```markdown
# YYYY-MM-DD

## Priorities
- [ ] Priority 1
- [ ] Priority 2

## Open Tasks
- [ClientA] Task title — doing
- [ClientB] Task title — todo

## Pending Invoices
- Client — €X,XXX (due YYYY-MM-DD)

## Notes
(carry-over from yesterday, if any)
```

## Error Handling

- If a data source fails (e.g., iDoklad timeout, Gmail error), include what you have and note the failure in the email.
- Never skip the email — send whatever data was gathered successfully.
- Always send the Telegram summary, even if abbreviated.
