xmtplabs/xmtp-agent-examples / skills/resolving-domains
resolving-domains
VerifiedENS 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.9 KB |
| rules/extract-mentions.md | markdown | 1.4 KB |
| rules/profiles-farcaster.md | markdown | 1.5 KB |
| rules/resolve-address.md | markdown | 1.3 KB |
rules/extract-mentions.md
View on GitHub---
title: Extract @mentions from text
impact: HIGH
tags: mentions, parsing, extract
---
## Extract @mentions from text
Use `extractMentions` to find all mentions in a message.
**Basic extraction:**
```typescript
import { extractMentions } from "../../utils/resolver";
const message = "Hey @vitalik.eth and @dwr, check this out!";
const mentions = extractMentions(message);
// Returns: ["vitalik.eth", "dwr"]
```
**Supported formats:**
```typescript
// @domain.eth
extractMentions("Hello @vitalik.eth"); // ["vitalik.eth"]
// @username (becomes username.farcaster.eth when resolving)
extractMentions("Hello @fabri"); // ["fabri"]
// Standalone domain.eth
extractMentions("Check vitalik.eth"); // ["vitalik.eth"]
// Shortened addresses in groups
extractMentions("@0xabc5…f002"); // ["0xabc5…f002"]
// Full addresses
extractMentions("Send to 0x1234567890abcdef..."); // ["0x1234..."]
```
**Resolve all mentions:**
```typescript
import { resolveMentionsInMessage } from "../../utils/resolver";
const message = "Send 10 USDC to @vitalik.eth";
const members = await ctx.conversation.members();
const resolved = await resolveMentionsInMessage(message, members);
// Returns: { "vitalik.eth": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }
```
**Filter subdomains:**
The function automatically filters parent domains when subdomains are present:
- If `"byteai.base.eth"` exists, `"base.eth"` is filtered out
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 |