Get the FREE Ultimate OpenClaw Setup Guide →

customize

npx machina-cli add skill crypdick/pynchy/customize --openclaw
Files (1)
SKILL.md
3.8 KB

NanoClaw Customization

This skill helps users add capabilities or modify behavior. Use AskUserQuestion to understand what they want before making changes.

Workflow

  1. Understand the request - Ask clarifying questions
  2. Plan the changes - Identify files to modify
  3. Implement - Make changes directly to the code
  4. Test guidance - Tell user how to verify

Key Files

FilePurpose
src/index.tsOrchestrator: state, message loop, agent invocation
src/channels/whatsapp.tsWhatsApp connection, auth, send/receive
src/ipc.tsIPC watcher and task processing
src/router.tsMessage formatting and outbound routing
src/types.tsTypeScript interfaces (includes Channel)
src/config.tsAssistant name, trigger pattern, directories
src/db.tsDatabase initialization and queries
src/whatsapp-auth.tsStandalone WhatsApp authentication script
groups/CLAUDE.mdGlobal 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:

  1. Create src/channels/{name}.ts implementing the Channel interface from src/types.ts (see src/channels/whatsapp.ts for reference)
  2. Add the channel instance to main() in src/index.ts and wire callbacks (onMessage, onChatMetadata)
  3. Messages are stored via the onMessage callback; routing is automatic via ownsJid()

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:

  1. Add MCP server config to the container settings (see src/container-runner.ts for how MCP servers are mounted)
  2. 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:

  1. Commands are handled by the agent naturally — add instructions to groups/CLAUDE.md or the group's CLAUDE.md
  2. For trigger-level routing changes, modify processGroupMessages() in src/index.ts

Changing Deployment

Questions to ask:

  • Target platform? (Linux server, Docker, different Mac)
  • Service manager? (systemd, Docker, supervisord)

Implementation:

  1. Create appropriate service files
  2. Update paths in config
  3. 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"

  1. Ask: "Should Telegram use the same @Andy trigger, or a different one?"
  2. Ask: "Should Telegram messages create separate conversation contexts, or share with WhatsApp groups?"
  3. Create src/channels/telegram.ts implementing the Channel interface (see src/channels/whatsapp.ts)
  4. Add the channel to main() in src/index.ts
  5. Tell user how to authenticate and test

Source

git clone https://github.com/crypdick/pynchy/blob/main/docs/_archive/old-nanoclaw-skills/customize/SKILL.mdView on GitHub

Overview

Customize NanoClaw by adding new input channels (e.g., Telegram, Slack, email), altering triggers, integrating new tools, or tweaking the router and behavior. It uses an interactive AskUserQuestion flow to clarify exactly what you want before implementing code changes.

How This Skill Works

Workflow: Understand the request by asking clarifying questions, plan changes by identifying affected files, then implement modifications directly in the code. Changes typically touch core files like src/index.ts, src/router.ts, and src/channels/{name}.ts, following documented customization patterns.

When to Use It

  • Add a new input channel (Telegram, Slack, email)
  • Change triggers, routing, or memory/group behavior
  • Add or modify MCP integrations (calendars, Notion, databases)
  • Add new commands or adjust per-group behavior
  • Change deployment or service setup and testing

Quick Start

  1. Step 1: Understand the request and ask clarifying questions
  2. Step 2: Plan the changes by identifying affected files to modify
  3. Step 3: Implement changes and test, following the After Changes guidance

Best Practices

  • Create src/channels/{name}.ts implementing Channel and reference src/channels/whatsapp.ts for guidance
  • Add the channel to main() in src/index.ts and wire callbacks (onMessage, onChatMetadata)
  • Messages flow via onMessage; routing is automatic via ownsJid()
  • Document changes in groups/CLAUDE.md for persona or per-group behavior
  • Rebuild and restart after changes using npm run build and the provided restart steps

Example Use Cases

  • Add Telegram as an input channel
  • Add MCP integration for Google Calendar
  • Change the trigger for a specific group to a different word
  • Modify router to route messages to a new group based on channel
  • Update deployment setup (Docker/systemd) and test the changes

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers