# TestForge

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

TestForge is a free AI agent skill on Agensi by 0xndrean7, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [0xndrean7](https://www.agensi.io/creators/0xndrean7)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Version: 1.0
- Last updated: 2026-11-20
- Security: scan passed (2026-11-20); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/testforge
- Tags: testing, foundry, solidity, javascript, coverage, invariant, test-gap, unit-test

## 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

- Node.js
- Git

## Known limitations

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 this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the TestForge skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does testforge differ from standard AI-generated unit tests?

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.

### What technical dependencies are required to use this skill?

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.

### Which testing frameworks and languages are supported?

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.

### What is the typical workflow when I run testforge on a new codebase?

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.

### What is included with my purchase of the testforge skill?

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.

### Are there any limitations to the coverage mapping for JavaScript projects?

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.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
