skills/dag-dependency-resolver/SKILL.md
Validates DAG structures, performs topological sorting, detects cycles, and resolves dependency conflicts. Uses Kahn's algorithm for optimal execution ordering. Activate on 'resolve dependencies', 'topological sort', 'cycle detection', 'dependency order', 'validate dag'. NOT for building DAGs (use dag-graph-builder) or scheduling execution (use dag-task-scheduler).
npx skillsauth add curiositech/windags-skills dag-dependency-resolverInstall 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 Dependency Resolver, ensuring graphs are executable by detecting cycles, computing optimal execution orders, and resolving dependency conflicts.
Graph Size < 100 nodes AND Dense connections (>50% edge density)?
├── YES → Use Kahn's algorithm (better for dense graphs)
└── NO → Graph Size > 1000 nodes?
├── YES → Use DFS with early termination (memory efficient)
└── NO → Use Kahn's algorithm (clearer wave structure)
Cycle Breaking Strategy (when cycles detected):
├── Single cycle with 2-3 nodes? → Suggest node merge
├── Multiple interconnected cycles? → Find minimum feedback arc set
├── Cycle involves external dependencies? → Add intermediate buffer node
└── Self-referential cycle? → Remove self-dependency (always safe)
Parallelization Opportunity Assessment:
├── Wave has >5 independent nodes? → Flag high parallelization potential
├── Critical path > 3x average path? → Recommend breaking bottleneck nodes
├── Resource conflicts detected? → Add ordering constraints
└── No conflicts? → Mark wave as fully parallelizable
Fan-Out Explosion
if node.dependents.length > 20 && maxWaveSize/avgWaveSize > 5Deep Chain Dependency
if criticalPath.length > shortestPath.length * 5Phantom Dependency
if dependency not in dag.nodes && not flagged as missingResource Thrashing
if nodes in wave share exclusive resource without orderingCycle Masking
if cycle exists in any possible execution branchInput: 10-node DAG with cycle and resource conflicts
nodes:
load-data: { deps: [], resources: [database] }
validate-data: { deps: [load-data], resources: [] }
clean-data: { deps: [validate-data], resources: [memory-pool] }
analyze-A: { deps: [clean-data], resources: [gpu] }
analyze-B: { deps: [clean-data], resources: [gpu] } # CONFLICT!
transform-A: { deps: [analyze-A, summarize], resources: [] } # CYCLE!
transform-B: { deps: [analyze-B], resources: [memory-pool] } # CONFLICT with clean-data!
summarize: { deps: [transform-A], resources: [] } # CYCLE!
report: { deps: [transform-A, transform-B], resources: [disk] }
cleanup: { deps: [report], resources: [database] } # CONFLICT with load-data!
Resolution Process:
Cycle Detection: DFS finds analyze-A → transform-A → summarize → transform-A
transform-A → summarize, add analyze-A → summarizeResource Conflict Analysis:
analyze-A vs analyze-B in wave 2clean-data vs transform-B spans wavesload-data vs cleanup in different waves (OK)Dependency Reordering:
analyze-A before analyze-B (serialize GPU)transform-B to wave after clean-data completesFinal Resolution:
executionWaves:
- wave: 0
nodes: [load-data]
parallelizable: false
- wave: 1
nodes: [validate-data]
parallelizable: false
- wave: 2
nodes: [clean-data]
parallelizable: false
- wave: 3
nodes: [analyze-A] # GPU exclusive
parallelizable: false
- wave: 4
nodes: [analyze-B, summarize] # GPU freed, memory freed
parallelizable: true
- wave: 5
nodes: [transform-A, transform-B] # Both can run
parallelizable: true
- wave: 6
nodes: [report]
parallelizable: false
- wave: 7
nodes: [cleanup]
parallelizable: false
criticalPath: [load-data, validate-data, clean-data, analyze-A, transform-A, report, cleanup]
parallelizationFactor: 1.4x # Limited by resource conflicts
Expert vs Novice: Novice would miss resource conflicts and only fix the cycle, leading to runtime failures. Expert analyzes resource constraints alongside dependency structure.
dag-graph-builder - this only validates existing graphsdag-task-scheduler - this only provides execution orderdag-dynamic-replanner - this doesn't handle dynamic changesdag-performance-optimizer - this focuses on correctnessdag-data-validator - this only checks structural dependenciestools
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.