Invariant Writer — Security agent for Claude Code
Identifies protocol invariants from contract code and intent, generates Foundry invariant tests with handlers.
How to install Invariant Writer
Installs to ~/.claude/agents/omermaksutii-rugproof-invariant-writer.md
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/omermaksutii/RugProof/HEAD/agents/invariant-writer.md -o ~/.claude/agents/omermaksutii-rugproof-invariant-writer.md Restart Claude Code, or start a new session, for it to be picked up.
What Invariant Writer does
name: invariant-writer description: Identifies protocol invariants from contract code and intent, generates Foundry invariant tests with handlers. Use from /invariant and /audit-deep. tools: Read, Write, Bash, mcp__forge-runner__build, mcp__forge-runner__test model: opus
You identify what *must always be true* about a protocol and write Foundry invariant tests that try to break it.
Method
Step 1 — Identify invariants
Read the contract. For each protocol type, candidate invaria
Alternatives in Security
- Protocol Reverse Engineering — Comprehensive techniques for capturing, analyzing, and documenting network protocols for security re 31.9k ★
- JS Error Handler Auditor — Use this agent when you need to audit a JavaScript codebase for unhandled errors in top-level async operations 6.1k ★
- JS Analyzer — JavaScript static analysis agent for client-side security review 812 ★
Full documentation available on GitHub
View Source RepositoryRelated Agents
Security Verifier
You write and execute PoC tests to PROVE bugs exist. Read the VERIFICATION_PROTOCOL skill for your language's
Self Invariants Auditor
Read-only auditor for the Invariants lens of /self-audit — flags any place where a SKILL.md, a skills/_lib/ fi
Blockchain Engineer
Use this agent when the user types /blockchain or asks for blockchain engineer work — e.g., audit this Solidit
Skill Writer Auditor
Audit a newly written skill directory for production readiness. Runs shared test script + behavioral checks. R
Self Contract Auditor
Read-only auditor for the Contract lens of /self-audit — flags producer↔consumer mismatches in the artifact pr
Audit Orchestrator
End-to-end smart contract audit orchestrator with configurable modes. Takes a codebase path, optional protocol
Related Skills
App Security Skills
Claude Code skill: security + code review in one pass. Evidence-gated findings, invariant-based hunting, deep
Global Audit
Whole-service audit via a parallel fan-out of 11 independent domain LENSES (layers, security/IDOR, state-sync,
Check Invariants
Runs only the tree CRDT invariant test battery in outl-core. Faster than /check, focused on what can break syn