xmtplabs/xmtp-agent-examples / skills/managing-groups
managing-groups
VerifiedGroup 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.0 KB |
| rules/create-group.md | markdown | 1.3 KB |
| rules/members-add.md | markdown | 1.2 KB |
| rules/permissions-roles.md | markdown | 1.4 KB |
| rules/welcome-on-install.md | markdown | 2.2 KB |
rules/welcome-on-install.md
View on GitHub---
title: Send welcome on agent installation
impact: MEDIUM
tags: groups, welcome, installation, events
---
## Send welcome on agent installation
Use `dm` and `group` events to welcome users when they start a conversation.
**Welcome on new conversations:**
```typescript
import { Agent, Conversation, ConversationContext } from "@xmtp/agent-sdk";
// Shared welcome message function
async function sendWelcomeMessage(
ctx: ConversationContext<unknown, Conversation>
) {
await ctx.conversation.sendText(
"π Welcome! I'm your XMTP agent. How can I help you today?"
);
}
// Listen for new DM conversations
agent.on("dm", async (ctx) => {
await sendWelcomeMessage(ctx);
});
// Listen for new Group conversations
agent.on("group", async (ctx) => {
await sendWelcomeMessage(ctx);
});
```
**Welcome with inline actions:**
```typescript
async function sendWelcomeMessage(ctx: ConversationContext) {
const welcomeActions = ActionBuilder.create(
`welcome-${Date.now()}`,
"π Welcome! I'm your ETH price agent. What would you like to do?"
)
.add("get-current-price", "π° Get Current ETH Price")
.add("get-price-chart", "π Get Price with 24h Change")
.build();
await ctx.conversation.sendActions(welcomeActions);
}
```
See the [creating-inline-actions](../../creating-inline-actions/) skill for implementing `ActionBuilder`.
**Group gating example:**
```typescript
import { IdentifierKind } from "@xmtp/agent-sdk";
const GROUP_CONFIG = {
secretWord: "xmtp",
groupName: "Secret Group",
messages: {
welcome: "Hi! What's the secret passphrase?",
success: "π Correct! You've been added to the group.",
invalid: "β Invalid passphrase. Please try again.",
},
};
agent.on("dm", async (ctx) => {
await ctx.conversation.sendText(GROUP_CONFIG.messages.welcome);
});
agent.on("text", async (ctx) => {
if (ctx.message.content.toLowerCase() === GROUP_CONFIG.secretWord) {
const senderAddress = await ctx.getSenderAddress();
await group.addMembersByIdentifiers([{
identifier: senderAddress,
identifierKind: IdentifierKind.Ethereum,
}]);
await ctx.conversation.sendText(GROUP_CONFIG.messages.success);
} else {
await ctx.conversation.sendText(GROUP_CONFIG.messages.invalid);
}
});
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 471k | Updated | Claude CodeCodex | Verified | Install |
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |