skills/dag-performance-profiler/SKILL.md
Profiles DAG execution performance including latency, token usage, cost, and resource consumption. Identifies bottlenecks and optimization opportunities. Activate on 'performance profile', 'execution metrics', 'latency analysis', 'token usage', 'cost analysis'. NOT for execution tracing (use dag-execution-tracer) or failure analysis (use dag-failure-analyzer).
npx skillsauth add curiositech/windags-skills dag-performance-profilerInstall 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 analyze DAG execution performance to identify bottlenecks and optimization opportunities through systematic profiling of latency, token usage, cost, and resource consumption.
Primary bottleneck detected?
├─ High latency (>3x avg node time)
│ ├─ Sequential dependency chain → Restructure for parallelization
│ └─ Single slow node → Break into smaller tasks or downgrade model
├─ High cost (>40% of total budget)
│ ├─ Token usage >5000/node → Context reduction strategy
│ └─ Expensive model overuse → Model selection optimization
└─ Resource contention (wait time >50% execution time)
├─ Tool latency bottleneck → Cache or parallelize tool calls
└─ Dependency blocking → DAG restructuring
Impact vs Effort analysis:
├─ High Impact (>20% improvement) + Low Effort → IMMEDIATE (same day)
│ ├─ Model downgrade for simple tasks → Execute immediately
│ └─ Remove obvious sequential dependencies → Execute immediately
├─ High Impact + High Effort → PLANNED (next sprint)
│ ├─ Major DAG restructuring → Schedule with stakeholders
│ └─ Tool replacement/caching → Plan implementation
├─ Low Impact (<10% improvement) → DEFER
│ └─ Minor optimizations → Document but don't implement
└─ Negative Impact → REJECT
└─ Optimizations that hurt other metrics → Explicitly reject
Performance requirement context?
├─ Cost-sensitive (budget constrained)
│ ├─ Accept 20% latency increase for 30%+ cost reduction → Recommend
│ └─ <20% cost savings → Keep current configuration
├─ Latency-critical (real-time requirements)
│ ├─ Accept 40%+ cost increase for 20% latency reduction → Recommend
│ └─ <15% latency improvement → Reject cost increase
└─ Balanced requirements
├─ Cost/latency ratio improvement >15% → Recommend
└─ <10% improvement either metric → No change recommended
Symptoms: Recommending micro-optimizations that save <5% while ignoring major bottlenecks Detection: If optimization list has >5 items with <10% individual impact each Fix: Rank by impact percentage, focus only on top 2-3 optimizations with >15% impact. Defer others explicitly.
Symptoms: Misidentifying wait time as execution bottleneck, blaming wrong nodes Detection: If "slow node" has high wait time but normal execution time relative to task complexity Fix: Separate wait time from execution time in analysis. Focus on dependency structure causing waits, not node speed.
Symptoms: Providing token savings calculations without accounting for model pricing differences Detection: If cost savings percentages don't match token reduction ratios by model type Fix: Always calculate actual cost: (token_change / 1000) × model_price_per_1k. Show both token AND dollar impact.
Symptoms: Suggesting parallelization for inherently sequential tasks with data dependencies Detection: If recommending parallel execution for nodes where output of A feeds input of B Fix: Map actual data dependencies before suggesting parallelization. Only truly independent nodes can run parallel.
Symptoms: Optimizing one metric while catastrophically degrading another Detection: If optimizing for cost increases latency >50% or optimizing latency increases cost >100% Fix: Always provide trade-off analysis: "20% cost savings, 15% latency increase, 5% accuracy impact"
Initial State: 5-node code review DAG: 45s total, $0.42 cost
extract-code: 4.2s, 2,400 tokens, Sonnetanalyze-complexity: 8.1s (3.4s wait + 4.7s exec), 4,200 tokens, Sonnetcheck-security: 6.8s, 3,100 tokens, Sonnetreview-performance: 12.4s, 8,900 tokens, Opusgenerate-report: 13.5s (9.2s wait + 4.3s exec), 5,200 tokens, SonnetStep 1 - Bottleneck Classification
Primary bottleneck: review-performance at 12.4s (27% of total) - Single slow node pattern
Secondary: Dependency blocking causing 12.6s total wait time
Step 2 - Apply Decision Tree High latency bottleneck + resource contention → Restructure for parallelization + break down slow node
Step 3 - Optimization Recommendations
review-performance into check-patterns (3s, Sonnet) + assess-complexity (4s, Sonnet)
analyze-complexity + check-security (currently sequential)
Final Result: 28s total (38% faster), $0.34 cost (19% cheaper)
Initial State: 8-node data analysis: 67s total, $2.40 cost, 95% Opus usage
Step 1 - Cost Analysis Discovery
extract-tables: 2,800 tokens, Opus ($0.42) - Simple extraction taskclean-data: 3,200 tokens, Opus ($0.48) - Pattern matching taskstatistical-analysis: 12,600 tokens, Opus ($1.89) - Complex reasoninggenerate-insights: 9,400 tokens, Opus ($1.41) - Moderate analysisStep 2 - Model Selection Decision Tree Using complexity assessment:
Step 3 - Impact Calculation
Expert Decision: Accept trade-off - massive cost savings for minimal latency impact in non-critical analytics pipeline.
Performance profiling complete when:
This skill should NOT be used for:
dag-execution-tracer insteaddag-failure-analyzer insteaddag-architect insteaddag-auto-optimizer insteaddag-task-scheduler insteadDelegate when:
dag-execution-tracerdag-failure-analyzerdag-architectdag-auto-optimizerdag-task-schedulerThis skill focuses on analysis and actionable recommendations, not monitoring, design, or automatic implementation.
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.