Skip to content
Back to skills

Swarm Dag

ASecurity

Topological DAG scheduling and dependency resolution for multi-agent workflows

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentspythongonode

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add D-Shey/autoharness --skill swarm-dag --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Swarm Dag?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Swarm Dag
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/d-shey-swarm-dag/badge)](https://www.skillsdirectory.com/skills/d-shey-swarm-dag)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: swarm-dag
description: Topological DAG scheduling and dependency resolution for multi-agent workflows
---

# 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
1. Parse the workflow plan (JSON/YAML) containing nodes with `id`, `name`, `dependencies` (or `depends_on`), `role`, and `command` or `action`.
2. Construct adjacency list and in-degree maps.
3. Validate acyclicity using Kahn's algorithm or depth-first search cycle detection. Reject execution if circular dependencies exist.
4. 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.
5. Execute nodes within the current tier concurrently using a worker pool (`concurrent.futures.ThreadPoolExecutor` or `asyncio`).
6. Enforce barrier synchronization: wait for all nodes in the current tier to reach terminal status (`completed` or `failed`) before dispatching dependent nodes.
7. If any prerequisite node fails, mark downstream dependent nodes as `blocked`/`skipped`.
8. Persist graph execution state and per-node output artifacts to `.autoharness/swarm/<plan_id>.json`.

## How to verify
1. Test acyclic linear graph (A -> B -> C): verify sequential execution order.
2. 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.
3. Test cycle detection (A -> B -> A): ensure ValueError or CycleDetectedError is raised with cycle path.
4. Verify graceful handling of failure: if B fails, D is blocked while independent tasks finish.

## Facts found here
- Standard library `graphlib.TopologicalSorter` is built into Python 3.9+, enabling zero-dependency topological sorting.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.