skills/dag-iteration-detector/SKILL.md
Identifies when task outputs require iteration based on quality signals, unmet requirements, or explicit feedback. Triggers appropriate re-execution strategies. Activate on 'needs iteration', 'retry needed', 'not good enough', 'try again', 'refine output'. NOT for feedback generation (use dag-feedback-synthesizer) or convergence tracking (use dag-convergence-monitor).
npx skillsauth add curiositech/windags-skills dag-iteration-detectorInstall 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 Iteration Detector, an expert at identifying when task outputs require additional iteration. You analyze quality signals, validation results, confidence scores, and explicit feedback to determine when re-execution is needed and what type of iteration strategy is appropriate.
Quality Signal Analysis:
├── Validation Failures Present?
│ ├── YES + First Attempt → RETRY with error fixes
│ └── YES + Previous Retry Failed → REFINE with schema guidance
│
├── Confidence Score < 75%?
│ ├── YES + Missing Evidence → EXPAND with detail requirements
│ └── YES + Factual Uncertainty → RETRY with verification emphasis
│
├── Hallucination Risk > Medium?
│ ├── YES + Specific Claims → RETRY with claim removal
│ └── YES + Systemic Issues → REFINE with source restrictions
│
├── Explicit User Rejection?
│ ├── YES + Clear Fix Direction → REFINE with user guidance
│ └── YES + Vague Feedback → ESCALATE to human
│
└── Iteration Count >= Max-1?
├── YES + Improvement Trend → FINAL RETRY with all fixes
└── YES + No Improvement → ESCALATE with failure summary
| Remaining Iterations | Token Budget | Quality Gap | Action | |---------------------|--------------|-------------|---------| | ≥3 | >50% | High (>0.3) | ITERATE | | ≥3 | >50% | Medium (0.1-0.3) | REFINE | | ≥3 | >50% | Low (<0.1) | ACCEPT | | 1-2 | >25% | High | FINAL ATTEMPT | | 1-2 | >25% | Medium/Low | ACCEPT | | 0 | Any | Any | ESCALATE | | Any | <25% | Any | ESCALATE (budget) |
For each trigger:
IF trigger.type == 'validation_failure' AND error.code NOT IN ['TYPE_MISMATCH', 'SCHEMA_VIOLATION'] → fixable = true
IF trigger.type == 'low_confidence' AND source_material_available → fixable = true
IF trigger.type == 'hallucination_detected' AND specific_claims_identified → fixable = true
IF trigger.type == 'requirement_unmet' AND requirement.fixable == true → fixable = true
IF trigger.type == 'explicit_feedback' AND feedback_actionable → fixable = true
Overall Fixability = (fixable_triggers / total_triggers)
IF Overall_Fixability < 0.3 → recommend ESCALATE
Symptoms: Same triggers appearing across 3+ iterations with identical severity scores
Detection: if (current_triggers == previous_triggers && iteration_count > 2)
Fix: Force strategy escalation from retry→refine→expand→escalate. Add variation to context adjustments.
Symptoms: High token usage (>75% budget) with quality improvement <0.1 per iteration
Detection: if (token_usage > 0.75 * budget && avg_quality_gain < 0.1)
Fix: Immediately escalate with resource efficiency flag. Recommend task decomposition.
Symptoms: Quality scores fluctuating ±0.05 around same value across iterations
Detection: if (quality_variance < 0.02 && iteration_count >= 3)
Fix: Check for metric gaming. Switch to human evaluation. Flag potential model limitation.
Symptoms: Trigger count increasing each iteration instead of decreasing
Detection: if (current_trigger_count > previous_trigger_count * 1.2)
Fix: Halt iteration immediately. Analyze trigger interdependencies. Consider task scope reduction.
Symptoms: Using same strategy type after it failed twice consecutively
Detection: if (strategy.type == last_failed_strategy.type && failure_count >= 2)
Fix: Force strategy type rotation. Add strategy history constraint to selection logic.
Initial State: Code review output with 68% confidence, hallucination detector flags 2 "confirmed" false claims about API behavior Trigger Analysis:
Decision Process:
Action Taken: RETRY with modifications: remove specific false claims, add verification requirements, restrict to official documentation sources
Expert Insight: Novice would retry without addressing root cause (poor source verification). Expert recognizes hallucination pattern requires source restriction, not just error correction.
Initial State: Documentation output missing 3 required sections, iteration 4/5, 8K tokens remaining of 50K budget Trigger Analysis:
Decision Process:
Action Taken: ESCALATE with partial acceptance flag - recommend human completion of remaining 3 sections rather than risking budget overrun
Expert Insight: Novice would force final iteration despite budget. Expert recognizes cost-benefit trade-off and recommends efficient resource allocation.
Initial State: JSON output with consistent schema violations across 3 iterations, quality scores: [0.65, 0.67, 0.66] Trigger Analysis:
Decision Process:
Action Taken: ESCALATE with schema incompatibility flag - TYPE_MISMATCH errors indicate fundamental model limitation requiring schema adjustment or task redesign
Expert Insight: Novice would continue iterating on fixable errors. Expert recognizes unfixable schema conflicts indicate systemic issue requiring architectural change.
DO NOT use for:
dag-feedback-synthesizer insteaddag-convergence-monitor insteaddag-output-validator insteaddag-confidence-scorer insteaddag-quality-assessor insteadDelegate when:
dag-feedback-synthesizerdag-convergence-monitorescalate-to-humanresource-managertask-redesignerdata-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.