---
name: rocketchat-mentions
description: Automatically identify and format user mentions within a Rocket.Chat message.
metadata:
nanobot:
emoji: 💬
category: communication
tags: [rocketchat, mentions, formatting]
---
## Rocket.Chat Mentions Skill
This skill identifies and formats user mentions within a text string, specifically for use in Rocket.Chat. It assumes mentions are formatted as `@username`.
**Instructions for the Agent:**
1. **Input:** The skill receives a single string as input, representing the text message to be processed.
2. **Pattern Matching:** Use a regular expression to find all occurrences of the pattern `@\w+`. This pattern matches the "@" symbol followed by one or more alphanumeric characters (representing the username).
3. **Formatting:** For each match found:
* Replace the matched string (e.g., `@username`) with a Markdown link formatted as `[username](https://rocket.chat/user/username)`. Replace "username" with the actual username extracted from the match. *Note: This assumes a standard Rocket.Chat user profile URL structure. Adjust the URL if necessary.*
4. **Output:** Return the modified string with the user mentions formatted as Markdown links.
**Example:**
* **Input:** `Hey @john.doe, can you help me with this? Also, @jane.smith, what do you think?`
* **Output:** `Hey [john.doe](https://rocket.chat/user/john.doe), can you help me with this? Also, [jane.smith](https://rocket.chat/user/jane.smith), what do you think?`
**Error Handling:**
* If the input is not a string, return an error message: "Invalid input: Input must be a string."
* If no mentions are found, return the original input string unchanged.
* If the regular expression fails to match, return the original input string unchanged.
Use this skill with your AI agent:
Open on Skill Issue to copy, download, or add to your library.
Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.