NanoClaw 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/config.ts |
Assistant name, trigger pattern, directories |
src/index.ts |
Message routing, WhatsApp connection, agent invocation |
src/db.ts |
Database initialization and queries |
src/types.ts |
TypeScript interfaces |
src/whatsapp-auth.ts |
Standalone WhatsApp authentication script |
.mcp.json |
MCP server configuration (reference) |
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:
- Find/add MCP server for the channel
- Add connection and message handling in
src/index.ts
- Store messages in the database (update
src/db.ts if needed)
- Ensure responses route back to correct channel
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 to the
mcpServers config in src/index.ts
- Add tools to
allowedTools array
- Document 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:
- Add command handling in
processMessage() in src/index.ts
- Check for the command before the trigger pattern check
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
launchctl unload ~/Library/LaunchAgents/com.nanoclaw.plist
launchctl load ~/Library/LaunchAgents/com.nanoclaw.plist
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?"
- Find Telegram MCP or library
- Add connection handling in index.ts
- Update message storage in db.ts
- Tell user how to authenticate and test
1---2name: customize3description: Add new capabilities or modify NanoClaw behavior. Use when user wants to add channels (Telegram, Slack, email input), change triggers, add integrations, modify the router, or make any other customizations. This is an interactive skill that asks questions to understand what the user wants.4---5
6# NanoClaw Customization
7
8This skill helps users add capabilities or modify behavior. Use AskUserQuestion to understand what they want before making changes.
9
10## Workflow
11
121. **Understand the request** - Ask clarifying questions
132. **Plan the changes** - Identify files to modify
143. **Implement** - Make changes directly to the code
154. **Test guidance** - Tell user how to verify
16
17## Key Files
18
19| File | Purpose |
20|------|---------|
21| `src/config.ts` | Assistant name, trigger pattern, directories |
22| `src/index.ts` | Message routing, WhatsApp connection, agent invocation |
23| `src/db.ts` | Database initialization and queries |
24| `src/types.ts` | TypeScript interfaces |
25| `src/whatsapp-auth.ts` | Standalone WhatsApp authentication script |
26| `.mcp.json` | MCP server configuration (reference) |
27| `groups/CLAUDE.md` | Global memory/persona |
28
29## Common Customization Patterns
30
31### Adding a New Input Channel (e.g., Telegram, Slack, Email)
32
33Questions to ask:
34- Which channel? (Telegram, Slack, Discord, email, SMS, etc.)
35- Same trigger word or different?
36- Same memory hierarchy or separate?
37- Should messages from this channel go to existing groups or new ones?
38
39Implementation pattern:
401. Find/add MCP server for the channel
412. Add connection and message handling in `src/index.ts`
423. Store messages in the database (update `src/db.ts` if needed)
434. Ensure responses route back to correct channel
44
45### Adding a New MCP Integration
46
47Questions to ask:
48- What service? (Calendar, Notion, database, etc.)
49- What operations needed? (read, write, both)
50- Which groups should have access?
51
52Implementation:
531. Add MCP server to the `mcpServers` config in `src/index.ts`
542. Add tools to `allowedTools` array
553. Document in `groups/CLAUDE.md`
56
57### Changing Assistant Behavior
58
59Questions to ask:
60- What aspect? (name, trigger, persona, response style)
61- Apply to all groups or specific ones?
62
63Simple changes → edit `src/config.ts`
64Persona changes → edit `groups/CLAUDE.md`
65Per-group behavior → edit specific group's `CLAUDE.md`
66
67### Adding New Commands
68
69Questions to ask:
70- What should the command do?
71- Available in all groups or main only?
72- Does it need new MCP tools?
73
74Implementation:
751. Add command handling in `processMessage()` in `src/index.ts`
762. Check for the command before the trigger pattern check
77
78### Changing Deployment
79
80Questions to ask:
81- Target platform? (Linux server, Docker, different Mac)
82- Service manager? (systemd, Docker, supervisord)
83
84Implementation:
851. Create appropriate service files
862. Update paths in config
873. Provide setup instructions
88
89## After Changes
90
91Always tell the user:
92```bash
93# Rebuild and restart
94npm run build
95launchctl unload ~/Library/LaunchAgents/com.nanoclaw.plist
96launchctl load ~/Library/LaunchAgents/com.nanoclaw.plist
97```
98
99## Example Interaction
100
101User: "Add Telegram as an input channel"
102
1031. Ask: "Should Telegram use the same @Andy trigger, or a different one?"
1042. Ask: "Should Telegram messages create separate conversation contexts, or share with WhatsApp groups?"
1053. Find Telegram MCP or library
1064. Add connection handling in index.ts
1075. Update message storage in db.ts
1086. Tell user how to authenticate and test