Skip to content
cccskills
FreePublished on GitHub

creating-inline-actions

Interactive button-based UI for XMTP agents following XIP-67. Use when creating menus, confirmation dialogs, selection options, or any button-based interaction. Triggers on inline actions, buttons, menus, or ActionBuilder.

The English summary is being prepared. Showing the original description.

See how to install

Files included (5)

  • SKILL.md4.0 KB
  • rules/builder-create.md1.2 KB
  • rules/config-menus.md1.5 KB
  • rules/helpers-confirmation.md947 B
  • rules/helpers-selection.md1.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

XMTP inline actions

Interactive button-based UI for XMTP agents following the XIP-67 specification. Users can tap buttons instead of typing commands.

When to apply

Reference these guidelines when:

  • Creating interactive button menus
  • Building confirmation dialogs
  • Implementing selection options
  • Setting up multi-menu navigation
  • Handling action callbacks

Rule categories by priority

PriorityCategoryImpactPrefix
1ActionBuilderCRITICALbuilder-
2HelpersHIGHhelpers-
3App ConfigMEDIUMconfig-
4ValidatorsMEDIUMvalidators-

Quick reference

ActionBuilder (CRITICAL)

  • builder-create - Create action menus with ActionBuilder
  • builder-send - Send actions to conversation

Helpers (HIGH)

  • helpers-confirmation - Send confirmation dialogs
  • helpers-selection - Send selection menus
  • helpers-navigation - Show navigation options

App Config (MEDIUM)

  • config-menus - Configure multi-menu applications
  • config-initialize - Initialize app from config

Validators (MEDIUM)

  • validators-inbox-id - Validate inbox ID format
  • validators-ethereum-address - Validate Ethereum address

Quick start

// 1. Add middleware to handle intent messages
agent.use(inlineActionsMiddleware);

// 2. Register action handlers
registerAction("my-action", async (ctx) => {
  await ctx.conversation.sendText("Action executed!");
});

// 3. Send interactive buttons
await ActionBuilder.create("my-menu", "Choose an option:")
  .add("my-action", "Click Me")
  .add("other-action", "Cancel")
  .send(ctx);

Implementation snippets

Action registry and handler:

import type { AgentMiddleware, MessageContext } from "@xmtp/agent-sdk";
import type { Intent } from "@xmtp/node-sdk";

type ActionHandler = (ctx: MessageContext) => Promise<void>;
const actionHandlers = new Map<string, ActionHandler>();

const registerAction = (id: string, handler: ActionHandler) => {
  actionHandlers.set(id, handler);
};

Inline actions middleware:

const inlineActionsMiddleware: AgentMiddleware = async (ctx, next) => {
  if (ctx.message.contentType?.typeId === "intent") {
    const intent = ctx.message.content as Intent;
    const handler = actionHandlers.get(intent.actionId);
    if (handler) await handler(ctx);
    else await ctx.conversation.sendText(`Unknown action: ${intent.actionId}`);
    return;
  }
  await next();
};

ActionBuilder class:

import { ActionStyle } from "@xmtp/node-sdk";

class ActionBuilder {
  private actions: { id: string; label: string; style?: ActionStyle }[] = [];
  constructor(private id: string, private description: string) {}
  
  static create(id: string, description: string) {
    return new ActionBuilder(id, description);
  }
  
  add(id: string, label: string, style?: ActionStyle) {
    this.actions.push({ id, label, style });
    return this;
  }
  
  async send(ctx: MessageContext) {
    await ctx.conversation.sendActions({
      id: this.id,
      description: this.description,
      actions: this.actions,
    });
  }
}

Confirmation helper:

const sendConfirmation = async (
  ctx: MessageContext, message: string,
  onYes: ActionHandler, onNo?: ActionHandler
) => {
  const ts = Date.now();
  registerAction(`yes-${ts}`, onYes);
  registerAction(`no-${ts}`, onNo || (async (c) => c.conversation.sendText("Cancelled")));
  await ActionBuilder.create(`confirm-${ts}`, message)
    .add(`yes-${ts}`, "Yes").add(`no-${ts}`, "No", ActionStyle.Danger).send(ctx);
};

How to use

Read individual rule files for detailed explanations:

rules/builder-create.md
rules/helpers-confirmation.md
rules/config-menus.md

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this 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.

The English summary is being prepared. Showing the original description.

xmtplabs/xmtp-agent-examples53Updated Feb 21, 2026

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.

The English summary is being prepared. Showing the original description.

xmtplabs/xmtp-agent-examples53Updated Feb 21, 2026

Patterns for handling commands, validating input, and filtering messages in XMTP agents. Use when implementing slash commands, validators, or message filters. Triggers on command handling, input validation, or type guards.

The English summary is being prepared. Showing the original description.

xmtplabs/xmtp-agent-examples53Updated Feb 21, 2026

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.

The English summary is being prepared. Showing the original description.

xmtplabs/xmtp-agent-examples53Updated Feb 21, 2026

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.

The English summary is being prepared. Showing the original description.

xmtplabs/xmtp-agent-examples53Updated Feb 21, 2026

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.

The English summary is being prepared. Showing the original description.

xmtplabs/xmtp-agent-examples53Updated Feb 21, 2026

See all skills by xmtplabs

Report a problem with this skill