duylinhdang1998/claude-template-agent/git-worktrees
Claude Code and agent skill by duylinhdang1998/claude-template-agent
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install duylinhdang1998/claude-template-agent/git-worktreesSKILL.md
The same SKILL.md was published earlier as duylinhdang1998/claude-template-agent/git-worktrees.
Git Worktrees
Overview
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.
When to Use
- Starting new feature that needs isolation
- Working on multiple features in parallel
- Experimenting without affecting main workspace
- Running tests on different branches simultaneously
- PM assigns parallel tasks to multiple specialists
Directory Selection Priority
1. Check Existing Directories
If found: Use that directory. If both exist, .worktrees wins.
2. Check CLAUDE.md
If preference specified: Use it without asking.
3. Default to .worktrees/
If no directory exists and no preference, create .worktrees/.
Safety Verification
For Project-Local Directories
MUST verify directory is ignored before creating worktree:
If NOT ignored:
- Add to .gitignore
- Commit the change
- Proceed with worktree creation
Why critical: Prevents accidentally committing worktree contents.
Creation Steps
Step 1: Prepare
Step 2: Create Worktree
Step 3: Run Project Setup
Auto-detect and run appropriate setup:
Step 4: Verify Clean Baseline
If tests fail: Report failures, ask whether to proceed. If tests pass: Ready to work.
Step 5: Report Location
Managing Worktrees
List All Worktrees
Remove Worktree
Switch Between Worktrees
Integration with Super Agent
For PM
When assigning parallel tasks:
For Specialists
Before starting isolated work:
Quick Reference
| 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 |
Common Mistakes
Skipping ignore verification
Problem: Worktree contents get tracked Fix: Always git check-ignore before creating
Not cleaning up worktrees
Problem: Stale worktrees accumulate Fix: git worktree remove after merge
Forgetting to setup dependencies
Problem: Build fails in worktree Fix: Always run npm install / pip install after creation
Red Flags
Never:
- Create worktree without verifying it's ignored
- Skip baseline test verification
- Leave stale worktrees after merge
- Commit from wrong worktree
Always:
- Follow directory priority
- Verify directory is ignored
- Run project setup
- Verify clean baseline
- Clean up after merge
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/vfm-agent-company/skills/git-worktrees/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/duylinhdang1998/claude-template-agent/git-worktrees)