init-first-agent
Skill1 starsChanged 40 days agoMITView on GitHub
Walk the operator through creating the first NanoClaw agent for a DM channel — resolve the operator's channel identity, wire the DM messaging group to a new agent, and trigger a welcome DM via the normal delivery path. Use after channel credentials are configured and the service is running.
- Reads credentials
7 other projects use a version of this, 7 of them edited.
Adopted by
Most recently taken up by
- nanocoai/nanoclawedited, first seen Nov 3, 2026
- prathish-ks/isthmusedited, first seen Oct 12, 2026
- gavrielc/nanoclawedited, first seen Oct 8, 2026
- qwibitai/nanoclawedited, first seen Oct 8, 2026
- TomGranot/groupguardedited, first seen Sep 3, 2026
- microsoft/amplifier-app-nanoclawedited, first seen Jun 12, 2026
Used with
Projects with it also use add-anydoc, add-clidash and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TomGranotSkilladd-anydoc
Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when agents need to read attached Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, or text-based PDF files without uploading them to a hosted parser.
Also in 5 projects that use this
TomGranotSkilladd-clidash
Add clidash — a zero-dependency, read-only web dashboard that derives its tabs and tables at runtime from any CLI that lists resources as JSON. Ships pre-wired for NanoClaw's ncl CLI (agent groups, sessions, channels, users, roles), plus message-activity charts, a log tail, and a read-only file viewer for group skills/CLAUDE.md/profiles.
Also in 5 projects that use this
qwibitaiSkilladd-iron-proxy
Install or refresh Iron Proxy and its official Iron Control web console for NanoClaw. Use when selecting the Iron gateway, adding its management UI, configuring credentials and grants, or restoring the proxy, approval bridge, and agent guidance.
Also in 4 projects that use this
qwibitaiSkilladd-mattermost
Add a self-hosted or cloud Mattermost bot channel through the Chat SDK bridge, reusing a healthy server when available and linking to official server setup guidance when needed.
Also in 4 projects that use this
nanocoaiSkilladd-cursor
Use Cursor (local Agent SDK) as a full agent provider — planning, tool orchestration, MCP tools, session resume — alongside or instead of Claude. Cursor-account sign-in or API key, held by the credential gateway. Per-group via `ncl groups config update --provider cursor`. Distinct from using Cursor as a cloud agent (those run on Cursor VMs and are not this provider).
Also in 3 projects that use this
- +5 more from TomGranot
- +1 more from qwibitai
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 7
- gavrielc/nanoclaw★ 31k75% same
- nanocoai/nanoclaw★ 31k75% same
- qwibitai/nanoclaw★ 31k75% same
- microsoft/amplifier-app-nanoclaw★ 599% same
- TomGranot/groupguard★ 375% same
- prathish-ks/isthmus★ 275% same
- mcarmona1064-cell/clawbridge-codex★ 195% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- container/AGENTS.mdAGENTS.md
- container/CLAUDE.mdCLAUDE.md
- add-atomic-chat-toolSkill
- add-codexSkill
- add-dashboardSkill
- add-deltachatSkill
- add-discordSkill
- add-emacsSkill
- add-gcal-toolSkill
- add-gchatSkill
- add-githubSkill
- add-gmail-toolSkill
- add-imessageSkill
- add-karpathy-llm-wikiSkill
- add-linearSkill
- add-macos-statusbarSkill
- add-matrixSkill
- add-mnemonSkill
- add-ollama-providerSkill
- add-ollama-toolSkill
- add-opencodeSkill
- add-piSkill
- add-resendSkill
- add-rtkSkill
- add-signalSkill
- add-slackSkill
- add-teamsSkill
- add-telegramSkill
- add-vercelSkill
- add-webexSkill
- add-wechatSkill
- add-whatsapp-cloudSkill
- add-whatsappSkill
- archive-tripSkill
- customizeSkill
- debugSkill
- get-qodo-rulesSkill
- init-onecliSkill
- learnSkill
- manage-channelsSkill
- manage-mountsSkill
- migrate-from-openclawSkill
- migrate-from-v1Skill
- migrate-memorySkill
- migrate-nanoclawSkill
- nano-pvt-hubSkill
- new-knowledge-graph-tutorSkill
- new-tripSkill
- qodo-pr-resolverSkill
- reflectSkill
- setupSkill
- update-nanoclawSkill
- update-skillsSkill
- use-native-credential-proxySkill
The file
We split this skill into the rules it gives an agent
8 rules. 4 are common, 0 are distinctive, and 4 are very specific to this project.
4
Common
Most of the 7 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Service running: Check: launchctl list | grep "$(.
- Very specific: line 18
Read src/channels/index.ts to find enabled channels (uncommented imports).
- Very specific: line 26
Read the channel's own skill for its ## Channel Info > how-to-find-id section (e.g.
- Common: line 54
Wait for the user's confirmation.
- Very specific: line 85
Add --provider <name> when the user picked a non-default provider (there is no install-wide default — the choice is explicit per group).
- Common: line 100
Do not tail the log or poll in a sleep loop.
- Common: line 104
Wait for the user's reply.
- Common: line 106
If they say it didn't arrive, then diagnose using the DB directly (no waiting loops required — the message either delivered or it didn't):
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Init First Agent
Stand up the first NanoClaw agent for a channel and verify end-to-end delivery by having the agent DM the operator. Everything the skill does is idempotent — rerunning is safe.
Prerequisites
- Service running. Check:
launchctl list | grep "$(. setup/lib/install-slug.sh && launchd_label)"(macOS) orsystemctl --user status "$(. setup/lib/install-slug.sh && systemd_unit)"(Linux). If stopped, tell the user to run/setupfirst. - Target channel installed. At least one
/add-<channel>skill has run, credentials are in.env, and the adapter is uncommented insrc/channels/index.ts. - Adapter connected. Tail
logs/nanoclaw.log— look for a recentchannel setup/adapter connectedline for the target channel.
1. Pick the channel
Read src/channels/index.ts to find enabled channels (uncommented imports). Cross-check .env for the relevant credentials.
AskUserQuestion: "Which channel should host the welcome DM?" with one option per enabled channel (Discord, Slack, Telegram, WhatsApp, Webex, Teams, Google Chat, Matrix, iMessage, Resend, …).
Record the choice as CHANNEL (lowercase, e.g. discord).
2. Ask for the operator's identity
Read the channel's own skill for its ## Channel Info > how-to-find-id section (e.g. .claude/skills/add-discord/SKILL.md, .claude/skills/add-telegram/SKILL.md). Show those instructions to the user in plain text.
Then ask in plain text (NOT AskUserQuestion — these are free-form):
- Your user id on this channel — e.g. a Discord user ID, Telegram user ID, Slack user ID. Record as
USER_HANDLE. - Your display name — human name, used to name the agent group (
dm-with-<normalized>) and as the welcome-message addressee. Record asDISPLAY_NAME. - Agent persona name — the assistant's display name. Default:
DISPLAY_NAME. Record asAGENT_NAME.
3. Resolve the DM platform id
This depends on whether the channel supports cold DM via adapter.openDM.
Channels without cold DM (direct-addressable): telegram, whatsapp, imessage, matrix, resend. The user handle doubles as the DM chat id. Set:
PLATFORM_ID=${CHANNEL}:${USER_HANDLE}Skip to step 4.
Channels with cold DM (resolution-required): discord, slack, teams, webex, gchat. The bot can DM cold at runtime via Chat SDK, but this skill runs standalone — it can't call the adapter. Two resolutions:
3a. User DMs the bot once (Discord / Slack / Teams / Webex / gChat)
Tell the user:
Send any single message to the bot as a DM from your account on
${CHANNEL}. The router will record the DM as a messaging group. Replydonehere when you've sent the message.
Wait for the user's confirmation. Then look up the most recent DM messaging groups:
pnpm exec tsx scripts/q.ts data/v2.db "SELECT id, platform_id, name, created_at FROM messaging_groups WHERE channel_type='${CHANNEL}' AND is_group=0 ORDER BY created_at DESC LIMIT 5"Show the top rows to the user and confirm which platform_id is theirs (usually the most recent). Record as PLATFORM_ID. If none appeared, check logs/nanoclaw.log for unknown_sender drops — the adapter might be rejecting inbound due to connection or permission issues.
3b. Telegram pair-code path (if the user prefers not to DM first)
For Telegram only, there's an existing pair-code primitive. When you run this tool, take the output and extract the pairing code. Then show it to the user in plain text and ask the user to send the code in the Telegram chat to complete the pairing.
npx tsx setup/index.ts --step pair-telegram -- --intent new-agent:dm-with-<folder>Parse the PAIR_TELEGRAM_ISSUED status block for CODE and follow the REMINDER_TO_ASSISTANT line in that block. Then wait for the PAIR_TELEGRAM block — read PLATFORM_ID and PAIRED_USER_ID from it. telegram.ts's interceptor has already upserted the user and granted owner if none existed yet. Use PLATFORM_ID and PAIRED_USER_ID directly in step 4.
4. Run the init script
First, pick the agent provider. Read src/providers/index.ts and collect the installed providers from its import './<name>.js'; lines — claude is always available as the built-in default. If a non-default provider is installed (e.g. codex), ask the user which one this agent should run on; if only claude is available, skip the question and omit the flag.
npx tsx scripts/init-first-agent.ts \
--channel "${CHANNEL}" \
--user-id "${CHANNEL}:${USER_HANDLE}" \
--platform-id "${PLATFORM_ID}" \
--display-name "${DISPLAY_NAME}" \
--agent-name "${AGENT_NAME}"Add --provider <name> when the user picked a non-default provider (there is no install-wide default — the choice is explicit per group). Add --welcome "System instruction: ..." to override the default welcome prompt.
The script:
- Upserts the
usersrow and grantsownerrole if no owner exists. - Creates the
agent_groupsrow and callsinitGroupFilesystematgroups/dm-with-<name>/. - Reuses or creates the DM
messaging_groupsrow. - Wires them via
messaging_group_agents(which auto-creates the companionagent_destinationsrow). - Hands the welcome message to the running service via its CLI socket (
data/cli.sock), targeting the DM messaging group. The service routes it into the DM session, which wakes the container synchronously. If the socket isn't reachable (service down), falls back to a directinbound.dbwrite that the next host sweep picks up.
Show the script's output to the user.
5. Verify
The welcome DM is queued synchronously; the only wait is container cold-start (~60s on first launch) before the agent processes the message and the reply flows through outbound.db to the channel.
Do not tail the log or poll in a sleep loop. Ask the user in plain text:
The welcome DM should arrive shortly. Let me know when you've received it (or if it doesn't arrive within two minutes).
Wait for the user's reply. If they confirm receipt, the skill is done.
If they say it didn't arrive, then diagnose using the DB directly (no waiting loops required — the message either delivered or it didn't):
pnpm exec tsx scripts/q.ts data/v2-sessions/<agent-group-id>/<session-id>/outbound.db "SELECT id, status, created_at FROM messages_out ORDER BY created_at DESC LIMIT 5"— check for stuckpendingrows. Replace<agent-group-id>and<session-id>with the values from the script's output.grep -E 'Unauthorized channel destination|container.*exited|error' logs/nanoclaw.log | tail -20— look for ACL rejections or container crashes.ls data/v2-sessions/<agent-group-id>/*/outbound.db— confirm the session exists.
Troubleshooting
"Missing required args" — the script wants --channel, --user-id, --platform-id, --display-name at minimum. Re-check the command you assembled.
No messaging_groups row appears after the user DMs (step 3a) — the router silently drops messages from unknown senders under strict policy but still creates the messaging_groups row. If the row is missing entirely, the adapter isn't receiving the inbound message. Check logs/nanoclaw.log for adapter errors (auth, gateway disconnect, rate limit).
Owner already exists — hasAnyOwner() returned true, so the grant is skipped silently. That's fine; the script still creates the agent and wiring. Reassigning ownership needs a separate flow (not this skill).
Wrong person got the welcome DM — the --platform-id you passed is someone else's DM channel. Rerun with the correct one; the script is idempotent on user/messaging-group/agent-group but writes a new session welcome each run.
Agent group name collision — if dm-with-<display-name> already exists (e.g. rerunning with the same display name), the script reuses it. Pass a different --display-name to get a distinct folder.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

