feat: add mosaic upgrade command to clean stale per-project files

Detects and cleans up files that are now centralized:
- SOUL.md: removed (now global at ~/.config/mosaic/SOUL.md)
- CLAUDE.md: replaced with thin pointer to global AGENTS.md
- AGENTS.md: stale load-order sections stripped, project content preserved

Supports --dry-run, --all (scan ~/src/*), and per-project paths.
Creates .mosaic-bak backups before any modification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jason Woltje
2026-02-19 13:33:10 -06:00
parent 3f2ba89db2
commit 56b644e6d3
3 changed files with 231 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ Management:
doctor [args...] Audit runtime state and detect drift
sync [args...] Sync skills from canonical source
bootstrap <path> Bootstrap a repo with Mosaic standards
upgrade [path] Clean up stale SOUL.md/CLAUDE.md in a project
Options:
-h, --help Show this help
@@ -140,6 +141,11 @@ switch ($command) {
Write-Host "[mosaic] NOTE: mosaic-bootstrap-repo requires bash. Use Git Bash or WSL." -ForegroundColor Yellow
& (Join-Path $MosaicHome "bin\mosaic-bootstrap-repo") @remaining
}
"upgrade" {
Assert-MosaicHome
Write-Host "[mosaic] NOTE: mosaic-upgrade requires bash. Use Git Bash or WSL." -ForegroundColor Yellow
& (Join-Path $MosaicHome "bin\mosaic-upgrade") @remaining
}
{ $_ -in "help", "-h", "--help" } { Show-Usage }
{ $_ -in "version", "-v", "--version" } { Write-Host "mosaic $Version" }
default {