feat: Move specs and memory to git for multi-developer collaboration (v1.0.6)
BREAKING CHANGE: Specs, plans, and memory moved from .auto-build-data/ (gitignored) to .auto-build/ (git-tracked) to enable team collaboration. Changes: - Specs/plans now in .auto-build/specs/ (shared with team) - Memory (patterns, gotchas) now in .auto-build/memory/ (shared with team) - .auto-build-data/ now only contains local data (worktrees, cache) - Added /ab:migrate command for existing projects - Removed symlinks from worktree-create.sh (no longer needed) Benefits: - Any developer can continue a plan started by another - Patterns and gotchas shared across team - Works on Windows/Linux/Mac without symlinks - Full version history in git 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
141
plugin/commands/migrate.md
Normal file
141
plugin/commands/migrate.md
Normal file
@@ -0,0 +1,141 @@
|
||||
---
|
||||
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.
|
||||
|
||||
## When to Use
|
||||
|
||||
Run this command if you have an existing project that was using Auto-Build v1.0.5 or earlier, where specs and memory were stored in `.auto-build-data/` (gitignored).
|
||||
|
||||
## What It Does
|
||||
|
||||
1. **Moves specs**: `.auto-build-data/specs/` → `.auto-build/specs/`
|
||||
2. **Moves memory**: `.auto-build-data/memory/` → `.auto-build/memory/`
|
||||
3. **Keeps local data**: `.auto-build-data/worktrees/` and `.auto-build-data/cache/` stay local
|
||||
4. **Updates .gitignore**: Ensures only `.auto-build-data/` is ignored
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Check for Existing Data
|
||||
|
||||
First, check if migration is needed:
|
||||
|
||||
```bash
|
||||
# Check if old structure exists
|
||||
ls -la .auto-build-data/specs/
|
||||
ls -la .auto-build-data/memory/
|
||||
```
|
||||
|
||||
If `.auto-build-data/specs/` or `.auto-build-data/memory/` exist with data, proceed with migration.
|
||||
|
||||
### 2. Create New Structure
|
||||
|
||||
```bash
|
||||
mkdir -p .auto-build/specs
|
||||
mkdir -p .auto-build/memory/sessions
|
||||
```
|
||||
|
||||
### 3. Move Specs
|
||||
|
||||
```bash
|
||||
# Move all feature specs
|
||||
if [ -d ".auto-build-data/specs" ] && [ "$(ls -A .auto-build-data/specs)" ]; then
|
||||
mv .auto-build-data/specs/* .auto-build/specs/
|
||||
echo "Moved specs to .auto-build/specs/"
|
||||
fi
|
||||
```
|
||||
|
||||
### 4. Move Memory
|
||||
|
||||
```bash
|
||||
# Move memory files
|
||||
if [ -f ".auto-build-data/memory/patterns.json" ]; then
|
||||
mv .auto-build-data/memory/patterns.json .auto-build/memory/
|
||||
fi
|
||||
|
||||
if [ -f ".auto-build-data/memory/gotchas.json" ]; then
|
||||
mv .auto-build-data/memory/gotchas.json .auto-build/memory/
|
||||
fi
|
||||
|
||||
if [ -d ".auto-build-data/memory/sessions" ] && [ "$(ls -A .auto-build-data/memory/sessions)" ]; then
|
||||
mv .auto-build-data/memory/sessions/* .auto-build/memory/sessions/
|
||||
fi
|
||||
|
||||
echo "Moved memory to .auto-build/memory/"
|
||||
```
|
||||
|
||||
### 5. Initialize Missing Files
|
||||
|
||||
If memory files don't exist, create them:
|
||||
|
||||
```bash
|
||||
if [ ! -f ".auto-build/memory/patterns.json" ]; then
|
||||
echo '{"patterns": [], "updated": null}' > .auto-build/memory/patterns.json
|
||||
fi
|
||||
|
||||
if [ ! -f ".auto-build/memory/gotchas.json" ]; then
|
||||
echo '{"gotchas": [], "updated": null}' > .auto-build/memory/gotchas.json
|
||||
fi
|
||||
```
|
||||
|
||||
### 6. Update .gitignore
|
||||
|
||||
Ensure `.gitignore` only ignores `.auto-build-data/`:
|
||||
|
||||
```bash
|
||||
# Remove old entries if present
|
||||
grep -v "^\.auto-build-data/" .gitignore > .gitignore.tmp && mv .gitignore.tmp .gitignore
|
||||
|
||||
# Add correct entry
|
||||
if ! grep -q "^\.auto-build-data/" .gitignore; then
|
||||
echo "" >> .gitignore
|
||||
echo "# Auto-Build local data (worktrees, cache)" >> .gitignore
|
||||
echo ".auto-build-data/" >> .gitignore
|
||||
fi
|
||||
```
|
||||
|
||||
### 7. Display 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 is **one-way** - the old structure is not preserved
|
||||
- After migration, specs and memory are **version controlled** and shared with your team
|
||||
- Worktrees remain local as they are machine-specific
|
||||
Reference in New Issue
Block a user