diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 17de205..5196836 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -11,7 +11,7 @@ "name": "ab", "source": "./plugin", "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"] } ] diff --git a/CHANGELOG.md b/CHANGELOG.md index be250df..0f0fed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,27 @@ 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 ### Fixed diff --git a/README.md b/README.md index 01f8f02..138ec3c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ Auto-Build este un plugin oficial Claude Code care transformฤƒ modul รฎn care de # - CLAUDE.md (dacฤƒ nu existฤƒ) # - .claude/rules/auto-build-patterns.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 /ab:help @@ -227,9 +228,9 @@ What insights should be saved? Agent salveazฤƒ รฎn **2 locaศ›ii simultan**: -**A) JSON Files** (searchable) +**A) JSON Files** (searchable, git-tracked - shared with team) ```json -// .auto-build-data/memory/patterns.json +// .auto-build/memory/patterns.json { "id": "pat_20250121_143000", "title": "API Error Handling Pattern", @@ -512,20 +513,28 @@ user-project/ โ”‚ โ”‚ โ””โ”€โ”€ auto-build-memory.md โ† Updated de /ab:memory-save โ”‚ โ””โ”€โ”€ settings.json โ”‚ -โ””โ”€โ”€ .auto-build-data/ โ† Runtime data (gitignored) - โ”œโ”€โ”€ specs/{feature-name}/ - โ”‚ โ”œโ”€โ”€ spec.md - โ”‚ โ”œโ”€โ”€ plan.md - โ”‚ โ””โ”€โ”€ status.json +โ”œโ”€โ”€ .auto-build/ โ† COMMITTED TO GIT - shared with team +โ”‚ โ”œโ”€โ”€ specs/{feature-name}/ +โ”‚ โ”‚ โ”œโ”€โ”€ spec.md +โ”‚ โ”‚ โ”œโ”€โ”€ plan.md +โ”‚ โ”‚ โ””โ”€โ”€ status.json +โ”‚ โ””โ”€โ”€ memory/ +โ”‚ โ”œโ”€โ”€ patterns.json โ† Searchable via /ab:memory-search +โ”‚ โ”œโ”€โ”€ gotchas.json โ† Searchable via /ab:memory-search +โ”‚ โ””โ”€โ”€ sessions/ +โ”‚ +โ””โ”€โ”€ .auto-build-data/ โ† GITIGNORED - local only โ”œโ”€โ”€ worktrees/ โ”‚ โ””โ”€โ”€ worktree-registry.json - โ”œโ”€โ”€ memory/ - โ”‚ โ”œโ”€โ”€ patterns.json โ† Searchable via /ab:memory-search - โ”‚ โ”œโ”€โ”€ gotchas.json โ† Searchable via /ab:memory-search - โ”‚ โ””โ”€โ”€ sessions/ โ””โ”€โ”€ 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 diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index 39704bd..58805b8 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "ab", "description": "Auto-Build: Spec-driven build orchestration with worktree isolation and session memory", - "version": "1.0.5", + "version": "1.0.6", "author": { "name": "ROA2WEB Team" } diff --git a/plugin/README.md b/plugin/README.md index ebcacc2..22d86c6 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -31,7 +31,7 @@ Auto-Build is a Claude Code plugin that provides autonomous feature implementati โ†“ spec-writer agent โ†“ - spec.md created in .auto-build-data/specs/ + spec.md created in .auto-build/specs/ (git-tracked!) โ†“ /ab:build feature-name โ†“ @@ -49,10 +49,12 @@ Auto-Build is a Claude Code plugin that provides autonomous feature implementati โ†“ /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!) ``` +**New in v1.0.6**: Specs, plans, and memory are now git-tracked, enabling multi-developer collaboration! + --- ## Commands @@ -130,20 +132,26 @@ user-project/ # Your project โ”‚ โ”‚ โ””โ”€โ”€ auto-build-memory.md # Updated by /ab:memory-save โ”‚ โ””โ”€โ”€ settings.json โ”‚ -โ””โ”€โ”€ .auto-build-data/ # Runtime data (gitignored) - โ”œโ”€โ”€ specs/{feature-name}/ - โ”‚ โ”œโ”€โ”€ spec.md - โ”‚ โ”œโ”€โ”€ plan.md - โ”‚ โ””โ”€โ”€ status.json +โ”œโ”€โ”€ .auto-build/ # โญ COMMITTED TO GIT - shared with team +โ”‚ โ”œโ”€โ”€ specs/{feature-name}/ +โ”‚ โ”‚ โ”œโ”€โ”€ spec.md # Feature specification +โ”‚ โ”‚ โ”œโ”€โ”€ plan.md # Implementation plan +โ”‚ โ”‚ โ””โ”€โ”€ status.json # Build status +โ”‚ โ””โ”€โ”€ memory/ +โ”‚ โ”œโ”€โ”€ patterns.json # Searchable via /ab:memory-search +โ”‚ โ”œโ”€โ”€ gotchas.json # Searchable via /ab:memory-search +โ”‚ โ””โ”€โ”€ sessions/ # Session history +โ”‚ +โ””โ”€โ”€ .auto-build-data/ # GITIGNORED - local only โ”œโ”€โ”€ worktrees/ - โ”‚ โ””โ”€โ”€ worktree-registry.json - โ”œโ”€โ”€ memory/ - โ”‚ โ”œโ”€โ”€ patterns.json # Searchable via /ab:memory-search - โ”‚ โ”œโ”€โ”€ gotchas.json # Searchable via /ab:memory-search - โ”‚ โ””โ”€โ”€ sessions/ - โ””โ”€โ”€ cache/qa-iterations/ + โ”‚ โ””โ”€โ”€ 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 @@ -236,9 +244,9 @@ Auto-Build is designed to be portable: 1. **Plugin-based**: Installs via official Claude Code plugin system 2. **Self-contained**: Everything lives in plugin directory 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 -6. **Team sharing**: Git-friendly, works on all platforms +6. **Team sharing**: Specs, plans, and memory are git-tracked for multi-developer collaboration --- diff --git a/plugin/commands/build.md b/plugin/commands/build.md index 62a62d7..ee7f7a6 100644 --- a/plugin/commands/build.md +++ b/plugin/commands/build.md @@ -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" +``` diff --git a/plugin/commands/memory-save.md b/plugin/commands/memory-save.md index 4b674a1..fd7c823 100644 --- a/plugin/commands/memory-save.md +++ b/plugin/commands/memory-save.md @@ -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 diff --git a/plugin/commands/memory-search.md b/plugin/commands/memory-search.md index 72e873f..8cdfed6 100644 --- a/plugin/commands/memory-search.md +++ b/plugin/commands/memory-search.md @@ -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 diff --git a/plugin/commands/migrate.md b/plugin/commands/migrate.md new file mode 100644 index 0000000..d095386 --- /dev/null +++ b/plugin/commands/migrate.md @@ -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 diff --git a/plugin/commands/qa-review.md b/plugin/commands/qa-review.md index 40e5166..85de12f 100644 --- a/plugin/commands/qa-review.md +++ b/plugin/commands/qa-review.md @@ -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, diff --git a/plugin/commands/spec.md b/plugin/commands/spec.md index d896a3e..d203c09 100644 --- a/plugin/commands/spec.md +++ b/plugin/commands/spec.md @@ -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 diff --git a/plugin/commands/status.md b/plugin/commands/status.md index c2dcd7f..53aac26 100644 --- a/plugin/commands/status.md +++ b/plugin/commands/status.md @@ -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 diff --git a/plugin/hooks/post-install.sh b/plugin/hooks/post-install.sh index b015892..02b685b 100644 --- a/plugin/hooks/post-install.sh +++ b/plugin/hooks/post-install.sh @@ -26,30 +26,43 @@ Last updated: Never (This file is automatically updated by /ab:memory-save)" > "$PROJECT_ROOT/.claude/rules/auto-build-memory.md" -# 4. Create .auto-build-data/ structure -echo "Creating .auto-build-data/ structure..." -mkdir -p "$PROJECT_ROOT/.auto-build-data"/{specs,worktrees,memory/sessions,cache/qa-iterations} +# 4. Create .auto-build/ structure (COMMITTED TO GIT - shared with team) +echo "Creating .auto-build/ structure (shared with team)..." +mkdir -p "$PROJECT_ROOT/.auto-build"/{specs,memory/sessions} -# Initialize memory files -echo '{"patterns": [], "updated": null}' > "$PROJECT_ROOT/.auto-build-data/memory/patterns.json" -echo '{"gotchas": [], "updated": null}' > "$PROJECT_ROOT/.auto-build-data/memory/gotchas.json" -echo '{"worktrees": []}' > "$PROJECT_ROOT/.auto-build-data/worktrees/worktree-registry.json" +# Initialize memory files if they don't exist +if [ ! -f "$PROJECT_ROOT/.auto-build/memory/patterns.json" ]; then + echo '{"patterns": [], "updated": null}' > "$PROJECT_ROOT/.auto-build/memory/patterns.json" +fi -# 5. Add .auto-build-data/ to .gitignore if not present +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" +fi + +# 6. Add .auto-build-data/ to .gitignore if not present if [ -f "$PROJECT_ROOT/.gitignore" ]; then if ! grep -q "^\.auto-build-data/" "$PROJECT_ROOT/.gitignore" 2>/dev/null; then 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 "Added .auto-build-data/ to .gitignore" fi 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 "Created .gitignore with .auto-build-data/ entry" fi -# 6. Initialize or update CLAUDE.md +# 7. Initialize or update CLAUDE.md if [ ! -f "$PROJECT_ROOT/CLAUDE.md" ]; then echo "Generating CLAUDE.md from template..." cp "$PLUGIN_DIR/templates/CLAUDE.md.template" "$PROJECT_ROOT/CLAUDE.md" @@ -75,7 +88,8 @@ echo "" echo "What was installed:" echo " โœ… .claude/rules/auto-build-patterns.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 " โœ… .gitignore updated" echo "" @@ -84,3 +98,5 @@ echo " 1. Restart Claude Code to load CLAUDE.md" echo " 2. Run /ab:help for available commands" echo " 3. Create your first spec: /ab:spec \"My Feature\"" echo "" +echo "Note: Don't forget to commit .auto-build/ to share specs with your team!" +echo "" diff --git a/plugin/rules/auto-build-patterns.md b/plugin/rules/auto-build-patterns.md index d7afec1..6fc91d2 100644 --- a/plugin/rules/auto-build-patterns.md +++ b/plugin/rules/auto-build-patterns.md @@ -10,8 +10,9 @@ These rules apply to all Auto-Build related files and workflows. ### 1. Portability First - All paths must be relative or dynamically determined -- No hardcoded project-specific values in .auto-build/ -- Data lives in .auto-build-data/ which is gitignored +- No hardcoded project-specific values +- Shared data (specs, plans, memory) lives in `.auto-build/` (git-tracked) +- Local data (worktrees, cache) lives in `.auto-build-data/` (gitignored) ### 2. Minimal Footprint - 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 - Include at least 3 acceptance criteria - 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 - Check for existing spec before proceeding @@ -89,17 +90,21 @@ SPEC_DRAFT โ†’ SPEC_COMPLETE โ†’ PLANNING โ†’ PLANNING_COMPLETE โ†’ IMPLEMENTING โ†’ IMPLEMENTATION_COMPLETE โ†’ QA_REVIEW โ†’ COMPLETE ``` -### Memory Files -- patterns.json: Reusable code patterns -- gotchas.json: Problems and solutions -- codebase-map.json: Structural insights -- sessions/*.json: Session history +### Memory Files (`.auto-build/memory/` - git-tracked) +- patterns.json: Reusable code patterns (shared with team) +- gotchas.json: Problems and solutions (shared with team) +- sessions/*.json: Session history (shared with team) + +### Local Data Files (`.auto-build-data/` - gitignored) +- worktrees/worktree-registry.json: Local worktree tracking +- cache/qa-iterations/*.json: Temporary QA cache ## Git Worktree Rules - Create worktrees outside project: ../ab-worktrees/ - 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 ## Error Handling diff --git a/plugin/scripts/worktree-create.sh b/plugin/scripts/worktree-create.sh index a20c2c5..9ebbd52 100644 --- a/plugin/scripts/worktree-create.sh +++ b/plugin/scripts/worktree-create.sh @@ -66,18 +66,8 @@ fi echo "Creating worktree..." git worktree add "$WORKTREE_PATH" "$BRANCH_NAME" -# Create symlink to .auto-build-data/ from main repo -# This ensures specs, plans, and status are shared across worktrees -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 +# Note: No symlinks needed - specs and memory are in .auto-build/ (git-tracked) +# The worktree automatically has access to all shared data # Update registry REGISTRY_FILE="$PROJECT_ROOT/.auto-build-data/worktrees/worktree-registry.json"