scan-inboxlisted
Install: claude install-skill suxrobGM/jobpilot
# Scan Inbox — Triage Pending Email
Classify recent email and link each thread to an existing `Application` when there's a confident match. This skill does **not** write `StageEvent` rows or mutate `Application.stage` — the user approves from `/inbox`, that's where state changes happen.
## Setup
Follow `../shared/setup.md`.
```bash
JOBPILOT_API=http://localhost:8000
```
## Phase 1: Confirm Mailbox Connected
```bash
curl -fsS "$JOBPILOT_API/api/email/account"
```
If `data.connected === false`, stop:
> No email account is connected. Open `/profile` → **Email** and connect a Gmail account, then re-run `scan-inbox`.
## Phase 2: Pick the Queue
**One message** — an id was passed (a re-scan from the inbox table). Fetch just it and classify it again even if it's already classified or reviewed:
```bash
curl -fsS "$JOBPILOT_API/api/email/messages/<id>"
```
**All pending** — no argument. Sync, then pull the unscanned queue:
```bash
curl -fsS -X POST "$JOBPILOT_API/api/email/sync"
curl -fsS "$JOBPILOT_API/api/email/messages?reviewStatus=pending&classification=null"
```
If `data` is empty: **"Inbox is already triaged. Nothing new to classify."** and exit.
The rest of the skill runs over whatever you fetched. A re-scan overwrites the classification and resets `reviewStatus`, but never undoes an approved stage move.
## Phase 3: Classify
For each message, pick one classification:
| Classification | When