Skip to content
Security
Command

/coverage

Run forge coverage, identify untested branches, generate tests to close gaps.

From plugin
rugproof
945 skills23 agents45 commands4 hooks
Install
> /plugin marketplace add omermaksutii/RugProof
> /plugin install rugproof@rugproof

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/coverage

Context preview

What this command does when you run it.

Run forge coverage, identify untested branches, generate tests to close gaps.

Command definition

coverage.md
description: Run forge coverage, identify untested branches, generate tests to close gaps.
allowed-tools: Read, Write, Bash, Agent, mcp__forge-runner__*

/coverage — close test coverage gaps

Procedure

Step 1 — Run coverage

mcp__forge-runner__coverage(format=json)

Returns per-file branch / line / function coverage.

Step 2 — Identify gaps

For each file under `src/`:

  • Lines covered < 90%? Identify which lines.
  • Branches covered < 80%? Identify which branches.

Step 3 — Generate targeted tests

For each gap, generate a test that exercises the uncovered path. Lean on `/test-gen` infrastructure.

Common gap patterns:

  • Revert branches (`require` failure paths) — write a test that triggers the revert.
  • Conditional logic (`if (x > 10)`) — test both arms.
  • Loop edge cases (empty array, single element, max bound).

Step 4 — Re-run coverage

Verify the new tests close the gaps. Iterate.

Step 5 — Output

Coverage:
  Before:  src/Vault.sol      lines 78% / branches 71%
           src/Oracle.sol     lines 92% / branches 84%
  After:   src/Vault.sol      lines 96% / branches 88%   ✓
           src/Oracle.sol     lines 98% / branches 91%   ✓

Generated:
  test/generated/coverage/VaultGaps.t.sol     (12 tests)
  test/generated/coverage/OracleGaps.t.sol    (4 tests)

Notes

  • 100% line coverage is achievable. 100% branch coverage is harder; aim for 90%.
  • Some lines are intentionally untested (e.g. unreachable revert in storage-init). Allow `// rugproof-skip-coverage` inline.
  • Coverage is a *minimum*, not a measure of correctness. High coverage + no invariants is misleading.
Read more
Ships withrugproof

Rugproof your code before someone else does. 🌐 Live site: omermaksutii.github.io/RugProof 📦 Latest: v1.0.0 — 45 commands · 23 agents · 45 skills · 13 MCP servers · tested, offline-first, with rule packs, a benchmark, non-EVM coverage, and post-deploy

Get the whole plugin

Other commands on rugproof.