Agent skill

Formal Verification

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when applying formal verification to Solidity contracts using Certora CVL or Halmos symbolic testing.

MITAuto-check passedBackend & APIs

Install Formal Verification

skills CLI
$ npx skills add ccashwell/evm-cortex --skill formal-verification -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex formal-verification --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/formal-verification .claude/skills/formal-verification && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
formal-verification
GitHub stars
131
Token cost
~1.5k tokens
SKILL.md length
177 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when applying formal verification to Solidity contracts using Certora CVL or Halmos symbolic testing.

  • Applying formal verification to Solidity contracts using Certora CVL
  • SKILL.md covers Tools, Certora CVL Specification…, Rule Types and Ghost Variables and Hooks, plus 4 more sections
  • Calls pip
  • Halmos symbolic testing

What it does

Formal Verification is an agent skill from ccashwell/evm-cortex. Use when applying formal verification to Solidity contracts using Certora CVL or Halmos symbolic testing. Covers specification writing, rule types, ghost variables, hooks, and common verification patterns.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Smart contracts and Brand voice and tone. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Applying formal verification to Solidity contracts using Certora CVL
  • Halmos symbolic testing

Example prompts

  • “/formal-verification”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Formal Verification loads about 1.5k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 177 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 177 words, ~1,472 tokens.

Download SKILL.mdSave it as .claude/skills/formal-verification/SKILL.md (or your agent's skills folder).
name
formal-verification
description
Use when applying formal verification to Solidity contracts using Certora CVL or Halmos symbolic testing. Covers specification writing, rule types, ghost variables, hooks, and common verification patterns.

Formal Verification for Solidity

Tools

ToolApproachStrengths
Certora ProverCVL specs + SMT solvingIndustry standard, deep analysis
HalmosSymbolic Foundry testsFamiliar Foundry interface, open source
KEVMK Framework semanticsEVM bytecode level verification

Certora CVL Specification Template

cvl
// spec/Vault.spec

using ERC20 as token;

methods {
    function deposit(uint256) external returns (uint256);
    function withdraw(uint256, address, address) external returns (uint256);
    function totalAssets() external returns (uint256) envfree;
    function totalSupply() external returns (uint256) envfree;
    function balanceOf(address) external returns (uint256) envfree;
    function asset() external returns (address) envfree;

    // Summarize external calls
    function _.transfer(address, uint256) external => DISPATCHER(true);
    function _.transferFrom(address, address, uint256) external => DISPATCHER(true);
    function _.balanceOf(address) external => DISPATCHER(true);
}

Rule Types

Parametric Rules

Verify properties for all possible inputs:

cvl
// Depositing should increase total supply
rule depositIncreasesSupply(uint256 assets) {
    env e;
    uint256 supplyBefore = totalSupply();

    deposit(e, assets);

    uint256 supplyAfter = totalSupply();
    assert supplyAfter >= supplyBefore, "supply must not decrease on deposit";
}
Invariant Rules

Properties that must hold in every reachable state:

cvl
// Solvency: vault always has enough assets to back shares
invariant solvency()
    totalSupply() == 0 || totalAssets() > 0
    {
        preserved deposit(uint256 assets) with (env e) {
            require assets > 0;
        }
    }
Relational Rules

Compare two executions:

cvl
// Monotonicity: depositing more gives more shares
rule depositMonotonicity(uint256 assets1, uint256 assets2) {
    env e;
    require assets1 < assets2;

    storage init = lastStorage;

    uint256 shares1 = deposit(e, assets1);

    uint256 shares2 = deposit(e, assets2) at init;

    assert shares2 >= shares1, "more assets should give more shares";
}

Ghost Variables and Hooks

Track state that isn't directly accessible:

cvl
ghost mathint sumOfBalances {
    init_state axiom sumOfBalances == 0;
}

hook Sstore balanceOf[KEY address user] uint256 newBalance (uint256 oldBalance) {
    sumOfBalances = sumOfBalances + newBalance - oldBalance;
}

invariant totalSupplyIsSumOfBalances()
    to_mathint(totalSupply()) == sumOfBalances;

Halmos Symbolic Testing

Halmos runs Foundry tests symbolically — inputs are symbolic values, not concrete:

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vault} from "../src/Vault.sol";
import {SymTest} from "halmos-cheatcodes/SymTest.sol";

contract VaultSymbolicTest is Test, SymTest {
    Vault vault;

    function setUp() public {
        vault = new Vault(address(token));
    }

    /// @notice Verify deposit then withdraw returns at least original amount
    function check_depositWithdrawRoundTrip(uint256 assets) public {
        vm.assume(assets > 0 && assets < type(uint128).max);

        deal(address(token), address(this), assets);
        token.approve(address(vault), assets);

        uint256 shares = vault.deposit(assets, address(this));
        uint256 received = vault.redeem(shares, address(this), address(this));

        // Due to rounding, received should be <= assets
        assert(received <= assets);
    }

    /// @notice No share inflation from direct transfer
    function check_noShareInflation(uint256 donation) public {
        vm.assume(donation > 0 && donation < type(uint128).max);

        uint256 sharesBefore = vault.totalSupply();

        // Direct transfer (donation attack)
        deal(address(token), address(vault), donation);

        uint256 sharesAfter = vault.totalSupply();
        assert(sharesAfter == sharesBefore);
    }
}

Run with: halmos --contract VaultSymbolicTest

Common Verification Properties

ERC20 Properties
cvl
rule transferIntegrity(address to, uint256 amount) {
    env e;
    address from = e.msg.sender;
    uint256 fromBefore = balanceOf(from);
    uint256 toBefore = balanceOf(to);

    transfer(e, to, amount);

    assert balanceOf(from) == fromBefore - amount;
    assert balanceOf(to) == toBefore + amount;
}
Access Control
cvl
rule onlyOwnerCanPause() {
    env e;
    require e.msg.sender != owner();

    pause@withrevert(e);

    assert lastReverted, "non-owner should not be able to pause";
}
No Ether Leak
cvl
invariant noEtherLeak()
    nativeBalances[currentContract] == 0;

Running Certora

bash
# Install
pip install certora-cli

# Run verification
certoraRun src/Vault.sol \
    --verify Vault:spec/Vault.spec \
    --solc solc8.20 \
    --optimistic_loop \
    --loop_iter 3 \
    --msg "Vault verification"

Checklist

  • Identify critical invariants before writing specs
  • Use envfree for view/pure functions (no environment needed)
  • Summarize external calls with DISPATCHER or NONDET
  • Ghost variables + hooks track aggregate state (sum of balances, etc.)
  • Test specs against known-buggy versions to verify they catch issues
  • Use preserved blocks in invariants to add preconditions
  • Halmos tests prefixed with check_ (not test_)
  • Run with --optimistic_loop and appropriate --loop_iter
  • Review counterexamples in Certora's web UI for false positives

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/formal-verification of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Formal Verification next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Formal Verification compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Formal Verification this skillccashwell/evm-cortex131—~1.5kAutomated safety check: PassMIT
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT
Feynman Auditor0xiehnnkta/nemesis-auditor2431 repos~11kAutomated safety check: PassMIT
Smart Contract Auditgreatpie/smart-contract-audit-skill101—~1.1kAutomated safety check: PassNone
RadarAuditware/radar154—~2.1kAutomated safety check: PassGPL-3.0
Solidity AuditorGabson0x/bountyforge443—~3.7kAutomated safety check: PassNone

Similar skills

  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    243 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed
  • Smart Contract Audit

    greatpie/smart-contract-audit-skill

    Script-backed, out-of-box auditing workflow for Solidity/EVM repositories based on EVMbench detect/patch/exploit methodology.

    101 GitHub stars~1.1k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Radar

    Auditware/radar

    Use radar for smart contract security analysis, AST generation, and detection template development.

    154 GitHub stars~2.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    Gabson0x/bountyforge

    Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.

    443 GitHub stars~3.7k tokensUpdated 21 days ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    pashov/skills

    Security audit of Solidity code while you develop. An agent skill from pashov/skills.

    1.2k GitHub starsUsed in 1 repo~9.9k tokens
    Backend & APIsAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 8 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 8 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed

Works with

Categories

Questions about Formal Verification

What does Formal Verification do?

A skill your agent uses when applying formal verification to Solidity contracts using Certora CVL or Halmos symbolic testing. Formal Verification is an agent skill from ccashwell/evm-cortex. Use when applying formal verification to Solidity contracts using Certora CVL or Halmos symbolic testing.

When should I use Formal Verification?

Formal Verification fits situations like: applying formal verification to Solidity contracts using Certora CVL; halmos symbolic testing.

How do I install Formal Verification in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill formal-verification -a claude-code`. Or copy the skill folder (skills/formal-verification in ccashwell/evm-cortex) into .claude/skills/formal-verification in your project. Claude Code loads it when a task matches its description.

How do I install Formal Verification in Codex?

Run `npx skills add ccashwell/evm-cortex --skill formal-verification -a codex`. Or copy the skill folder (skills/formal-verification in ccashwell/evm-cortex) into .agents/skills/formal-verification in your project. Codex loads it when a task matches its description.

Can I use Formal Verification in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill formal-verification -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/formal-verification, .gemini/skills/formal-verification, .github/skills/formal-verification and .opencode/skills/formal-verification in your project.

What does Formal Verification need to run?

Going by SKILL.md and its folder, Formal Verification needs the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Formal Verification access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Formal Verification safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Formal Verification use?

Formal Verification is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Formal Verification use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Formal Verification?

Skills that share tags, products or a category with Formal Verification: Fizz Convert (pashov/skills, 1.2k stars), Feynman Auditor (0xiehnnkta/nemesis-auditor, 243 stars), Smart Contract Audit (greatpie/smart-contract-audit-skill, 101 stars) and Radar (Auditware/radar, 154 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Formal Verification?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.