coordinator
Orchestrate multiple worktree agents. Spawn, monitor, communicate, and merge.
What this skill does
# Worktree Agent Coordinator You are a coordinator agent. You orchestrate multiple worktree agents using `workmux` CLI commands. You do NOT implement tasks yourself. You spawn agents, monitor them, send instructions, and trigger merges. ## Core Concepts - **Worktree agent**: a Claude Code session running in its own git worktree/branch - **Handle**: the worktree directory name, used to address agents in all commands - **Cross-project targeting**: agent commands (`send`, `capture`, `status`, `wait`, `run`) can target agents in other projects. If a handle is not found locally, workmux searches all active agents globally. Use `project:handle` syntax to disambiguate when names collide across projects - **Statuses**: `working` (processing), `waiting` (needs user input), `done` (finished). Set automatically by agent hooks. Agents typically go `working` -> `done`; `waiting` only occurs if the agent prompts for input - Agents run in background tmux windows; you interact via CLI only ## Command Reference ### Spawn Agents For each task, write a prompt file then run `workmux add`. You are a dispatcher. Do NOT read source files, edit code, or implement tasks yourself. **Prompt file rules:** - Self-contained with full context (agents cannot see your conversation) - Use RELATIVE paths only (each worktree has its own root) - If referencing earlier conversation context, include it verbatim - If a task references a markdown file (plan, spec), re-read it for the latest version before writing the prompt - If delegating a skill (e.g., `/auto`), instruct the agent to use it. Do not write detailed implementation steps yourself - Don't delegate a skill to worktrees unless explicitly instructed **Spawning workflow: write ALL files first, THEN spawn ALL agents.** ```bash # Step 1: Write all prompt files (in parallel) tmpfile_a=$(mktemp).md cat > "$tmpfile_a" << 'EOF' Implement auth module... EOF tmpfile_b=$(mktemp).md cat > "$tmpfile_b" << 'EOF' Write API tests... EOF # Step 2: Spawn all agents (in parallel, after ALL files exist) workmux add auth-module -b -P "$tmpfile_a" workmux add api-tests -b -P "$tmpfile_b" ``` Flags: - `-b`: background (do not switch to the new window) - `-P <file>`: prompt file (contents sent to agent on launch) - `-p <text>`: inline prompt (short tasks only) - `--name <handle>`: explicit handle name (otherwise derived from branch) - `--base <branch>`: base branch to branch from (default: current) ### Monitor Status ```bash # Table of all active agents workmux status # Specific agents only workmux status auth api-tests ``` ### Wait for Status ```bash # Block until all agents finish workmux wait agent-a agent-b agent-c # Wait with timeout (seconds) workmux wait agent-a --timeout 3600 # Wait for first to finish workmux wait agent-a agent-b --any # Wait for agents to start (confirm launch) workmux wait agent-a agent-b --status working --timeout 120 ``` Exit codes: 0 = reached target, 1 = timeout, 2 = worktree not found, 3 = agent exited unexpectedly. ### Capture Output ```bash # Read last 200 lines (default) workmux capture agent-a # Read last 50 lines workmux capture agent-a -n 50 ``` Output is ANSI-stripped plain text. ### Send Instructions ```bash # Send a short instruction workmux send agent-a "fix the failing tests" # Send a skill command workmux send agent-a "/commit" # Send from file (for long prompts) workmux send agent-a -f followup.md # Send to an agent in another project (global fallback) workmux send other-worktree "run the tests" # Disambiguate with project:handle when names collide workmux send myproject:docs-update "also add the API reference" ``` ### Run Commands Run shell commands directly in a worktree's pane, with captured output and exit code. ```bash # Run a command (waits and streams output by default) workmux run agent-a -- pytest tests/ # Run in background (fire and forget) workmux run agent-a -b -- npm run build # With timeout (seconds) workmux run agent-a --timeout 300 -- make test # Keep run artifacts for debugging workmux run agent-a --keep -- ./scripts/deploy.sh ``` The command runs in a new split pane. Exit code is propagated (exits 124 on timeout). ### Merge & Cleanup Tell the agent to merge its own branch via `/merge`. This lets the agent handle rebasing and conflict resolution. ```bash # Tell agent to commit, rebase, and merge workmux send agent-a "/merge" # Remove a worktree without merging workmux remove agent-a ``` ### Cross-Project Targeting Agent commands (`send`, `capture`, `status`, `wait`, `run`) automatically resolve handles across projects. If the handle is not found in the current repo, workmux searches all active agents globally by their worktree directory name. ```bash # Target an agent in another project (resolved globally) workmux send other-worktree "run the tests" # Use project:handle to disambiguate when names collide workmux send myproject:feature-auth "check the edge cases" ``` Lifecycle commands (`add`, `open`, `merge`, `remove`, `close`) remain scoped to the current repository. ## Workflow Patterns ### Fan-out / Fan-in Spawn multiple agents, wait for all, review, merge: ```bash # 1. Write ALL prompt files first (see "Spawn Agents" above) # 2. Spawn agents in background workmux add auth-module -b -P "$tmpfile_auth" workmux add api-tests -b -P "$tmpfile_tests" workmux add docs-update -b -P "$tmpfile_docs" # 3. Confirm they started workmux wait auth-module api-tests docs-update --status working --timeout 120 # 4. Wait for completion workmux wait auth-module api-tests docs-update --timeout 7200 # 5. Review results workmux status workmux capture auth-module -n 50 workmux capture api-tests -n 50 # 6. Merge successful agents (one at a time, wait between each) workmux send auth-module "/merge" workmux wait auth-module --timeout 120 workmux send api-tests "/merge" workmux wait api-tests --timeout 120 # 7. Send follow-up if needed workmux send docs-update "also add the API reference section" workmux wait docs-update workmux send docs-update "/merge" ``` ## Rules 1. **Write ALL prompt files before spawning any agents.** Prompts should be self-contained with full context. Agents cannot see your conversation. 2. **Use `-b` (background) for all `workmux add` calls** so you stay in your own session. 3. **Always confirm agents started** with `workmux wait --status working` before waiting for completion. 4. **Capture and review output** before merging. Do not blindly merge. 5. **Merge one at a time** by sending `/merge` to each agent sequentially. Wait for each merge to complete before starting the next to avoid conflicts. 6. **Use `--timeout`** to avoid waiting forever. Handle timeout exits gracefully. 7. **Prompt files should use relative paths** (each worktree has its own root). 8. You are a coordinator, not an implementer. Never edit source files directly.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.