A small Rust CLI + agent skill that lets coding agents (pi, Claude Code, Cursor, …) write emails in your voice by learning from (draft → final) revision pairs you make.
The CLI just stores pairs and lessons in SQLite and surfaces them. All the reasoning (deriving voice rules from diffs) happens in the agent session via the bundled email-voice skill — no LLM call leaves your agent.
cargo install --path .Puts the email-learn binary on your PATH (in ~/.cargo/bin).
The skill lives in skills/email-voice/SKILL.md. Symlink it into your agent's global skills directory:
# pi
ln -s "$PWD/skills/email-voice" ~/.pi/agent/skills/email-voiceThen any pi agent can load it by name (email-voice) and follow its workflows.
- DB defaults to
~/.email-learn/emails.db— global, shared across all projects so your voice lessons accumulate everywhere. - Override with
EMAIL_LEARN_DB=/abs/path/emails.db.
email-learn add <draft> <final> --context "<one line>" --tags a,b # store a pair → prints id
email-learn show <id> # draft + final + diff as JSON
email-learn recent [N] # N most recent pairs (default 10)
email-learn lessons [--tags a,b] # stored voice lessons
email-learn add-lesson <pair_id> "<lesson>" --tags a,b # record a derived rule
email-learn query "<needle>" # LIKE search pairs + lessons
email-learn export # everything as one markdown dump
- You give the agent a draft you wrote and the version you actually sent.
- The agent stores the pair, reads the diff, and derives 1–3 specific voice lessons (word swaps, structural moves, tone shifts, things you never do).
- Next time you ask the agent to draft an email, it pulls
lessons,query, andrecentfirst and writes to your rules.
See skills/email-voice/SKILL.md for the full workflow and what counts as a good lesson.
MIT