migrate-from-v1
Skill1 starsChanged 41 days agoMITView on GitHub
Finish migrating a NanoClaw v1 install into v2. Run after `bash migrate-v2.sh` completes. Seeds the owner, cleans up CLAUDE.local.md files, reconciles container configs, and helps port custom v1 code. Triggers on "migrate from v1", "finish migration", "v1 migration".
- Reads credentials
6 other projects use a version of this, 6 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 versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 6
- gavrielc/nanoclaw★ 31k90% same
- nanocoai/nanoclaw★ 31k90% same
- qwibitai/nanoclaw★ 31k90% same
- microsoft/amplifier-app-nanoclaw★ 594% same
- TomGranot/groupguard★ 390% same
- prathish-ks/isthmus★ 290% 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-first-agentSkill
- init-onecliSkill
- learnSkill
- manage-channelsSkill
- manage-mountsSkill
- migrate-from-openclawSkill
- 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
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. 7 are common, 2 are distinctive, and 18 are very specific to this project.
7
Common
Most of the 6 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Read logs/setup-migration/handoff.json first — it has overall_status, per-step results in steps, and a followups list.
- Very specific: line 26
Before anything else, check that logs/setup-migration/handoff.json exists.
- Common: line 36
Do not attempt to run the script yourself, simulate its effects, or pick up the migration mid-stream.
- Common: line 42
Before any deeper migration work, prove v2 actually answers messages on the user's real channels.
- Very specific: line 52
If yes, continue to Phase 1.
- Very specific: line 62
User ID format: always <channel_type>:<platform_handle>.
- Very specific: line 72
If exactly one user exists, confirm: AskUserQuestion: "Is <display_name> (<id>) you?" — Yes / No, let me type it.
- Very specific: line 73
If multiple users exist, present them as options in AskUserQuestion.
- Common: line 74
If no users exist yet (service hasn't received a message), ask the user to send a test message first, then re-query.
- Very specific: line 77
Use the DB helpers in src/modules/permissions/db/user-roles.ts (getUserRoles, grantRole).
- Very specific: line 103
After seeding the owner, discuss the access policy.
- Very specific: line 113
If the user picks option 2 or 3, seed the known users from v1's message history.
- Distinctive: line 143
Read the v1 template it was based on.
- Very specific: line 144
If the group had is_main=1 in v1's registered_groups, the template was groups/main/CLAUDE.md
- Very specific: line 169
Keep the # Name heading and first paragraph (identity) — this is the user's agent personality.
- Distinctive: line 172
If a CLAUDE.local.md has no user customizations (pure template copy), write a minimal file with just the identity heading.
- Very specific: line 180
If container.json exists, read it and verify the additionalMounts host paths are still valid on this machine.
- Very specific: line 181
If .v1-container-config.json exists (parse failure fallback), read it, discuss with the user, and write a proper container.json.
- Very specific: line 182
Check for env or packages fields — env may overlap with OneCLI vault, packages (apt/npm) are portable.
- Common: line 186
Check whether the user's v1 install was a customized fork.
- Common: line 194
If no commits ahead of upstream: stock v1, skip this phase.
- Common: line 196
If there are commits:
- Very specific: line 207
v1 checkout is read-only: Never modify files under handoff.v1_path.
- Very specific: line 209
Mask credentials: when displaying (first 4 + ...
- Very specific: line 210
handoff.jsonis the recovery point: If context gets compacted, re-read it and git status to recover state. - Common: line 232
Run the verify step to confirm everything works:
- Very specific: line 236
Delete logs/setup-migration/handoff.json — offer to save as docs/migration-<date>.md first.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Finish v1 → v2 migration
bash migrate-v2.sh already ran the deterministic migration. It handled:
- .env keys merged
- v2 DB seeded (agent_groups, messaging_groups, wiring)
- Group folders copied (v1 CLAUDE.md → v2 CLAUDE.local.md)
- Session data copied with conversation continuity (incl. Claude Code memory + JSONL transcripts)
- Scheduled tasks ported
- Channel code installed and auth state copied (incl. WhatsApp Baileys keystore)
- WhatsApp LIDs resolved from
store/authand aliased intomessaging_groups - Container skills copied
- Container image built
Your job is the parts that need human judgment: triage any failed steps, seed the owner, clean up CLAUDE.local.md files, reconcile configs, and port any fork customizations.
Read logs/setup-migration/handoff.json first — it has overall_status, per-step results in steps, and a followups list.
Preflight: was the script run?
Before anything else, check that logs/setup-migration/handoff.json exists. If it doesn't, the user is invoking this skill before migrate-v2.sh ran. Stop and tell them, verbatim:
This skill finishes a migration that
migrate-v2.shstarted. Run that first, in your terminal — not from inside Claude:bash migrate-v2.shIt needs interactive prompts (channel selection, service switchover) and runs Node/pnpm bootstrap, Docker, OneCLI setup, and a container build that don't fit inside a Claude session. When it finishes, it'll hand control back to Claude automatically — at which point this skill picks up.
Do not attempt to run the script yourself, simulate its effects, or pick up the migration mid-stream. The deterministic side has dependencies on a real interactive shell.
Once handoff.json exists, proceed to Phase 0.
Phase 0: Get v2 routing real messages
Before any deeper migration work, prove v2 actually answers messages on the user's real channels. v1 is paused, not touched — flipping back is a service restart.
0a — Fix blockers only
Walk handoff.steps. Fix only the failures that would stop the bot from routing one message; defer the rest to its later phase.
0b — Smoke test, then continue
Tell the user the switch is non-destructive (v1 is paused, not modified; reverting is one command). Help them stop v1's service unit and start v2's, tail the host log for a clean boot, and have them send a real test message. Use AskUserQuestion to confirm the bot responded.
If yes, continue to Phase 1. If no, diagnose from logs/nanoclaw.log and re-test — don't proceed to deeper work on a broken router.
Deferred failures
Re-visit anything you skipped in 0a before declaring the migration done. Most surface naturally in later phases (1c-groups ↔ Phase 2, 1e-tasks ↔ task verification).
Phase 1: Owner and access
v2 auto-creates a users row for every sender it sees (via extractAndUpsertUser in src/modules/permissions/index.ts). By the time this skill runs, the owner's row likely already exists — it just needs the owner role granted.
User ID format: always <channel_type>:<platform_handle>. Each channel populates this differently:
- Telegram:
telegram:<numeric_user_id>(e.g.telegram:6037840640) - Discord:
discord:<snowflake_user_id>(e.g.discord:<snowflake>) - WhatsApp:
whatsapp:<phone>@s.whatsapp.net(e.g.whatsapp:15550000005@s.whatsapp.net) - Slack:
slack:<user_id>(e.g.slack:U04ABCDEF) - Others:
<channel_type>:<platform_id>
Steps:
- Query
userstable:SELECT id, kind, display_name FROM users. - If exactly one user exists, confirm:
AskUserQuestion: "Is<display_name>(<id>) you?" — Yes / No, let me type it. - If multiple users exist, present them as options in
AskUserQuestion. - If no users exist yet (service hasn't received a message), ask the user to send a test message first, then re-query.
- Once confirmed, check
user_rolesviagetUserRoles(userId). If anownerrow already exists, skip. Otherwise grant it withgrantRole.grantRoleinserts a new row per call, so thegetUserRolescheck keeps this re-runnable.
Use the DB helpers in src/modules/permissions/db/user-roles.ts (getUserRoles, grantRole). Init the DB first, then call the helpers:
import path from 'path';
import { initDb } from '../src/db/connection.js';
import { runMigrations } from '../src/db/migrations/index.js';
import { DATA_DIR } from '../src/config.js';
import { getUserRoles, grantRole } from '../src/modules/permissions/db/user-roles.js';
const db = initDb(path.join(DATA_DIR, 'v2.db'));
runMigrations(db); // idempotent
const userId = '<user_id>';
if (!getUserRoles(userId).some((r) => r.role === 'owner')) {
grantRole({
user_id: userId,
role: 'owner',
agent_group_id: null, // owner role must be global
granted_by: null,
granted_at: new Date().toISOString(),
});
}Access policy
After seeding the owner, discuss the access policy. v2's messaging_groups.unknown_sender_policy controls who can interact with the bot. migrate-v2.sh set it to public so the bot would respond during the switchover test, but the user may want to tighten it.
Present the options via AskUserQuestion:
- Public (
public, current) — anyone can message the bot. Good for personal DM bots. - Known users only (
strict) — only users the access gate accepts (owner, admin, oragent_group_members) can trigger the bot. Others are silently dropped. - Approval required (
request_approval) — unknown senders trigger an approval request to the owner. Good for group chats where you want to vet new members.
The unknown_sender_policy column accepts exactly these three values; use the parenthesized value for <chosen_policy> below.
If the user picks option 2 or 3, seed the known users from v1's message history. The v1 database is at <handoff.v1_path>/store/messages.db. It has a messages table with sender and sender_name columns. For each group:
-- v1: unique senders per chat (excluding bot messages)
SELECT DISTINCT sender, sender_name
FROM messages
WHERE chat_jid = '<v1_jid>' AND is_from_me = 0 AND sender IS NOT NULLThe sender value is a platform handle (e.g. 6037840640 for Telegram). Build the v2 user ID by inferring the channel type from the chat JID prefix (use parseJid from setup/migrate-v2/shared.ts) and combining: <channel_type>:<sender>.
For each sender:
- Upsert into
users(id, kind, display_name)if not already present. - Insert into
agent_group_members(user_id, agent_group_id)for each agent group wired to that messaging group.
Show the user the list of senders being imported and let them deselect any they don't want.
Then update the messaging groups:
UPDATE messaging_groups SET unknown_sender_policy = '<chosen_policy>'
WHERE id IN (SELECT id FROM messaging_groups WHERE channel_type IN (<migrated_channels>))Phase 2: Clean up CLAUDE.local.md
The migration copied v1's entire CLAUDE.md into CLAUDE.local.md for each group. This file now contains v1 boilerplate that v2 handles through its own composed fragments (container/CLAUDE.md + .claude-fragments/module-*.md). The user's customizations are buried inside.
For each group that has a CLAUDE.local.md:
- Read the file.
- Read the v1 template it was based on. Determine which template by checking the v1 install:
- If the group had
is_main=1in v1'sregistered_groups, the template wasgroups/main/CLAUDE.md - Otherwise, the template was
groups/global/CLAUDE.md - The v1 path is in
handoff.json→v1_path
- If the group had
- Diff the file against the template. Identify sections that are:
- Stock boilerplate (identical to template) — remove. v2's fragments cover this.
- User customizations (added sections, modified sections) — keep.
- The following v1 sections are now handled by v2 fragments and should be removed even if slightly modified:
- "What You Can Do" → v2 runtime system prompt
- "Communication" / "Internal thoughts" / "Sub-agents" →
container/CLAUDE.md+module-core.md - "Your Workspace" / workspace path references →
container/CLAUDE.md - "Memory" (the stock version) →
container/CLAUDE.md - "Message Formatting" →
container/CLAUDE.md - "Admin Context" → v2 uses
user_roles, not is_main - "Authentication" → v2 uses OneCLI
- "Container Mounts" → v2 mounts are different
- "Managing Groups" / "Finding Available Groups" / "Registered Groups Config" → v2 entity model, no IPC
- "Global Memory" → v2 has
.claude-shared.mdsymlink - "Scheduling for Other Groups" →
module-scheduling.md - "Task Scripts" →
module-scheduling.md - "Sender Allowlist" → v2 uses
unknown_sender_policy+user_roles
- Fix path references in kept sections:
/workspace/group/→/workspace/agent//workspace/project/→ these paths don't exist in v2; discuss with the user/workspace/ipc/→ gone; remove references/workspace/extra/→ v2 usescontainer.jsonadditionalMounts; keep but note the path may change
- Keep the
# Nameheading and first paragraph (identity) — this is the user's agent personality. - Show the user the proposed new CLAUDE.local.md before writing it. Use
AskUserQuestion: "Here's what I'd keep — look right?" with options to approve, edit, or keep the original.
If a CLAUDE.local.md has no user customizations (pure template copy), write a minimal file with just the identity heading.
Phase 3: Container config
migrate-v2.sh writes container.json directly from v1's container_config (the additionalMounts shape is identical). If the v1 config was unparseable, it falls back to a .v1-container-config.json sidecar.
For each group, check:
- If
container.jsonexists, read it and verify theadditionalMountshost paths are still valid on this machine. Flag any that don't exist. - If
.v1-container-config.jsonexists (parse failure fallback), read it, discuss with the user, and write a propercontainer.json. Then delete the sidecar. - Check for
envorpackagesfields —envmay overlap with OneCLI vault,packages(apt/npm) are portable.
Phase 4: Fork customizations
Check whether the user's v1 install was a customized fork.
cd <v1_path>
git remote -v
git log --oneline <upstream>/main..HEAD 2>/dev/nullIf no commits ahead of upstream: stock v1, skip this phase.
If there are commits:
- Show the commit list to the user.
AskUserQuestion: "How do you want to handle your v1 customizations?"- Copy portable items (recommended) — copy
container/skills/*,.claude/skills/*,docs/*. Grep each copied file for v1-only references that won't resolve in v2 and flag them to the user: workspace paths (/workspace/group/,/workspace/project/,/workspace/ipc/,/workspace/extra/), the v1 IPC mechanism,registered_groups/is_main, the v1 sender allowlist, andstore/messages.db. - Full walkthrough — go commit by commit, decide together.
- Reference only — stash to
docs/v1-fork-reference/for later.
- Copy portable items (recommended) — copy
- Source code (
src/*,container/agent-runner/src/*) is NOT portable — v2's architecture is fundamentally different. Stash todocs/v1-fork-reference/with a README explaining what each file did. Don't translate.
Principles
- v1 checkout is read-only. Never modify files under
handoff.v1_path. - Show before writing. Show diffs/proposed content before modifying CLAUDE.local.md or container.json.
- Mask credentials when displaying (first 4 +
...+ last 4 characters). handoff.jsonis the recovery point. If context gets compacted, re-read it andgit statusto recover state.
Setup steps you can run
The setup flow at setup/index.ts has individual steps you can invoke if something is missing or failed:
pnpm exec tsx setup/index.ts --step <name>| Step | When to use |
onecli | OneCLI not installed or not healthy |
auth | No Anthropic credential in vault |
container | Container image needs rebuild |
service | Service not installed or not running |
mounts | Mount allowlist missing |
verify | End-to-end health check (run after everything else) |
environment | System check (Node, dirs) |
When done
- Run the verify step to confirm everything works:
pnpm exec tsx setup/index.ts --step verify - Delete
logs/setup-migration/handoff.json— offer to save asdocs/migration-<date>.mdfirst. - Restart the service if running so changes take effect. The v2 service label is install-specific (
nanoclaw-v2-<slug>/com.nanoclaw-v2-<slug>), so derive it fromsrc/install-slug.tsrather than guessing:# Linux UNIT=$(pnpm exec tsx -e "import{getSystemdUnit}from'./src/install-slug.js';console.log(getSystemdUnit())") systemctl --user restart "$UNIT" # macOS LABEL=$(pnpm exec tsx -e "import{getLaunchdLabel}from'./src/install-slug.js';console.log(getLaunchdLabel())") launchctl kickstart -k "gui/$(id -u)/$LABEL"
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.

