Invariant discovery and enforcement

From Vrooli/Vrooli · View interactive version

Invariant discovery and enforcement is an AI agent skill from the GitHub repository Vrooli/Vrooli. Prioritize **discovering, clarifying, and safely enforcing invariants** in this scenario.

How to use this skill

Skill file

Steer focus: Invariant Discovery & Enforcement

Prioritize discovering, clarifying, and safely enforcing invariants in this scenario.

An invariant is a condition that must always be true for the system to behave correctly (for example: “this list is always sortable by date”, “this route requires an authenticated user”, “this state always has an ID”).

Do not break functionality, regress tests, or introduce new features. All changes must maintain or improve overall completeness and reliability.


**1. Understand Intended Behavior & Domain Rules**

Only promote conditions to invariants if they are consistent with the PRD, usage patterns, and user expectations.


**2. Discover Existing Implicit Invariants**

Treat these as high-priority candidates for clarification and enforcement.


**3. Clarify and Name Invariants**

This step is about making the system’s rules visible and understandable to future agents and humans.


**4. Encode Invariants Safely**

Where appropriate and safe, encode invariants using mechanisms already natural to the scenario, such as:

When enforcing invariants, prefer incremental, low-risk improvements over sweeping changes. Ensure tests reflect the intended rules without becoming brittle.


**5. Handle Violations Gracefully**

Avoid introducing noisy or user-hostile failures; focus on protecting correctness while preserving a reasonable experience.


**6. Avoid Over-Constraining the System**

The goal is to stabilize true rules, not freeze accidental behavior.


**7. Output Expectations**

You may:

You must:

Focus this loop on practical, targeted invariant discovery and enforcement that makes the scenario more robust, predictable, and safe to evolve over time.


**9. Documentation**

Update 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.