Repository navigation
Description
Summary
Users migrating from v0.5.4 to v0.8.x — particularly those who installed Squad via npx to a repo root rather than globally — encounter several friction points that make the migration feel broken even when following the guide.
What needs improving
1. Shell blocks /init when .squad/ is missing (circular error)
When .squad/team.md doesn't exist, the interactive shell shows "Run /init to create your team first" and returns early — before the /init command can execute. The message is accurate but the fix requires /init to be runnable in the first place.
Fix: scaffold .squad/ with sdkInitSquad() when team.md is absent, then fall through to the existing handleInitCast path.
2. scrub-emails defaults to .ai-team/ (stale default)
cli-entry.ts still defaults to .ai-team/ for the scrub-emails command help text and argument fallback — the directory was renamed to .squad/ in v0.8.
3. No automated migration command
There is currently no squad migrate command. Users must manually back up, delete, and reinitialise — and the steps are different depending on whether they installed globally, locally, or via npx.
New command: squad migrate [--dry-run] [--backup-dir <path>] that backs up .squad/, removes squad-owned scaffold files, runs a fresh sdkInitSquad(), and restores user-owned files (agents, decisions, routing, team.md, skills).
4. Docs reference the removed npx github:bradygaster/squad distribution
docs/scenarios/upgrading.md and docs/scenarios/troubleshooting.md still use the old GitHub-hosted install command throughout. The correct package is @bradygaster/squad-cli.
5. Node.js version inconsistency across docs
docs/get-started/migration.mdsays "Node.js 18 or later"docs/scenarios/troubleshooting.mdsays "22.0.0"- Actual
package.jsonengines field:>=20.0.0
6. Migration guide only covers global install
The migration guide (docs/get-started/migration.md) has no steps for local (npm install --save-dev) or npx users. Install commands are also pinned to @0.8.18.
Acceptance criteria
- Shell
/init "description"works even when.squad/has been deleted -
scrub-emailsdefaults to.squad/ -
squad migratecommand exists, documented, and tested -
docs/scenarios/upgrading.mduses@bradygaster/squad-clionly -
docs/scenarios/troubleshooting.mdcorrected (commands + Node.js version) -
docs/get-started/migration.mdcovers global, local, andnpxinstall paths; uses@latest; documentssquad migrate - All existing tests pass; new tests added for migrate command and updated shell behavior
Activity
williamhallatt commentedon Mar 5, 2026
How to test locally
No global install needed. Use the built CLI directly from your local clone.
1. Build the CLI
2. Set a shorthand (optional but convenient)
SQUAD="node $(git rev-parse --show-toplevel)/packages/squad-cli/dist/cli-entry.js"3. Test
migrate(dry run first)In a repo with an existing
.squad/directory:Expected: backup created at
.squad-backup-{timestamp}/, scaffold files cleaned, fresh scaffold applied, user files (agents/,decisions.md,routing.md,team.md,skills/) restored.4. Test the shell fix (missing
.squad/)rm -rf .squad $SQUADExpected: shell scaffolds
.squad/automatically and prompts for init — does not show the circular "Run /init first" error.5. Verify shell does NOT re-init after migrate
After running
$SQUAD migrate, confirm.first-runis gone:ls .squad/.first-run # expected: No such file or directoryThen launch the shell and type any message:
6. Test backup restoration
Expected:
.squad/is replaced with backup contents intact. When satisfied, clean up:rm -rf .squad-backup-{timestamp}.7. Test
scrub-emailsdefault$SQUAD scrub-emails --helpExpected: default directory shown as
.squad/(not.ai-team/).8. Verify docs
docs/get-started/migration.md— Node >=20,@latest, all 3 install methods,squad migrateusagedocs/scenarios/upgrading.md— nonpx github:bradygaster/squadreferencesdocs/scenarios/troubleshooting.md— Node 20+, no SSH hang sectionwilliamhallatt commentedon Mar 5, 2026
Implementation status — PR #199
All work is complete. Branch:
williamhallatt/197-migration-experience→ target:devNew
squad migratecommandmigrate— backs up.squad/, cleans scaffold files, runssdkInitSquad(), restores user-owned files (agents/,config.json,decisions.md,routing.md,team.md,skills/)migrate --dry-run— shows what would happen, no files changedmigrate --backup-dir <path>— custom backup location (constrained to cwd)migrate --restore— auto-detects and restores the most recent.squad-backup-*/migrate --restore <path>— restores from a specific backup path (constrained to cwd)backupCompleteflag — rollback only fires if backup succeeded)Bug fixes
sdkInitSquad(),.first-runand.init-promptare deleted so the shell does not treat a migrated install as brand-newcasting/registry.json: Case A (v0.8.x): restore entirecasting/from backup; Case B (v0.5.x): scan restoredagents/and create a legacy registrycreateTeam()guardscharter.mdandhistory.md, only writes if absent or emptyscrub-emailsdefault path corrected from.ai-team/to.squad/config.jsonpreserved — added toUSER_OWNEDso user Squad config survives migration--restoreand--backup-dirreject paths outsidecwdDocs updated
docs/get-started/migration.md— full rewrite: all 9 scenarios,squad migrateflow, restore/rollback instructions,squad initdocumented as internaldocs/scenarios/upgrading.md,troubleshooting.md— updateddocs/reference/cli.md— migrate command documented; fixed incorrect install entrydocs/scenarios/disaster-recovery.md,keep-my-squad.md,README.md— updateddocs/whatsnew.md— v0.8.21 section addeddocs/blog/021-the-migration.md—squad migratecallout addedTests (57 total, all passing)
test/migrate-command.test.tsrunMigrate,runRestore,findLatestBackup, dry-run, auto-rollback,.first-runcleanup, casting state inittest/cast-guard.test.tscreateTeam()overwrite guardtest/migrate-e2e.test.tsexecFileSync, restore (auto-detect + explicit path), shell reinit guardfix(cli): fix migration experience for v0.5.x → v0.8.x upgrades
docs: add backup restoration steps to migration guide
docs: documentation sweep for migrate --restore
test: add unit, integration, and E2E tests for squad migrate and cast…
williamhallatt commentedon Mar 5, 2026
PR #199 opened — ready for review
PR: #199
Branch:
williamhallatt/197-migration-experience→devWhat's in the PR
New command:
squad migrateBacks up, cleans, and reinitialises
.squad/in one step. Flags:--dry-run,--backup-dir,--restore [path]. Auto-rollback on failure.Bug fixes
.first-run/.init-promptdeleted post-reinit)registry.jsonmissing after migrate (restored from backup or synthesised fromagents/)createTeam()overwrite guard (charter.md/history.md never overwritten)scrub-emailsdefault path (.ai-team/→.squad/)Tests: 57/57 passing
test/migrate-command.test.ts— 23 unit/integration teststest/cast-guard.test.ts— 11 overwrite guard teststest/migrate-e2e.test.ts— 23 E2E tests against built CLI binaryDocs
All migration entry points updated:
migration.md,upgrading.md,troubleshooting.md,cli.md,disaster-recovery.md,keep-my-squad.md,README.md,whatsnew.md,021-the-migration.mdPre-PR team review summary
9 squad members reviewed the branch. All blockers were fixed before opening:
config.jsonadded to USER_OWNEDbackupCompleteflag gates rollbackrunInitissue noted (out of scope)whatsnew.mdv0.8.21 added;cli.mdinstall entry fixedCastingRegistryarray/object mismatch noted (separate issue)--restoreand--backup-dirfix(cli): fix migration experience for v0.5.x → v0.8.x upgrades
docs: add backup restoration steps to migration guide
docs: documentation sweep for migrate --restore
test: add unit, integration, and E2E tests for squad migrate and cast…
feat: scaffold monorepo with npm workspaces
docs(ai-team): Merge next-wave triage decisions, update agent history
fix: wire missing CLI commands into cli-entry.ts (#244)
29 remaining items
github-actions commentedon Mar 15, 2026
📋 Assigned to PAO (DevRel)
Issue: #197 — Improve migration experience: fix shell init, add migrate command, update docs for all install methods
PAO will pick this up in the next Copilot session.
github-actions commentedon Mar 15, 2026
📋 Assigned to EECOM (Core Dev)
Issue: #197 — Improve migration experience: fix shell init, add migrate command, update docs for all install methods
EECOM will pick this up in the next Copilot session.
bradygaster commentedon Mar 15, 2026
Thanks for filing this — it's on our sprint board now. The team will be picking this up in the next session to improve the migration experience across all install paths and platforms. 🚀
chore: update now.md with session state — dev stabilized, 4113 tests,…
docs: add local and npx install paths to migration guide
docs: consolidated docs quality, reduction, and dedup
diberry commentedon Mar 31, 2026
🔄 Ralph status: Feature — migration experience improvements. No PR. Backlog.
bradygaster commentedon May 18, 2026
@williamhallatt any of these still remaining after your pull requests and other contributions? if so, please re-open but closing for now since i think we got all of these.