xmtplabs/xmtp-agent-examples/building-agents
Claude Code and agent skill by xmtplabs/xmtp-agent-examples
- community
Checking that the SKILL.md file is still in the repository.
Core XMTP Agent SDK setup and patterns. Use when creating new agents, handling messages, setting up middleware, or configuring environment variables. Triggers on agent setup, XMTP configuration, message handling, or middleware implementation.
Install
npx vskill@latest install xmtplabs/xmtp-agent-examples/building-agentsSKILL.md
XMTP agent basics
Build event-driven, middleware-powered messaging agents on the XMTP network using the @xmtp/agent-sdk.
When to apply
Reference these guidelines when:
- Creating a new XMTP agent
- Setting up environment variables
- Handling text messages and events
- Implementing middleware
- Using filters and context helpers
Rule categories by priority
| Priority | Category | Impact | Prefix | |
|---|---|---|---|---|
| 1 | Setup | CRITICAL | setup- | |
| 2 | Events | HIGH | events- | |
| 3 | Middleware | MEDIUM | middleware- | |
| 4 | Filters | MEDIUM | filters- |
Quick reference
Setup (CRITICAL)
setup-environment- Configure environment variables for agentsetup-from-env- Create agent using Agent.createFromEnv()setup-manual- Manual agent creation with signer
Events (HIGH)
events-text- Handle text messagesevents-lifecycle- Handle start/stop eventsevents-conversation- Handle new DM and group conversationsevents-message-types- Handle different message types (reaction, reply, attachment)
Middleware (MEDIUM)
middleware-basics- Create and register middlewaremiddleware-error-handling- Handle errors in middleware chainmiddleware-command-router- Use CommandRouter for slash commands
Filters (MEDIUM)
filters-message-types- Filter by message typefilters-sender- Filter out self-messages
Installation
SDK 2.0+ uses unified exports: import everything from @xmtp/agent-sdk (no /debug, /middleware, /user, /util subpaths).
Quick start
Environment variables
| Variable | Purpose | Example | |
|---|---|---|---|
XMTP_WALLET_KEY | Private key for wallet | 0x1234...abcd | |
XMTP_DB_ENCRYPTION_KEY | Database encryption key | 0xabcd...1234 | |
XMTP_ENV | Network environment | dev or production | |
XMTP_DB_DIRECTORY | Database directory | ./data |
How to use
Read individual rule files for detailed explanations:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/building-agents/SKILL.md
Popularity
- Repository stars
- 52
- Repository forks
- 23
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 13 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/xmtplabs/xmtp-agent-examples/building-agents)