skills/dag-planner/SKILL.md
Builds, validates, schedules, and dynamically modifies DAG execution graphs. Decomposes problems into nodes with dependencies, performs topological sorting, detects cycles, resolves conflicts, and schedules wave-based parallel execution. Use when designing a DAG structure, validating dependencies, planning execution order, or modifying a DAG at runtime. Activate on "build DAG", "plan workflow", "DAG dependencies", "topological sort", "schedule execution", "modify DAG", "replan". NOT for executing DAGs (use dag-runtime), validating outputs (use dag-quality), or matching skills to nodes (use dag-skills-matcher).
npx skillsauth add curiositech/windags-skills dag-plannerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Builds, validates, schedules, and dynamically modifies DAG execution graphs for complex multi-step tasks.
Problem complexity assessment:
├── Single coherent output from one skill → No DAG needed (use direct skill)
├── 2-3 sequential steps, linear dependency → Simple pipeline (3-5 nodes)
├── Multiple parallel paths with convergence → Complex DAG (5-15 nodes)
└── Unclear requirements or multiple approaches → Start with vague nodes, refine later
Node type decision tree:
├── If task is well-defined with known skills → agent node
├── If task is unclear but bounded → vague node (refine during execution)
├── If requires human judgment/approval → human-gate node
└── If task needs external system → agent node with tool restrictions
Node size assessment:
├── If completable in 1 LLM call with 1-3 skills → Good granularity
├── If requires 5+ sequential LLM calls → Split into multiple nodes
├── If output is 1-2 simple values → Too granular, merge with parent
└── If node does "everything" → Too coarse, decompose further
Dependency resolution:
├── Data dependency (B needs A's output) → Direct edge A→B
├── Resource conflict (both modify same file) → Serialize into different waves
├── Ordering constraint (B after A for logic) → Add ordering edge A→B
└── Optional dependency (B benefits from A but can run without) → Parallel with optional input
Modification decision tree:
├── If node repeatedly fails → Replace node (different skill/model/approach)
├── If output quality insufficient → Add quality gate node after current
├── If gap discovered in coverage → Insert new node in dependency chain
├── If path proves unnecessary → Remove node and reconnect edges
└── If multiple approaches needed → Fork into parallel paths, converge later
Symptoms: Downstream nodes fail with "missing field" or "unexpected format" errors Detection: If >50% of nodes in a wave fail with schema violations Diagnosis: Node output schemas don't match downstream input expectations Fix: Halt execution, audit all schemas in the dependency chain, add adapter nodes if needed
Symptoms: Topological sort fails, no nodes have in_degree=0 after some are processed Detection: Validation throws CycleError during DAG build phase Diagnosis: Implicit dependency created a cycle (often through shared resources) Fix: Trace cycle using Kahn's algorithm state, break weakest dependency (usually resource conflicts)
Symptoms: DAG has >20 nodes for simple task, execution overhead dominates work time Detection: If node_count > 3 × estimated_complexity_score Diagnosis: Over-decomposed trivial operations into separate nodes Fix: Merge adjacent nodes with single dependencies, combine related operations
Symptoms: Nodes wait indefinitely, execution stalls despite no explicit blocking Detection: If wave scheduling shows nodes stuck in higher waves despite dependencies met Diagnosis: Hidden dependencies through shared mutable state not modeled as edges Fix: Audit all file I/O and shared resources, add explicit edges or resource locks
Symptoms: Later waves have 1-2 nodes while early waves are overloaded Detection: If max_wave_size / min_wave_size > 5 and total_waves > 3 Diagnosis: Poor dependency structure creates artificial serialization Fix: Identify independent sub-paths, restructure to enable more parallelization
Problem: "Analyze customer feedback and generate recommendations"
Decomposition Process:
Final DAG:
nodes:
- id: collect_feedback
type: agent
skills: [data-collector]
output_schema: {feedback_items: array, metadata: object}
wave: 1
- id: analyze_sentiment
type: agent
skills: [text-analyzer]
depends_on: [collect_feedback]
output_schema: {sentiment_scores: array, themes: array}
wave: 2
- id: generate_recommendations
type: agent
skills: [strategic-advisor]
depends_on: [analyze_sentiment]
wave: 3
Problem: "Research market trends, analyze competitors, and create strategy presentation"
Key Decisions:
Decomposition reasoning:
Final structure: 4 waves, 2 parallel paths converging, 1 human gate
Initial plan: Simple linear DAG for code review Runtime issue: Code quality gate fails repeatedly Replanning decision:
Expert insight: Novice would just retry same approach; expert recognizes need for alternative path
Do NOT use dag-planner for:
dag-runtime insteaddag-quality insteaddag-skills-matcher insteadDelegate to:
dag-runtime: For executing planned DAGsdag-quality: For validating node outputsdag-skills-matcher: For selecting appropriate skills for each nodeworkflow-simple: For linear 2-3 step processestools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.