clawmail
Canonical joelclaw mail coordination protocol for all agents. Use when announcing work, checking inboxes, reserving files, releasing locks, handling task handoffs, triaging stale reservations, or auditing coordination quality. Triggers on: 'clawmail', 'agent mail', 'joelclaw mail', 'reserve files', 'release locks', 'handoff', 'agent coordination', 'mail status', or any multi-agent collaboration workflow.
What this skill does
# Clawmail Canonical agent coordination contract for joelclaw. `joelclaw mail` is the **only** supported mail access surface for pi agents. Do not call `mcp_agent_mail` HTTP endpoints directly from agent prompts or role instructions. ## Interfaces ### Canonical interface - `joelclaw mail ...` (CLI) ### Pi wrapper tools (allowed, but still CLI-backed) These wrappers shell to `joelclaw mail` under the hood: | Tool | CLI equivalent | |------|----------------| | `mail_send` | `joelclaw mail send` | | `mail_inbox` | `joelclaw mail inbox` | | `mail_read` | `joelclaw mail read` | | `mail_reserve` | `joelclaw mail reserve` | | `mail_release` | `joelclaw mail release` | | `mail_status` | `joelclaw mail status` | ## Required Protocol (default for shared work) 1. **Check inbox before touching files** - `joelclaw mail inbox --agent <AgentName> --unread` 2. **Announce active scope** - `joelclaw mail send --from <AgentName> --to <AgentName|team> --subject "Starting: <work>" "intent + paths + expected output"` 3. **Reserve file paths before edits** - `joelclaw mail reserve --agent <AgentName> --paths "path/a.ts,path/b.ts" [--ttl-seconds 900]` 4. **If work runs long, renew reservation lease** - `joelclaw mail renew --agent <AgentName> --paths "path/a.ts" [--extend-seconds 900]` 5. **Send status/handoff updates during work** - `joelclaw mail send --subject "Status: ..." ...` 6. **Release reservations after commit/handoff** - `joelclaw mail release --agent <AgentName> --paths "..."` - or `--all` when done with all reserved paths ## Subject Taxonomy (for searchability + steering) Use these prefixes consistently: - `Starting:` — work start / intent announcement - `Task:` — handoff or assignment - `Status:` — progress update - `Blocked:` — dependency/incident requiring intervention - `Done:` — completion with artifact/commit IDs Daily steering uses these signals to detect protocol drift. ## Command Quick Reference ```bash # server + inbox health joelclaw mail status # register / refresh identity metadata joelclaw mail register --agent MaroonReef --program pi --model gpt-5.4 --task "interactive" # send a coordination message joelclaw mail send --from MaroonReef --to BlueFox --subject "Task: update prompt docs" "Please edit SYSTEM.md and roles/*.md" # inbox / read joelclaw mail inbox --agent MaroonReef --unread joelclaw mail read --agent MaroonReef --id 12 # reservations joelclaw mail reserve --agent MaroonReef --paths "SYSTEM.md,roles/interactive.md" --ttl-seconds 900 joelclaw mail renew --agent MaroonReef --paths "SYSTEM.md" --extend-seconds 900 joelclaw mail release --agent MaroonReef --paths "SYSTEM.md,roles/interactive.md" joelclaw mail release --agent MaroonReef --all # audit/search joelclaw mail locks joelclaw mail search --query "Starting:" ``` ## Reliability Checks ### Verify protocol health quickly ```bash joelclaw mail status joelclaw mail locks joelclaw mail search --query "Starting:" joelclaw mail search --query "Status:" ``` `joelclaw mail locks` should reflect active advisory file reservations from the local git-mailbox `file_reservations/` artifacts when that repo is available. This matters because the raw `/mail/api/locks` endpoint can under-report file reservations while still showing mailbox-internal archive/commit locks. ### If search is degraded (DB/tool errors) - Treat signal counts as unreliable. - Continue using protocol anyway (announce/reserve/release). - Escalate to mail backend health repair and log findings. ### If CLI flags are rejected unexpectedly - Your compiled `~/.bun/bin/joelclaw` may be stale relative to source. - Rebuild CLI from `packages/cli/src/cli.ts` and retry. ### If wrapper output says `ok: true` but the nested result contains an error - Treat the operation as failed. Some CLI paths can return a successful envelope while `result.result` or `result.raw` contains backend errors such as `Too many open files`, `Agent not found`, or stale project metadata. - Verify reservations/register/inbox calls by reading the nested result, not only the top-level `ok` flag. - Retry once if the backend says it freed cached repos; if it still fails, continue only for low-risk edits and report the coordination failure in the final summary. - For repeated `Too many open files. Freed 0 cached repos`, inspect `lsof -p $(pgrep -f 'mcp_agent_mail.*serve-http') | rg '\.(archive|commit)\.lock'`. The durable fix is in `joelhooks/mcp_agent_mail`: close orphaned lock FDs, avoid treating metadata-missing locks as immediately stale, and run `com.joelclaw.agent-mail` with `NumberOfFiles=8192` via `infra/agent-mail-daemon.sh` + `infra/launchd/com.joelclaw.agent-mail.plist`. ## Prompt Authoring Checklist (shore up prompts) Any prompt/role/system contract that mentions coordination should: 1. Reference **`clawmail`** as canonical protocol skill. 2. State that **mail access is via `joelclaw mail`** (wrappers allowed, direct MCP not allowed). 3. Include at minimum: inbox check, announce, reserve, release. 4. Require path context in coordination messages. 5. Encourage subject prefixes (`Starting:`, `Task:`, `Status:`, `Blocked:`, `Done:`). 6. Avoid filler about mail when no shared edits/coordination are involved. ## Steering Loop Integration `pi/extensions/session-lifecycle` runs a daily monitor+steer review and emits: - `agent-mail/steering.reviewed` Snapshot path: - `~/.joelclaw/workspace/agent-mail-steering/YYYY-MM-DD.json` Use steering hints to tighten protocol compliance when drift is detected. ## Related - `skills/agent-mail/SKILL.md` (compatibility alias) - `joelclaw mail --help` - ADR-0172: Agent Mail via MCP Agent Mail
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.