substrate
This skill provides agent mail management via the Subtrate command center. Use when checking mail, sending messages to other agents, or managing agent identity.
What this skill does
# Subtrate Mail Management
Access the Subtrate mail system for agent-to-agent and user-to-agent communication.
## Prerequisites
Before using any substrate commands, verify the CLI is installed:
```bash
which substrate || echo "NOT INSTALLED"
```
If `substrate` is not found, install it from the plugin source directory:
```bash
cd "${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel)}" && make install
```
This builds both `substrate` (CLI) and `substrated` (daemon) and places them
in `$(go env GOPATH)/bin/`. Ensure that directory is in your PATH.
## Quick Reference
| Action | Command |
|--------|---------|
| Check inbox | `substrate inbox` |
| Send message | `substrate send --to <agent> --subject "..." --body "..."` |
| Read message | `substrate read <id>` |
| Reply | `substrate send --to <agent> --thread <id> --body "..."` |
| Search | `substrate search "query"` |
| Status | `substrate status` |
| Send diff | `substrate send-diff --to User --base main` |
| Request review | `substrate review request` |
| Review status | `substrate review status <id>` |
| Review issues | `substrate review issues <id>` |
| Web UI | Open http://localhost:8080 |
## Identity Management
Your agent identity persists across sessions and compactions. The identity is auto-created on first use and linked to your session.
```bash
substrate identity current # Show your agent name and ID
substrate identity ensure # Create identity if none exists
substrate identity save # Save state before compaction
substrate identity list # List all known agent identities
```
**How Identity Works**:
- First session: Auto-generates a memorable name (e.g., "GreenCastle")
- Session binding: Identity linked to your session ID
- Across compactions: PreCompact hook saves identity, SessionStart restores
- Per-project: Can have different identities per project directory
## Message Actions
```bash
substrate ack <id> # Acknowledge urgent message
substrate star <id> # Star for later
substrate snooze <id> --until "2h" # Snooze
substrate archive <id> # Archive
substrate trash <id> # Move to trash
```
## Sending Messages
```bash
# Direct message to another agent
substrate send --to AgentName --subject "Subject" --body "Message body"
# Reply to a thread
substrate send --to AgentName --thread <thread_id> --body "Reply text"
# Urgent message
substrate send --to AgentName --subject "Urgent" --body "..." --priority urgent
```
## Priority Handling
- **URGENT**: Address immediately - these may have deadlines
- **NORMAL**: Process in order received
- **LOW**: Can be deferred
## Agent Lifecycle (Hooks)
Subtrate integrates with Claude Code hooks:
- **SessionStart**: Heartbeat + check inbox
- **UserPromptSubmit**: Silent heartbeat + check for new messages
- **Stop**: Long-poll for 55s, block exit to keep agent alive (persistent agent pattern)
- **SubagentStop**: One-shot check, then allow exit
- **PreCompact**: Save identity state
The Stop hook keeps your main agent alive and continuously checking for work. Use Ctrl+C to force exit.
## Web UI
Open http://localhost:8080 to:
- View all agent inboxes
- Send messages between agents
- See agent status (active/idle/offline)
- Manage topics and subscriptions
## Sending Diffs
After making commits, send a diff to the User so they can review code changes
in the web UI with syntax highlighting:
```bash
substrate send-diff --to User --base main
```
The command auto-detects the current branch and computes a diff against the
base branch.
## Code Reviews
Request a code review to spawn Claude reviewer agents that analyze your diff:
```bash
# General review (default)
substrate review request
# Security-focused review
substrate review request --type security
# Architecture review
substrate review request --type architecture
# Check review status
substrate review status <id>
# View issues found
substrate review issues <id>
# Cancel a review
substrate review cancel <id>
```
Review types: `full` (default), `security`, `performance`, `architecture`.
## When to Check Mail
- At session start (automatic via hooks)
- Before major decisions
- When blocked waiting for input
- Before finishing tasks
- After completing work (others may have sent follow-up)
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.