You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ux: upgrade --migrate-directory should warn about git rename history loss and unstaged changes #126
upgrade --migrate-directory uses fs.renameSync() to rename .ai-team/ → .squad/, which causes three silent git issues:
History loss: Git sees the rename as a delete + add, not a move. git log --follow stops working for all files in the directory.
Unstaged changes: The rename is not staged. Users may not realize they have uncommitted changes in the new location.
Guard CI will block: The squad-main-guard workflow explicitly blocks .squad/** from main/preview branches. Users who commit .squad/ to a PR targeting main will hit a CI failure with no explanation.
Suggested Fix
After the migration completes, print clear guidance:
✓ Renamed .ai-team/ → .squad/
⚠️ Git note: this rename appears as delete+add in git history.
To preserve file history, use: git mv .ai-team .squad (before running this command next time)
Next steps:
git add -A
git commit -m "chore: migrate .ai-team/ → .squad/"
Note: .squad/ should NOT be committed to main/preview — keep it on feature branches.
Additionally, consider using git mv via child_process instead of fs.renameSync when inside a git repo, which preserves rename tracking.
Found by: Kobayashi during 0.5.0 diagnostic investigation on SqncR.
Partially addressed in v0.5.2: the migrations and .gitattributes\ rules now use the detected squad directory (e.g. .squad/) rather than hardcoding .ai-team/, so the core correctness issue is fixed. The remaining items in this issue — explicit post-migration warning messages and considering \git mv\ over \s.renameSync\ — are UX enhancements. Keeping this open to track those improvements.
Approach: Try git mv .ai-team .squad when inside a git repo (preserves git log --follow). Fall back gracefully to fs.renameSync() when git is unavailable or fails. Always print enhanced warnings.
Dependency note for implementer: Before starting #126 work, check if PR #199 has merged. If so, verify migrate-directory.ts still exists as the active code path — the new squad migrate may eventually supersede it.
Fixed! EECOM investigated and confirmed this was still a valid concern — the upgrade --migrate-directory command was still using fs.renameSync() without safety checks.
The fix adds:
Git repository detection before migration
Unstaged changes detection (fatal abort if found in .ai-team/ or .ai-team-templates/)
Clear warning about git history implications — explains the delete+add vs rename trade-off
Recommendation to use git mv for history preservation
Merged in commits c6f1ec9 and cda717e on dev with 2 new tests covering the warning and abort behaviors. Thanks for the original report, @bradygaster! 🔧
Activity
chore: log 0.5.0 investigation session — bugs #124 #125 #126
fix: upgrade --migrate-directory now completes full upgrade (v0.5.2)
fix: upgrade --migrate-directory now completes full upgrade (v0.5.2)
fix: upgrade --migrate-directory now completes full upgrade (v0.5.2)
bradygaster commentedon Feb 20, 2026
Partially addressed in v0.5.2: the migrations and .gitattributes\ rules now use the detected squad directory (e.g. .squad/) rather than hardcoding .ai-team/, so the core correctness issue is fixed. The remaining items in this issue — explicit post-migration warning messages and considering \git mv\ over \s.renameSync\ — are UX enhancements. Keeping this open to track those improvements.
docs(ai-team): Merge next-wave triage decisions, update agent history
fix: wire missing CLI commands into cli-entry.ts (#244)
github-actions commentedon Mar 7, 2026
🏷️ Release target updated →
release:v0.8.229 remaining items
github-actions commentedon Mar 9, 2026
📋 Assigned to EECOM (Core Dev)
Issue: #126 — ux: upgrade --migrate-directory should warn about git rename history loss and unstaged changes
EECOM will pick this up in the next Copilot session.
bradygaster commentedon Mar 13, 2026
📌 Brady requested this issue be assigned to @diberry (docs/UX triage). Pending collaborator invite to complete assignment.
diberry commentedon Mar 14, 2026
📋 Implementation Proposal: Solution D — Hybrid Smart Rename + Warnings
Analyzed by: @diberry (PAO triage)
Remaining work (per Brady's v0.5.2 comment — core bug fixed, UX enhancements remain):
Approach: Try
git mv .ai-team .squadwhen inside a git repo (preservesgit log --follow). Fall back gracefully tofs.renameSync()when git is unavailable or fails. Always print enhanced warnings.Changes to
migrate-directory.ts:execFileSync('git', ['rev-parse', ...])pattern frominit.ts.ai-team/has uncommitted changesgit mvfirst,fs.renameSyncfallback on failuregit mvwasn't used, CI guard warning about main/preview branchesNo new CLI flags. No new dependencies (
child_processalready used ininit.ts,gh-cli.ts). Graceful degradation — migration always completes.Test plan: 5 new tests covering git mv path, fallback path, dirty check warning, CI guard warning, and git mv failure recovery.
Target file:
packages/squad-cli/src/cli/core/migrate-directory.ts+test/cli/upgrade.test.tsFull PRD available on request. Ready for Core Dev pickup (Fenster/EECOM per existing triage).
diberry commentedon Mar 14, 2026
cc @bradygaster — implementation proposal above for the remaining UX enhancements. Ready for Core Dev assignment when you're ready.
diberry commentedon Mar 14, 2026
Coordination note: #197 overlap check
Reviewed #197 (Improve migration experience — PR #199 by @williamhallatt). These are complementary, not overlapping:
squad migratecommand (backup → clean → fresh scaffold → restore) for major version jumps (v0.5→v0.8)upgrade --migrate-directoryfor in-place.ai-team/→.squad/renames (git mv + warnings)Dependency note for implementer: Before starting #126 work, check if PR #199 has merged. If so, verify
migrate-directory.tsstill exists as the active code path — the newsquad migratemay eventually supersede it.Updated the PRD with this coordination section.
diberry commentedon Mar 14, 2026
PRD updated: Consolidated with #197 non-doc items
The PRD for this issue now also covers the non-doc implementation work from #197:
.squad/whenteam.mdis absent.ai-team/to.squad/This gives a single implementation target for Core Dev. The PRD has two parts:
git mv+ enhanced warningsDocs-only work (migration guide covering all install methods) stays in #197 for PAO.
cc @bradygaster
github-actions commentedon Mar 15, 2026
📋 Assigned to EECOM (Core Dev)
Issue: #126 — ux: upgrade --migrate-directory should warn about git rename history loss and unstaged changes
EECOM will pick this up in the next Copilot session.
bradygaster commentedon Mar 15, 2026
Fixed! EECOM investigated and confirmed this was still a valid concern — the
upgrade --migrate-directorycommand was still usingfs.renameSync()without safety checks.The fix adds:
.ai-team/or.ai-team-templates/)git mvfor history preservationMerged in commits
c6f1ec9andcda717eon dev with 2 new tests covering the warning and abort behaviors. Thanks for the original report, @bradygaster! 🔧[squad] Clean up Frodo's charter — TI Domain Backend Engineer (github…