inbox-management
This skill automatically manages a Gmail inbox on a recurring schedule by archiving routine messages, flagging urgent items, drafting contextual replies without sending them, and identifying stale follow-ups needing responses. Use it to keep an inbox clean and organized over time, starting in flag-only mode that requires explicit user approval before advancing to autonomous archiving at higher trust levels. It never auto-sends replies and prioritizes user consent through a three-stage trust system.
git clone --depth 1 https://github.com/vellum-ai/vellum-assistant /tmp/inbox-management && cp -r /tmp/inbox-management/skills/inbox-management ~/.claude/skills/inbox-managementSKILL.md
# Inbox Management Skill
Companion to `inbox-cleanup`. Cleanup drains the backlog once. **Management keeps the inbox clean on a schedule** — archiving noise, flagging urgents, drafting replies, and catching stale follow-ups.
Runs as a **scheduled task** (via the `schedule` skill). Each run should be silent unless something is worth interrupting the user for.
> **Default posture:** high recall on noise archiving, high precision on user interruption. Archive aggressively on known-safe patterns. Ping sparingly. Never auto-send a reply. When unsure, flag instead of archiving.
---
## Trust Ladder
A single wrong archive of an important email kills trust. Earn autonomy in stages:
| Stage | Archive behavior | Draft behavior | Alerts |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ------------------- |
| **0 — Flag-only** (default) | Nothing archived. All archive calls use `--dry-run`. Summary shows what _would_ be archived for user review. | Drafts created in-thread, listed in summary. | Urgent scan active. |
| **1 — Standard** | Silent archive of known-safe categories only (calendar responses, no-reply, newsletters). Cold outreach still flagged. Batches > 1,000 ops auto-dry-run. | Drafts created in-thread, summarized per run. | Urgent scan active. |
| **2 — Aggressive** | Above + cold outreach archived by LLM judgment (default archive, flag only when relevant to user). All ops logged for reversal. | Same as Stage 1. | Urgent scan active. |
**Graduation requires the user to explicitly say "graduate me" or equivalent.** Do not infer from silence.
**Never auto-send a draft. No toggle for this rule.**
---
## Setup (one-time, before enabling schedule)
### 0. Informed consent
Before anything else, explain what the user is opting into. Be direct:
> "Here's what inbox management does: on a schedule you choose (e.g. every few hours on weekdays), I'll scan your inbox and take action based on a trust level you control.
>
> **Stage 0 (where everyone starts):** I watch but don't touch. I'll tell you what I _would_ archive, show you draft replies I wrote, and flag urgent items — but I won't move or delete anything. This lasts until you explicitly tell me to graduate.
>
> **Stage 1 (you opt in):** I silently archive obvious noise — calendar responses, no-reply senders, newsletters. Everything else is still flagged for your review.
>
> **Stage 2 (you opt in):** I also archive cold outreach using my judgment. Higher autonomy, slightly higher risk of a wrong call.
>
> At every stage: I will never send an email on your behalf. I create drafts for you to review. You can pause or stop this at any time."
Wait for explicit confirmation before proceeding. If the user hesitates or asks clarifying questions, answer them — don't rush past this step.
### 1. Stage
Start at **Stage 0**. Store via `gmail-prefs.ts --action set-management-config --stage 0`.
### 2. Safe-list
Ask for senders/domains that may look like outreach but matter. Seed categories:
- Financial advisors, lawyers, accountants
- Active investors and VCs
- Customer domains
- Family/personal contacts
- Paid subscriptions (billing addresses)
Store via `gmail-prefs.ts --action add-safelist --emails "..."`. The safe-list is shared with `inbox-cleanup`.
### 3. Interrupt threshold
Default urgency bar for alerts:
- Customer at risk (churn, renewal, escalation)
- Investor/board with time-sensitive ask
- Legal/compliance deadline
- Team member flagging urgency
- Explicit markers ("EOD today", "ASAP", "urgent") from real humans
Store threshold level via `gmail-prefs.ts --action set-management-config --interrupt-threshold "default"`.
### 4. Schedule
Create a recurring schedule via `schedule_create`:
- Default: `0 */3 * * 1-5` (every 3 hours on weekdays)
- Message: `"Load the inbox-management skill and run the inbox management pipeline."`
- Mode: `execute`
- Set `reuse_conversation: true` for context accumulation across runs
Confirm cadence with user. Overnight: urgent-scan only.
### 5. Voice profile
Run `messaging_analyze_style` on the user's recent sent mail. Store the style profile in the Personal Knowledge Base for draft generation.
### 6. Draft preference
Confirm the user wants drafts generated. Some prefer flag-only forever.
---
## Pipeline (each scheduled run)
Each step is silent unless something qualifies for interrupt. Run these in order.
### Step 0: Missed-run check & resume
**Resume interrupted runs first.** Before starting a new pipeline pass, check `bun run scripts/gmail-runs.ts list`. If the most recent run has `status: "interrupted"`, resume it via `bun run scripts/gmail-archive.ts archive --resume "<run-id>"` before proceeding. Also run `bun run scripts/gmail-runs.ts prune` to clean up logs older than 30 days.
Read the last-run timestamp via `gmail-prefs.ts --action get-management-config`. If `last-run` is more than 2x the scheduled interval ago (e.g. >6 hours for a 3-hour schedule), notify the user:
- **Slack:** "📬 Inbox management hasn't run since [time]. I'm catching up now."
- **No Slack:** In-app notification.
Then update `last-run` to now via `gmail-prefs.ts --action set-management-config --last-run "..."` before continuing.
### Step 1: Archive known noise (Stage 1+ only)
Run these queries via `gmail-archive.ts --action archive --query "..."` and bulk archive results:
```
subject:(Accepted: OR Declined: OR Tentative: OR "has accepted" OR "has declined") in:inbox
from:(noreply OR no-reply OR donotreply) i>
>
>
>
Check Vellum Assistant architecture and package boundaries. Use when editing imports, moving code, adding endpoints, touching assistant/gateway/client/skill boundaries, or reviewing architecture-sensitive changes.
Review Vellum Assistant code changes for correctness, repo-specific quality rules, security risks, and missing validation. Use when reviewing diffs, preparing a PR, finishing implementation work, or when the user asks for a code review, quality pass, or pre-merge check in this repository.
Guide Vellum Assistant feature flag changes and rollout hygiene. Use when adding, editing, reviewing, or documenting assistant feature flags, rollout-gated behavior, or platform flag follow-up work.
Validate Vellum Assistant database and workspace migrations. Use when adding, editing, reviewing, or testing migrations, release-note migrations, persisted schemas, workspace file formats, or data backfills.