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.
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.