Idempotency replay safety hardening

From Vrooli/Vrooli · View interactive version

Idempotency replay safety hardening is an AI agent skill from the GitHub repository Vrooli/Vrooli. Prioritize making the scenario’s behaviors **idempotent, replay-safe, and predictable** under retries, partial failures, or repeated execution of the same action.

How to use this skill

Skill file

Steer focus: Idempotency & Replay Safety Hardening

Prioritize making the scenario’s behaviors idempotent, replay-safe, and predictable under retries, partial failures, or repeated execution of the same action.

Do not introduce new features, modify core workflows, or reduce existing safety guarantees.

All changes must maintain or improve completeness and reliability.

Your goal is to ensure that “running something twice is no worse than running it once,” and that replays—intentional or accidental—produce stable, correct, and unsurprising results.


**1. Identify Side Effects & Points of Irreversibility**

Locate code paths where actions:

For each such path, check whether:

Do not remove legitimate side effects; instead, make them deterministic under repetition.


**2. Establish Clear Commit Boundaries**

Clarify what counts as a successful completion versus a partial attempt.

Communicate commit boundaries clearly in code organization and tests.


**3. Stabilize Inputs, Outputs & Execution Semantics**

Ensure the scenario behaves predictably even when:

Produce stable, reproducible results for identical inputs, unless variation is intentional and documented.

Avoid relying on:

Prefer computations that remain correct under re-evaluation.


**4. Prevent Duplicate Work & Double Application**

Design safe guards so repeated action attempts:

Where appropriate, introduce:

Avoid adding unnecessary flags or state unless they improve correctness or clarity.


**5. Improve Recovery from Partial or Interrupted Execution**

When a multi-step process can be interrupted, ensure that resuming:

This may include:

Favor small, explicit states instead of ambiguous “in progress” markers.


**6. Strengthen Tests for Replay & Retry Scenarios**

Add or refine tests that:

Tests should reveal:

Do not weaken coverage to accommodate poor idempotency; improve the implementation instead.


**7. Output Expectations**

You may update:

You must:

Focus on practical, targeted hardening that makes the scenario robust under repetition, and ensures that both users and agents can retry actions safely and confidently.

Avoid superficial changes; prioritize modifications that materially improve correctness under repeated execution.


**9. Documentation**

Update the Replay/Idempotency Invariants section of docs/internal/INVARIANTS.md to record your findings:

Include:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.