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

@@ -11,7 +11,7 @@
"name": "ab", "name": "ab",
"source": "./plugin", "source": "./plugin",
"description": "Spec-driven build orchestration with git worktree isolation and session memory", "description": "Spec-driven build orchestration with git worktree isolation and session memory",
"version": "1.0.5", "version": "1.0.6",
"keywords": ["build", "spec", "automation", "worktree", "qa"] "keywords": ["build", "spec", "automation", "worktree", "qa"]
} }
] ]

View File

@@ -2,6 +2,27 @@
All notable changes to Auto-Build plugin. All notable changes to Auto-Build plugin.
## [1.0.6] - 2024-12-22
### Changed (BREAKING)
- **Specs and plans moved to `.auto-build/`** (git-tracked) for multi-developer collaboration
- **Memory moved to `.auto-build/memory/`** (git-tracked) so team shares learned patterns
- `.auto-build-data/` now only contains local data (worktrees, cache)
### Added
- New `/ab:migrate` command for existing projects to migrate from old structure
- Documentation updates explaining git-tracked vs local data separation
### Removed
- Symlinks in worktree-create.sh - no longer needed since data is in git
- Old `.auto-build-data/specs/` and `.auto-build-data/memory/` paths
### Benefits
- 🤝 Multi-developer collaboration - any developer can continue a plan
- 🧠 Shared learning - patterns and gotchas available to entire team
- 🌍 Cross-platform - works on Windows/Linux/Mac without symlinks
- 📜 Version history - specs/plans/memory changes visible in git
## [1.0.5] - 2024-12-22 ## [1.0.5] - 2024-12-22
### Fixed ### Fixed

View File

@@ -45,7 +45,8 @@ Auto-Build este un plugin oficial Claude Code care transformă modul în care de
# - CLAUDE.md (dacă nu există) # - CLAUDE.md (dacă nu există)
# - .claude/rules/auto-build-patterns.md # - .claude/rules/auto-build-patterns.md
# - .claude/rules/auto-build-memory.md # - .claude/rules/auto-build-memory.md
# - .auto-build-data/ structure # - .auto-build/ structure (specs, memory - git-tracked)
# - .auto-build-data/ structure (worktrees, cache - local only)
# 4. Verifică instalarea # 4. Verifică instalarea
/ab:help /ab:help
@@ -227,9 +228,9 @@ What insights should be saved?
Agent salvează în **2 locații simultan**: Agent salvează în **2 locații simultan**:
**A) JSON Files** (searchable) **A) JSON Files** (searchable, git-tracked - shared with team)
```json ```json
// .auto-build-data/memory/patterns.json // .auto-build/memory/patterns.json
{ {
"id": "pat_20250121_143000", "id": "pat_20250121_143000",
"title": "API Error Handling Pattern", "title": "API Error Handling Pattern",
@@ -512,20 +513,28 @@ user-project/
│ │ └── auto-build-memory.md ← Updated de /ab:memory-save │ │ └── auto-build-memory.md ← Updated de /ab:memory-save
│ └── settings.json │ └── settings.json
── .auto-build-data/ ← Runtime data (gitignored) ── .auto-build/ ← COMMITTED TO GIT - shared with team
├── specs/{feature-name}/ ├── specs/{feature-name}/
│ ├── spec.md │ ├── spec.md
│ ├── plan.md │ ├── plan.md
│ └── status.json │ └── status.json
── worktrees/ ── memory/
│ └── worktree-registry.json
├── memory/
│ ├── patterns.json ← Searchable via /ab:memory-search │ ├── patterns.json ← Searchable via /ab:memory-search
│ ├── gotchas.json ← Searchable via /ab:memory-search │ ├── gotchas.json ← Searchable via /ab:memory-search
│ └── sessions/ │ └── sessions/
└── .auto-build-data/ ← GITIGNORED - local only
├── worktrees/
│ └── worktree-registry.json
└── cache/qa-iterations/ └── cache/qa-iterations/
``` ```
**Beneficii noi (v1.0.6)**:
- 🤝 **Colaborare**: Alt developer poate continua planul tău
- 🧠 **Învățare partajată**: Patterns și gotchas disponibile pentru toată echipa
- 🌍 **Cross-platform**: Funcționează fără symlinks pe Windows/Linux/Mac
- 📜 **Versionare**: Istoricul specs/plans/memory vizibil în git
--- ---
## 🔧 Configurare Gitea ## 🔧 Configurare Gitea

View File

@@ -1,7 +1,7 @@
{ {
"name": "ab", "name": "ab",
"description": "Auto-Build: Spec-driven build orchestration with worktree isolation and session memory", "description": "Auto-Build: Spec-driven build orchestration with worktree isolation and session memory",
"version": "1.0.5", "version": "1.0.6",
"author": { "author": {
"name": "ROA2WEB Team" "name": "ROA2WEB Team"
} }

View File

@@ -31,7 +31,7 @@ Auto-Build is a Claude Code plugin that provides autonomous feature implementati
spec-writer agent spec-writer agent
spec.md created in .auto-build-data/specs/ spec.md created in .auto-build/specs/ (git-tracked!)
/ab:build feature-name /ab:build feature-name
@@ -49,10 +49,12 @@ Auto-Build is a Claude Code plugin that provides autonomous feature implementati
/ab:memory-save /ab:memory-save
patterns.json, gotchas.json updated patterns.json, gotchas.json in .auto-build/memory/ (git-tracked!)
+ .claude/rules/auto-build-memory.md synced (auto-loaded!) + .claude/rules/auto-build-memory.md synced (auto-loaded!)
``` ```
**New in v1.0.6**: Specs, plans, and memory are now git-tracked, enabling multi-developer collaboration!
--- ---
## Commands ## Commands
@@ -130,20 +132,26 @@ user-project/ # Your project
│ │ └── auto-build-memory.md # Updated by /ab:memory-save │ │ └── auto-build-memory.md # Updated by /ab:memory-save
│ └── settings.json │ └── settings.json
── .auto-build-data/ # Runtime data (gitignored) ── .auto-build/ # ⭐ COMMITTED TO GIT - shared with team
├── specs/{feature-name}/ ├── specs/{feature-name}/
│ ├── spec.md │ ├── spec.md # Feature specification
│ ├── plan.md │ ├── plan.md # Implementation plan
│ └── status.json │ └── status.json # Build status
── worktrees/ ── memory/
│ └── worktree-registry.json
├── memory/
│ ├── patterns.json # Searchable via /ab:memory-search │ ├── patterns.json # Searchable via /ab:memory-search
│ ├── gotchas.json # Searchable via /ab:memory-search │ ├── gotchas.json # Searchable via /ab:memory-search
└── sessions/ └── sessions/ # Session history
└── cache/qa-iterations/
└── .auto-build-data/ # GITIGNORED - local only
├── worktrees/
│ └── worktree-registry.json # Local worktree tracking
└── cache/qa-iterations/ # Temporary QA cache
``` ```
**Data Separation (v1.0.6)**:
- `.auto-build/` - Git-tracked: specs, plans, memory (shared with team)
- `.auto-build-data/` - Gitignored: worktrees, cache (local only)
--- ---
## Agents ## Agents
@@ -236,9 +244,9 @@ Auto-Build is designed to be portable:
1. **Plugin-based**: Installs via official Claude Code plugin system 1. **Plugin-based**: Installs via official Claude Code plugin system
2. **Self-contained**: Everything lives in plugin directory 2. **Self-contained**: Everything lives in plugin directory
3. **No external dependencies**: Uses only Claude Code agents and Bash scripts 3. **No external dependencies**: Uses only Claude Code agents and Bash scripts
4. **Clean separation**: Runtime data in `.auto-build-data/` (gitignored) 4. **Clean separation**: Shared data in `.auto-build/` (git), local data in `.auto-build-data/` (gitignored)
5. **Cross-platform**: Uses @import (git-friendly), not symlinks 5. **Cross-platform**: Uses @import (git-friendly), not symlinks
6. **Team sharing**: Git-friendly, works on all platforms 6. **Team sharing**: Specs, plans, and memory are git-tracked for multi-developer collaboration
--- ---

View File

@@ -13,15 +13,15 @@ Orchestrate the complete implementation of a feature using its specification. Th
## Prerequisites ## 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` - Status must be `SPEC_COMPLETE` or `PLANNING_COMPLETE` or `IMPLEMENTING`
## Workflow ## Workflow
### 1. Load Specification ### 1. Load Specification
- Read `.auto-build-data/specs/{feature-name}/spec.md` - Read `.auto-build/specs/{feature-name}/spec.md`
- Read `.auto-build-data/specs/{feature-name}/status.json` - Read `.auto-build/specs/{feature-name}/status.json`
- Validate spec exists and is complete - Validate spec exists and is complete
- If status is `IMPLEMENTING`, resume from current task - If status is `IMPLEMENTING`, resume from current task
@@ -37,18 +37,17 @@ Create an isolated git worktree? (recommended for larger features)
If yes: If yes:
- Run: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/worktree-create.sh {feature-name}` - Run: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/worktree-create.sh {feature-name}`
- Update status.json with worktree path - 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}/ ✅ Worktree created at: ../ab-worktrees/{project}-{feature-name}/
✅ Branch: feature/ab-{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: 1. Open a NEW VSCode window in the worktree:
@@ -58,11 +57,9 @@ If yes:
/ab:build {feature-name} /ab:build {feature-name}
(It will detect the plan and start implementation)
──────────────────────────────────────────────────────────────── ────────────────────────────────────────────────────────────────
Why? Claude Code sessions are tied to the current directory. Note: Specs and plans in .auto-build/ are already available in
To work in the isolated worktree, you need a new session there. 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`**: **If status is `SPEC_COMPLETE`**:
1. Load memory context (if exists): 1. Load memory context (if exists):
- Read `.auto-build-data/memory/patterns.json` - Read `.auto-build/memory/patterns.json`
- Read `.auto-build-data/memory/gotchas.json` - Read `.auto-build/memory/gotchas.json`
2. Launch **planner** agent with: 2. Launch **planner** agent with:
- The complete spec.md content - The complete spec.md content
- Relevant patterns from memory - Relevant patterns from memory
- Instruction to create ordered implementation tasks - 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 ```markdown
# Implementation Plan: {feature-name} # 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 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 worktree creation fails: Continue without worktree, warn user
- If spec not found: "Spec not found. Create with: /ab:spec {name}" - 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 ### 5. Create Session Record
Save comprehensive session record: Save comprehensive session record:
`.auto-build-data/memory/sessions/{timestamp}-{feature}.json` `.auto-build/memory/sessions/{timestamp}-{feature}.json`
```json ```json
{ {
@@ -123,8 +123,8 @@ Save comprehensive session record:
After saving to JSON files, convert and sync to CLAUDE.md-compatible format: After saving to JSON files, convert and sync to CLAUDE.md-compatible format:
1. **Load memory files**: 1. **Load memory files**:
- Read `.auto-build-data/memory/patterns.json` - Read `.auto-build/memory/patterns.json`
- Read `.auto-build-data/memory/gotchas.json` - Read `.auto-build/memory/gotchas.json`
2. **Convert to Markdown**: 2. **Convert to Markdown**:
```markdown ```markdown

View File

@@ -14,9 +14,9 @@ Search through accumulated patterns, gotchas, and session insights to find relev
## Search Scope ## Search Scope
Searches across: Searches across:
1. `.auto-build-data/memory/patterns.json` 1. `.auto-build/memory/patterns.json`
2. `.auto-build-data/memory/gotchas.json` 2. `.auto-build/memory/gotchas.json`
3. `.auto-build-data/memory/sessions/*.json` 3. `.auto-build/memory/sessions/*.json`
## Workflow ## 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 ### 1. Initialize
- Determine feature from argument or find active build in status files - 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}/` - Create QA iteration directory: `.auto-build-data/cache/qa-iterations/{feature-name}/`
- Set iteration counter to 0 - Set iteration counter to 0
- Update status to `QA_REVIEW` - Update status to `QA_REVIEW`
@@ -44,7 +44,7 @@ while iteration < MAX_ITERATIONS:
- warning: Should fix - warning: Should fix
- info: Nice to 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 # 2c. Check Exit Condition
if no errors and no warnings: if no errors and no warnings:
@@ -111,7 +111,7 @@ Next steps:
## Iteration Record Format ## 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 ```json
{ {
"iteration": 1, "iteration": 1,

View File

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

View File

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

View File

@@ -26,30 +26,43 @@ Last updated: Never
(This file is automatically updated by /ab:memory-save)" > "$PROJECT_ROOT/.claude/rules/auto-build-memory.md" (This file is automatically updated by /ab:memory-save)" > "$PROJECT_ROOT/.claude/rules/auto-build-memory.md"
# 4. Create .auto-build-data/ structure # 4. Create .auto-build/ structure (COMMITTED TO GIT - shared with team)
echo "Creating .auto-build-data/ structure..." echo "Creating .auto-build/ structure (shared with team)..."
mkdir -p "$PROJECT_ROOT/.auto-build-data"/{specs,worktrees,memory/sessions,cache/qa-iterations} mkdir -p "$PROJECT_ROOT/.auto-build"/{specs,memory/sessions}
# Initialize memory files # Initialize memory files if they don't exist
echo '{"patterns": [], "updated": null}' > "$PROJECT_ROOT/.auto-build-data/memory/patterns.json" if [ ! -f "$PROJECT_ROOT/.auto-build/memory/patterns.json" ]; then
echo '{"gotchas": [], "updated": null}' > "$PROJECT_ROOT/.auto-build-data/memory/gotchas.json" echo '{"patterns": [], "updated": null}' > "$PROJECT_ROOT/.auto-build/memory/patterns.json"
fi
if [ ! -f "$PROJECT_ROOT/.auto-build/memory/gotchas.json" ]; then
echo '{"gotchas": [], "updated": null}' > "$PROJECT_ROOT/.auto-build/memory/gotchas.json"
fi
# 5. Create .auto-build-data/ structure (GITIGNORED - local only)
echo "Creating .auto-build-data/ structure (local only)..."
mkdir -p "$PROJECT_ROOT/.auto-build-data"/{worktrees,cache/qa-iterations}
# Initialize worktree registry
if [ ! -f "$PROJECT_ROOT/.auto-build-data/worktrees/worktree-registry.json" ]; then
echo '{"worktrees": []}' > "$PROJECT_ROOT/.auto-build-data/worktrees/worktree-registry.json" echo '{"worktrees": []}' > "$PROJECT_ROOT/.auto-build-data/worktrees/worktree-registry.json"
fi
# 5. Add .auto-build-data/ to .gitignore if not present # 6. Add .auto-build-data/ to .gitignore if not present
if [ -f "$PROJECT_ROOT/.gitignore" ]; then if [ -f "$PROJECT_ROOT/.gitignore" ]; then
if ! grep -q "^\.auto-build-data/" "$PROJECT_ROOT/.gitignore" 2>/dev/null; then if ! grep -q "^\.auto-build-data/" "$PROJECT_ROOT/.gitignore" 2>/dev/null; then
echo "" >> "$PROJECT_ROOT/.gitignore" echo "" >> "$PROJECT_ROOT/.gitignore"
echo "# Auto-Build runtime data (local only)" >> "$PROJECT_ROOT/.gitignore" echo "# Auto-Build local data (worktrees, cache)" >> "$PROJECT_ROOT/.gitignore"
echo ".auto-build-data/" >> "$PROJECT_ROOT/.gitignore" echo ".auto-build-data/" >> "$PROJECT_ROOT/.gitignore"
echo "Added .auto-build-data/ to .gitignore" echo "Added .auto-build-data/ to .gitignore"
fi fi
else else
echo "# Auto-Build runtime data (local only)" > "$PROJECT_ROOT/.gitignore" echo "# Auto-Build local data (worktrees, cache)" > "$PROJECT_ROOT/.gitignore"
echo ".auto-build-data/" >> "$PROJECT_ROOT/.gitignore" echo ".auto-build-data/" >> "$PROJECT_ROOT/.gitignore"
echo "Created .gitignore with .auto-build-data/ entry" echo "Created .gitignore with .auto-build-data/ entry"
fi fi
# 6. Initialize or update CLAUDE.md # 7. Initialize or update CLAUDE.md
if [ ! -f "$PROJECT_ROOT/CLAUDE.md" ]; then if [ ! -f "$PROJECT_ROOT/CLAUDE.md" ]; then
echo "Generating CLAUDE.md from template..." echo "Generating CLAUDE.md from template..."
cp "$PLUGIN_DIR/templates/CLAUDE.md.template" "$PROJECT_ROOT/CLAUDE.md" cp "$PLUGIN_DIR/templates/CLAUDE.md.template" "$PROJECT_ROOT/CLAUDE.md"
@@ -75,7 +88,8 @@ echo ""
echo "What was installed:" echo "What was installed:"
echo " ✅ .claude/rules/auto-build-patterns.md" echo " ✅ .claude/rules/auto-build-patterns.md"
echo " ✅ .claude/rules/auto-build-memory.md" echo " ✅ .claude/rules/auto-build-memory.md"
echo " ✅ .auto-build-data/ structure" echo " ✅ .auto-build/ (specs & memory - shared with team)"
echo " ✅ .auto-build-data/ (local worktrees & cache)"
echo " ✅ CLAUDE.md (created or updated)" echo " ✅ CLAUDE.md (created or updated)"
echo " ✅ .gitignore updated" echo " ✅ .gitignore updated"
echo "" echo ""
@@ -84,3 +98,5 @@ echo " 1. Restart Claude Code to load CLAUDE.md"
echo " 2. Run /ab:help for available commands" echo " 2. Run /ab:help for available commands"
echo " 3. Create your first spec: /ab:spec \"My Feature\"" echo " 3. Create your first spec: /ab:spec \"My Feature\""
echo "" echo ""
echo "Note: Don't forget to commit .auto-build/ to share specs with your team!"
echo ""

View File

@@ -10,8 +10,9 @@ These rules apply to all Auto-Build related files and workflows.
### 1. Portability First ### 1. Portability First
- All paths must be relative or dynamically determined - All paths must be relative or dynamically determined
- No hardcoded project-specific values in .auto-build/ - No hardcoded project-specific values
- Data lives in .auto-build-data/ which is gitignored - Shared data (specs, plans, memory) lives in `.auto-build/` (git-tracked)
- Local data (worktrees, cache) lives in `.auto-build-data/` (gitignored)
### 2. Minimal Footprint ### 2. Minimal Footprint
- Never modify files outside the current task scope - Never modify files outside the current task scope
@@ -29,7 +30,7 @@ These rules apply to all Auto-Build related files and workflows.
- Always analyze the codebase before writing spec - Always analyze the codebase before writing spec
- Include at least 3 acceptance criteria - Include at least 3 acceptance criteria
- Identify affected files explicitly - Identify affected files explicitly
- Save to .auto-build-data/specs/{name}/ - Save to `.auto-build/specs/{name}/` (git-tracked, shared with team)
### When Running /ab:build ### When Running /ab:build
- Check for existing spec before proceeding - Check for existing spec before proceeding
@@ -89,17 +90,21 @@ SPEC_DRAFT → SPEC_COMPLETE → PLANNING → PLANNING_COMPLETE →
IMPLEMENTING → IMPLEMENTATION_COMPLETE → QA_REVIEW → COMPLETE IMPLEMENTING → IMPLEMENTATION_COMPLETE → QA_REVIEW → COMPLETE
``` ```
### Memory Files ### Memory Files (`.auto-build/memory/` - git-tracked)
- patterns.json: Reusable code patterns - patterns.json: Reusable code patterns (shared with team)
- gotchas.json: Problems and solutions - gotchas.json: Problems and solutions (shared with team)
- codebase-map.json: Structural insights - sessions/*.json: Session history (shared with team)
- sessions/*.json: Session history
### Local Data Files (`.auto-build-data/` - gitignored)
- worktrees/worktree-registry.json: Local worktree tracking
- cache/qa-iterations/*.json: Temporary QA cache
## Git Worktree Rules ## Git Worktree Rules
- Create worktrees outside project: ../ab-worktrees/ - Create worktrees outside project: ../ab-worktrees/
- Branch naming: feature/ab-{feature-name} - Branch naming: feature/ab-{feature-name}
- Registry tracking in worktree-registry.json - Registry tracking in `.auto-build-data/worktrees/worktree-registry.json`
- No symlinks needed - specs/plans/memory are in git, available in all worktrees
- Cleanup only merged branches automatically - Cleanup only merged branches automatically
## Error Handling ## Error Handling

View File

@@ -66,18 +66,8 @@ fi
echo "Creating worktree..." echo "Creating worktree..."
git worktree add "$WORKTREE_PATH" "$BRANCH_NAME" git worktree add "$WORKTREE_PATH" "$BRANCH_NAME"
# Create symlink to .auto-build-data/ from main repo # Note: No symlinks needed - specs and memory are in .auto-build/ (git-tracked)
# This ensures specs, plans, and status are shared across worktrees # The worktree automatically has access to all shared data
if [ -d "$PROJECT_ROOT/.auto-build-data" ]; then
echo "Creating symlink to .auto-build-data/..."
ln -s "$PROJECT_ROOT/.auto-build-data" "$WORKTREE_PATH/.auto-build-data"
fi
# Also symlink .claude/rules/ for memory access
if [ -d "$PROJECT_ROOT/.claude/rules" ]; then
mkdir -p "$WORKTREE_PATH/.claude"
ln -s "$PROJECT_ROOT/.claude/rules" "$WORKTREE_PATH/.claude/rules"
fi
# Update registry # Update registry
REGISTRY_FILE="$PROJECT_ROOT/.auto-build-data/worktrees/worktree-registry.json" REGISTRY_FILE="$PROJECT_ROOT/.auto-build-data/worktrees/worktree-registry.json"