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:
2025-12-22 17:44:52 +02:00
parent f324b43a85
commit 940c6a9f58
15 changed files with 298 additions and 97 deletions

View File

@@ -13,15 +13,15 @@ Orchestrate the complete implementation of a feature using its specification. Th
## Prerequisites
- Spec must exist at `.auto-build-data/specs/{feature-name}/spec.md`
- Spec must exist at `.auto-build/specs/{feature-name}/spec.md`
- Status must be `SPEC_COMPLETE` or `PLANNING_COMPLETE` or `IMPLEMENTING`
## Workflow
### 1. Load Specification
- Read `.auto-build-data/specs/{feature-name}/spec.md`
- Read `.auto-build-data/specs/{feature-name}/status.json`
- Read `.auto-build/specs/{feature-name}/spec.md`
- Read `.auto-build/specs/{feature-name}/status.json`
- Validate spec exists and is complete
- If status is `IMPLEMENTING`, resume from current task
@@ -37,18 +37,17 @@ Create an isolated git worktree? (recommended for larger features)
If yes:
- Run: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/worktree-create.sh {feature-name}`
- Update status.json with worktree path
- **IMPORTANT**: After worktree creation and planning, display clear next steps:
- Display next steps:
```
════════════════════════════════════════════════════════════════
WORKTREE CREATED - ACTION REQUIRED
WORKTREE CREATED
════════════════════════════════════════════════════════════════
✅ Worktree created at: ../ab-worktrees/{project}-{feature-name}/
✅ Branch: feature/ab-{feature-name}
✅ Plan created: .auto-build-data/specs/{feature-name}/plan.md
⚠️ NEXT STEPS (you must do this to continue):
⚠️ NEXT STEPS:
1. Open a NEW VSCode window in the worktree:
@@ -58,11 +57,9 @@ If yes:
/ab:build {feature-name}
(It will detect the plan and start implementation)
────────────────────────────────────────────────────────────────
Why? Claude Code sessions are tied to the current directory.
To work in the isolated worktree, you need a new session there.
Note: Specs and plans in .auto-build/ are already available in
the worktree (they're in git). No symlinks needed!
════════════════════════════════════════════════════════════════
```
@@ -78,15 +75,15 @@ To work in the isolated worktree, you need a new session there.
**If status is `SPEC_COMPLETE`**:
1. Load memory context (if exists):
- Read `.auto-build-data/memory/patterns.json`
- Read `.auto-build-data/memory/gotchas.json`
- Read `.auto-build/memory/patterns.json`
- Read `.auto-build/memory/gotchas.json`
2. Launch **planner** agent with:
- The complete spec.md content
- Relevant patterns from memory
- Instruction to create ordered implementation tasks
3. The planner creates `.auto-build-data/specs/{feature-name}/plan.md`:
3. The planner creates `.auto-build/specs/{feature-name}/plan.md`:
```markdown
# Implementation Plan: {feature-name}
@@ -204,3 +201,16 @@ If status is already `IMPLEMENTING`:
- If coder fails on a task: Mark task as failed, ask user to continue or fix manually
- If worktree creation fails: Continue without worktree, warn user
- If spec not found: "Spec not found. Create with: /ab:spec {name}"
## Note on Team Collaboration
Since specs and plans are stored in `.auto-build/` (committed to git), any team member can:
1. Clone the repo and see existing specs/plans
2. Continue implementation from where another developer left off
3. Share memory (patterns, gotchas) with the team
After making progress, commit changes to share with team:
```bash
git add .auto-build/
git commit -m "build: {feature-name} - completed task X/Y"
```

View File

@@ -101,7 +101,7 @@ For **codebase**:
### 5. Create Session Record
Save comprehensive session record:
`.auto-build-data/memory/sessions/{timestamp}-{feature}.json`
`.auto-build/memory/sessions/{timestamp}-{feature}.json`
```json
{
@@ -123,8 +123,8 @@ Save comprehensive session record:
After saving to JSON files, convert and sync to CLAUDE.md-compatible format:
1. **Load memory files**:
- Read `.auto-build-data/memory/patterns.json`
- Read `.auto-build-data/memory/gotchas.json`
- Read `.auto-build/memory/patterns.json`
- Read `.auto-build/memory/gotchas.json`
2. **Convert to Markdown**:
```markdown

View File

@@ -14,9 +14,9 @@ Search through accumulated patterns, gotchas, and session insights to find relev
## Search Scope
Searches across:
1. `.auto-build-data/memory/patterns.json`
2. `.auto-build-data/memory/gotchas.json`
3. `.auto-build-data/memory/sessions/*.json`
1. `.auto-build/memory/patterns.json`
2. `.auto-build/memory/gotchas.json`
3. `.auto-build/memory/sessions/*.json`
## Workflow

141
plugin/commands/migrate.md Normal file
View 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

View File

@@ -21,7 +21,7 @@ Run iterative QA review with automatic fix attempts. The system will review code
### 1. Initialize
- Determine feature from argument or find active build in status files
- Load spec and plan from `.auto-build-data/specs/{feature-name}/`
- Load spec and plan from `.auto-build/specs/{feature-name}/`
- Create QA iteration directory: `.auto-build-data/cache/qa-iterations/{feature-name}/`
- Set iteration counter to 0
- Update status to `QA_REVIEW`
@@ -44,7 +44,7 @@ while iteration < MAX_ITERATIONS:
- warning: Should fix
- info: Nice to fix
Save to: .auto-build-data/cache/qa-iterations/{feature-name}/iteration-{n}.json
Save to: `.auto-build-data/cache/qa-iterations/{feature-name}/iteration-{n}.json`
# 2c. Check Exit Condition
if no errors and no warnings:
@@ -111,7 +111,7 @@ Next steps:
## Iteration Record Format
`.auto-build-data/cache/qa-iterations/{feature-name}/iteration-{n}.json`:
`.auto-build-data/cache/qa-iterations/{feature-name}/iteration-{n}.json` (local cache):
```json
{
"iteration": 1,

View File

@@ -17,13 +17,13 @@ Create a comprehensive specification for a new feature using the spec-writer age
### 1. Initialize
- Parse feature name from arguments (kebab-case: "User Dashboard" -> "user-dashboard")
- Check if `.auto-build-data/` exists in the project root
- Check if `.auto-build/` exists in the project root
- If not: Create the directory structure:
```
mkdir -p .auto-build-data/specs
mkdir -p .auto-build-data/memory
mkdir -p .auto-build/specs
mkdir -p .auto-build/memory
```
- Check if spec already exists at `.auto-build-data/specs/{feature-name}/`
- Check if spec already exists at `.auto-build/specs/{feature-name}/`
- If exists: Ask "Update existing spec or create new version?"
### 2. Gather Requirements
@@ -56,14 +56,14 @@ Launch the **spec-writer** agent with:
### 4. Generate Specification
The spec-writer agent creates:
- `.auto-build-data/specs/{feature-name}/spec.md` using the template
- `.auto-build-data/specs/{feature-name}/status.json` with state: "SPEC_COMPLETE"
- `.auto-build/specs/{feature-name}/spec.md` using the template
- `.auto-build/specs/{feature-name}/status.json` with state: "SPEC_COMPLETE"
### 5. Confirmation
Display:
```
Specification created: .auto-build-data/specs/{feature-name}/spec.md
Specification created: .auto-build/specs/{feature-name}/spec.md
Summary:
- [Key requirement 1]
@@ -74,8 +74,9 @@ Affected files identified: X files
Estimated complexity: [Low/Medium/High]
Next steps:
- Review the spec: Read .auto-build-data/specs/{feature-name}/spec.md
- Review the spec: Read .auto-build/specs/{feature-name}/spec.md
- Start implementation: /ab:build {feature-name}
- Commit to share with team: git add .auto-build/ && git commit -m "spec: {feature-name}"
```
## Spec Template

View File

@@ -9,11 +9,11 @@ Display the current status of Auto-Build, including active specs and builds.
## Workflow
1. **Check Data Directory**
- Verify `.auto-build-data/` exists
- If not, create it: `mkdir -p .auto-build-data/specs .auto-build-data/memory`
- Verify `.auto-build/` exists
- If not, create it: `mkdir -p .auto-build/specs .auto-build/memory`
2. **List Active Specs**
- Read all directories in `.auto-build-data/specs/`
- Read all directories in `.auto-build/specs/`
- For each spec, read `status.json` to get current state
- Display in table format:
```
@@ -28,7 +28,7 @@ Display the current status of Auto-Build, including active specs and builds.
- Display active worktrees with their paths
4. **Memory Summary**
- Count entries in `patterns.json` and `gotchas.json`
- Count entries in `.auto-build/memory/patterns.json` and `.auto-build/memory/gotchas.json`
- Show last update timestamp
## Status States