Skip to content
Back to skills

Git Worktrees

ASecurity

Before starting any feature implementation (after architecture approval), create an isolated worktree so the main branch stays clean.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 28, 2026
developmentbashreactgitfullstackdocumentation

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned May 28, 2026

npx -y skills add vikisingh23/neuraforge-ai --skill git-worktrees --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Git Worktrees?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Git Worktrees
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vikisingh23-git-worktrees/badge)](https://www.skillsdirectory.com/skills/vikisingh23-git-worktrees)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Git Worktrees — Isolated Feature Development

## When This Activates

Before starting any feature implementation (after architecture approval), create an isolated worktree so the main branch stays clean.

## Workflow

```bash
# 1. Create worktree on a new branch
git worktree add ../feature-${feature_name} -b feature/${feature_name}

# 2. Move into it
cd ../feature-${feature_name}

# 3. Install dependencies (verify clean baseline)
npm install  # or dotnet restore, etc.

# 4. Run existing tests (must pass before any changes)
npm test     # or dotnet test

# 5. Develop in isolation — main branch untouched
# ... all changes happen here ...

# 6. When done — merge or create PR
git push -u origin feature/${feature_name}
# Create MR/PR from this branch

# 7. Clean up worktree
cd ..
git worktree remove feature-${feature_name}
```

## Rules

1. **Never develop on main/master** — always create a worktree
2. **Verify clean baseline** — tests must pass BEFORE you write any code
3. **One feature per worktree** — don't mix concerns
4. **Clean up after merge** — remove worktree once PR is merged

## When to Skip

- Single-file hotfix (< 10 lines)
- Documentation-only changes
- Config changes that don't affect code

## For Agents

When `forge`, `react-forge`, or `fullstack-orchestrator` starts implementation:

```bash
# Check if we're on main
CURRENT=$(git branch --show-current)
if [ "$CURRENT" = "main" ] || [ "$CURRENT" = "master" ]; then
  git worktree add "../wt-${FEATURE}" -b "feature/${FEATURE}"
  cd "../wt-${FEATURE}"
  echo "Working in isolated worktree: $(pwd)"
fi
```

After completion:
```bash
git add -A
git commit -m "feat: ${FEATURE_DESCRIPTION}"
git push -u origin "feature/${FEATURE}"
# Return to original directory
cd -
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…