create-worktree
Use when creating a git worktree for feature isolation with automatic environment setup including .env files and dependency installation
Skill by giladresisi
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/giladresisi-create-worktree
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/create-worktree
What's inside
- Skill name
create-worktree- Description
- Use when creating a git worktree for feature isolation with automatic environment setup including .env files and dependency installation
- License
- MIT
- Instructions
- 171 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Create Worktree with Environment Setup
When this command is invoked with `/create-worktree <branch-name> [base-branch] [path=<folder>]`, execute the following steps:
## Step 1: Parse Arguments
Extract the branch name, optional base branch, and optional path override from the command arguments.
Derive the **worktree folder name**:
- If an explicit `path=<folder>` argument was provided, use that.
- Otherwise, use the **last segment** of the branch name (the part after the final `/`).
- `autoresearch/multisector-mar22` → `multisector-mar22`
- `feature/auth` → `auth`
- `feature-auth` → `feature-auth` (no slash, use as-is)
The worktree will be created at `../{folder}`. The git branch is still created as `{branch-name}` (preserving the full hierarchical name).
## Step 2: Create Git Worktree
Execute the git worktree add command:
```bash
# If base-branch provided:
git worktree add ../{folder} -b {branch-name} {base-branch}
# If no base-branch provided:
git worktree add ../{folder} -b {branch-name}
```
The worktree will be created in the parent directory at `../{folder}`.
## Step 3: Identify Source and Target Paths
- **Source:** Current working directory (the original repo)
- **Target:** `../{folder}` (the new worktree)
## Step 4: Copy .env Files
Use Bash to find and copy all .env files. Because .env files are gitignored, Glob cannot see them — use `find` to discover them recursively:
```bash
# Find and copy all .env* files, excluding tooling directories
find . -maxdepth 6 \( -name ".env" -o -name ".env.local" -o -name ".env.*" \) \
! -path "*/.venv/*" ! -path "*/node_modules/*" ! -path "*/.git/*" | while read env_file; do
env_file="${env_file#./}"
target_dir=$(dirname "../{folder}/$env_file")
mkdir -p "$target_dir"
cp "$env_file" "../{folder}/$env_file"
echo "Copied $env_file"
done
```
This approach:
1. Discovers all `.env`, `.env.local`, and `.env.*` files at any depth (up to 6 levels)
2. Excludes `.venv`, `node_modules`, and `.git` directories
3. Creates target subdirectories as needed with `mkdir -p`
4. Works with gitignored files that Glob cannot see
## Step 5: Install Python Dependencies
Check which Python package manager the project uses, then install dependencies in the worktree:
**If project uses `uv`** (has `pyproject.toml` + `uv.lock`):
- Run `uv sync` — recreates `.venv` from the lockfile, no copying needed
```bash
# uv projects — run in the worktree backend directory
cd ../{folder}/backend
uv sync
```
**If project uses `pip`** (has `requirements.txt`):
- Copy the existing venv, then run pip install
```bash
# Copy venv (all platforms)
cp -r backend/venv ../{folder}/backend/venv
# Install dependencies
# Windows
cd ..\{folder}\backend && venv\Scripts\python -m pip install -r requirements.txt
# Unix/Mac
cd ../{folder}/backend && venv/bin/python -m pip install -r requirements.txt
```
Check both top-level and `backend/` for `pyproject.toml`/`uv.lock` or `requirements.txt`.
## Step 7: Install npm Dependencies
Use Glob to find all `package.json` files in:
- Top-level: `package.json`
- Frontend: `frontend/package.json`
- Backend: `backend/package.json`
For each package.json found:
1. Navigate to the target worktree directory containing the package.json
2. Run npm install
```bash
# Windows
cd ..\{folder}\frontend
npm install
# Unix/Mac
cd ../{folder}/frontend
npm install
```
**Important:** Install npm dependencies in ALL directories that have a package.json file (top-level, frontend/, backend/, or any other subdirectories).
## Step 8: Report Completion
Provide a summary to the user:
- Worktree created at: `../{folder}`
- .env files copied: [list]
- Python dependencies installed in: [list] (method: uv sync / pip install)
- npm dependencies installed in: [list]
## Platform DetectionFrom giladresisi/ai-dev-env, MIT.
More from giladresisi/ai-dev-env
- 0.507score
new-co-trader-worktree
giladresisi
Creates a new git worktree in the auto-co-trader project for any purpose — optimization, regression, backtesting, brainstorming, etc.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
acceptance-criteria-define
giladresisi
Use when an agent is asked to define, review, or write acceptance criteria for a request or plan.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
plan-feature
giladresisi
Use when creating a comprehensive implementation plan for a new feature including codebase analysis, API research, and parallel execution strategy
SkillCFreshness: C★ 2Claude Code +9 - 0.498score
execute
giladresisi
Use when implementing a feature plan file, choosing between sequential and team-based parallel execution with mandatory validation gates
SkillCFreshness: C★ 2Claude Code +9 - 0.443score
execution-report
giladresisi
Use when generating an implementation report after feature completion documenting what was done, divergences from plan, and test results
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
explore-api
giladresisi
Use when researching an unfamiliar external API before integration to verify feasibility, integration patterns, and limitations
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
acceptance-criteria-validate
giladresisi
Use when an agent executing an implementation plan claims to have finished, to validate that all acceptance criteria were actually met.
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
cleanup-progress
giladresisi
Use when a feature is complete and PROGRESS.md needs cleaning up by replacing verbose execution notes with a concise completion summary
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
code-review
giladresisi
Use when performing a technical pre-commit code review on recently changed files for bugs, security issues, and standards compliance
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
prime
giladresisi
Use when loading project context and architecture overview before starting implementation work, with optional focus on a specific area
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
system-review
giladresisi
Use when performing a meta-level analysis of plan adherence after implementation to identify process improvements and suggest CLAUDE.md updates
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
validate
giladresisi
Use when running comprehensive project validation including tests, type checking, linting, API connectivity checks, and server startup verification
SkillDFreshness: D★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 2, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/giladresisi/ai-dev-env
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from giladresisi
- 0.507score
plan-feature
giladresisi
Use when creating a comprehensive implementation plan for a new feature including codebase analysis, API research, and parallel execution strategy
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
new-co-trader-worktree
giladresisi
Creates a new git worktree in the auto-co-trader project for any purpose — optimization, regression, backtesting, brainstorming, etc.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
acceptance-criteria-define
giladresisi
Use when an agent is asked to define, review, or write acceptance criteria for a request or plan.
SkillCFreshness: C★ 2Claude Code +9 - 0.498score
execute
giladresisi
Use when implementing a feature plan file, choosing between sequential and team-based parallel execution with mandatory validation gates
SkillCFreshness: C★ 2Claude Code +9 - 0.443score
cleanup-progress
giladresisi
Use when a feature is complete and PROGRESS.md needs cleaning up by replacing verbose execution notes with a concise completion summary
SkillDFreshness: D★ 2Claude Code +9 - 0.443score
code-review
giladresisi
Use when performing a technical pre-commit code review on recently changed files for bugs, security issues, and standards compliance
SkillDFreshness: D★ 2Claude Code +9
Cite this page
create-worktree skill. Agent Mart. https://agentmart.dev/skills/giladresisi-create-worktree (last updated 2026-10-24)