What problem does it solve?
This Skill systematically verifies that critical domain invariants (properties that must always hold true) are correctly enforced in code and adequately covered by tests, preventing subtle bugs and ensuring business logic integrity.
Core Features & Use Cases
- Invariant Identification: Discovers and inventories all domain invariants within the codebase.
- Code Enforcement Verification: Checks if invariants are properly implemented in the code across all relevant paths.
- Test Coverage Assessment: Evaluates the extent to which invariants are covered by existing tests.
- Missing Invariant Detection: Identifies invariants that should exist but are not present in the code.
- Use Case: For a financial application, this skill would ensure that account balances never go below zero (unless overdraft is enabled), transfer amounts are always positive, and state transitions for accounts and cards adhere to defined lifecycles.
Quick Start
Use the domain invariant assertion skill to check invariants in the models and service directories.