You use AI to write code. Reading every line defeats the purpose.
Invar provides mechanical verification so you can trust AI output without manual review.
Invar handles mechanical correctness. You focus on business logic.
• Contracts exist (boundaries were considered)
• Contracts aren't empty placeholders
• Doctests pass (behavior is proven)
• Pure logic has no I/O calls
• Code size limits respected
• Whether contracts match business requirements
• Whether edge cases are covered
• Whether the architecture is correct
• Whether to ship
Zero decisions — default runs full verification
Principles that make AI code verifiable
Pure logic (Core) and I/O (Shell) must be physically separate
Define COMPLETE boundaries that uniquely determine implementation
Read map → signatures → implementation (only if needed)
Break complex tasks into sub-functions before implementing
If fail: Reflect (why?) → Fix → Verify again
Verify all feature paths connect; local correctness ≠ global correctness
AI follows this workflow for every task — depth varies naturally
| Understand | Core function (pure logic), check existing patterns with invar sig |
| Specify | @pre: price > 0, discount ∈ [0,1]. @post: result ≥ 0. Decompose if needed. |
| Build | Write code with contracts and doctests |
| Validate | invar guard — Smart Guard runs static + doctests. Iterate if needed. |
First-class tools for AI agents
invar init creates .mcp.json automatically
Every law is grounded in research
uvx invar-tools init --claude
AI follows USBV workflow
uvx invar-tools guard
No install required! uvx runs tools in isolated environment.
Workflow skills (/develop, /review) require Claude Code's sub-agent capabilities
Check-In shows context. Guard runs in VALIDATE phase and Final.