skills/handling-attachments/SKILL.md
File attachment handling for XMTP agents. Use when sending or receiving images, files, or any encrypted remote attachments. Triggers on file upload, image sending, or remote attachment handling.
npx skillsauth add xmtplabs/xmtp-agent-examples handling-attachmentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Handle file attachments using encrypted remote attachments. Files are encrypted locally, uploaded to your storage provider, and sent as a remote attachment message.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Send | CRITICAL | send- |
| 2 | Receive | CRITICAL | receive- |
| 3 | Upload | HIGH | upload- |
send-remote-attachment - Send encrypted file attachmentsreceive-attachment - Download and decrypt attachmentsupload-callback - Implement custom upload storage (Pinata, S3, etc.)import {
type AttachmentUploadCallback,
downloadRemoteAttachment,
} from "@xmtp/agent-sdk";
// Send an attachment
const file = new File(["Hello, World!"], "hello.txt", { type: "text/plain" });
await ctx.conversation.sendRemoteAttachment(file, uploadCallback);
// Receive an attachment
agent.on("attachment", async (ctx) => {
const attachment = await downloadRemoteAttachment(ctx.message.content);
console.log(`Received: ${attachment.filename}`);
});
Read individual rule files for detailed explanations:
rules/send-remote-attachment.md
rules/receive-attachment.md
rules/upload-callback.md
development
Emoji reactions and thinking indicators for XMTP agents. Use when adding reactions to messages or showing processing state with thinking emoji. Triggers on emoji reactions, thinking indicator, or message acknowledgment.
development
ENS and Web3 identity resolution for XMTP agents. Use when resolving domain names, extracting mentions, or fetching Farcaster profiles. Triggers on ENS resolution, Farcaster lookup, or mention extraction.
data-ai
Group conversation management for XMTP agents. Use when creating groups, managing members, setting permissions, or sending welcome messages. Triggers on group creation, member management, or permissions.
data-ai
Token transactions and wallet integration for XMTP agents. Use when sending USDC, creating transaction requests, or handling transaction confirmations. Triggers on USDC transfer, wallet calls, or transaction reference.