get-codelisted
Install: claude install-skill suxrobGM/jobpilot
# Get Verification Code
Return the most recent verification code (or magic link) for a given board domain. Output is a single JSON object on stdout — the caller parses it and fills the form. Argument is the board domain (`linkedin.com`, `workday.com`, etc.).
## Setup
Read `../shared/setup.md` to load `JOBPILOT_API`.
```bash
JOBPILOT_API=http://localhost:8000
BOARD_DOMAIN="$1"
```
## Phase 1: Confirm Mailbox Connected
```bash
curl -fsS "$JOBPILOT_API/api/email/account"
```
If `data.connected === false`, print exactly `{}` and exit. Caller falls back to asking the user.
## Phase 2: Trigger Sync
```bash
curl -fsS -X POST "$JOBPILOT_API/api/email/sync"
```
## Phase 3: Poll for the Code
Up to 6 attempts (~30s) looking for a verification message in the last 5 minutes:
```bash
for i in 1 2 3 4 5 6; do
RESULT=$(curl -fsS -G "$JOBPILOT_API/api/email/messages" \
--data-urlencode "classification=verification" \
--data-urlencode "domainHint=$BOARD_DOMAIN" \
--data-urlencode "since=$(date -u -d '5 minutes ago' +%FT%TZ 2>/dev/null || date -u -v-5M +%FT%TZ)")
COUNT=$(echo "$RESULT" | jq '.data | length')
if [ "$COUNT" -gt 0 ]; then break; fi
sleep 5
done
```
If still nothing, also look for unclassified messages whose body matches the board domain (Gmail may have arrived but `scan-inbox` hasn't classified it yet). Classify inline:
1. Read `data[0]` (most recent first).
2. Inspect `subject`, `fromAddress`, `snippet`, `rawBody`.
3. If it's not a real verificat