Phase 1 — Identify the source
Ask the user what he wants to migrate:
- "Paste the content here and I'll work from stdin"
- "Point me at a file path"
- "Point me at a directory and I'll scan everything inside"
- "I have a Cursor rules file at ~/Projects/X/.cursorrules"
- "My old PAI install has TELOS at ~/old-claude/TELOS/"
Collect the source path. If content is pasted, write it to a temp file first.
Phase 2 — Scan
Run the scanner:
bun ~/.claude/PAI/TOOLS/MigrateScan.ts --source <path>
# or
echo "$CONTENT" | bun ~/.claude/PAI/TOOLS/MigrateScan.ts --stdin
Scanner output includes:
- Total chunks found
- Proposed routing table (how many chunks per target)
- Average classification confidence
- Count of UNCLEAR chunks
- Count of low-confidence (<40%) chunks
Phase 3 — Present routing summary
Show the user the routing proposal in a scannable format:
Found 47 chunks from 3 files. Proposed routing:
📂 TELOS/GOALS.md 12 chunks (78% avg confidence)
📂 TELOS/WISDOM.md 8 chunks (65% avg confidence)
📂 TELOS/BELIEFS.md 6 chunks (71% avg confidence)
📂 MEMORY/KNOWLEDGE/Ideas 15 chunks (52% avg confidence)
🧠 memory/feedback 4 chunks (85% avg confidence)
❓ UNCLEAR 2 chunks (needs your call)
Options:
- Approve everything trusted (confidence ≥60%)?
- Walk through the low-confidence and UNCLEAR chunks one by one?
- Review specific categories?
- Review everything?
Phase 4 — Approval loop
Based on the user's preference:
Fast path (he says "approve all trusted"):
bun ~/.claude/PAI/TOOLS/MigrateApprove.ts --approve-all
Commits everything non-UNCLEAR. Then walk through UNCLEAR chunks conversationally.
Category path (he says "approve goals and wisdom, skip knowledge"):
bun ~/.claude/PAI/TOOLS/MigrateApprove.ts --approve-target TELOS/GOALS.md
bun ~/.claude/PAI/TOOLS/MigrateApprove.ts --approve-target TELOS/WISDOM.md
Walk-through path (he wants careful review):
bun ~/.claude/PAI/TOOLS/MigrateApprove.ts --review
Show each pending chunk. For each:
- Show preview + proposed target + confidence + alternatives
- Ask: approve / modify target / reject
- Commit decision
Phase 5 — Handle UNCLEAR chunks
UNCLEAR chunks are ones where no classification rule matched strongly. For each:
- Display full content (not just preview)
- Ask the user: "This one's unclear — what is it? Could be X, Y, Z, or maybe Knowledge/Ideas as a catch-all?"
- the user chooses → commit via
--modify <id> --target <chosen>
Phase 6 — Completion summary
After approval pass:
- Report total chunks committed, per-target count
- Flag any remaining UNCLEAR
- Recommend next step: run
/interview to interview around anything the migration left sparse