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.
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.