worktree-orchestrator
Use when spawning parallel Claude Code subagents in git worktrees for code review, architecture analysis, SDK verification, or testing. Load for multi-agent codebase optimization, parallel PR creation, or orchestrating Claude Code features across isolated worktrees. Triggers: 'parallel analysis', 'worktree review', 'multi-agent optimization', 'spawn reviewers', 'orchestrate worktrees', 'smart review'.
What this skill does
# Worktree Orchestrator
Spawn parallel Claude Code subagents in isolated git worktrees, each running specialized analysis (code review, architecture, SDK verification, testing), then aggregate results and create PRs.
## Two Modes
| Mode | Script | When to Use |
|------|--------|-------------|
| **Smart (Dynamic)** | `smart_setup.sh` | Let system decide which agents based on codebase analysis |
| **Static (Fixed)** | `setup_worktrees.sh` | Always spawn all 5 agent types |
## Smart Mode (Recommended)
Analyzes codebase and selects appropriate agents:
```
Orchestrator: "Analyzing jarvis-mac..."
→ Python project (75 files)
→ Claude Agent SDK detected
→ Tests exist
→ API + Auth code detected
Decision: Spawn 5 agents (all HIGH confidence)
✅ sdk-verify (SDK detected)
✅ testing (tests detected)
✅ review-security (API + auth)
✅ architecture (132 files)
✅ review-performance (large project)
```
### Detection Rules
| Detection | Triggers Agent | Confidence |
|-----------|----------------|------------|
| Claude Agent SDK | sdk-verify | high |
| tests/ directory | testing | high |
| API endpoints | review-security | high |
| Auth code | review-security | high |
| 50+ source files | architecture | high |
| React/Frontend | review-performance | high |
| Small project (<20 files) | architecture | low (skip) |
## Static Mode
Always creates 5 worktrees:
```
main-branch (orchestrator)
│
├── worktree: review-security/ → code-review (security)
├── worktree: review-performance/ → code-review (performance)
├── worktree: architecture/ → Plan agent
├── worktree: sdk-verify/ → agent-sdk-verifier
└── worktree: testing/ → testing skill
```
## Workflow
### Phase 1: Setup
```bash
# Smart mode (recommended) - analyzes codebase first
~/.claude/skills/worktree-orchestrator/scripts/smart_setup.sh [base-branch] [target-dir]
# Static mode - always creates 5 worktrees
~/.claude/skills/worktree-orchestrator/scripts/setup_worktrees.sh [base-branch] [target-dir]
```
Creates worktrees in `../<worktree-name>/` with isolated `.claude/sessions/`.
### Phase 2: Spawn Agents
Use Task tool to spawn parallel subagents in each worktree:
| Agent Type | Focus Area | Model | Subagent Type |
|------------|------------|-------|---------------|
| code-review | Security | sonnet | general-purpose |
| code-review | Performance | sonnet | general-purpose |
| plan | Architecture | opus | Plan |
| agent-sdk-verifier | SDK compliance | haiku | agent-sdk-verifier-py |
| testing | Coverage | haiku | test-runner |
### Phase 3: Aggregate Results
```bash
~/.claude/skills/worktree-orchestrator/scripts/aggregate_results.sh [target-dir]
```
### Phase 4: Create PRs
```bash
~/.claude/skills/worktree-orchestrator/scripts/create_prs.sh [target-dir] [base-branch]
```
## Scripts Reference
| Script | Purpose | Output |
|--------|---------|--------|
| `analyze_codebase.sh` | Detect features, recommend agents | JSON analysis |
| `smart_setup.sh` | Dynamic worktree creation | Selected worktrees |
| `setup_worktrees.sh` | Static worktree creation | All 5 worktrees |
| `aggregate_results.sh` | Collect agent outputs | summary.md |
| `create_prs.sh` | Generate PRs from changes | PR URLs |
| `create_issues.sh` | Create GitHub issues from findings | Issue URLs |
| `clean_worktrees.sh` | Remove all worktrees | Clean state |
## Output Structure
```
.claude/worktrees/
├── analysis.json # Smart mode detection results
├── FINAL_SUMMARY.md # Combined analysis summary
├── review-security/
│ ├── findings.md
│ └── patches/
├── review-performance/
│ └── findings.md
├── architecture/
│ └── architecture_review.md
├── sdk-verify/
│ └── sdk_compliance.md
├── testing/
│ └── test_report.md
└── aggregated/
├── summary.md
└── prioritized_actions.md
```
## Example Usage
```bash
# 1. Smart setup (recommended) - outputs to .claude/worktrees/
~/.claude/skills/worktree-orchestrator/scripts/smart_setup.sh main
# 2. Spawn agents via Task tool (parallel)
# - Each agent reads worktree-metadata.json for focus area
# - Writes findings.md to worktree root
# 3. Aggregate results
~/.claude/skills/worktree-orchestrator/scripts/aggregate_results.sh
# 4. Create GitHub issues from findings (requires gh CLI)
~/.claude/skills/worktree-orchestrator/scripts/create_issues.sh
# 5. Comment @claude on issues to have Claude fix them
# 6. Cleanup when done
~/.claude/skills/worktree-orchestrator/scripts/clean_worktrees.sh
```
## GitHub Issue Integration
After aggregation, create GitHub issues from findings:
```bash
# Requires GitHub CLI (gh)
brew install gh
gh auth login
# Create issues
~/.claude/skills/worktree-orchestrator/scripts/create_issues.sh
```
Issues are formatted for @claude GitHub App integration:
1. Install <https://github.com/apps/claude> on your repo
2. Comment `@claude please fix this` on any issue
3. Claude analyzes and creates a PR
## Resource Loading
| Resource | When to Load | Purpose |
|----------|--------------|---------|
| `scripts/analyze_codebase.sh` | Phase 1 (smart) | Detect codebase features |
| `scripts/smart_setup.sh` | Phase 1 (smart) | Dynamic worktree creation |
| `scripts/setup_worktrees.sh` | Phase 1 (static) | Fixed worktree creation |
| `scripts/aggregate_results.sh` | Phase 3 | Collect agent outputs |
| `scripts/create_prs.sh` | Phase 4 | Generate PRs |
| `scripts/clean_worktrees.sh` | Cleanup | Remove worktrees |
| `references/agent_prompts.md` | Phase 2 | Subagent task templates |
## Integration with .agent Framework
| .agent Concept | worktree-orchestrator Equivalent |
|----------------|----------------------------------|
| AGENT_COMMS_FRAMEWORK | Task tool + SendMessage |
| ARCHITECTURE.md | architecture/ worktree output |
| IMPLEMENTATION_PLAN.md | Plan agent output |
| Evidence ladder | Per-worktree findings |
## Key Rules
1. **Parallel execution**: All agents run concurrently via Task tool
2. **Isolation**: Each worktree has separate `.claude/sessions/`
3. **No context bleeding**: Agents cannot see each other's work
4. **Deterministic aggregation**: Scripts collect, not LLM judgment
5. **Evidence-based**: All findings require file refs + line numbers
6. **Smart selection**: Only spawn relevant agents based on codebase
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.