task-contextlisted
Install: claude install-skill educlopez/mallard
# task-context — Intervals task → ready-to-work
Single source of truth = **Intervals**. Google Workspace = **opt-in enricher only**. Never auto-search Gmail/Drive (wastes tokens on context that may not exist).
All Intervals calls use the `intervals` MCP tools. Gmail/Drive use the `gws` CLI via the helper script.
---
## Flow A — start a task: `/task <localid> [flags]`
### 1. Fetch
- `get_task(<localid>)` → core fields.
- `get_task_notes(taskId=<localid>)` → comments (real detail usually lives here).
- **Decode HTML entities** in `title`, `summary`, and note bodies — both named (`ó`→ó, `&`→&) and **numeric** (` `→newline, `'`→'). Notes commonly use ` ` for paragraph breaks.
### 2. Assess completeness (label only — no search)
If `summary` is empty AND notes are thin (< ~200 chars / no actionable detail), mark the brief:
```
⚠ thin — no actionable detail in Intervals. Run /task <localid> --enrich to pull Gmail/Drive context.
```
Do **not** search anything here. Enrich is explicit only.
### 3. Enrich — ONLY if `--enrich` was passed
Never triggered automatically. When invoked:
```bash
~/.claude/skills/task-context/scripts/gmail_search.sh "<client>" "<pm-owner>" "<keywords>"
```
- `<client>` = task `client` field; `<pm-owner>` = task `owners` field (the PM); `<keywords>` = 2–4 salient words from the title.
- The script prints compact JSON (from / date / subject / snippet). Fold the relevant lines into the brief with a one-line source note.