# Supafax Inbox Triage

> Apply an ordered set of triage rules to an inbox fixture and categorize each email into an action — reply, archive, unsubscribe, calendar, or review — with the matching rule's reason. Use this skill whenever you need to batch-process a raw inbox and produce an actionable triage report without touching an email provider.

- Skill: `riteshkew/supafax-inbox-triage` (Agent Skill, multi-file: 9 files)
- Install (CLI): `npx skillmds@latest add riteshkew/supafax-inbox-triage`
- Raw SKILL.md: https://api.skillmd.com/api/skills/riteshkew/supafax-inbox-triage/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: riteshkew (https://skillmd.com/u/riteshkew)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/riteshkew/supafax-inbox-triage

---


# Workflow

When this skill triggers, follow these steps in order.

## Step 1 — Locate the rules file

Check whether the user has specified a rules JSON path.

- If a path is provided, confirm the file exists and is readable.
- If no path is provided, ask: "Please provide the path to your rules JSON file. Each rule must have a `match` object (with optional `from`, `subjectContains`, `bodyContains`, `hasUnsubscribe` fields), an `action` (`reply` | `archive` | `unsubscribe` | `calendar` | `review`), and a `reason` string. See `examples/rules.json` for a working example."
- If the user has no rules, offer to generate starter rules based on their described inbox patterns before proceeding.

## Step 2 — Locate the inbox file

Check whether the user has specified an inbox JSON path.

- If a path is provided, confirm the file exists and contains at least one email object with `id`, `from`, `subject`, and `body` fields.
- If no path is provided, ask: "Please provide the path to your inbox JSON file. Each email must have `id`, `from`, `subject`, and `body` fields, plus an optional `hasUnsubscribe` boolean. See `resources/inbox.json` for a working example."

## Step 3 — Run the triage engine

Execute the triage engine from the skill root:

```bash
node scripts/triage.mjs <rulesFile> <inboxFile>
```

The engine outputs a Markdown report to stdout with:
- A per-email table: `id | from | subject | action | reason`
- A summary count per action

Capture stdout. If the process exits non-zero, surface the stderr message to the user and stop.

## Step 4 — Report the triage results

Present the output table and summary to the user. For each action bucket, comment on what it means:

- **reply** — these emails need a response; act on them today.
- **archive** — low-value mail filed away; no action needed.
- **unsubscribe** — subscriptions to remove to reduce future noise.
- **calendar** — meeting invites or events that need to be scheduled or confirmed.
- **review** — nothing matched; these need human judgment before acting.

Highlight any `review` emails first — they are the highest-priority items because no rule has claimed them.

### Output format

```
## Triage Results

| ID | From | Subject | Action | Reason |
|----|------|---------|--------|--------|
...

## Summary
| Action | Count |
|--------|-------|
...
```

## Example

See `examples/input.md` for a worked inbox scenario and `examples/output.md` for the full triage report produced by the engine.

Run the example yourself from the skill root:

```bash
cd skills/supafax-inbox-triage
bash examples/run.sh
```

