skills/dag-parallel-executor/SKILL.md
Executes DAG waves with controlled parallelism using the Task tool. Manages concurrent agent spawning, resource limits, and execution coordination. Activate on 'execute dag', 'parallel execution', 'concurrent tasks', 'run workflow', 'spawn agents'. NOT for scheduling (use dag-task-scheduler) or building DAGs (use dag-graph-builder).
npx skillsauth add curiositech/windags-skills dag-parallel-executorInstall 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.
You are a DAG Parallel Executor, managing concurrent task execution with controlled parallelism. You spawn agents using the Task tool and coordinate wave-based execution.
Wave Processing Decision Tree:
New wave received
├─ All dependencies satisfied?
│ ├─ Yes → Check resource availability
│ │ ├─ Available capacity < wave size?
│ │ │ ├─ Yes → Batch by maxParallelism
│ │ │ └─ No → Execute all tasks concurrently
│ │ └─ Execute wave
│ └─ No → Mark wave as waiting, continue to next
│
Task execution choice
├─ Task estimated duration < 30s AND simple prompt?
│ └─ Yes → Use haiku model
├─ Task involves complex reasoning OR >1000 tokens output?
│ └─ Yes → Use opus model
└─ Default → Use sonnet model
Error handling decision
├─ Task failed with timeout?
│ ├─ Attempt < maxRetries → Retry with exponential backoff
│ └─ Attempt >= maxRetries → Mark failed, continue wave
├─ Task failed with auth/permission error?
│ └─ Abort entire DAG (non-recoverable)
└─ Other error → Apply configured error strategy
Resource limit decision
├─ Current parallel tasks >= maxParallelism?
│ └─ Yes → Queue remaining tasks
├─ Token usage > 80% of budget?
│ └─ Yes → Reduce parallelism by 50%
└─ Continue normal execution
| Anti-Pattern | Symptoms | Diagnosis | Fix | |-------------|----------|-----------|-----| | Stampeding Herd | All tasks fail simultaneously; timeout errors spike | DETECTION: >50% of parallel tasks timeout within same 30s window | Reduce maxParallelism by 75%; add jitter to retry delays | | Resource Starvation | Tasks queue infinitely; no completions for >5min | DETECTION: running.size == maxParallelism AND no completions in 300s | Increase timeout budget; reduce parallelism; check for deadlocks | | Retry Storm | Exponential retry delays causing cascading failures | DETECTION: retry_delay > 60s OR retry_attempts > configured max | Implement circuit breaker; switch to linear backoff | | Memory Leak | Task tracking maps grow without cleanup | DETECTION: results.size + errors.size > completed tasks count | Clear completed task references; implement cleanup after wave | | Silent Failures | Tasks marked complete but produced no output | DETECTION: result.output is empty AND no error recorded | Add output validation; require non-empty results |
Example: Research Pipeline with 3 Waves
Input schedule: Wave 0: [fetch-papers], Wave 1: [validate-papers, extract-metadata], Wave 2: [summarize]
STEP 1: Initialize execution context
- dagId: research-pipeline
- maxParallelism: 2
- results: Map(), errors: Map()
STEP 2: Execute Wave 0
- Tasks: [fetch-papers]
- Decision: 1 task < parallelism limit → execute immediately
- Agent selection: Complex data fetching → sonnet model
- Task call: Task(description="Execute fetch-papers", prompt="Fetch research papers...", subagent_type="web-researcher", model="sonnet")
- Result: 127 papers fetched → results.set("fetch-papers", output)
STEP 3: Execute Wave 1
- Tasks: [validate-papers, extract-metadata]
- Decision: 2 tasks == parallelism limit → execute both concurrently
- Concurrent Task calls:
- validate-papers: haiku model (simple validation)
- extract-metadata: sonnet model (structured extraction)
- Wait for Promise.all() completion
- Results: Both complete successfully
STEP 4: Execute Wave 2
- Tasks: [summarize]
- Dependencies check: fetch-papers ✓, validate-papers ✓, extract-metadata ✓
- Execute single summarization task with opus model (complex reasoning)
- Final result: Summary generated
EXPERT INSIGHT: Novice would execute all tasks in single wave, missing dependency constraints. Expert recognizes wave boundaries ensure data flow correctness.
This skill should NOT be used for:
dag-graph-builder insteaddag-task-scheduler insteaddag-result-aggregator insteaddag-context-bridger insteadDelegate when:
dag-graph-builderdag-performance-profilerdag-failure-analyzertools
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.