Today's Agent Skill: Auto-Filing Inbox Attachments
What It Does
Attachments arrive buried in email threads and land nowhere — invoices, signed contracts, and screenshots all rot in the inbox until someone needs them urgently. Manual filing is the kind of work nobody schedules and everybody regrets skipping. This skill hands the job to an agent that reads, classifies, renames, and files every attachment on a predictable cadence.
How It Works
The agent scans a defined mail folder for messages carrying attachments, reads each file's content and its parent email context, then assigns a document type and canonical filename. It writes the file to a destination folder that matches the type, appends a one-line index entry to a running manifest, and tags the source email as filed so it never reprocesses the same message twice.
How to Deploy It
Drop the SKILL.md below into your agent's skills directory (for Claude Code, `~/.claude/skills/inbox-attachment-filer/SKILL.md`) and set the two path variables at the top of the Input section to your mail folder and archive root. Any SKILL.md-compatible agent with mail read access and filesystem write access will pick it up from the trigger phrases without further configuration.
SKILL.md — Ready to Deploy
## Description
Classifies, renames, and files email attachments into a structured archive, then maintains a searchable manifest of everything filed. Turns an unsorted inbox into a browsable document store without manual drag-and-drop.
## Trigger
Fires on: "file my attachments", "sort the inbox attachments", "archive these documents", "clean up my attachments", "where did that invoice go", "inbox-attachment-filer". Also fires on a scheduled run (daily or weekly) when configured as a cron task.
## Input
- `SOURCE_FOLDER` — mail folder to scan (default: Inbox)
- `ARCHIVE_ROOT` — destination directory for filed documents
- `LOOKBACK` — how far back to scan (default: 7 days)
- Optional: `TYPE_MAP` — custom document-type-to-subfolder mapping
## Steps
1. Query `SOURCE_FOLDER` for messages within `LOOKBACK` that carry attachments and lack the `filed` tag.
2. For each attachment, read the file content plus the parent email's subject, sender, and date.
3. Classify into a document type: invoice, receipt, contract, report, presentation, image, or other. Use content first, filename second — filenames lie.
4. Extract key metadata for the filename: counterparty name, document date, and ide
Copy the full SKILL.md and drop it into your agent's skills directory to activate this skill.