本文へ移動
cccskills
無料GitHub で公開

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.1 KB

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.

ChannelTransformation
WhatsApp**bold** → *bold*, *italic* → _italic_, headings → bold, links → text (url)
Telegramsame as WhatsApp, but [text](url) links are preserved (Markdown v1 renders them natively)
Slacksame as WhatsApp, but links become <url|text>
Discordpassthrough (Discord already renders Markdown)
Signalpassthrough 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 and parseSignalStyles(text) for Signal native rich text
  • src/router.ts — formatOutbound gains an optional channel parameter; when provided it calls parseTextStyles after stripping <internal> tags
  • src/index.ts — both outbound sendMessage paths pass channel.name to formatOutbound
  • src/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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Add /compact command for manual context compaction. Solves context rot in long sessions by forwarding the SDK's built-in /compact slash command. Main-group or trusted sender only.

日本語の概要は準備中です。原文の説明を表示しています。

nanocoai/nanoclaw-telegram102026年4月3日 更新

Add Discord bot channel integration to NanoClaw.

日本語の概要は準備中です。原文の説明を表示しています。

nanocoai/nanoclaw-telegram102026年4月3日 更新

add-emacs

無料

Add Emacs as a channel. Opens an interactive chat buffer and org-mode integration so you can talk to NanoClaw from within Emacs (Doom, Spacemacs, or vanilla). Uses a local HTTP bridge — no bot token or external service needed.

日本語の概要は準備中です。原文の説明を表示しています。

nanocoai/nanoclaw-telegram102026年4月3日 更新

add-gmail

無料

Add Gmail integration to NanoClaw. Can be configured as a tool (agent reads/sends emails when triggered from WhatsApp) or as a full channel (emails can trigger the agent, schedule tasks, and receive replies). Guides through GCP OAuth setup and implements the integration.

日本語の概要は準備中です。原文の説明を表示しています。

nanocoai/nanoclaw-telegram102026年4月3日 更新

Add image vision to NanoClaw agents. Resizes and processes WhatsApp image attachments, then sends them to Claude as multimodal content blocks.

日本語の概要は準備中です。原文の説明を表示しています。

nanocoai/nanoclaw-telegram102026年4月3日 更新

Add a macOS menu bar status indicator for NanoClaw. Shows a bolt icon with a green/red dot indicating whether NanoClaw is running, with Start, Stop, and Restart controls. macOS only.

日本語の概要は準備中です。原文の説明を表示しています。

nanocoai/nanoclaw-telegram102026年4月3日 更新

nanocoai のスキルをすべて見る

このスキルの問題を報告する