Automatic Worktree Setup
Automatically set up worktrees with proper isolation when detected.
Detection Triggers
- •Entering a worktree path that exists but lacks
.venv(for Python projects) - •Creating a new worktree via
/worktrees add - •User mentions a worktree that needs setup
Setup Process
For Python Projects (TheRock worktrees, dnn-benchmarking)
When detecting a worktree without .venv:
bash
# Check if .venv exists
ls <worktree-path>/.venv 2>/dev/null || {
echo "Setting up venv for worktree..."
cd <worktree-path>
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt 2>/dev/null || true
}
For CMake Projects
Build directory is created on first build, but verify prerequisites:
bash
# Check for CMakeLists.txt ls <worktree-path>/CMakeLists.txt || echo "Warning: No CMakeLists.txt found" # Build directory will be created by cmake -B build
Post-Setup Actions
- •
Update project registry if this is a new worktree:
- •Add entry to
/home/AMD/sareeder/ROCm-workspace/.claude/registry/projects.json
- •Add entry to
- •
Copy CLAUDE.md from main repo if worktree doesn't have one:
bashcp /home/AMD/sareeder/TheRock/CLAUDE.md /home/AMD/sareeder/therock-newworktree/CLAUDE.md
- •
Report setup status to user:
- •Venv location
- •Python version
- •Installed packages count
- •Ready for development
Worktree Naming Convention
New worktrees follow pattern: /home/AMD/sareeder/{project}-{name}
Examples:
- •TheRock worktree "feature-x" →
/home/AMD/sareeder/therock-feature-x - •rocm-libraries worktree "bugfix" →
/home/AMD/sareeder/rocm-libraries-bugfix
Requirements Files
| Project | Requirements |
|---|---|
| TheRock | requirements.txt, requirements-test.txt |
| dnn-benchmarking | requirements.txt, requirements-dev.txt |
Silent Operation
This skill operates automatically without prompting the user. Report results after completion, not before.