fixed-delay-audit

Identify fixed-delay wait patterns and assess exit conditions in source code.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/brian-wijaya/dotfiles --skill fixed-delay-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixed-delay-audit
Source: https://github.com/brian-wijaya/dotfiles/tree/main/.claude/skills/fixed-delay-audit
Command: npx skills add https://github.com/brian-wijaya/dotfiles --skill fixed-delay-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audit code for fixed-delay anti-patterns where sleeps, delays, or time-based waits lack exit conditions.

Core Features & Use Cases

  • Identify fixed-delay patterns across languages (sleep, delay, time.sleep, setTimeout, Task.Delay, etc.) and categorize the wait condition.
  • Propose condition-based polling, event-driven waits, callbacks, or synchronization primitives to replace time-based waits.
  • Use Case: When a function waits for a resource or state change with a fixed timeout, provide actionable refactor suggestions (and locations).

Quick Start

Run the fixed-delay-audit on the target codebase to locate fixed-delay waits and suggest condition-based or event-driven replacements.

Frequently Asked Questions about fixed-delay-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find fixed-delay anti-patterns like sleep and setTimeout in my codebase?

To find fixed-delay anti-patterns, audit your source code for sleep, setTimeout, time.sleep, or Task.Delay constructs. The audit identifies locations where time-based waits lack exit conditions and suggests event-driven replacements.

What is a fixed-delay anti-pattern and when does it lack an exit condition?

A fixed-delay anti-pattern occurs when sleeps, delays, or time-based waits lack exit conditions. This happens when code pauses execution for a set duration instead of waiting for a specific resource state change or event trigger.

How do I replace time.sleep or setTimeout with event-driven waits?

To replace time.sleep or setTimeout, implement condition-based polling, event-driven waits, callbacks, or synchronization primitives. An audit reports each occurrence with actionable refactor suggestions for adopting these event-driven alternatives.

Does this fixed-delay audit work with multiple programming languages?

Yes, the fixed-delay audit works across multiple languages. It identifies time-based wait constructs such as sleep, delay, time.sleep, setTimeout, and Task.Delay found throughout your codebase regardless of the specific language.

What is the best way to refactor a fixed timeout waiting for a resource state change?

The best way to refactor a fixed timeout waiting for a resource is to replace it with condition-based polling or event-driven waits. This ensures the code reacts immediately when the state changes rather than waiting an arbitrary duration.

When should I not use a fixed delay or sleep in my code?

You should not use a fixed delay or sleep when waiting for a resource or state change. Without an exit condition, time-based waits cause unnecessary latency or failure; use synchronization primitives or event-driven callbacks instead.