customize
Scannednpx machina-cli add skill qwibitai/nanoclaw/customize --openclawNanoClaw Customization
This skill helps users add capabilities or modify behavior. Use AskUserQuestion to understand what they want before making changes.
Workflow
- Understand the request - Ask clarifying questions
- Plan the changes - Identify files to modify
- Implement - Make changes directly to the code
- Test guidance - Tell user how to verify
Key Files
| File | Purpose |
|---|---|
src/index.ts | Orchestrator: state, message loop, agent invocation |
src/channels/whatsapp.ts | WhatsApp connection, auth, send/receive |
src/ipc.ts | IPC watcher and task processing |
src/router.ts | Message formatting and outbound routing |
src/types.ts | TypeScript interfaces (includes Channel) |
src/config.ts | Assistant name, trigger pattern, directories |
src/db.ts | Database initialization and queries |
src/whatsapp-auth.ts | Standalone WhatsApp authentication script |
groups/CLAUDE.md | Global memory/persona |
Common Customization Patterns
Adding a New Input Channel (e.g., Telegram, Slack, Email)
Questions to ask:
- Which channel? (Telegram, Slack, Discord, email, SMS, etc.)
- Same trigger word or different?
- Same memory hierarchy or separate?
- Should messages from this channel go to existing groups or new ones?
Implementation pattern:
- Create
src/channels/{name}.tsimplementing theChannelinterface fromsrc/types.ts(seesrc/channels/whatsapp.tsfor reference) - Add the channel instance to
main()insrc/index.tsand wire callbacks (onMessage,onChatMetadata) - Messages are stored via the
onMessagecallback; routing is automatic viaownsJid()
Adding a New MCP Integration
Questions to ask:
- What service? (Calendar, Notion, database, etc.)
- What operations needed? (read, write, both)
- Which groups should have access?
Implementation:
- Add MCP server config to the container settings (see
src/container-runner.tsfor how MCP servers are mounted) - Document available tools in
groups/CLAUDE.md
Changing Assistant Behavior
Questions to ask:
- What aspect? (name, trigger, persona, response style)
- Apply to all groups or specific ones?
Simple changes → edit src/config.ts
Persona changes → edit groups/CLAUDE.md
Per-group behavior → edit specific group's CLAUDE.md
Adding New Commands
Questions to ask:
- What should the command do?
- Available in all groups or main only?
- Does it need new MCP tools?
Implementation:
- Commands are handled by the agent naturally — add instructions to
groups/CLAUDE.mdor the group'sCLAUDE.md - For trigger-level routing changes, modify
processGroupMessages()insrc/index.ts
Changing Deployment
Questions to ask:
- Target platform? (Linux server, Docker, different Mac)
- Service manager? (systemd, Docker, supervisord)
Implementation:
- Create appropriate service files
- Update paths in config
- Provide setup instructions
After Changes
Always tell the user:
# Rebuild and restart
npm run build
# macOS:
launchctl unload ~/Library/LaunchAgents/com.nanoclaw.plist
launchctl load ~/Library/LaunchAgents/com.nanoclaw.plist
# Linux:
# systemctl --user restart nanoclaw
Example Interaction
User: "Add Telegram as an input channel"
- Ask: "Should Telegram use the same @Andy trigger, or a different one?"
- Ask: "Should Telegram messages create separate conversation contexts, or share with WhatsApp groups?"
- Create
src/channels/telegram.tsimplementing theChannelinterface (seesrc/channels/whatsapp.ts) - Add the channel to
main()insrc/index.ts - Tell user how to authenticate and test
Source
git clone https://github.com/qwibitai/nanoclaw/blob/main/.claude/skills/customize/SKILL.mdView on GitHub Overview
Customize NanoClaw by adding capabilities or changing its behavior. This interactive skill asks clarifying questions to determine the desired changes before applying them, covering channels, triggers, integrations, routing, and other customizations.
How This Skill Works
Follow a four-step workflow: understand the request with targeted questions, plan the changes by identifying affected files, implement the changes directly in code, and provide testing guidance. It references key files such as src/index.ts (orchestrator), src/channels/whatsapp.ts, src/router.ts, src/config.ts, and groups/CLAUDE.md for per-group behavior.
When to Use It
- Add a new input channel (e.g., Telegram, Slack, email) to extend messaging options
- Change triggers or routing to adjust conversation flow and group routing
- Add an MCP integration (calendar, Notion, database, etc.) and configure access
- Modify deployment or environment settings (Docker, systemd, config paths)
- Adjust per-group behavior or persona by editing CLAUDE.md and related group files
Quick Start
- Step 1: Clarify requirements with AskUserQuestion to define channels, triggers, and integrations
- Step 2: Implement changes in code (e.g., add a new channel, adjust router, or configure MCP) following the patterns in the Skill
- Step 3: Rebuild and test end-to-end (npm run build, test messaging flows, verify routing and memory/group behavior)
Best Practices
- Ask clarifying questions first and confirm requirements before coding
- Identify all impacted files (e.g., src/index.ts, src/channels/*.ts, src/router.ts, src/config.ts, groups/CLAUDE.md)
- Follow the documented patterns for adding channels or integrations (create a new src/channels/{name}.ts and wire it in main())
- Test end-to-end by simulating messages and verifying onMessage, routing, and ownsJid behavior
- Document changes in groups/CLAUDE.md and provide setup/test instructions to the user
Example Use Cases
- Add Telegram as a new input channel by creating src/channels/telegram.ts and wiring it in src/index.ts
- Integrate an MCP service (e.g., calendar) by configuring MCP server settings and updating container docs
- Change assistant behavior by editing src/config.ts for triggers or persona in groups/CLAUDE.md
- Modify per-group routing rules by updating the group's CLAUDE.md and related processGroupMessages logic
- Update deployment: create or adjust systemd/service files and update paths in config for Docker or hosting environments