add-whatsapp
БесплатноБез исполняемых скриптовНе проверенAdd WhatsApp as a channel. Can replace other channels entirely or run alongside them. Uses QR code or pairing code for authentication.
от sliamh11★ 50 звёзд на GitHubОб этом скилле
Add WhatsApp Channel
This skill adds WhatsApp support to Deus. It builds the local MCP packages, registers the channel, and guides through authentication.
IMPORTANT: Do NOT add git remotes, fetch from external repos, or install npm packages from the public registry during this skill. All channel code is already in the repo under packages/ and src/channels/.
Phase 1: Pre-flight
Recovery: If something goes wrong in Phase 1, simply re-run the skill from the beginning.
Check current state
Check if WhatsApp is already configured. If store/auth/ exists with credential files, skip to Phase 4 (Registration) or Phase 5 (Verify).
ls store/auth/creds.json 2>/dev/null && echo "WhatsApp auth exists" || echo "No WhatsApp auth"
Detect environment
Check whether the environment is headless (no display server):
-z "$DISPLAY" && -z "$WAYLAND_DISPLAY" && "$OSTYPE" != darwin* && echo "IS_HEADLESS=true" || echo "IS_HEADLESS=false"
Ask the user
Use AskUserQuestion to collect configuration. Adapt auth options based on environment:
If IS_HEADLESS=true AND not WSL → AskUserQuestion: How do you want to authenticate WhatsApp?
- Pairing code (Recommended) - Enter a numeric code on your phone (no camera needed, requires phone number)
- QR code in terminal - Displays QR code in the terminal (can be too small on some displays)
Otherwise (macOS, desktop Linux, Windows, or WSL) → AskUserQuestion: How do you want to authenticate WhatsApp?
- QR code in terminal (Recommended) - Displays QR code in the terminal
- Pairing code - Enter a numeric code on your phone (no camera needed, requires phone number)
If they chose pairing code:
AskUserQuestion: What is your phone number? (Include country code without +, e.g., 1234567890)
Phase 2: Build Local Packages
Recovery: If the build fails, fix the error and re-run from Phase 2. No need to redo Phase 1.
The WhatsApp channel is a local MCP server in packages/. Build the packages in order (core first, then whatsapp):
cd packages/mcp-channel-core && npm install && npm run build && cd ../..
cd packages/mcp-whatsapp && npm install && npm run build && cd ../..
Configure environment
Add ASSISTANT_HAS_OWN_NUMBER to .env if not already present:
ASSISTANT_HAS_OWN_NUMBER=false
Validate
npm run build
Build must be clean before proceeding.
Phase 3: Authentication
Recovery: If authentication fails, delete
store/auth/and re-run from Phase 3. Phases 1-2 do not need to be repeated.
Clean previous auth state (if re-authenticating)
rm -rf store/auth/
Run WhatsApp authentication
The auth script is at scripts/whatsapp-auth.ts. It uses baileys from the mcp-whatsapp workspace package.
For QR code in terminal:
npx tsx scripts/whatsapp-auth.ts
(Bash timeout: 120000ms)
Tell the user:
A QR code will appear in the terminal.
- Open WhatsApp > Settings > Linked Devices > Link a Device
- Scan the QR code displayed in the terminal
- Wait for "Authentication successful!" message
If the QR code is cut off or doesn't display: The auth script writes raw QR data to store/qr-data.txt. Render it manually:
node -e "require('qrcode-terminal').generate(require('fs').readFileSync('store/qr-data.txt','utf-8').trim(), {small: true})"
For pairing code:
Tell the user to have WhatsApp open on Settings > Linked Devices > Link a Device, ready to tap "Link with phone number instead" — the code expires in ~60 seconds and must be entered immediately.
Run the auth process in the background and poll store/pairing-code.txt for the code:
rm -f store/pairing-code.txt && npx tsx scripts/whatsapp-auth.ts --pairing-code --phone <their-phone-number> > /tmp/wa-auth.log 2>&1 &
Then immediately poll for the code (do NOT wait for the background command to finish):
for i in $(seq 1 50); do [ -f store/pairing-code.txt ] && cat store/pairing-code.txt && break; sleep 0.2; done
Display the code to the user the moment it appears. Tell them:
Enter this code now — it expires in ~60 seconds.
- Open WhatsApp > Settings > Linked Devices > Link a Device
- Tap Link with phone number instead
- Enter the code immediately
After the user enters the code, poll for authentication to complete:
for i in $(seq 1 120); do grep -q 'AUTH_STATUS: authenticated' /tmp/wa-auth.log 2>/dev/null && echo "authenticated" && break; grep -q 'AUTH_STATUS: failed' /tmp/wa-auth.log 2>/dev/null && echo "failed" && break; sleep 0.5; done
If failed: qr_timeout → re-run. logged_out → delete store/auth/ and re-run. 515 → re-run. timeout → ask user, offer retry.
Verify authentication succeeded
test -f store/auth/creds.json && echo "Authentication successful" || echo "Authentication failed"
Configure environme
Установить add-whatsapp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл add-whatsapp?
Add WhatsApp as a channel. Can replace other channels entirely or run alongside them. Uses QR code or pairing code for authentication.
Как установить скилл add-whatsapp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-whatsapp запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic