Agent skill

jmap-email

Enables JMAP email operations using Node.js and jmap-jam library. Use when working with JMAP email servers, FastMail, Cyrus IMAP, Stalwart Mail Server, or when user mentions email search, reading, sending, or mailbox management.

Stars 4
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/jacobrask/claude-skills/tree/main/skills/jmap-email

SKILL.md

JMAP Email Access

Access JMAP email servers (FastMail, Cyrus IMAP, Stalwart) using pre-built scripts.

Prerequisites

Environment variables must be set before launching Claude Code:

  • JMAP_SESSION_URL - JMAP server session URL
  • JMAP_BEARER_TOKEN - Authentication bearer token
  • JMAP_ACCOUNT_ID - Account ID (optional, auto-detected)

Available Scripts

Choose the right script:

  • Browse recent emails? → Use list-emails.ts (supports --unread, --flagged, --mailbox, --from, --limit filters)
  • Search by sender? → Use list-emails.ts --from "sender@example.com"
  • Search for multiple keywords? → Use search-keywords.ts keyword1 keyword2 ...
  • Get full email content? → Use get-email.ts with email ID
  • View folder structure? → Use list-mailboxes.ts
  • Move emails by ID? → Use move-by-ids.ts --mailbox <name> <id1> <id2> ...
  • Delete emails? → Use delete-emails.ts <id1> <id2> ...

All scripts support --help for detailed usage.

Common Tasks

Browse unread emails

bash
node scripts/list-emails.ts --unread
node scripts/list-emails.ts --unread --limit 50

Find emails from specific sender

bash
node scripts/list-emails.ts --from "sender@example.com"
node scripts/list-emails.ts --from "sender@example.com" --unread

Search for receipts or specific content

bash
node scripts/search-keywords.ts "invoice" "receipt" "order confirmation"
node scripts/search-keywords.ts --mailbox "Archive" --limit 10 "meeting" "agenda"

Note: Search shows previews only. For full email content, use get-email.ts with the email ID.

Get full email content

bash
node scripts/get-email.ts <email-id>

Organize emails (classification workflow)

  1. Search for candidates: search-keywords.ts "keyword1" "keyword2"
  2. Review previews and identify relevant email IDs
  3. (Optional) View full content: get-email.ts <email-id>
  4. Move to target mailbox: move-by-ids.ts --mailbox @MailboxName id1 id2 id3

Interactive email triage

Workflow for processing new emails with learning:

  1. Fetch recent emails:

    • Use list-emails.ts --limit 20 to get batch (optionally add --unread or --mailbox "Inbox")
    • Review subject, sender, and preview
  2. Present classification options:

    • Use AskUserQuestion with multiSelect for each email
    • Options should be target mailboxes (Inbox, Archive, @Reference, etc.)
    • Allow user to select destination for each email
  3. Execute moves:

    • Group emails by target mailbox
    • Use move-by-ids.ts --mailbox <name> <id1> <id2> ... for each group
  4. Save routing patterns to memory:

    • Note sender domains and subjects that map to specific mailboxes
    • Record user's classification decisions (e.g., "newsletters from X → Archive")
    • Reference these patterns in future triage sessions
    • Suggest automatic routing rules based on observed patterns

Benefits:

  • Process inbox in batches with interactive guidance
  • Build up routing knowledge over time
  • Suggest classifications based on past decisions
  • Gradually automate common routing patterns

View mailbox structure

bash
node scripts/list-mailboxes.ts

Output Format

Scripts output compact, human-readable results:

Found 5 email(s) (unread)
================================================================================

⭐ [UNREAD] Meeting tomorrow
From: John Doe <john@example.com>
Date: 1/15/2024, 10:30:45 AM
ID: StrgucNsyw-3
Preview: Hi Jane, let's meet at 2pm to discuss the project...
--------------------------------------------------------------------------------

Advanced Usage

For writing custom JMAP operations or understanding the API, see:

  • Code Examples: examples.md
  • API Reference: reference.md
  • Development Guide: DEVELOPMENT.md

Expand your agent's capabilities with these related and highly-rated skills.

jacobrask/claude-skills

calendar

Interact with Apple Calendar via AppleScript. Use when the user asks to check calendar, view events, create events, manage schedule, find free time, or list calendars. Triggers include "my calendar", "my schedule", "calendar events", "create event", "add to calendar", "what's on my calendar", "free time", "available slots", "upcoming events", "today's events". Requires macOS with Calendar.app.

4 0
Explore
jacobrask/claude-skills

safari-tabs

Interact with Safari browser tabs, reading list, bookmarks, and history via AppleScript. Use when the user asks to analyze, organize, summarize, deduplicate, close, export, or manage their Safari tabs. Also handles reading list, bookmarks, and history searches. Triggers include "my tabs", "open tabs", "Safari tabs", "clean up my browser", "what tabs do I have open", "organize my tabs", "too many tabs", "reading list", "bookmarks", "browser history", "export tabs". Requires macOS with Safari.

4 0
Explore
jacobrask/claude-skills

knowledge-base

Manage your personal knowledge base of curated resources, bookmarks, and excerpts. Triggers include "knowledge base", "kb", "add to knowledge", "add tabs to", "what do I have on", "what do we know about", "find resources about". Use with safari-tabs skill for bulk ingestion from Safari windows. Location is ~/knowledge/.

4 0
Explore
mattpocock/skills

edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

111,310 9,758
Explore
mattpocock/skills

obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

111,310 9,758
Explore
mattpocock/skills

setup-pre-commit

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

111,310 9,758
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results