Domain Invariant Assertion

Analyze Go source and test files to verify domain invariants.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/cdalsoniii/brightpath-coder --skill domain-invariant-assertion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Domain Invariant Assertion
Source: https://github.com/cdalsoniii/brightpath-coder/tree/main/.cursor/skills/domain-invariant-assertion
Command: npx skills add https://github.com/cdalsoniii/brightpath-coder --skill domain-invariant-assertion

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about Domain Invariant Assertion

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

FAQPage Schema
How do I verify domain invariants are enforced across all code paths in Go?

Verify domain invariants by analyzing Go source and test files to identify properties like non-negative balances and state transitions, checking their enforcement status, and reporting missing invariants or inadequate test coverage.

What are domain invariants in software engineering and when do they need test coverage?

Domain invariants are properties that must always hold true, such as zero-sum transfers. They need test coverage to prevent subtle bugs and ensure business logic integrity across all code paths.

How do I check my codebase for missing invariants and state machine transition errors?

Check for missing invariants by analyzing source and test files to inventory existing properties, validate state machine transitions, and identify critical business logic rules that should exist but are absent.

Does this invariant verification tool work with financial application logic like account balances?

Yes, invariant verification works with financial application logic by checking that account balances never go below zero, transfer amounts are positive, and account state transitions adhere to defined lifecycles.

What is the best way to audit test coverage for critical business logic properties?

The best way to audit test coverage is to systematically evaluate source and test files to assess the extent to which critical domain invariants are covered, reporting on enforcement status and missing tests.

How do I start using domain invariant assertion on my models and service directories?

Start using domain invariant assertion by running it against your models and service directories to automatically discover, inventory, and validate invariants across the analyzed Go source files.