.claude/skills/worktree-pr/SKILL.md
Manage git worktrees with PR workflow and multi-agent review (Claude + Codex). Use when developing features in isolation with easy rollback.
npx skillsauth add alfredolopez80/multi-agent-ralph-loop worktree-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
~/.claude/settings.json or CLI/env varsANTHROPIC_DEFAULT_*_MODEL env varsultrathink - Take a deep breath. We're not here to write code. We're here to make a dent in the universe.
Isolation should make every change safer and more inevitable.
This skill enables isolated feature development using git worktrees with a PR-based merge workflow and multi-agent code review.
Key Principles:
AskUserQuestion for isolation decisionsbrew install max-sixty/worktrunk/wtbrew install gh| Command | Description |
|---------|-------------|
| ralph worktree <task> | Create isolated worktree + launch Claude |
| ralph worktree-pr <branch> | Create PR with Claude + Codex review |
| ralph worktree-merge <pr> | Approve and merge PR |
| ralph worktree-fix <pr> | Apply fixes from review comments |
| ralph worktree-close <pr> | Close PR and cleanup without merge |
| ralph worktree-status | Show all worktrees and PR status |
| ralph worktree-cleanup | Clean up merged worktrees |
ralph worktree "implement oauth authentication"
# Creates: .worktrees/ai-ralph-20260103-implement-oauth-authentication/
# Branch: ai/ralph/20260103-implement-oauth-authentication
All subagents work in the same worktree:
src/api/oauth.tssrc/ui/login.tsxtests/oauth.test.tsdocs/oauth.mdEach subagent makes local commits but does NOT push.
ralph worktree-pr ai/ralph/20260103-implement-oauth-authentication
This will:
If reviews pass:
ralph worktree-merge <pr-number>
# Squash merges, deletes branch, cleans up worktree
If reviews find issues:
ralph worktree-fix <pr-number>
# Opens Claude in worktree with review comments as context
If you want to abandon:
ralph worktree-close <pr-number>
# Closes PR, deletes branch, cleans up worktree
The orchestrator automatically asks about worktree isolation (Step 2b):
AskUserQuestion:
questions:
- question: "¿Este cambio requiere un worktree aislado?"
header: "Isolation"
multiSelect: false
options:
- label: "Sí, crear worktree"
description: "Feature nueva, refactor grande, cambio experimental"
- label: "No, branch actual"
description: "Hotfix, cambio menor, ajuste simple"
When working in a worktree, subagents receive:
WORKTREE_CONTEXT:
path: .worktrees/ai-ralph-YYYYMMDD-feature/
branch: ai/ralph/YYYYMMDD-feature
isolated: true
Subagent rules:
SUBAGENT_COMPLETE: [description]Each worktree has hardened security:
core.hooksPath → .git-hooks-disabled)current branch only# User request: "Add OAuth authentication"
# Orchestrator asks about worktree
> ¿Este cambio requiere un worktree aislado?
> [Sí, crear worktree] ← User selects
# Create worktree
$ ralph worktree "oauth-authentication"
✓ Created worktree: .worktrees/ai-ralph-20260103-oauth-authentication
✓ Branch: ai/ralph/20260103-oauth-authentication
✓ Security hardening applied
# Subagents work in parallel in SAME worktree
# ... backend, frontend, tests, docs ...
# All subagents complete
# Orchestrator creates PR with review
$ ralph worktree-pr ai/ralph/20260103-oauth-authentication
✓ Pushed to origin
✓ Created PR #42
✓ Claude review: APPROVED
✓ Codex review: APPROVED with suggestions
# User decides to merge
$ ralph worktree-merge 42
✓ PR #42 merged (squash)
✓ Branch deleted
✓ Worktree cleaned up
brew install max-sixty/worktrunk/wt
wt config shell install
source ~/.zshrc
gh auth status # Verify GitHub auth
gh auth login # Re-authenticate if needed
git worktree prune # Clean orphaned metadata
ralph worktree-status # Check current state
development
Living knowledge base management. Actions: search (query vault), save (store learning), index (update indices), compile (raw->wiki->rules graduation), init (create vault structure). Follows Karpathy pipeline: ingest->compile->query. Use when: (1) searching accumulated knowledge, (2) saving learnings, (3) compiling raw notes into wiki, (4) initializing a new vault. Triggers: /vault, 'vault search', 'knowledge base', 'save learning'.
testing
Produce a verifiable technical specification before coding. 6 mandatory sections: Interfaces, Behaviors, Invariants (from Aristotle Phase 2), File Plan, Test Plan, Exit Criteria (executable bash commands + expected results). Use when: (1) before implementing features with complexity > 4, (2) as Step 1.5 in orchestrator workflow, (3) when requirements need formalization. Triggers: /spec, 'create spec', 'write specification', 'technical spec'.
testing
Pre-launch shipping checklist orchestrating /gates, /security, /browser-test, /perf. Ensures nothing ships without passing all quality checks. Use when: (1) before deploying, (2) before merging to main, (3) before release. Triggers: /ship, 'ship it', 'ready to deploy', 'pre-launch check'.
development
Performance optimization skill. Core Web Vitals via Lighthouse, bundle size analysis, metrics tracking over time. Use when: (1) optimizing frontend performance, (2) analyzing bundle size, (3) tracking metrics regression. Triggers: /perf, 'performance audit', 'core web vitals', 'bundle size'.