- Home
- Skills
- Testing & Debugging
- TestForge
TestForge
by 0xndrean7
Untested code is where bugs hide — find the gaps, write real tests, run them until green.
Free
TestForge
Example session with this skill installed
Run a gap analysis on the current Solidity contract in src/Vault.sol and write a Foundry fuzz test for the withdraw function.
- Read your context and instructions
- Compiled the testforge
I have analyzed the coverage for src/Vault.sol and identified a gap in the withdraw function's handling of zero-balance accounts and rounding increments.
Test Coverage & Fuzz Implementation
| File | Function | Gap Type | Risk Level |
|---|---|---|---|
| Vault.sol | withdraw | Zero-amount branch | High |
| Vault.sol | withdraw | Successive calls | Medium |
| Vault.sol | deposit | Integer overflow | Low |
// test/Vault.t.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "forge-std/Test.sol";
import "../src/Vault.sol";
contract VaultTest is Test {
Vault public vault;
address public user = address(0x1);
function setUp() public {
vault = new Vault();
vm.deal(user, 100 ether);
}
/// @dev Fuzz test for withdrawal integrity
function testFuzz_Withdraw(uint256 amount) public {
// Bound amount to available user balance
amount = bound(amount, 1, 100 ether);
vm.startPrank(user);
vault.deposit{value: amount}();
uint256 preBalance = user.balance;
vault.withdraw(amount);
uint256 postBalance = user.balance;
assertEq(postBalance - preBalance, amount, "Withdrawal amount mismatch");
assertEq(vault.balanceOf(user), 0, "Vault balance should be zero");
vm.stopPrank();
}
}
Next steps
- Run
forge test --match-test testFuzz_Withdrawto verify the implementation. - Review the
Still Untestedsection in the generatedgap-report.md. - Apply the access control check test for the
emergencyShutdownfunction.
Connects securely to your tools. The creator never sees your data.
About this skill
Every codebase has code nobody tested: the error branch nobody took, the withdraw path nobody called twice, the rounding edge nobody hit. That is where bugs live — and a test suite that only covers the happy path is a blanket with holes in it. Give TestForge a codebase and it finds the holes. It measures coverage, lists every untested function and branch with file and line, ordered by risk — money-moving code first — then writes a real test for each gap. A real test asserts observable behavior with numbers: balances moved, state changed, the call reverted for the exact reason. A test that cannot fail is not a test, and this skill never writes one. Then it runs the suite, reads the failures, and decides: is the test wrong, or is the code wrong? It fixes the right one and repeats until everything is green. What is still untested at the end is written down in a gap report, so nobody has to guess. Two stacks. Solidity goes through Foundry: unit tests, fuzz tests, and stateful invariant tests that hammer a contract with random sequences of calls — with the hard-won lessons built in (pin the fuzz target, check a view before summing it, fund the paying contract, assert against the contract's own ledger). JavaScript and TypeScript go through the Node test runner with zero dependencies — no framework to install, no config to fight. Built from real testing practice, measured on real work: a 120-test suite running 120/120, a chess engine verified with perft 6/6, an agent codebase kept at 9/9 tests passing. The same discipline is in this skill: assert numbers, run the suite, and do not call a test done until it is green for the right reason. What it does not do: it never claims full coverage it did not measure, and it never promises a codebase is bug-free. Tests prove the cases they cover — the gap report says the rest plainly.
Requires Foundry for Solidity or Node.js 18+. JS gap scanning checks export usage rather than line-by-line runtime trace. No network access by default.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 15 days ago
- Free with an Agensi account
- Accounts
GitHub
- Software
Node.js
Git
Permissions
Allowed Hosts
What's inside
Frequently Asked Questions
New in Testing & Debugging
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.