skills/dag-fast-decomposition/SKILL.md
Apply hierarchical decomposition and structural exploitation strategies from DAG theory to complex system design, problem-solving, and abstraction challenges
npx skillsauth add curiositech/windags-skills dag-fast-decompositionInstall 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.
license: Apache-2.0
Name: graph-decomposition-strategies
Description: Apply hierarchical decomposition and structural exploitation strategies from DAG theory to complex system design, problem-solving, and abstraction challenges
Triggers: system scaling problems, dependency management, reachability/connectivity analysis, hierarchical design, performance optimization through preprocessing, abstraction layer design
Load this skill when encountering:
Key signal: When you suspect most of the apparent complexity is redundant structure that could be compressed or bypassed through better decomposition.
The insight: Edge count misleads. The width of a system (maximum number of mutually independent components) reveals true complexity better than connection density.
Why it matters: Dense systems with high edge counts can still have low intrinsic complexity if most edges are transitive (implied by shorter paths). A build system with 10,000 dependency edges might have width 20, meaning at most 20 things truly can't be derived from each other.
Application: When analyzing system complexity, first identify the "reduced edge set" (Ered)—the minimal connections that imply all others. Budget scaling effort against width, not total connections. Systems with low width but high density are ripe for hierarchical compression.
The insight: Near-optimal solutions computed quickly enable their use as preprocessing steps in larger workflows. A 90% optimal solution in 1 second is more valuable than 100% optimal in 1 hour if you need to run it 1000 times or use its output for further computation.
Why it matters: Optimization obsession creates local maxima while missing global efficiency. The paper's heuristics produce chain decompositions within 5-10% of optimal but run orders of magnitude faster, enabling their use in contexts where optimal algorithms would be prohibitive.
Application: For preprocessing, indexing, or iterative workflows, prioritize fast heuristics with quality guarantees over slow exact algorithms. Measure optimization algorithms by downstream value (what they enable), not just solution quality.
The insight: Decomposing a DAG into chains creates natural abstraction levels. Each chain represents a total order (linear hierarchy), while relationships between chains represent coordination boundaries. Reachability within chains is trivial; complexity lives in cross-chain relationships.
Why it matters: This transforms an O(V²) problem (all-pairs reachability) into O(kc * Ered) where kc = chain count and Ered = reduced edges. For graphs where 85-95% of edges are transitive, this is a 10-20x compression of what you need to track.
Application: When designing layered systems, identify "chains" (sequences with clear ordering) and separate them from "coordination points" (where chains must interact). Optimize within chains separately from optimizing across chains. Build indexes at chain boundaries.
The insight: In dense graphs (average degree > 20), 85-95% of edges are transitive—implied by shorter paths. This isn't a bug; it's structural regularity waiting to be exploited.
Why it matters: Apparent complexity often reflects redundant representation, not inherent difficulty. By identifying and collapsing transitive structure, you can dramatically reduce working set size while preserving all essential information.
Application: In dependency graphs, import chains, knowledge bases, or any transitive relation, explicitly identify which edges are transitive vs. generative. Store and process only the reduced set. Use queries against the reduced set to reconstruct full closure on demand.
The insight: Spending O(kc * Ered) time preprocessing to build an index enables O(1) reachability queries. This indexing cost is sublinear in total edges when transitive structure dominates, and the payoff grows with query count.
Why it matters: Systems often face the tradeoff: recompute on every query (no space cost, high time cost per query) vs. precompute everything (O(V²) space, O(1) queries). Chain-based indexing offers a middle path: O(kc * V) space with O(1) queries.
Application: For systems answering many reachability/connectivity queries (access control, dependency checking, routing), invest in structural indexing during preprocessing. The flatter the runtime curve relative to graph density, the better the indexing scheme exploits structure.
IF your system's theoretical complexity predicts failure, BUT empirical behavior suggests hidden structure:
hierarchical-abstraction-for-scaling.mdIF you need optimal solutions in an interactive or iterative workflow:
greedy-decomposition-and-progressive-refinement.mdIF decomposing a complex system into manageable components:
width-as-coordination-complexity.mdIF a dense graph shows better-than-expected algorithmic behavior:
transitive-structure-as-compression-opportunity.mdIF you need to answer many connectivity/reachability queries:
constant-time-reachability-through-indexing.mdIF unsure whether to use top-down or bottom-up decomposition:
problem-decomposition-strategies.md| Reference File | When to Load | Key Content |
|---------------|--------------|-------------|
| hierarchical-abstraction-for-scaling.md | Facing scaling problems where flat approaches fail; designing multi-level systems; need to understand how abstraction reduces complexity | Chain decomposition as hierarchical organization; how levels communicate; scaling through structural exploitation |
| width-as-coordination-complexity.md | Analyzing true system complexity; designing parallel/distributed systems; estimating coordination overhead | Width definition; relationship to reduced edges; how width predicts scaling behavior; width vs. density |
| greedy-decomposition-and-progressive-refinement.md | Choosing between optimization algorithms; designing iterative refinement processes; balancing speed vs. quality | Heuristic vs. exact approaches; path concatenation algorithm; progressive refinement patterns; when "good enough" is better |
| transitive-structure-as-compression-opportunity.md | Working with dense graphs; surprising performance results; opportunity to compress working sets | The 85-95% transitive edge finding; implications for storage and computation; how to identify and exploit transitive structure |
| constant-time-reachability-through-indexing.md | Designing query systems; preprocessing tradeoff analysis; need for fast lookups | Indexing scheme details; space-time tradeoffs; when to invest in preprocessing; O(1) query performance |
| problem-decomposition-strategies.md | Uncertain how to break down complex problems; comparing decomposition approaches; designing modular systems | Top-down vs. bottom-up; hybrid strategies; when each approach works best; decomposition heuristics comparison |
| failure-modes-and-structural-blindness.md | Debugging poor performance; understanding when approaches fail; avoiding common pitfalls | Pathological graph structures; when width ≈ V (worst case); hidden assumptions in decomposition strategies |
Symptom: Spending weeks achieving 100% optimal solution when 95% solution computed in seconds would unlock downstream value
Why it fails: Ignores compound workflow effects; local optimization creates global inefficiency
Alternative: Profile the full pipeline; optimize for end-to-end value, not component perfection
Symptom: Allocating equal storage, computation, or attention to transitive vs. generative edges
Why it fails: Transitive edges are redundant—they're implied by paths through other edges
Alternative: Identify and operate on Ered (reduced edge set); reconstruct transitive closure only when needed
Symptom: Predicting O(V²) or O(E) behavior without checking if width « V
Why it fails: Width determines true complexity for many graph operations; dense low-width graphs behave much better than edge count suggests
Alternative: Measure width; use width-based complexity estimates (e.g., O(width * V) for reduced edges)
Symptom: Building expensive indexes for systems with few queries, or recomputing on every query when many queries are needed
Why it fails: Wrong tradeoff point; either wasting preprocessing time or query time
Alternative: Estimate query frequency; calculate breakeven point; choose indexing strategy accordingly
Symptom: Treating all components as peers when natural hierarchies exist; building O(n²) cross-component communication
Why it fails: Ignores transitive structure and natural ordering; creates false coordination complexity
Alternative: Identify chains (total orders) first; separate intra-chain logic from inter-chain coordination
Symptom: Applying hierarchical decomposition to graphs with width ≈ V (e.g., random graphs, cross-product structures)
Why it fails: These techniques exploit low width and high transitivity; benefits vanish when width is high
Alternative: Check structural preconditions (width, transitive percentage) before applying; have fallback strategies
Recognizing Width in the Wild
The Ered Instinct
Preprocessing Calculus
The Greedy Wisdom
Hierarchical Intuition
Structural Awareness
Ask: "Your system has 10,000 dependencies. Is that a lot?"
Surface answer: "Yes, that's very complex."
Deep answer: "What's the width? If width is 50, then Ered ≤ 500,000, and if 90% of the 10,000 edges are transitive, you only have 1,000 generative relationships to track. That might be trivial. But if width is 8,000, you have a genuinely complex coordination problem regardless of edge count."
When this skill activates:
Remember: The goal isn't to turn everything into a graph problem. It's to recognize when hierarchical decomposition, width-based analysis, or transitive structure exploitation can transform apparent complexity into tractable computation.
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.