Skip to content

xmtplabs/xmtp-agent-examples / skills/sending-reactions

sending-reactions

Verified

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.

FileKindSize
SKILL.mdskill md1.7 KB
rules/patterns-thinking.mdmarkdown1.6 KB
rules/receive-reaction.mdmarkdown1.2 KB
rules/send-reaction.mdmarkdown1.1 KB

rules/patterns-thinking.md

View on GitHub
---
title: Thinking indicator pattern
impact: MEDIUM
tags: reactions, thinking, patterns, ux
---

## Thinking indicator pattern

Show users that your agent is processing by adding a thinking emoji reaction, then removing it when done.

**Basic pattern:**

```typescript
agent.on("text", async (ctx) => {
  // Add thinking reaction
  await ctx.conversation.sendReaction({
    reference: ctx.message.id,
    action: "added",
    content: "⏳",
    schema: "unicode",
  });

  try {
    // Simulate processing
    const response = await processMessage(ctx.message.content);
    
    // Send response
    await ctx.conversation.sendText(response);
  } finally {
    // Always remove thinking reaction
    await ctx.conversation.sendReaction({
      reference: ctx.message.id,
      action: "removed",
      content: "⏳",
      schema: "unicode",
    });
  }
});
```

**With helper function:**

```typescript
async function withThinking<T>(
  ctx: MessageContext,
  fn: () => Promise<T>
): Promise<T> {
  const reaction = {
    reference: ctx.message.id,
    content: "⏳",
    schema: "unicode" as const,
  };

  await ctx.conversation.sendReaction({ ...reaction, action: "added" });
  
  try {
    return await fn();
  } finally {
    await ctx.conversation.sendReaction({ ...reaction, action: "removed" });
  }
}

// Usage
agent.on("text", async (ctx) => {
  const response = await withThinking(ctx, async () => {
    return await processMessage(ctx.message.content);
  });
  
  await ctx.conversation.sendText(response);
});
```

**Alternative thinking emojis:**

- `⏳` - Hourglass (processing)
- `🤔` - Thinking face
- `💭` - Thought bubble
- `⚙️` - Gear (working)
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall