skills$openclaw/building-agents
humanagent6.1k

by humanagent

building-agents – OpenClaw Skill

building-agents is an OpenClaw Skills integration for coding workflows. 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.

6.1k stars5.6k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namebuilding-agents
descriptionCore 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. OpenClaw Skills integration.
ownerhumanagent
repositoryhumanagent/xmtp-agentpath: building-agents
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @humanagent/xmtp-agent:building-agents
last updatedFeb 7, 2026

Maintainer

humanagent

humanagent

Maintains building-agents in the OpenClaw Skills directory.

View GitHub profile
File Explorer
8 files
building-agents
rules
events-lifecycle.md
866 B
events-text.md
913 B
middleware-basics.md
1.3 KB
middleware-command-router.md
1.2 KB
setup-environment.md
751 B
setup-from-env.md
1.1 KB
SKILL.md
2.8 KB
SKILL.md

name: building-agents description: 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. license: MIT metadata: author: xmtp version: "1.0.0"

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

PriorityCategoryImpactPrefix
1SetupCRITICALsetup-
2EventsHIGHevents-
3MiddlewareMEDIUMmiddleware-
4FiltersMEDIUMfilters-

Quick reference

Setup (CRITICAL)

  • setup-environment - Configure environment variables for agent
  • setup-from-env - Create agent using Agent.createFromEnv()
  • setup-manual - Manual agent creation with signer

Events (HIGH)

  • events-text - Handle text messages
  • events-lifecycle - Handle start/stop events
  • events-conversation - Handle new DM and group conversations
  • events-message-types - Handle different message types (reaction, reply, attachment)

Middleware (MEDIUM)

  • middleware-basics - Create and register middleware
  • middleware-error-handling - Handle errors in middleware chain
  • middleware-command-router - Use CommandRouter for slash commands

Filters (MEDIUM)

  • filters-message-types - Filter by message type
  • filters-sender - Filter out self-messages

Installation

npm install @xmtp/agent-sdk
# or
yarn add @xmtp/agent-sdk

Quick start

import { Agent } from "@xmtp/agent-sdk";
import { getTestUrl } from "@xmtp/agent-sdk/debug";

// Create agent using environment variables
const agent = await Agent.createFromEnv();

// Handle text messages
agent.on("text", async (ctx) => {
  await ctx.conversation.sendText("Hello from my XMTP Agent!");
});

// Log when ready
agent.on("start", () => {
  console.log(`Agent online: ${getTestUrl(agent.client)}`);
});

await agent.start();

Environment variables

VariablePurposeExample
XMTP_WALLET_KEYPrivate key for wallet0x1234...abcd
XMTP_DB_ENCRYPTION_KEYDatabase encryption key0xabcd...1234
XMTP_ENVNetwork environmentdev or production
XMTP_DB_DIRECTORYDatabase directory./data

How to use

Read individual rule files for detailed explanations:

rules/setup-environment.md
rules/events-text.md
rules/middleware-basics.md
README.md

No README available.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install building-agents?

Run openclaw add @humanagent/xmtp-agent:building-agents in your terminal. This installs building-agents into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/humanagent/xmtp-agent. Review commits and README documentation before installing.