mora

Identify waits by mechanism and guide refactors to event-driven patterns.

Updated May 20, 2026
One-click install
npx skills add https://github.com/watmin/datamancy.dev --skill mora
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mora
Source: https://github.com/watmin/datamancy.dev/tree/main/mora
Command: npx skills add https://github.com/watmin/datamancy.dev --skill mora

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mora enforces time discipline by ensuring waits are driven by genuine events rather than fixed sleeps, reducing flaky behavior and improving determinism.

Core Features & Use Cases

  • Detects sleeps, timeouts, and busy-waits in code and tests and flags them as potential design flaws.
  • Guides refactors to swap waits-by-mechanism for event-driven patterns (fd-events, channels, timer-driven triggers).
  • Use case: when tests sleep to wait for readiness, Mora suggests awaiting a server-ready marker or channel notification to drive deterministic flows.

Quick Start

Refactor a sample wait to be driven by an event source instead of a fixed sleep.

Frequently Asked Questions about mora

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

FAQPage Schema
How do I replace fixed sleeps with event-driven waits in tests?

Mora identifies sleeps, timeouts, and busy-waits as potential design flaws, quantifying them by mechanism and suggesting refactors to event-driven patterns using real sources like fd-events or channels.

Why does sleep-based waiting cause flaky tests?

Sleep-based waiting causes flaky tests because fixed durations do not correlate with genuine system readiness. Treating time as I/O and waiting for real event sources eliminates racing paths and improves deterministic test execution.

What is the best way to detect timeout-based waits and busy-waits in code?

The best way to detect timeout-based waits and busy-waits is to scan code and tests to identify and quantify all waits by mechanism, classifying findings into specific levels to guide concrete refactoring steps.

Does this approach work for non-blocking event-driven architectures?

Yes, this approach applies to non-blocking event-driven architectures by transforming fixed sleeps into timer-driven triggers or fd-events, ensuring deterministic flows without blocking the execution thread.

When should I not use sleeps for waiting in software engineering?

You should not use sleeps when waiting for state readiness, as they introduce non-determinism and flaky behavior; instead, await channel notifications or server-ready markers to drive deterministic flows.