swarm-observer
Skill18 starsChanged 3 months agoMITView on GitHub
Observe, diagnose, and recover Agent Toolkit swarm runs via status, handoffs, logs, and attach
In this repository105 other files it gives its agents.
- AGENTS.mdAGENTS.md
- reviewSkill
- mcp-auditSkill
- owasp-agentic-reviewSkill
- supply-chain-auditSkill
- threat-modelingSkill
- architecture-diagramSkill
- c4-modelSkill
- aws-well-architected-reviewSkill
- cloud-design-patternsSkill
- assistantSkill
- dev-companionSkill
- onboardingSkill
- output-handshakeSkill
- pr-fallbackSkill
- projectSkill
- workspace-knowledge-syncSkill
- workspaceSkill
- dbt-validationSkill
- snowflake-validationSkill
- adrSkill
- agreementSkill
- bugSkill
- decision-logSkill
- development-workflowSkill
- epicSkill
- incidentSkill
- management-unit-assessmentSkill
- meeting-minutesSkill
- planningSkill
- prdSkill
- project-assessment-evidenceSkill
- project-assessmentSkill
- spikeSkill
- taskSkill
- technical-unit-assessmentSkill
- trdSkill
- user-storySkill
- workflow-client-bootstrapSkill
- workflow-generic-projectSkill
- work-itemSkill
- bragSkill
- brag-slimSkill
- design-assessmentSkill
- design-improvementSkill
- figma-code-connect-componentsSkill
- figma-create-design-system-rulesSkill
- figma-create-new-fileSkill
- figma-implement-designSkill
- figmaSkill
- frontend-design-reviewSkill
- frontend-designSkill
- web-design-guidelinesSkill
- fix-merge-conflictsSkill
- gh-address-commentsSkill
- gh-contribution-plannerSkill
- gh-fix-ciSkill
- github-cli-workflowSkill
- gitlab-cli-workflowSkill
- worktreeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Run lives under .agent-toolkit/swarm/runs/<run-id>/state.json (filesystem is authoritative).
- Very specific: line 91
Never edit .agent-toolkit/swarm/runs/<run-id>/state.json by hand.
- Very specific: line 92
Never create new Herdr workspaces for headless — fix the backend fallback instead.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swarm Observer
Monitor any agent-toolkit swarm run, diagnose stuck handoffs or backend drift, and recover without losing windows. Works for both Herdr (tabs) and tmux (isolated socket agent-toolkit-swarm-<run-id>). Integrates with swarm's eager-window model (every role starts as Waiting for handoff: <pred> -> <role> with agent_waiting trace).
When to use
- A swarm was launched and the user asks "is it done?", "what's the status?", "show logs", or "attach".
- A handoff has been
activefor >5m (955be6f6e2c...pattern) orworktree_failed. - Herdr shows extra workspaces (
w7-wA) forheadlessruns — theget_backend("headless")fallback case. - User wants to reuse the same run for a new request and needs to know if windows are still alive.
Prerequisites
- Run lives under
.agent-toolkit/swarm/runs/<run-id>/state.json(filesystem is authoritative). - Know
run-id(20260807T...-xxxxxx) fromswarm start --jsonorswarm list --json. - Shell is detected (
_user_shell():$SHELL→pwd.getpwuid→/usr/bin/zshfallback, executed as<shell> -lc).
Workflow
1. List and pick the run
agent-toolkit swarm list --json | jq
agent-toolkit swarm status --run-id <run-id>
agent-toolkit swarm status --run-id <run-id> --json | jq '.handoffs,.worktrees,.trace'2. Inspect handoffs and trace
agent-toolkit swarm handoffs --run-id <run-id>
agent-toolkit swarm handoffs --run-id <run-id> --json | jq '.[] | {id,from,to,status,artifact,auto}'
# Active that should have auto-completed:
# where to==from_role and handoff create --to == that role -> auto:trueTrace keys to watch: agent_waiting, handoff_completed auto:true, worktree_failed, headless_fallback.
3. Tail logs and attach
agent-toolkit swarm logs --run-id <run-id> --follow
agent-toolkit swarm logs --run-id <run-id> --role reviewer --follow
agent-toolkit swarm attach --run-id <run-id> # herdr: workspace focus; tmux: attach -L agent-toolkit-swarm-<run-id>
herdr workspace list --json 2>&1 | jq '.[] | {id,name,status}'
tmux -L agent-toolkit-swarm-<run-id> capture-pane -t <window> -p | tail -n 804. Diagnose
| Symptom | Cause | Fix | |
| `Waiting for handoff: a -> b | role: b` stuck >5m | active handoff never task complete | agent-toolkit swarm task next --role b --run-id <run-id> then task complete --task-id <id> or handoff create --from a --to b ... which auto-completes active where to==a |
worktree_failed | find_repo_root failed (git rev-parse --git-common-dir on .git file) | Re-run handoff create — fixed via AGENT_TOOLKIT_SWARM_RUN_ID export + path extract | |
Extra Herdr workspaces w7-wA with headless | get_backend("headless") returned HerdrBackend | Patch backends/__init__.py to return headless/noop backend; then herdr workspace delete <id> for orphans | |
Shell shows bash while user uses zsh | Hardcoded bash -lc | Fixed via _user_shell() / _shell_base() — verify ps -o comm= -p <pid> shows zsh |
5. Recover or reuse
# Complete stuck handoff and provision next role (worktree/tab + agent start)
agent-toolkit swarm handoff create --type artifact --from implementer --to reviewer --artifact artifacts/fix.md --run-id <run-id>
# Reuse same windows for a new request (no new run needed)
agent-toolkit swarm handoff create --type artifact --from implementer --to reviewer --artifact artifacts/new-task.md --run-id <run-id>
# Chain re-triggers: implementer -> reviewer -> integrator via file handoffs
# Only create a new run when isolated branch is required
agent-toolkit swarm start --recipe pair --ui herdr --runner opencode --model-profile balanced --attach "new isolated task"Boundaries
- Never edit
.agent-toolkit/swarm/runs/<run-id>/state.jsonby hand; usehandoff create/task complete/promote. - Never create new Herdr workspaces for
headless— fix the backend fallback instead. - For tmux, always use isolated socket
-L agent-toolkit-swarm-<run-id>; never the default server.
Delegates to
| Need | Skill/Command |
| Show failure snippet before fixing | swarm-handoff |
| Recreate worktree | agent-toolkit swarm handoff create (auto-provisions) |
| Review code produced by swarm | code-reviewer, security-reviewer |
| Create PR after promotion | github-cli-workflow |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

