lamina-invariants

Solid

Product invariants — rules that must always hold, impossible states prevented, errors defined out of existence. Use when defining what can never happen in the product.

AI & Automation 65 stars 2 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 84/100

Stars 20%
61
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Invariants Rules the product must never violate. Design so illegal states are unrepresentable — not merely error-handled after the fact. ## Verify Each `invariants[]` id gets a probe in `/lamina-verify` — attempt violation on live product; UI must prevent or recover per linked `scenarios[]`. **Invariants vs dependencies:** Invariants are predicates that must hold in valid states. Dependencies are reachability edges — what must exist before a workflow can succeed. Do not collapse them; use [Dependencies](../lamina-dependencies/SKILL.md) for cross-feature setup. ## Decision frameworks - **Invariant**: A predicate that must hold for every valid system state (one hall ticket per student per exam; venue capacity not exceeded; cancelled tickets cannot be downloaded). - When to use: Any entity with uniqueness, capacity, lifecycle, or permission constraints. - How: Write in user language in the transactional graph `domain`; link scenarios to violation attempts. - **Define errors out of existence**: Redesign flows so invalid actions are unavailable, not allowed-then-rejected (disable download when unpaid; hide regenerate when exam completed). - When to use: High-frequency violations that produce support load. - How: Match UI affordances to legal states only. - **Illegal transitions**: State machine edges that must never occur (confirmed → draft without admin audit; issued → unissued without void record). - When to use: Lifecycle entities (orders, tickets, bookings)...

Details

Author
aryaniyaps
Repository
aryaniyaps/lamina
Created
3 weeks ago
Last Updated
today
Language
TypeScript
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category