coverage-analysis

coverage-analysis is a skill for Claude Code, Codex from ccashwell/evm-cortex. It costs 38 tokens per session (1,199 once invoked), scanned A, original, MIT.

A guide to measuring which parts of Solidity contracts are exercised by tests, known as test coverage.

In plain words
What is it for?
Use it to run coverage reports, inspect branch coverage, create LCOV files, and set coverage requirements for contracts.
Why use it?
It reveals untested lines, functions, and decision branches so important contract behavior is less likely to go unchecked.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ccashwell/evm-cortex/coverage-analysis
Any agent
npx skills add ccashwell/evm-cortex --skill coverage-analysis
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coverage-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccashwell/evm-cortex/coverage-analysis.svg)](https://agentmods.dev/skills/ccashwell/evm-cortex/coverage-analysis)
Your own site
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/coverage-analysis"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/coverage-analysis.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,199 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01199
Opus 5 $0.00019 $0.00600
Sonnet 5 $0.00008 $0.00240
Haiku 4.5 $0.00004 $0.00120

Measured 3d ago against content hash 9d8f96c60e27, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

coverage-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/coverage-analysis/SKILL.md · 169 lines

How it starts

The opening of the file, as written. The whole thing — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Coverage Analysis

Running Coverage

# Basic coverage report
forge coverage

# Output:
# | File               | % Lines         | % Statements    | % Branches      | % Functions     |
# |--------------------|-----------------|-----------------|-----------------|-----------------|
# | src/Vault.sol      | 92.31% (36/39)  | 89.47% (34/38)  | 75.00% (12/16)  | 100.00% (8/8)  |
# | src/Token.sol      | 100.00% (12/12) | 100.00% (10/10) | 100.00% (4/4)   | 100.00% (3/3)  |

LCOV Output for Visualization

# Generate lcov.info
forge coverage --report lcov

# View in VS Code with "Coverage Gutters" extension
# Or generate HTML report:
genhtml lcov.info -o coverage-report --branch-coverage
open coverage-report/index.html

Coverage Types

Type Meaning Priority
Line Was this line executed? Medium
Statement Was this statement executed? Medium
Branch Were both sides of if/else taken? High
Function Was this function called? Low

Branch coverage is the most important for security — untested branches are where bugs hide.

Filtering Coverage

# Exclude test files and scripts
forge coverage --report lcov

# Filter the lcov output
lcov --remove lcov.info 'test/*' 'script/*' 'node_modules/*' \
     --output-file lcov-filtered.info

Coverage-Driven Testing Workflow

1. Identify Gaps

# Generate and inspect coverage
forge coverage --report lcov
genhtml lcov.info -o coverage-report --branch-coverage

2. Focus on Uncovered Branches

For each uncovered branch, write a targeted test:

// If coverage shows this branch is untested:
//   if (amount > maxDeposit) revert ExceedsMax();

function test_depositExceedsMax() public {
    uint256 maxDeposit = vault.maxDeposit(address(this));
    vm.expectRevert(abi.encodeWithSelector(ExceedsMax.selector));
    vault.deposit(maxDeposit + 1, address(this));
}

3. Common Untested Paths

Read the full file on GitHub · 169 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 169 lines · 38 tokens per session scan A 9d8f96c60e27

Subscribe to this mod's changes

coverage-analysis is a skill published in the GitHub repository ccashwell/evm-cortex (127 stars, last pushed today), licensed MIT. It adds 38 tokens to every session and 1,199 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

web3-testing

Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.

wshobson/agents · 46 tokens

smart-contract-testing

Guide for testing smart contracts using Foundry and Hardhat, covering unit tests, fuzz testing, invariant testing, fork testing, and gas benchmarking.

nirholas/three.ws · 33 tokens

cairo-testing

Cairo smart-contract testing with snforge. Trigger on "write tests", "add unit tests", "fuzz test", "integration test", "test this contract", "regression test". Guides test strategy, cheatcode usage, and coverage.

keep-starknet-strange/starknet-agentic · 54 tokens

verification-protocol

How to prove a hypothesis is TRUE or FALSE using Move unit tests.

PlamenTSV/plamen · 18 tokens

foundry-solidity

Build and test Solidity smart contracts with Foundry toolkit. Use when developing Ethereum contracts, writing Forge tests, deploying with scripts, or debugging with Cast/Anvil. Triggers on Foundry commands (forge, cast, anvil), Solidity testing, smart contract development, or files like foundry.toml, .t.sol, .s.sol.

tenequm/skills · 75 tokens

blockchain-testing

Use this skill when asked about testing smart contracts, Foundry tests, Hardhat tests, fuzz testing, invariant testing, property-based testing, formal verification, audit preparation, integration testing for dApps, and blockchain testing patterns. Covers Foundry cheatcodes, Echidna fuzzing, Certora verification…

j4flmao/agent-skills · 117 tokens