Files
auto-build/plugin/commands/migrate.md
Marius Mutu d388ab4893 fix: Improve migrate.md with clearer execution instructions
- Added explicit "Execute These Steps Immediately" section
- Changed from mv to cp for safer migration (preserves original)
- Made bash commands directly executable
- Added error handling with 2>/dev/null

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 17:47:52 +02:00

3.9 KiB
Raw Blame History

description
description
Migrate from old .auto-build-data/ structure to new .auto-build/ structure

Migrate Auto-Build Data

Migrate specs and memory from the old .auto-build-data/ location to the new .auto-build/ location for team collaboration.

IMPORTANT: Execute These Steps Immediately

When this command is invoked, you MUST execute the following steps in order. Do not ask questions - just do it.

Step 1: Run Migration Commands

Execute these bash commands:

# Create new structure
mkdir -p .auto-build/specs
mkdir -p .auto-build/memory/sessions

# Move specs if they exist in old location
if [ -d ".auto-build-data/specs" ] && [ "$(ls -A .auto-build-data/specs 2>/dev/null)" ]; then
    cp -r .auto-build-data/specs/* .auto-build/specs/
    echo "✅ Copied specs to .auto-build/specs/"
else
    echo "  No specs to migrate"
fi

# Move memory files if they exist
if [ -f ".auto-build-data/memory/patterns.json" ]; then
    cp .auto-build-data/memory/patterns.json .auto-build/memory/
    echo "✅ Copied patterns.json"
fi

if [ -f ".auto-build-data/memory/gotchas.json" ]; then
    cp .auto-build-data/memory/gotchas.json .auto-build/memory/
    echo "✅ Copied gotchas.json"
fi

if [ -d ".auto-build-data/memory/sessions" ] && [ "$(ls -A .auto-build-data/memory/sessions 2>/dev/null)" ]; then
    cp -r .auto-build-data/memory/sessions/* .auto-build/memory/sessions/
    echo "✅ Copied sessions"
fi

# Initialize missing files
if [ ! -f ".auto-build/memory/patterns.json" ]; then
    echo '{"patterns": [], "updated": null}' > .auto-build/memory/patterns.json
    echo "✅ Created patterns.json"
fi

if [ ! -f ".auto-build/memory/gotchas.json" ]; then
    echo '{"gotchas": [], "updated": null}' > .auto-build/memory/gotchas.json
    echo "✅ Created gotchas.json"
fi

Step 2: Update .gitignore

Check and update .gitignore to ensure .auto-build-data/ is ignored but .auto-build/ is NOT:

# Add .auto-build-data/ to gitignore if not present
if ! grep -q "^\.auto-build-data/" .gitignore 2>/dev/null; then
    echo "" >> .gitignore
    echo "# Auto-Build local data (worktrees, cache)" >> .gitignore
    echo ".auto-build-data/" >> .gitignore
    echo "✅ Updated .gitignore"
fi

Step 3: Show Results

After running the commands, display this summary:

════════════════════════════════════════════════════════════════
  Migration Complete
════════════════════════════════════════════════════════════════

✅ Specs moved to .auto-build/specs/
✅ Memory moved to .auto-build/memory/
✅ .gitignore updated

New structure (committed to git):
  .auto-build/
  ├── specs/{feature-name}/
  │   ├── spec.md
  │   ├── plan.md
  │   └── status.json
  └── memory/
      ├── patterns.json
      ├── gotchas.json
      └── sessions/

Local data (gitignored):
  .auto-build-data/
  ├── worktrees/
  └── cache/

NEXT STEPS:
1. Review the migrated files
2. Commit the new .auto-build/ directory:
   git add .auto-build/
   git commit -m "chore: Migrate auto-build specs and memory for team sharing"
3. Push to share with your team

════════════════════════════════════════════════════════════════

Notes

  • This migration copies files (original structure preserved in case of issues)
  • After migration, specs and memory are version controlled and shared with your team
  • Worktrees remain local as they are machine-specific
  • You can delete .auto-build-data/specs/ and .auto-build-data/memory/ after verifying migration