Skip to content
Back to skills

147 Workflow 760dc71c

ASecurity

```bash ls -d .worktrees 2>/dev/null # Preferred (hidden) ls -d worktrees 2>/dev/null # Alternative ```

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
testingpythonrustgobashnodegit

Security analysis

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

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

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 147-workflow_760dc71c --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 147 Workflow 760dc71c?

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

Security grade badge for 147 Workflow 760dc71c
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-147-workflow-760dc71c/badge)](https://www.skillsdirectory.com/skills/tools-only-147-workflow-760dc71c)

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

SKILL.md
# Git Worktrees Workflow

## Directory Selection Process

### 1. Check Existing Directories

```bash
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.

### 2. Check CLAUDE.md

```bash
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
```

If preference specified: Use it without asking.

### 3. Ask User

```
No worktree directory found. Where should I create worktrees?

1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global location)
```

## Safety Verification

### For Project-Local Directories

**MUST verify .gitignore before creating worktree:**

```bash
grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignore
```

**If NOT in .gitignore:**

1. Add appropriate line to .gitignore
2. Commit the change
3. Proceed with worktree creation

### For Global Directory

No .gitignore verification needed - outside project entirely.

## Creation Steps

### 1. Detect Project Name

```bash
project=$(basename "$(git rev-parse --show-toplevel)")
```

### 2. Create Worktree

```bash
# Determine full path
case $LOCATION in
  .worktrees|worktrees)
    path="$LOCATION/$BRANCH_NAME"
    ;;
  ~/.config/superpowers/worktrees/*)
    path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME"
    ;;
esac

# Create worktree with new branch
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"
```

### 3. Run Project Setup

Auto-detect and run appropriate setup:

```bash
# Node.js
[ -f package.json ] && npm install

# Rust
[ -f Cargo.toml ] && cargo build

# Python
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f pyproject.toml ] && uv sync

# Go
[ -f go.mod ] && go mod download
```

### 4. Verify Clean Baseline

Run tests to ensure worktree starts clean:

```bash
# Use project-appropriate command
make test  # or npm test, cargo test, pytest, go test ./...
```

**If tests fail:** Report failures, ask whether to proceed.
**If tests pass:** Report ready.

### 5. Report Location

```
Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>
```

## Quick Reference

| Situation                   | Action                      |
| --------------------------- | --------------------------- |
| `.worktrees/` exists        | Use it (verify .gitignore)  |
| `worktrees/` exists         | Use it (verify .gitignore)  |
| Both exist                  | Use `.worktrees/`           |
| Neither exists              | Check CLAUDE.md → Ask user  |
| Directory not in .gitignore | Add it immediately + commit |
| Tests fail during baseline  | Report failures + ask       |

## Common Commands

```bash
# List all worktrees
git worktree list

# Remove worktree (after merging branch)
git worktree remove .worktrees/feature-name

# Prune stale worktrees
git worktree prune

# Move worktree
git worktree move .worktrees/old-name .worktrees/new-name
```

## Common Mistakes

**Skipping .gitignore verification**

- Worktree contents get tracked, pollute git status
- Fix: Always check .gitignore before creating project-local worktree

**Assuming directory location**

- Creates inconsistency, violates project conventions
- Fix: Follow priority: existing > CLAUDE.md > ask

**Proceeding with failing tests**

- Can't distinguish new bugs from pre-existing issues
- Fix: Report failures, get explicit permission

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.