Agent skill
channel-formatting
Convert Claude's Markdown output to each channel's native text syntax before delivery. Adds zero-dependency formatting for WhatsApp, Telegram, and Slack (marker substitution). Also ships a Signal rich-text helper (parseSignalStyles) used by the Signal skill.
Install this agent skill to your Project
npx add-skill https://github.com/qwibitai/nanoclaw/tree/main/.claude/skills/channel-formatting
SKILL.md
Channel Formatting
This skill wires channel-aware Markdown conversion into the outbound pipeline so Claude's
responses render natively on each platform — no more literal **asterisks** in WhatsApp or
Telegram.
| Channel | Transformation |
|---|---|
**bold** → *bold*, *italic* → _italic_, headings → bold, links → text (url) |
|
| Telegram | same as WhatsApp, but [text](url) links are preserved (Markdown v1 renders them natively) |
| Slack | same as WhatsApp, but links become <url|text> |
| Discord | passthrough (Discord already renders Markdown) |
| Signal | passthrough for parseTextStyles; parseSignalStyles in src/text-styles.ts produces plain text + native textStyle ranges for use by the Signal skill |
Code blocks (fenced and inline) are always protected — their content is never transformed.
Phase 1: Pre-flight
Check if already applied
test -f src/text-styles.ts && echo "already applied" || echo "not yet applied"
If already applied, skip to Phase 3 (Verify).
Phase 2: Apply Code Changes
Ensure the upstream remote
git remote -v
If an upstream remote pointing to https://github.com/qwibitai/nanoclaw.git is missing,
add it:
git remote add upstream https://github.com/qwibitai/nanoclaw.git
Merge the skill branch
git fetch upstream skill/channel-formatting
git merge upstream/skill/channel-formatting
If there are merge conflicts on package-lock.json, resolve them by accepting the incoming
version and continuing:
git checkout --theirs package-lock.json
git add package-lock.json
git merge --continue
For any other conflict, read the conflicted file and reconcile both sides manually.
This merge adds:
src/text-styles.ts—parseTextStyles(text, channel)for marker substitution andparseSignalStyles(text)for Signal native rich textsrc/router.ts—formatOutboundgains an optionalchannelparameter; when provided it callsparseTextStylesafter stripping<internal>tagssrc/index.ts— both outboundsendMessagepaths passchannel.nametoformatOutboundsrc/formatting.test.ts— test coverage for both functions across all channels
Validate
npm install
npm run build
npx vitest run src/formatting.test.ts
All 73 tests should pass and the build should be clean before continuing.
Phase 3: Verify
Rebuild and restart
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# Linux: systemctl --user restart nanoclaw
Spot-check formatting
Send a message through any registered WhatsApp or Telegram chat that will trigger a response from Claude. Ask something that will produce formatted output, such as:
Summarise the three main advantages of TypeScript using bullet points and bold headings.
Confirm that the response arrives with native bold (*text*) rather than raw double
asterisks.
Check logs if needed
tail -f logs/nanoclaw.log
Signal Skill Integration
If you have the Signal skill installed, src/channels/signal.ts can import
parseSignalStyles from the newly present src/text-styles.ts:
import { parseSignalStyles, SignalTextStyle } from '../text-styles.js';
parseSignalStyles returns { text: string, textStyle: SignalTextStyle[] } where
textStyle is an array of { style, start, length } objects suitable for the
signal-cli JSON-RPC textStyles parameter (format: "start:length:STYLE").
Removal
# Remove the new file
rm src/text-styles.ts
# Revert router.ts to remove the channel param
git diff upstream/main src/router.ts # review changes
git checkout upstream/main -- src/router.ts
# Revert the index.ts sendMessage call sites to plain formatOutbound(rawText)
# (edit manually or: git checkout upstream/main -- src/index.ts)
npm run build
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
capabilities
Show what this NanoClaw instance can do — installed skills, available tools, and system info. Read-only. Use when the user asks what the bot can do, what's installed, or runs /capabilities.
status
Quick read-only health check — session context, workspace mounts, tool availability, and task snapshot. Use when the user asks for system status or runs /status.
slack-formatting
Format messages for Slack using mrkdwn syntax. Use when responding to Slack channels (folder starts with "slack_" or JID contains slack identifiers).
agent-browser
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use whenever a browser would be useful, not just when the user explicitly asks.
add-voice-transcription
Add voice message transcription to NanoClaw using OpenAI's Whisper API. Automatically transcribes WhatsApp voice notes so the agent can read and respond to them.
add-whatsapp
Add WhatsApp as a channel. Can replace other channels entirely or run alongside them. Uses QR code or pairing code for authentication.
Didn't find tool you were looking for?