Skip to main content
ClaudeWave
ES, Spanish
Slash Command262 estrellas del repoactualizado 7mo ago

worktree

This Claude Code slash command manages Git worktrees to enable parallel feature development across isolated directories. Use the create subcommand to establish new worktrees with synced configuration files, the remove subcommand to clean up worktrees with optional branch deletion, the list subcommand to view all active worktrees and their status, and the cleanup subcommand to prune stale worktree references. It validates feature names, warns about uncommitted changes, and handles branch management including checking merge status before deletion.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/maslennikov-ig/claude-code-orchestrator-kit/HEAD/.claude/commands/worktree.md -o ~/.claude/commands/worktree.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

worktree.md

# Git Worktree Manager

Manage git worktrees for parallel feature development.

## Usage

```bash
/worktree create <feature-name> [base-branch]
/worktree remove <feature-name> [--force] [--delete-branch]
/worktree list
/worktree cleanup [--dry-run] [--remove-dirs]
```

---

## Commands

### create

Create new worktree for parallel development.

**What it does:**
- Creates `project-worktrees/` directory (if not exists)
- Creates new branch `feature/<name>` from base
- Creates worktree in separate directory
- Copies gitignored files per `.worktree-sync.json`

**Process:**
1. Validate feature name (alphanumeric, hyphens only)
2. Check for uncommitted changes (warn if present)
3. Create worktree: `git worktree add ../project-worktrees/<name> -b feature/<name> <base>`
4. Sync files from `.worktree-sync.json`:
   - `sync.files`: `.env`, `.env.local`, `.mcp.json`, etc.
   - `sync.directories`: `.vscode`
   - `sync.patterns`: `packages/*/.env`, `services/*/.env`
5. Output next steps (open in IDE, commit workflow)

**Errors:**
- Worktree exists: suggest different name or remove existing
- Branch exists: checkout existing or use different name

---

### remove

Remove worktree and optionally delete branch.

**What it does:**
- Checks for uncommitted changes
- Removes worktree directory
- Optionally deletes local and remote branch
- Runs `git worktree prune`

**Process:**
1. Find worktree by name
2. Check git status (if uncommitted changes, require --force or user choice)
3. Remove: `git worktree remove [--force] <path>`
4. If --delete-branch:
   - Check if merged: `git branch --merged main | grep feature/<name>`
   - Delete local: `git branch -d/-D feature/<name>`
   - Delete remote: `git push origin --delete feature/<name>`
5. Cleanup: `git worktree prune`

**Errors:**
- Not found: show available worktrees
- Main worktree: cannot remove
- Uncommitted changes: offer commit/force/cancel
- Unmerged branch: warn, offer PR/force/keep-branch

---

### list

Show all worktrees with status.

**Output:**
```
# Git Worktrees (N total)

| Name | Branch | Path | Status |
|------|--------|------|--------|
| main (основной) | main | /path/to/your-project | Active |
| feature-name | feature/feature-name | .../your-project-worktrees/feature-name | Active |

Commands: /worktree create <name> | /worktree remove <name>
```

**Process:**
1. Run `git worktree list --porcelain`
2. For each worktree: extract path, branch, HEAD, status (locked/prunable)
3. Format table with status indicators

---

### cleanup

Clean up stale worktree files and orphaned directories.

**What it does:**
- Prunes administrative files for deleted worktrees
- Repairs recoverable worktrees
- Removes orphaned directories (with --remove-dirs)

**Process:**
1. Dry-run check: `git worktree prune --dry-run --verbose`
2. Find orphaned dirs in `project-worktrees/` not in `git worktree list`
3. Try repair: `git worktree repair <path>`
4. If not --dry-run: `git worktree prune --verbose`
5. If --remove-dirs: remove orphaned/empty directories

**Output:**
```
# Worktree Cleanup Report

✅ Pruned administrative records: N
✅ Removed directories: N (--remove-dirs)
✅ Recovered worktrees: N

Active worktrees: N
All valid: ✅
```

---

## File Sync Config

`.worktree-sync.json` format:
```json
{
  "sync": {
    "files": [".env", ".env.local", ".mcp.json"],
    "directories": [".vscode"],
    "patterns": ["packages/*/.env", "services/*/.env"]
  }
}
```

---

## Notes

- Worktrees share `.git` → saves disk space
- Each worktree must be on unique branch
- Cannot checkout same branch in multiple worktrees
- Main worktree cannot be removed
- Use --dry-run with cleanup to preview changes
algorithmic-artSkill

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

artifacts-builderSkill

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

beadsSkill
beads-initSlash Command

Initialize Beads issue tracking in your project with interactive configuration setup.

calculate-priority-scoreSkill

Calculate priority score for bugs, issues, or tasks based on severity, impact, and likelihood. Use for bug prioritization, task ordering, or risk assessment.

canvas-designSkill

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

changelog-generatorSkill

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

cleanup-health-inlineSkill

Inline orchestration workflow for dead code detection and removal with Beads integration. Provides step-by-step phases for dead-code-hunter detection, priority-based cleanup with dead-code-remover, and verification cycles.