What problem does it solve?
Infinite loops can freeze systems, exhaust resources, and cause production outages when loop termination is unclear or progress is not guaranteed.
Core Features & Use Cases
- Detect Loop Risks: Identify missing termination conditions, stale loop variables, always-true conditions, and problematic nested loop behavior.
- Enforce Exit Strategies: Add counter-based, condition-based, timeout-based, state-based, and resource-based safeguards to guarantee termination.
- Add Runtime Monitoring: Implement loop health checks using iteration counts, duration thresholds, progress/stagnation detection, and alerting patterns.
Use case: When refactoring a long-running task (e.g., data ingestion, retry workflows, or polling APIs), apply loop detection and safety mechanisms to stop unbounded retries and surface clear failure modes instead of hanging indefinitely.
Quick Start
Use the loop-detection skill to review a proposed loop and rewrite it with a termination strategy, timeout/iteration limit, and progress monitoring.