nomad / references /migration-protocol.md
LucioLiu's picture
Initial release - mirrors github.com/LucioLiu/nomad
0110783 verified
|
Raw
History Blame Contribute Delete
18 kB
# Nomad Migration Protocol
> Defines how to bring an existing, scattered AI setup — a single custom-instructions box, a folder of prompt files, an existing single-assistant memory system, or an existing multi-agent setup that isn't yet Nomad-shaped — into the Nomad skeleton (see `team-skeleton.md`) without losing information. This is Path B from `SKILL.md`.
## 0. What this file assumes
Step 0 of `SKILL.md` already settled the language. This is the English version — see `migration-protocol.zh-CN.md` for the content-equivalent Chinese version. You already have (or are about to scaffold) a Nomad-shaped team root per `team-skeleton.md`; this file is about getting content *into* that skeleton from somewhere else, not about the skeleton's shape itself. Whether the target root is actually ready to receive content is checked in Phase 0a below, not assumed here.
## 1. Core principles (non-negotiable)
These come before any procedure below. If a step in this file and one of these principles ever seem to conflict, the principle wins.
1. **Preserve, don't summarize-rewrite.** When the source already has a complete, coherent document (a personality file, a preference list), copy it forward largely verbatim. Only restructure when the old content genuinely can't map onto a Nomad slot — and when you do restructure, keep every original detail; compressing "for tidiness" is a fidelity violation, not a cleanup.
2. **Inventory before asking, ask before writing.** Scan first. Show the user what you found. Get their go-ahead. Zero files get created or modified before that go-ahead is given.
3. **Report every category, including the empty ones.** "Found nothing" is a valid, reportable result — it is never a reason to omit a category from the final report. Never fabricate content to fill a category that's genuinely empty.
4. **When classification is unclear, ask — don't guess.** Whether a piece of content is "personal preference" vs. "project knowledge," or which agent should own a given skill, is not always obvious from the content alone. A wrong silent guess is worse than a short clarifying question. **Proviso — when there's no one to ask** (an unattended/automated run, or the user's pre-supplied answers don't cover this case): take the most conservative option available — the one that loses the least information and commits to the least — mark the item `OPEN QUESTION` directly in the landed content, and list it in its own section of the Phase 7 reconciliation statement rather than burying it in a regular row. This is not a license to skip asking whenever asking is merely inconvenient; it only applies when asking is genuinely not possible in the moment.
5. **Never silently drop anything.** Anything not confidently placed in this pass goes to a labeled staging area (§6) for the user to resolve later — it does not vanish, and it is not left half-imported without a note explaining why.
## 2. The five information types
Everything found during inventory sorts into one of five types. This is the classification vocabulary used for the rest of this file.
| Type | What it covers |
|---|---|
| **Personality** | Core identity, mission, values, voice/tone, behavioral rules — whatever makes "this AI" recognizably itself |
| **Memory** | Structured long-term knowledge: preferences, decisions, working experience, notable events |
| **Skills** | Reusable methods, workflows, templates, playbooks — knowledge about *how to do something*, not about the user |
| **Project knowledge** | Context tied to a specific ongoing or completed piece of work |
| **Session history** | Raw, unedited records of past conversations — the "ore," not the "refined metal" |
**Memory vs. Project knowledge — the recurring judgment call.** "Decision" content is the one item that plausibly fits either type, and re-litigating it on every migration wastes time. The dividing line: a decision bound to one specific, identifiable project belongs in **Project knowledge** (lands in that project's `projects/{name}/` decision log, per §4); a decision that's personal or applies across projects — a working-style choice, a standing preference, a general policy — belongs in **Memory**. When a decision genuinely spans both (a project-specific choice that also set a general precedent), file it under Project knowledge and add a one-line cross-reference from Memory rather than duplicating it in full.
## 3. The three hardest types to lose
These rarely live in any single file, so a naive file-by-file scan misses them. Ask about them explicitly during inventory — don't wait for the user to volunteer them.
- **Tone and values that were never written down as a rule.** "Was there a particular register your prior AI used with you — direct vs. gentle, formal vs. casual, any running jokes or ways it addressed you — that you'd want carried forward?"
- **Unwritten tacit agreements.** "Are there things you and your prior setup just came to 'know' without ever writing it down — a habit it picked up, something you stopped having to explain?"
- **Implicit relationships between files.** "Do any of your files only make sense next to another one — a memory note that references a project file informally, a shorthand that assumes context from somewhere else? Point them out so the mapping keeps the link intact."
## 4. Procedure
### Phase 0 — Identify the source
Ask, or infer: is the source a single persona (one file, one custom-instructions box, one export) or an existing multi-agent setup? This determines whether everything found lands under one `{AGENT_NAME}/` home or gets split across several.
Before moving to Phase 1, settle a concrete name for every `{AGENT_NAME}/` home this migration will land content into — reuse the source's existing name if it had one, or pick one now (see `team-skeleton.md` §7 design lesson 3 for naming-theme guidance). `{AGENT_NAME}` is not something that emerges naturally partway through Phase 4's landing map — every row in that map depends on it, so it has to be fixed before any writing starts, not discovered along the way.
### Phase 0a — Target readiness check
Before starting inventory, confirm the target team root actually meets `team-skeleton.md` §8's minimum-viable-team bar. If it doesn't yet, walk the user through the minimum Path A scaffold first (`team-config.json` + `path-conventions.md` + at least one agent home's four minimum pieces + an empty `team-log.md`), then come back here — migration is about landing content into a skeleton that already exists, not about creating the skeleton as a side effect.
### Phase 1 — Inventory
Scan every location the user points to (and ask "is there anything I can't see — local files, another platform's export, anything on paper?" — you cannot inventory what you were never told about). For each of the five types, produce a count and a location list, even when the count is zero. Copy the raw originals, unmodified, into a staging buffer (see §6) before doing anything else — this is your rollback point if something goes wrong downstream.
### Phase 2 — Dry-run preview
Before writing anything to a real Nomad slot, produce a full mapping table and show it to the user:
| Source item | Type | Target slot | Action | Notes |
|---|---|---|---|---|
| *(one row per item found)* | | | create / append / merge | |
**This is a hard gate, not a formality.** After presenting the complete preview table, STOP and wait for the user's explicit approval. Before that approval arrives, creating or modifying *any* target file is prohibited — this includes writing a "draft" version ahead of time "for efficiency," staging a file that only needs a final rename, or any other pre-write that happens before the user has actually said yes. Zero real writes happen at this stage, full stop. This table is the user's chance to catch a wrong classification before it's permanent.
**Known failure mode.** In real-run testing, the executing AI has been observed writing target files first and only presenting the mapping table afterward, as a post-hoc summary rather than a genuine approval gate — this is the single most commonly broken rule in this entire protocol. If you notice yourself reaching for a write tool before the user has responded to the preview table, stop; that impulse is the failure mode, not an exception to it.
### Phase 3 — User selects scope
The user may approve the whole preview, or select a subset by type ("just personality and memory for now, skip skills"). Partial import is a first-class option, not a fallback — don't push for "just do it all" if the user wants to go incrementally.
### Phase 4 — Import per type (the landing map)
Execute only the approved rows, using this mapping into the `team-skeleton.md` structure:
| Type | Nomad landing slot | Notes |
|---|---|---|
| Personality | `{AGENT_NAME}/AGENTS.md` (generate the `CLAUDE.md` thin shell alongside it if this deployment will use Claude Code — see `team-skeleton.md` §2) | Verbatim copy wherever the source already has a coherent personality doc. Content that doesn't fit any template field goes in an "Other" section at the end — never dropped for not fitting the mold. |
| Memory | `{AGENT_NAME}/memory/preferences.md` (create it — accumulating imported memory content is itself the trigger condition for building this file, per `team-skeleton.md` §2's optional-pieces table) | Preferences and decisions verbatim; experience may be condensed but never stripped of concrete parameters (commands, paths, numbers); events may be summarized |
| Skills | Reusable across every agent → team root `90-methodology/`. Deep, agent-specific methodology → that agent's `memory/playbook.md`. | When it's not obvious which bucket a skill belongs in, ask — don't default to one bucket silently. When the team currently has only one agent, "reusable across every agent" and "specific to this agent" are both trivially true — headcount can't decide the split. Judge it by portability instead: if a future new agent joining the team should automatically inherit this skill, it belongs in team root `90-methodology/`; if not, it stays in this agent's own `memory/playbook.md`. |
| Project knowledge | Owned by one identifiable agent, still active → that agent's `projects/{project-name}/` (see `team-skeleton.md` §2 — this is a persistent slot, distinct from `workspace/`, which stays scratch-only); owned by one agent, mid-handoff → that agent's `memory/handoff.md`; relevant across multiple agents → team root `02-shared-knowledge/` | The skeleton deliberately has no single *team-root-level* "projects" folder the way a single-persona memory system might — project ownership in a *team* is distributed across whichever agent's domain it falls under, each in its own `projects/` slot. Ask the user which agent should own a given project when it isn't obvious. |
| Session history | Full, unedited transcripts → `{TEAM_ROOT}/98-archive/sessions/{AGENT_NAME}/YYYY-MM/`. Optionally add one summary pointer line in that agent's `memory/worklog.md`. | The archived transcript is the record of truth; the worklog pointer is a convenience index, not a substitute. Never import only a summary and report it as "session history imported." |
### Phase 5 — Conflict resolution
A conflict is any case where the target slot already has real (non-placeholder) content. For each conflict, offer a three-way choice:
- **Skip** — leave the existing content untouched, drop the incoming item
- **Overwrite** — replace the existing content with the incoming item (only for genuinely superseding content — confirm this is what the user means, since Nomad's memory files are normally append-only per `team-skeleton.md` §6)
- **Rename** — keep both; the incoming item lands under a disambiguated name/section
If several conflicts are clearly the same kind (e.g., re-running an import that partially succeeded before), the user may set one rule for "all remaining conflicts in this batch" instead of confirming one at a time — but the default is per-conflict confirmation, not batch silence.
### Phase 5b — Source-internal contradictions
Phase 5 covers conflicts between an incoming item and existing target content. A different kind of conflict can also surface during Phase 1 inventory: two or more *source* items contradict each other — a disagreement that predates this migration and has nothing to do with the target slot. Do not silently resolve this by picking one and discarding the other; that destroys information the source itself never resolved.
For each source-internal contradiction found, offer the user a three-way choice:
- **Keep both, annotated** — land both versions in the target slot with an inline note flagging the disagreement and its sources
- **Prefer the newer, annotated** — if the items carry dates, land the newer one as primary and the older one as an annotated note beneath it (not deleted)
- **Ask the user to decide** — when neither of the above is clearly right, put the question to the user directly
Default when the user can't be reached in the moment (see §1 principle 4's proviso): if the contradicting items carry dates, the newer one wins by default — but **both must be preserved in the record**, never overwrite-and-discard. This is the same non-negotiable as principle 1 (preserve, don't rewrite) applied to the source itself, not just the target.
### Phase 6 — Staging and undecided items
Reuse the existing `97-inbox-misc/` folder (see `team-skeleton.md` §1) rather than inventing a new top-level location:
- `97-inbox-misc/migration-{YYYYMMDD}/raw/` — unmodified copies of every source item, made during Phase 1, before any classification write happens. This is the rollback point.
- `97-inbox-misc/migration-{YYYYMMDD}/undecided/` — anything that, even after asking the user, still couldn't be confidently placed. Every item here gets a one-line companion note explaining why it's stuck (ambiguous ownership, user deferred the decision, format didn't fit any of the five types). Nothing sits here silently — an entry with no reason attached is itself a bug in the migration run.
### Phase 7 — Reconciliation statement
Close every migration with a statement covering **all five types, including the ones with zero items**:
| # | Original source | Type | New location | Fidelity | Notes |
|---|---|---|---|---|---|
| 1 | *(file/section)* | Personality | `01-agents/{name}/AGENTS.md` | Verbatim | — |
| 2 | *(file/section)* | Memory | `01-agents/{name}/memory/preferences.md` | Verbatim | — |
| — | *(none found)* | Session history | — | — | 0 items — user confirmed no prior session logs exist |
Report format for the categories with zero items: state the count as zero explicitly ("Skills: 0 items — none found, user confirmed nothing to migrate") — never omit a category from the statement because it happened to be empty.
**Open questions get their own section.** Any item landed under §1 principle 4's "no one to ask" proviso is `OPEN QUESTION`-tagged at the landing site *and* listed again here, in a section separate from the five-type table above — don't fold it into a regular row where it can get lost.
## 5. Fidelity discipline
Priority order when the four goals below pull in different directions (highest first):
1. **Complete information retention** over tidy formatting. When in doubt, keep more, not less.
2. **Copy first, organize second.** Don't cherry-pick during the copy pass — that's how information quietly disappears. Get everything into the staging buffer, then classify.
3. **Format is a tool, not a cage.** The landing map in §4 is the default shape. If a piece of content genuinely doesn't fit any slot cleanly, say so and ask, rather than forcing a bad fit.
4. **A restructuring pass must flag its own compression ratio.** If turning source material into a landing-map file drops more than roughly half the original length, say so explicitly and let the user decide whether that's acceptable — don't silently ship a lossy conversion as if it were complete.
## 6. Sensitive content during migration
Two different situations, handled differently:
- **Already present in the source the user pointed you to** (credentials, personal contact details, addresses, financial figures already sitting in their old memory files) — this was already something the user previously entrusted to their prior setup. It may be migrated forward with a note ("carried over from prior setup, not newly collected"); it does not need to be re-confirmed item by item.
- **Newly surfacing during migration** (something you notice only because you're now reading files you weren't reading before, or the user mentions something new in the course of answering an inventory question) — treat this the same as any other newly-discovered sensitive information in normal operation: confirm with the user before writing it anywhere, rather than assuming prior consent extends to it.
## 7. Minimum bar for "migration complete"
A migration run is not done until:
1. Phase 1's inventory counts (including zeros) have been shown to the user
2. Phase 2's dry-run table was shown and approved *before* any real write
3. Every approved item has landed in its target slot per §4, or is logged in `97-inbox-misc/migration-{date}/undecided/` with a reason
4. Phase 7's reconciliation statement has been delivered, covering all five types
Skipping straight from "scan" to "done, everything's imported" without steps 2–4 is not a faster migration — it's an unverified one.
---
*Nomad skill · migration-protocol reference · desensitized — no real paths, names, or account details appear anywhere in this file.*
*Version 0.3 · Last updated 2026-07-14*