swarm-dag
Skill10 starsChanged yesterdayMITView on GitHub
Topological DAG scheduling and dependency resolution for multi-agent workflows
In this repository44 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- ai-prompt-engineering-safety-reviewSkill
- ast-codemapSkill
- ast-grepSkill
- autoharnessSkill
- autonomous-backlog-driverSkill
- claude-kimi-mcp-normalizationSkill
- cli-self-updaterSkill
- code-frugalitySkill
- codemode-gatewaySkill
- codemode-typesSkill
- consequence-simulationSkill
- context-pruningSkill
- github-update-checkerSkill
- google-agents-cli-evalSkill
- google-agents-cli-scaffoldSkill
- history-searchSkill
- hook-gatingSkill
- hybrid-semantic-searchSkill
- kimi-code-agent-integrationSkill
- kimi-mcp-configurationSkill
- leann-vectorSkill
- log-summarizerSkill
- markdown-vagueSkill
- memory-reconciliationSkill
- mode-classificationSkill
- multiagent-orchestrationSkill
- output-compressionSkill
- prompt-injectionSkill
- python-anti-patternsSkill
- regression-sentinelSkill
- restart-trackingSkill
- rollback-guardSkill
- rust-call-graphSkill
- secrets-managementSkill
- security-best-practicesSkill
- session-compactorSkill
- sqlite-memorySkill
- swarm-barrierSkill
- autoharnessSkill
- code-reliability-checksSkill
- skill-threat-rulesSkill
- autoharnessSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use when a complex task or epic consists of multiple interrelated subtasks where some subtasks can run in parallel, while others require …
- Very specific: line 20
If any prerequisite node fails, mark downstream dependent nodes as blocked/skipped.
- Distinctive: line 24
Test acyclic linear graph (A -> B -> C): verify sequential execution order.
- Distinctive: line 25
Test branching parallel graph (A -> [B, C] -> D): verify B and C run concurrently after A finishes, and D waits for both B and C.
- Distinctive: line 26
Test cycle detection (A -> B -> A): ensure ValueError or CycleDetectedError is raised with cycle path.
- Distinctive: line 27
Verify graceful handling of failure: if B fails, D is blocked while independent tasks finish.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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-dag
When to use
Use when a complex task or epic consists of multiple interrelated subtasks where some subtasks can run in parallel, while others require predecessor outputs or verification gates before starting.
Steps
- Parse the workflow plan (JSON/YAML) containing nodes with
id,name,dependencies(ordepends_on),role, andcommandoraction. - Construct adjacency list and in-degree maps.
- Validate acyclicity using Kahn's algorithm or depth-first search cycle detection. Reject execution if circular dependencies exist.
- Compute topological execution tiers (generations):
- Tier 0: nodes with in-degree 0 (no prerequisites).
- Tier N+1: nodes whose prerequisites are strictly satisfied by Tier <= N.
- Execute nodes within the current tier concurrently using a worker pool (
concurrent.futures.ThreadPoolExecutororasyncio). - Enforce barrier synchronization: wait for all nodes in the current tier to reach terminal status (
completedorfailed) before dispatching dependent nodes. - If any prerequisite node fails, mark downstream dependent nodes as
blocked/skipped. - Persist graph execution state and per-node output artifacts to
.autoharness/swarm/<plan_id>.json.
How to verify
- Test acyclic linear graph (A -> B -> C): verify sequential execution order.
- Test branching parallel graph (A -> [B, C] -> D): verify B and C run concurrently after A finishes, and D waits for both B and C.
- Test cycle detection (A -> B -> A): ensure ValueError or CycleDetectedError is raised with cycle path.
- Verify graceful handling of failure: if B fails, D is blocked while independent tasks finish.
Facts found here
- Standard library
graphlib.TopologicalSorteris built into Python 3.9+, enabling zero-dependency topological sorting.
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.

