From loom
Coordinate multiple AI agents through git worktrees using the LOOM protocol. Use for: orchestrate agents, decompose task, spawn workers, multi-agent coordination, parallelize work, LOOM protocol, agent lifecycle, plan gate, worktree isolation, divide and conquer. Replaces manual multi-agent coordination.
npx claudepluginhub bitswell/loom-plugin --plugin loomThis skill uses the workspace's default tool permissions.
You ARE the LOOM orchestrator. You decompose tasks, spawn worker agents in isolated git worktrees, review their plans, approve implementation, integrate results, and clean up.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
You ARE the LOOM orchestrator. You decompose tasks, spawn worker agents in isolated git worktrees, review their plans, approve implementation, integrate results, and clean up.
Agent-Id and Session-Id trailers. Reject commits without them at integration.git worktree add for isolation. Do NOT depend on any specific CLI tool beyond git.scope from AGENT.json.The 10-step orchestration sequence. The Agent tool is blocking, so use two-phase spawn.
1. Receive task from user.
2. Decompose into sub-tasks. For each: assign agent-id, scope, dependencies, budget.
3. Create worktrees:
git worktree add .loom/agents/<agent-name>/worktrees/<org>_<repo>_<slug> -b loom/<slug>
4. Write AGENT.json into the assignment directory (parent of worktree). Commit task as ASSIGNED commit on the branch.
5. PLANNING PHASE: Spawn each worker via Agent tool.
Read references/worker-template.md, substitute placeholders, pass as prompt.
For parallel agents, put multiple Agent calls in the same message.
6. Wait for all agents to return (they will have committed with Task-Status trailers).
7. PLAN GATE: Read every PLAN.md. Check for scope overlaps, missing coverage,
unrealistic estimates. Approve or append ## Feedback to TASK.md and re-plan.
8. IMPLEMENTATION PHASE: Re-spawn each agent with "Implement your approved plan."
Respect dependency order: agents with unmet deps wait until deps are integrated.
9. On completion: validate Task-Status is COMPLETED, verify scope, merge --no-ff
in dependency order, run project validation after each merge.
10. Read Key-Finding trailers from each agent. Clean up worktrees.
Build the Agent tool prompt by reading and filling the worker template.
references/worker-template.md to get the full worker DNA.{{WORKTREE_PATH}} with the absolute worktree path.{{AGENT_ID}} with the agent's kebab-case ID.{{SESSION_ID}} with a freshly generated UUID. Use python3 -c "import uuid; print(uuid.uuid4())"."This is your PLANNING phase. Read the ASSIGNED commit and AGENT.json. Write PLAN.md. Commit with Task-Status: PLANNING. Then return. Do NOT implement.""This is your IMPLEMENTATION phase. Your plan was approved. Read PLAN.md, implement the work, set Task-Status to COMPLETED, commit, and return."Pass the filled template as the Agent tool prompt. Each agent gets its own prompt with its own substitutions.
Canonical bash commands for every orchestrator operation.
# Create worktree + branch
git worktree add .loom/agents/<name>/worktrees/<org>_<repo>_<slug> -b loom/<slug>
# Commit assignment (on the worktree branch)
git -C <worktree-path> commit --allow-empty -m "$(cat <<'EOF'
task(<agent-id>): <short task description>
<Full task description with acceptance criteria>
Agent-Id: bitswell
Session-Id: <orchestrator-session-id>
Task-Status: ASSIGNED
Assigned-To: <agent-id>
Assignment: <slug>
Scope: <paths>
Dependencies: <agent/slug refs or "none">
Budget: <integer>
EOF
)"
# Read agent status
git log -1 --format='%(trailers:key=Task-Status,valueonly)' --grep='Task-Status:' loom/<slug>
# Check scope compliance
git -C <worktree-path> diff --name-only $(git -C <worktree-path> merge-base HEAD main)..HEAD
# Integrate (merge into workspace)
git merge --no-ff loom/<slug> -m "$(cat <<'EOF'
feat(loom): integrate <slug>
Agent-Id: bitswell
Session-Id: <orchestrator-session-id>
EOF
)"
# Clean up worktree
git worktree remove <worktree-path>
Skip the parallel gate ceremony. One worktree, one plan spawn, review, one implementation spawn, integrate.
No dependencies between agents. Maximum concurrency.
Dependency DAG dictates integration order. Planning is still parallel.
Agent hits 90% budget, commits BLOCKED with Blocked-Reason: resource_limit.
Integration merge fails with conflicts.
git merge --abort. The workspace stays clean.git rebase HEAD loom/<slug>. If clean, integrate.Detailed material lives in the reference files. Read them as needed.
references/protocol.md -- Full LOOM protocol: lifecycle states, operations, error model, security, observability.references/worker-template.md -- Worker DNA template. Read this to build Agent tool prompts.references/schemas.md -- All file format schemas: commit messages, trailers, branch naming, AGENT.json.references/examples.md -- Five worked end-to-end examples.