skills/dag-task-scheduler/SKILL.md
Wave-based parallel scheduling for DAG execution. Manages execution order, resource allocation, and parallelism constraints. Activate on 'schedule dag', 'execution waves', 'parallel scheduling', 'task queue', 'resource allocation'. NOT for building DAGs (use dag-graph-builder) or actual execution (use dag-parallel-executor).
npx skillsauth add curiositech/windags-skills dag-task-schedulerInstall 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 Task Scheduler that creates optimal execution schedules for directed acyclic graphs through wave-based parallelism and resource allocation.
Resource contention detected →
├─ CPU/Memory shortage:
│ ├─ If critical path affected → Preempt lower priority tasks
│ └─ If non-critical → Apply backpressure (delay wave start)
├─ Token budget exceeded:
│ ├─ If deadline approaching → Reorder tasks by ROI
│ └─ If time available → Split wave into sub-waves
└─ Parallelism limit hit:
├─ If homogeneous tasks → Round-robin allocation
└─ If mixed sizes → Priority-based allocation
Tasks exceed maxParallelism →
├─ If task count ≤ 2x limit → Split into sequential sub-waves
├─ If task count > 2x limit → Apply priority filtering
└─ If all high priority → Reduce parallelism temporarily
Multiple high-priority tasks in wave →
├─ Check deadlines:
│ ├─ If deadline conflicts → Schedule earliest deadline first
│ └─ If no conflicts → Schedule by resource efficiency
├─ Check dependencies:
│ ├─ If creates bottleneck → Delay non-critical path
│ └─ If independent → Parallel execution
Schedule deviation detected →
├─ Early completion → Advance dependent waves immediately
├─ Late completion →
│ ├─ If on critical path → Notify replanner
│ └─ If off critical path → Continue current schedule
└─ Task failure →
├─ If retry available → Add to next wave
└─ If no retries → Skip dependents or halt DAG
| Anti-Pattern | Detection Rule | Diagnosis | Fix | |-------------|----------------|-----------|-----| | Wave Overflow | Tasks in wave > maxParallelism × 1.5 | Scheduler ignored parallelism constraints | Split wave or reduce task priority | | Resource Starvation | Wave utilization < 30% with pending tasks | Over-conservative resource allocation | Increase per-task allocation or merge waves | | Priority Inversion | Low-priority task blocks high-priority | Dependency graph creates scheduling conflict | Reorder waves or boost blocker priority | | Deadline Miss | Estimated completion > deadline | Schedule too optimistic or resource shortage | Preempt non-critical tasks or add resources | | Thrashing Schedule | >3 reschedules in 1 minute | Dynamic replanning too aggressive | Add stability buffer or batch updates |
Input: 8-task research DAG, maxParallelism=3, 60-second deadline
Wave Analysis:
- Wave 0: [gather-sources] → 1 task, starts immediately
- Wave 1: [validate-sources, extract-metadata, fetch-citations] → 3 tasks
- Wave 2: [analyze-content, cross-reference] → 2 tasks
- Wave 3: [synthesize-report] → 1 task
Resource Contention Check:
- validate-sources: 15s, 2000 tokens
- extract-metadata: 20s, 3000 tokens
- fetch-citations: 25s, 4000 tokens
- Total Wave 1: 25s (parallel), 9000 tokens
Decision Process:
1. Check token budget: 15000 available > 9000 required ✓
2. Check timing: 25s + 20s (Wave 2) + 10s (Wave 3) = 55s < 60s ✓
3. Check parallelism: 3 tasks = 3 maxParallelism ✓
Expert Insight: Notice fetch-citations is longest task and not on critical path.
Novice miss: Would schedule alphabetically, missing optimization opportunity.
Final Schedule:
- Start fetch-citations first (longest duration)
- validate-sources and extract-metadata fill remaining slots
- Critical path: gather → validate → analyze → synthesize (45s total)
This skill should NOT be used for:
dag-graph-builderdag-parallel-executordag-execution-tracerdag-dynamic-replannerdag-result-processordag-error-handlerDelegation Rules:
dag-graph-builderdag-parallel-executordag-dynamic-replannerdag-error-handlerOptimal schedules. Maximum parallelism. Zero resource waste.
tools
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.