TestForge

    by 0xndrean7

    1

    Untested code is where bugs hide — find the gaps, write real tests, run them until green.

    Free

    Security scanned

    Works with the AI Agents you already use

    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

    FileFunctionGap TypeRisk Level
    Vault.solwithdrawZero-amount branchHigh
    Vault.solwithdrawSuccessive callsMedium
    Vault.soldepositInteger overflowLow
    // 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

    1. Run forge test --match-test testFuzz_Withdraw to verify the implementation.
    2. Review the Still Untested section in the generated gap-report.md.
    3. Apply the access control check test for the emergencyShutdown function.

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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.jsGit

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files

    Allowed Hosts

    raw.githubusercontent.com
    Listed15 days ago

    What's inside

    Frequently Asked Questions

    testforge is designed to identify specific untested code branches and functions, generating high-assertion Foundry or Node.js tests that target edge cases, access control, and state changes rather than just 'happy path' scenarios.

    For smart contract development, the skill requires a Foundry environment; for JavaScript or TypeScript projects, it utilizes the native node:test runner and requires Node.js version 18 or higher.

    The skill specializes in Foundry for Solidity (including unit, fuzz, and invariant testing) and uses native Node.js modules for JS/TS to ensure zero-dependency, high-speed test execution.

    The skill performs a gap analysis to prioritize 'money-moving' code and access controls, writes the test files based on rigorous state-change templates, and iterates until the tests pass and the coverage gaps are closed.

    A coverage-gap map: every untested function and branch, with file and line, ordered by risk. Real tests written for the gaps — Foundry unit, fuzz, and invariant tests for Solidity; Node test-runner tests for JavaScript/TypeScript. A run-until-green loop: failures read and fixed on the right side (test or code), with regression tests kept for real bugs found. A gap report: what was covered, what tests were added, what is still untested and why — with the final suite result. A worked sample vault (7/7 Foundry tests passing, real coverage numbers) and a sample JS ledger (6/6 Node tests passing) to learn from and copy.

    While it provides a structural scan for JS/TS exports, full runtime trace coverage for JavaScript is currently limited unless external tracing tools are integrated into your environment.

    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.

    Free