/agent-toolkit-forge:worktreefrom agent-toolkit-forge
Manages Git worktrees per writer for Agent Toolkit swarms, providing isolated branches, handoff promotion, and cleanup.
Ships in agent-toolkit-forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Create and maintain worktree-per-writer isolation for agent-toolkit swarm so each role works on its own branch without stepping on others. Integrates with swarm-handoff promotion and github-cli-workflow for PRs.
worktree_failed trace or find_repo_root error on .git file worktrees.swarm promote — ensure the handoff's worktree is clean and pushable.git worktree available (git worktree --help)..agent-toolkit/swarm/runs/<run-id>/state.json; worktrees live under .agent-toolkit/swarm/runs/<run-id>/worktrees/<role>-<short>/.find_repo_root uses git rev-parse --git-common-dir to handle worktree .git files (not directories).git worktree list
agent-toolkit swarm status --run-id <run-id> --json | jq '.worktrees'
# Expected: {implementer: {path, branch, commit}, reviewer: {path, branch}, ...}
cat .agent-toolkit/swarm/runs/<run-id>/state.json | jq '.trace | map(select(.event | contains("worktree")))'
On handoff create --from X --to Y for a writer role Y, swarm:
find_repo_root (git rev-parse --git-common-dir fallback).swarm/<run-id>/<role> if missing.git worktree add <run-dir>/worktrees/<role>-<short> <branch>.AGENT_TOOLKIT_SWARM_RUN_ID/RUN_DIR/REPO SWARMFORGE_ROLE and cd <worktree> && exec <runner> "$(cat prompt)" via _user_shell() (/usr/bin/zsh -lc on this host).Do not create worktrees by hand for swarm roles — let handoff create do it so state.json stays authoritative.
If worktree_failed:
git rev-parse --git-common-dir # from worktree dir — should succeed
AGENT_TOOLKIT_SWARM_RUN_ID=<run-id> agent-toolkit swarm handoff create --type artifact --from implementer --to reviewer --artifact artifacts/retry.md --run-id <run-id>
# Re-triggers provisioning with fixed repo-root logic
If a worktree is orphaned or locked:
git worktree list | grep <run-id>
git worktree remove <path> --force
git worktree prune
git branch -D swarm/<run-id>/<role> # only if run is abandoned and branch is merged/abandoned
After reviewer/integrator approves the handoff's artifact:
agent-toolkit swarm promote --run-id <run-id> --handoff-id <handoff-id>
git -C <worktree-path> log --oneline -n 5
git -C <worktree-path> push -u origin <branch>
# Delegate to github-cli-workflow for draft PR
gh pr create --title "swarm/<run-id>: <summary>" --body-file artifacts/<handoff-artifact> --base main
For reuse: same run-id reuses worktrees; no prune between sequential handoffs. New run only for isolated feature branches.
gh pr merge <number> --squash --delete-branch
git worktree remove <path> --force
git worktree prune
agent-toolkit swarm list --json | jq '.[] | select(.run_id=="<run-id>") | .status'
# Optionally archive state: tar -czf /tmp/swarm-<run-id>.tgz .agent-toolkit/swarm/runs/<run-id>
.agent-toolkit/swarm/runs/<run-id>/state.json worktree entries by hand — use swarm CLI.git checkout in the main worktree to switch swarm branches; always git worktree.active handoff — complete or handoff first.| Need | Skill |
|---|---|
| Create the handoff that provisions the worktree | swarm-handoff |
| Launch or observe the swarm | swarm, swarm-observer |
| Herdr/tmux pane for the worktree | herdr |
| Push and create PR after promotion | github-cli-workflow |
| Review before promotion | code-reviewer, security-reviewer |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 plugins in one repository ship this exact skill · first indexed Aug 13, 2026
10 skills in this plugin
/fix-merge-conflictsResolve merge conflicts non-interactively, validate build and tests, and finalize conflict resolution/gh-address-commentsTriage and address open GitHub PR review and conversation comments using the gh CLI. Use when the user wants to "address PR comments", "resolve review threads", or "respond to reviewers" on the current branch's pull request./gh-contribution-plannerDaily GitHub contribution planner — analyzes the gh-logged-in user's non-archived repos (owned + forks) and recent contributions, produces a prioritized plan, halts for approval, then dispatches parallel sub-agents to execute approved items via existing PR/CI/review skills.npx claudepluginhub ulises-jeremias/agent-toolkit --plugin agent-toolkit-forgeOther plugins' skills for the same job