skills/dag-result-aggregator/SKILL.md
Combines and synthesizes outputs from parallel DAG branches. Handles merge strategies, conflict resolution, and result formatting. Activate on 'aggregate results', 'combine outputs', 'merge branches', 'synthesize results', 'fan-in'. NOT for execution (use dag-parallel-executor) or scheduling (use dag-task-scheduler).
npx skillsauth add curiositech/windags-skills dag-result-aggregatorInstall 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 Result Aggregator, combining outputs from parallel branches into unified results with conflict resolution.
Primary Decision Tree: Aggregation Strategy Selection
Incoming results assessment:
├─ IF all results have identical structure AND no conflicts
│ └─ Use union merge (simple concatenation)
│
├─ IF concurrent conflicts detected (same field, different values)
│ ├─ IF timestamp-based → Apply last-wins strategy
│ ├─ IF priority-based → Apply priority merge
│ ├─ IF critical system → Throw error and halt
│ └─ ELSE → Apply first-wins strategy
│
├─ IF partial failures (some branches failed)
│ ├─ IF success rate < 50% → Skip aggregation, propagate error
│ ├─ IF success rate >= 50% → Union available results
│ └─ Mark missing data in output metadata
│
├─ IF schema mismatch between branches
│ ├─ IF coercible types (string↔number) → Apply type coercion
│ ├─ IF incompatible structures → Reject with schema error
│ └─ IF missing fields → Fill with null/defaults
│
└─ IF memory constraints (large result sets)
├─ IF total size > 100MB → Stream aggregation
├─ IF item count > 10K → Apply pagination
└─ ELSE → In-memory aggregation
Conflict Resolution Decision Matrix
| Data Type | Default Strategy | Fallback | Critical Systems | |-----------|-----------------|----------|------------------| | Timestamps | last-wins | error | error | | Counters | sum | highest-wins | error | | Strings | concatenate | first-wins | error | | Objects | deep-merge | last-wins | error | | Arrays | union | intersection | error |
1. Type Mismatch Chaos
if (typeof result[field] !== typeof expected[field])2. Memory Explosion
if (estimatedSize > memoryLimit || itemCount > 50000)3. Infinite Conflict Loop
if (conflictResolutionAttempts > maxRetries)4. Silent Data Loss
if (outputItemCount < (inputItemCount * 0.8))5. Deadlock Detection Miss
if (waitTime > timeout && pendingResults.length > 0)Example: Code Analysis Aggregation
// Scenario: 3 parallel code analyzers (security, performance, style)
// Input: Mixed success/failure, conflicting severity scores
STEP 1: Assess incoming results
- security-analyzer: SUCCESS, 12 findings
- performance-analyzer: FAILED (timeout)
- style-analyzer: SUCCESS, 8 findings with severity conflicts
STEP 2: Apply decision tree
- Partial failure detected (33% failure rate)
- Success rate 66% > 50% threshold → Continue with available results
- Schema mismatch: security uses 1-10 scale, style uses LOW/MED/HIGH
STEP 3: Handle conflicts and schema
- Convert style severity: LOW→2, MED→5, HIGH→8
- Merge findings arrays using union strategy
- Add metadata marking performance-analyzer as unavailable
STEP 4: Validate and format output
```json
{
"aggregationId": "code-analysis-001",
"data": {
"findings": [
{"type": "security", "severity": 8, "message": "SQL injection risk"},
{"type": "style", "severity": 5, "message": "Long method detected"}
]
},
"stats": {
"totalInputs": 3,
"successfulInputs": 2,
"failedInputs": 1,
"conflictsResolved": 0
},
"partialResults": ["performance-analyzer"]
}
What novice misses: Would fail on partial results instead of proceeding with available data. What expert catches: Recognizes 66% success rate is acceptable, applies schema normalization.
This skill should NOT be used for:
dag-parallel-executor for running parallel branchesdag-task-scheduler for timing and dependenciesstream-processor for continuous data flowsdata-analyzer for statistical computations beyond simple aggregationdata-persister for saving aggregated resultsDelegation Rules:
stream-processordata-analyzerdata-persisterMany inputs. One output. Unified results.
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.