一键导入
beeusing-git-worktrees
Isolated workspace creation - creates git worktrees with smart directory selection and safety verification for parallel feature development.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Isolated workspace creation - creates git worktrees with smart directory selection and safety verification for parallel feature development.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Gate 4 of development cycle - dispatches 6 specialized reviewers (code, business-logic, security, test, nil-safety, consequences) in parallel for comprehensive code review feedback.
Gate 7 of development cycle - ensures chaos tests exist using Toxiproxy to verify graceful degradation under connection loss, latency, and partitions.
Main orchestrator for the 8-gate development cycle system. Loads tasks/subtasks from PM team output and executes through implementation → unit testing → fuzz testing → property testing → integration testing (write) → chaos testing (write) → review → validation gates (Gates 0-7), with state persistence and metrics collection. Gates 4-5 (integration/chaos) write and update test code per unit but only execute tests at end of cycle (deferred execution).
Development cycle feedback system - calculates assertiveness scores, analyzes prompt quality for all agents executed, aggregates cycle metrics, performs root cause analysis on failures, and generates improvement reports to docs/feedbacks/cycle-{date}/.
Gate 1 of the React Native frontend development cycle - ensures all components pass accessibility checks with zero violations: correct accessibilityLabel, accessibilityRole, accessibilityHint, VoiceOver (iOS) and TalkBack (Android) compatibility, and minimum touch target sizes.
Gate 1 of frontend development cycle - ensures all components pass axe-core automated accessibility scans with zero WCAG 2.1 AA violations.
| name | bee:using-git-worktrees |
| description | Isolated workspace creation - creates git worktrees with smart directory selection and safety verification for parallel feature development. |
| trigger | - Starting feature that needs isolation from main workspace - Before executing implementation plan - Working on multiple features simultaneously |
| skip_when | - Quick fix in current branch → stay in place - Already in isolated worktree for this feature → continue - Repository doesn't use worktrees → use standard branch workflow |
| sequence | {"after":["brainstorming"],"before":["bee:writing-plans","bee:executing-plans"]} |
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
Core principle: Systematic directory selection + safety verification = reliable isolation.
Announce at start: "I'm using the bee:using-git-worktrees skill to set up an isolated workspace."
Priority order: (1) Existing .worktrees/ or worktrees/ (2) CLAUDE.md preference (3) Ask user
ls -d .worktrees worktrees 2>/dev/null # Check existing (prefer .worktrees)
grep -i "worktree.*director" CLAUDE.md # Check project preference
If none found, ask: .worktrees/ (project-local, hidden) OR ~/.config/bee/worktrees/<project>/ (global)
Project-local directories: MUST verify .gitignore before creating: grep -q "^\.worktrees/$\|^worktrees/$" .gitignore
Global directory (~/.config/bee/worktrees): No verification needed - outside project.
# 1. Detect project
project=$(basename "$(git rev-parse --show-toplevel)")
# 2. Create worktree (path = $LOCATION/$BRANCH or ~/.config/bee/worktrees/$project/$BRANCH)
git worktree add "$path" -b "$BRANCH_NAME" && cd "$path"
# 3. Auto-detect and run setup
[ -f package.json ] && npm install
[ -f Cargo.toml ] && cargo build
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f pyproject.toml ] && poetry install
[ -f composer.json ] && composer install
# 4. Verify clean baseline (npm test / cargo test / pytest / php artisan test)
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report: Worktree ready at <path> | Tests passing (<N> tests) | Ready to implement <feature>
| Situation | Action |
|---|---|
.worktrees/ exists | Use it (verify .gitignore) |
worktrees/ exists | Use it (verify .gitignore) |
| Both exist | Use .worktrees/ |
| Neither exists | Check CLAUDE.md → Ask user |
| Directory not in .gitignore | Add it immediately + commit |
| Tests fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
| Mistake | Problem | Fix |
|---|---|---|
| Skip .gitignore verification | Worktree contents tracked, pollute git status | Always grep .gitignore first |
| Assuming directory location | Inconsistency, violates conventions | Follow priority: existing > CLAUDE.md > ask |
| Proceeding with failing tests | Can't distinguish new vs pre-existing bugs | Report failures, get permission |
| Hardcoding setup commands | Breaks on different tools | Auto-detect from project files |
Announce → Check .worktrees/ exists → Verify .gitignore → git worktree add .worktrees/auth -b feature/auth → npm install → npm test (47 passing) → Report ready
Never:
Always:
Called by:
Pairs with:
STOP and report if:
| Decision Type | Blocker Condition | Required Action |
|---|---|---|
| .gitignore Safety | Project-local worktree directory not in .gitignore | STOP and report |
| Baseline Tests | Tests fail during worktree setup | STOP and report |
| Directory Ambiguity | Multiple conflicting worktree locations exist | STOP and report |
| Permission Issues | Cannot create worktree in target directory | STOP and report |
The following requirements CANNOT be waived:
| Severity | Condition | Required Action |
|---|---|---|
| CRITICAL | Worktree directory not in .gitignore (project-local) | MUST add to .gitignore immediately |
| CRITICAL | Proceeding with failing baseline tests | MUST report failures and get permission |
| HIGH | Skipping dependency installation step | MUST run appropriate package manager |
| HIGH | Assuming directory location when ambiguous | MUST follow priority order or ask user |
| MEDIUM | Missing CLAUDE.md check in priority order | Should check CLAUDE.md preferences |
| LOW | Not auto-detecting project type | Fix in next iteration |
| User Says | Your Response |
|---|---|
| "Skip .gitignore check, just create the worktree" | "CANNOT skip .gitignore verification for project-local directories. Worktree contents would pollute git status." |
| "Tests are failing but proceed anyway" | "CANNOT proceed with failing baseline tests. I need to report failures so we can distinguish pre-existing bugs from new ones." |
| "Put the worktree in this custom location" | "I'll verify that location doesn't conflict with existing conventions and check .gitignore requirements first." |
| "Skip dependency installation, it takes too long" | "CANNOT skip dependency installation. Tests won't run correctly without dependencies, invalidating baseline verification." |
| Rationalization | Why It's WRONG | Required Action |
|---|---|---|
| ".gitignore check is paranoia" | Without it, worktree contents get tracked, polluting every git status. | MUST verify .gitignore first |
| "I know where worktrees go in this project" | Assumption conflicts with existing directories or CLAUDE.md preferences. | MUST follow directory priority order |
| "Failing tests are probably unrelated" | You cannot distinguish new vs pre-existing bugs without clean baseline. | MUST report failures and ask before proceeding |
| "Setup is straightforward, skip auto-detection" | Different projects use different tools. Manual setup misses dependencies. | MUST auto-detect from project files |
| "Global directory doesn't need verification" | Global directories don't need .gitignore verification - this is correct. Only project-local needs it. | MUST distinguish global vs project-local |