From vfm-agent-company
Use when starting feature work that needs isolation from current workspace. Creates isolated git worktrees with smart directory selection and safety verification. Use for parallel development, feature branches, experiments without affecting main workspace.
npx claudepluginhub duylinhdang1998/claude-template-agent --plugin vfm-agent-companyThis skill uses the workspace's default tool permissions.
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
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.
# Check in priority order
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative
If found: Use that directory. If both exist, .worktrees wins.
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
If preference specified: Use it without asking.
If no directory exists and no preference, create .worktrees/.
MUST verify directory is ignored before creating worktree:
# Check if directory is ignored
git check-ignore -q .worktrees 2>/dev/null
If NOT ignored:
Why critical: Prevents accidentally committing worktree contents.
# Get project name
project=$(basename "$(git rev-parse --show-toplevel)")
# Ensure .worktrees is ignored
if ! git check-ignore -q .worktrees 2>/dev/null; then
echo ".worktrees/" >> .gitignore
git add .gitignore
git commit -m "chore: ignore .worktrees directory"
fi
# Create worktree with new branch
BRANCH_NAME="feature/your-feature"
git worktree add .worktrees/$BRANCH_NAME -b $BRANCH_NAME
# Navigate to worktree
cd .worktrees/$BRANCH_NAME
Auto-detect and run appropriate setup:
# Node.js
[ -f package.json ] && npm install
# Python
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f pyproject.toml ] && poetry install
# Go
[ -f go.mod ] && go mod download
# Rust
[ -f Cargo.toml ] && cargo build
# Run tests to ensure worktree starts clean
npm test # Node.js
pytest # Python
go test ./... # Go
cargo test # Rust
If tests fail: Report failures, ask whether to proceed. If tests pass: Ready to work.
Worktree ready at /path/to/project/.worktrees/feature-name
Tests passing (N tests, 0 failures)
Ready to implement [feature-name]
git worktree list
# After merging feature branch
git worktree remove .worktrees/feature-name
# Force remove (if dirty)
git worktree remove --force .worktrees/feature-name
# Clean up stale worktrees
git worktree prune
# Each worktree is a separate directory
cd .worktrees/feature-auth # Work on auth
cd .worktrees/feature-payment # Work on payment
cd /path/to/main/repo # Back to main
When assigning parallel tasks:
## Task Assignment
**Task 1.1** - Backend API (James)
Worktree: `.worktrees/sprint-1-backend`
Branch: `feature/sprint-1-backend`
**Task 1.2** - Frontend UI (Sarah)
Worktree: `.worktrees/sprint-1-frontend`
Branch: `feature/sprint-1-frontend`
Before starting isolated work:
# 1. Create worktree
git worktree add .worktrees/my-feature -b feature/my-feature
# 2. Setup dependencies
cd .worktrees/my-feature && npm install
# 3. Verify baseline
npm test
# 4. Start work
# ... implement feature ...
# 5. When done, merge and cleanup
git checkout main
git merge feature/my-feature
git worktree remove .worktrees/my-feature
git branch -d feature/my-feature
| Situation | Action |
|---|---|
.worktrees/ exists | Use it (verify ignored) |
worktrees/ exists | Use it (verify ignored) |
| Both exist | Use .worktrees/ |
| Neither exists | Create .worktrees/ |
| Directory not ignored | Add to .gitignore + commit |
| Tests fail | Report failures + ask |
| Feature complete | Merge + remove worktree |
Problem: Worktree contents get tracked
Fix: Always git check-ignore before creating
Problem: Stale worktrees accumulate
Fix: git worktree remove after merge
Problem: Build fails in worktree
Fix: Always run npm install / pip install after creation
Never:
Always: