{"id":"customize","name":"customize","summary":"新しい能力の追加やNanoClawの挙動修正。ユーザーがチャンネル(Telegram、Slack、メール入力)を追加したり、トリガーを変更したり、連携を追加したり、ルーターを改造したり、その他のカスタマイズをしたいときに使えます。","body":"# NanoClaw Customization\n\nThis skill helps users add capabilities or modify behavior. Use AskUserQuestion to understand what they want before making changes.\n\n## Workflow\n\n1. **Understand the request** — Ask clarifying questions.\n2. **Prefer a dedicated skill** — If a skill covers the request, invoke it instead of editing core by hand:\n   - Channels: `/add-telegram`, `/add-slack`, `/add-discord`, `/add-whatsapp`, `/add-signal`, `/add-imessage`, and the rest of the `/add-<channel>` family.\n   - Wiring channels to agents and isolation levels: `/manage-channels`.\n   - Container directory access: `/manage-mounts`.\n   - Agent providers (non-default): `/add-opencode`, `/add-codex`, `/add-ollama-provider`.\n   - MCP tools: `/add-ollama-tool`, `/add-atomic-chat-tool`.\n3. **Plan the changes** — Identify the v2 surface the change belongs to (entity model in the central DB, per-agent-group container config, per-group `CLAUDE.md`, or core code).\n4. **Implement** — Make the change on the right surface.\n5. **Test guidance** — Tell the user how to verify.\n\n## Entity Model\n\nCustomizations route through the v2 entity model: users → messaging groups → agent groups → sessions. A messaging group is one chat/channel on one platform; an agent group holds the workspace, personality, and container config; a wiring links a messaging group to an agent group with a session mode and trigger rules. Inspect and edit all of this with the `ncl` admin CLI. See `docs/isolation-model.md` for the three isolation levels.\n\n## Key Files\n\n| File | Purpose |\n|------|---------|\n| `src/index.ts` | Entry point: init DB, migrations, channel adapters, delivery polls, sweep, shutdown |\n| `src/router.ts` | Inbound routing: messaging group → agent group → session → `inbound.db` → wake |\n| `src/delivery.ts` | Polls `outbound.db`, delivers via adapter, handles system actions |\n| `src/session-manager.ts` | Resolves sessions; opens `inbound.db` / `outbound.db`; heartbeat path |\n| `src/container-runner.ts` | Spawns per-agent-group containers with session DB + outbox mounts, OneCLI `ensureAgent` |\n| `src/channels/` | Channel adapter infra (registry, Chat SDK bridge); specific adapters install from the `channels` branch |\n| `src/config.ts` | Process-level config (assistant name, paths, timeouts) read from `.env` |\n| `data/v2.db` | Central DB: users, roles, agent_groups, messaging_groups, wirings, container_configs |\n| `data/v2-sessions/<session>/` | Per-session `inbound.db` (host→container) + `outbound.db` (container→host) |\n| `groups/<folder>/CLAUDE.md` | Per-agent-group memory/persona and instructions |\n\nFor ad-hoc DB queries, use `pnpm exec tsx scripts/q.ts <db> \"<sql>\"`.\n\n## Common Customization Patterns\n\n### Adding a New Input Channel (e.g., Telegram, Slack, Email)\n\nQuestions to ask:\n- Which channel? (Telegram, Slack, Discord, WhatsApp, Signal, email, etc.)\n- Should this channel reach an existing agent group or a new one?\n- What isolation level — share an agent group with other channels, or keep it separate?\n- Same trigger rules as other channels on that agent group, or different?\n\nImplementation:\n1. Run the matching install skill (`/add-telegram`, `/add-slack`, …). It fetches the adapter from the `channels` branch, wires the registration import, installs the pinned package, and builds.\n2. Run `/manage-channels` (or use `ncl messaging-groups` + `ncl wirings`) to create the messaging group, choose the isolation level, and wire it to an agent group with a session mode and trigger rules.\n\n### Adding a New MCP Integration\n\nQuestions to ask:\n- What service? (Calendar, Notion, database, etc.)\n- What operations are needed? (read, write, both)\n- Which agent group should have access?\n\nImplementation:\n- If a dedicated `/add-<service>-tool` skill exists, run it — it wires the MCP server and routes credentials through OneCLI so no raw keys reach the container.\n- Otherwise wire the MCP server into the agent group's container config with either `--command <cmd> [--args <json-array>] [--env <json-object>]` for stdio or `--url <url>` for Streamable HTTP (HTTPS, or plain HTTP for localhost / host.docker.internal): `ncl groups config add-mcp-server --id <group-id> --name <name> ...`. Then run `ncl groups restart --id <group-id>` to take effect. From inside a container the agent uses the `add_mcp_server` self-mod tool, which requires one admin approval.\n\n### Changing Assistant Behavior\n\nQuestions to ask:\n- What aspect? (persona, response style, instructions)\n- Apply to one agent group or several?\n\nImplementation:\n- Persona, instructions, and personality live per agent group in `groups/<folder>/CLAUDE.md` — edit that file for the target group.\n- Container runtime behavior (provider, model, packages, MCP servers) lives in the `container_configs` table: `ncl groups config get/update --id <group-id>`.\n\n### Adding New Commands\n\nQuestions to ask:\n- What should the command do?\n- Which agent group(s)?\n- Does it need new MCP tools?\n\nImplementation:\n- The agent interprets requests naturally — add instructions to the agent group's `groups/<folder>/CLAUDE.md`.\n- For routing or trigger changes (which messages wake which agent group), update the wiring's trigger rules: `ncl wirings update --id <wiring-id> ...`.\n\n### Changing Deployment\n\nQuestions to ask:\n- Target platform? (Linux server, different Mac)\n- Service manager? (launchd, systemd)\n\nImplementation:\n1. Create the appropriate service files.\n2. Update paths in `.env` / config.\n3. Provide setup instructions.\n\n## After Changes\n\nAlways tell the user.\n\nRun from your NanoClaw project root:\n\n```bash\n# Rebuild and restart\npnpm run build\nsource setup/lib/install-slug.sh\n# macOS:\nlaunchctl unload ~/Library/LaunchAgents/$(launchd_label).plist\nlaunchctl load ~/Library/LaunchAgents/$(launchd_label).plist\n# Linux:\n# systemctl --user restart $(systemd_unit)\n```\n\n## Example Interaction\n\nUser: \"Add Telegram as an input channel\"\n\n1. Run `/add-telegram` to install the adapter, wire its registration, and build.\n2. Ask: \"Should Telegram reach an existing agent group, or a new one?\"\n3. Ask: \"Share an agent group with your other channels, or keep Telegram separate?\"\n4. Run `/manage-channels` (or `ncl messaging-groups create` + `ncl wirings create`) to create the messaging group and wire it to the chosen agent group with a session mode and trigger rules.\n5. Tell the user how to authenticate and test.","author":"@nanocoai","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/nanocoai/nanoclaw/tree/main/.claude/skills/customize","license":"MIT","category":"document","lang":"en","tokens":1537,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}