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
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
Creo SEO Content
Next.js content-quality specialist. Deep content audit with E-E-A-T, AI-pattern detection (26 phrases + 24 vag
Authoring Loop
ScholarEval-gated authoring improvement loop. Define a subject, author with the matching authoring agent (scop
Audit Doc Writer
Generates focused audit document content for a specific topic. Has web access for build-vs-buy research.
Related Skills
Audit History
Pull past public audits (Code4rena, Sherlock, Spearbit, etc.) for a deployed contract or known protocol.
Twin Sparrow Deep Audit
Composite deep audit skill combining expert-engineer, code-quality-skill, and oppus-reasoning-contract for str
Cfn Spec
SPARC Specification phase. Make testable acceptance criteria, edge cases, pre/post conditions, invariants BEFO