一键导入
worktree-execution
// Git worktree management for isolated parallel prompt execution. Use when creating isolated environments for prompt comparison or managing worktree lifecycle. Provides creation, cleanup, and orphan detection scripts.
// Git worktree management for isolated parallel prompt execution. Use when creating isolated environments for prompt comparison or managing worktree lifecycle. Provides creation, cleanup, and orphan detection scripts.
Analyzes and optimizes prompts using BP-001~008 patterns and 3-step flow (detect, optimize, balance). Use when "optimize this prompt", "review prompt quality", "analyze prompt issues", or creating/reviewing rashomon skill content.
Project-specific prompt optimization knowledge management. Use when storing or retrieving learned patterns from comparisons. Provides schema, extraction criteria, capacity management, and retention scoring.
Creates or updates Claude Code skills through interactive dialog, then evaluates effectiveness by parallel execution comparison. Use when creating new skills, updating existing skills, or evaluating skill quality.
Compares original and optimized prompts by parallel execution in git worktrees. Use when evaluating prompt improvement effects or learning prompt engineering through concrete examples.
| name | worktree-execution |
| description | Git worktree management for isolated parallel prompt execution. Use when creating isolated environments for prompt comparison or managing worktree lifecycle. Provides creation, cleanup, and orphan detection scripts. |
| user-invocable | false |
Two isolated worktrees enable parallel prompt execution.
Orchestrator
│
├── Create Worktrees (in ${TMPDIR:-/tmp}/)
│ ├── worktree-rashomon-original-{timestamp}
│ └── worktree-rashomon-optimized-{timestamp}
│
├── Parallel Execution (Task tool)
│ ├── Execution 1 → worktree-rashomon-original
│ └── Execution 2 → worktree-rashomon-optimized
│
├── Collect Results (await both)
│
└── Cleanup Worktrees (always)
Script: scripts/worktree-create.sh
# Default labels (original/optimized) for prompt eval
./scripts/worktree-create.sh [repo_root]
# Custom labels for skill eval
./scripts/worktree-create.sh [repo_root] baseline with-skill
./scripts/worktree-create.sh [repo_root] old-version new-version
Output (stdout):
/tmp/worktree-rashomon-{label_a}-20260114-123456
/tmp/worktree-rashomon-{label_b}-20260114-123456
Properties:
${TMPDIR:-/tmp}/worktree-rashomon-{label}-{timestamp}original / optimized if not specifiedScript: scripts/worktree-cleanup.sh
# Remove all rashomon worktrees
./scripts/worktree-cleanup.sh [repo_root]
# Remove specific worktrees
./scripts/worktree-cleanup.sh [repo_root] path1 path2
# Remove only orphaned worktrees (age > 1 hour)
./scripts/worktree-cleanup.sh --orphans [repo_root]
Cleanup Triggers:
Key: To achieve true parallel execution, spawn both Task calls in a single message.
The calling command determines which agents to invoke and how to structure the Task calls. This skill provides only the worktree infrastructure.
| Scenario | Behavior |
|---|---|
| Creation fails | Report git error, suggest checking repository state |
| Cleanup fails | Log warning, attempt orphan cleanup on next run |
| Orphan detected | Force remove worktrees older than 1 hour |
| Exit Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Not a git repository |
| 2 | Creation failed |
| Exit Code | Meaning |
|---|---|
| 0 | Success (or nothing to clean) |
| 1 | Not a git repository |
| 2 | Cleanup partially failed |