Created by Mohammed Nasher · Open source (MIT) · Free for anyone to use
Anvil is a self-contained testing engine for AI coding assistants. You point it at code and it decides what to test, writes the test at the right level, runs it and shows the actual output, proves the critical paths are covered, and keeps the suite green and fast — turning "it works on my machine" into proven, repeatable evidence.
An anvil is where raw metal becomes a proven tool under repeated, deliberate blows. Anvil is the same for code: it takes "I think it works" and hammers it into tests that prove it works, again and again, on every change.
Anvil is one of eight siblings in the Forge suite — Helm (the product loop), Loom (feature definition), Facet (the interface), Cairn (architecture), Anvil (testing), Lens (code quality), Bastion (security), Relay (ship & operate). They share one philosophy and a strict boundary contract, so they compose without colliding. Anvil owns testing; it defers structure to Cairn, quality to Lens, security severity to Bastion, and deploy gates to Relay.
Who built this? Anvil is designed and authored by Mohammed Nasher (@mhd-nasher). Released open source under MIT — use it, fork it, ship with it. If it helps you, a ⭐ and a mention go a long way.
Most testing advice fails in one of two ways: it misses the test that matters (the untested money path, the bug with no regression test), or it buries you in tests that don't pay (an e2e for a pure function, a unit test for a trivial getter, 200 assertion-free tests chasing 100%). Anvil refuses both:
- Right level, every time. The Right-Level Law: match each behavior to the cheapest level that proves it — pure logic → unit, seams → integration, journeys → e2e, trivial glue → often no test at all. It won't e2e your pure logic and it won't unit-test your wiring. A test must name the behavior it protects.
- Evidence before "done". It never says "tested" or "passing" without showing the actual test output, and never says "covered" without showing the critical path is exercised. Assertions without output are forbidden.
- Honest that green ≠ correct. A passing suite proves the behavior under test, never "this is correct" or "this is safe." Anvil says so plainly, and chases meaningful coverage of the paths that matter — not a vanity percentage gamed with junk tests.
- It's stack-aware. It detects your real technology and picks the right tools — the Firebase emulator instead of hand-mocking Firestore, Stripe test mode with signed webhook events, Flutter widget/golden tests, Next.js + Playwright — and suppresses what doesn't fit. Firebase / serverless is the flagship profile.
- It's an advisor on the dangerous stuff. A regression test for money, auth, access, or crypto code is proposed and explained — the human approves the behavior it locks in, because a test that enshrines wrong behavior is worse than no test.
- It's verifiable. Anvil ships with evals that prove it activates correctly, writes the tests that matter, and does not over-test, over-mock, or chase vanity coverage.
| Mode | For | Workflow |
|---|---|---|
| Mode 0 — Guided Testing (Beginner) | "I don't know how to test this." | plain-language walkthrough with progress gauges |
| Mode A — Test a New Feature | Designing the test strategy for new code. | decide level → write → run → prove |
| Mode B — Add Tests to Untested Code | A legacy/untested area needs a safety net. | characterize → pin behavior → grow coverage where it pays |
| Mode C — Fix a Flaky/Failing Suite | Tests are red, slow, or non-deterministic. | quarantine → find the source of non-determinism → fix |
- Decide what to test and at which level.
- Write the test — behavior not implementation, the lightest double that works.
- Run it and show the actual output — RED first for a new behavior or a bug.
- Prove coverage of the critical paths, not a vanity percentage.
- Keep it green and fast — quarantine and fix flakes, never silently skip.
Personal skill (recommended):
# Claude Code
cp -R anvil ~/.claude/skills/Then start a new session. Anvil auto-activates when you discuss writing tests, deciding what to test, adding coverage, fixing flaky suites, judging coverage, or doing TDD.
Project skill:
mkdir -p .claude/skills && cp -R anvil .claude/skills/Beginner — "I don't know how to test this":
"I wrote a function that splits a payment into commission and payout. I have no tests. Where do I start?"
Anvil runs Step 0 (detects the stack, sees the money path), then the guided mode: a plain-language walkthrough with progress gauges, choosing the right level, writing behavior tests, and showing the run output.
Targeted — write the right tests:
"Test my Stripe webhook handler — should I mock the Stripe SDK?"
Anvil contract-tests the boundary with a signed test-mode event, wraps Stripe behind a port instead of mocking the SDK, and proves your verification + idempotency path runs.
Fix a flaky suite:
"These tests pass locally but fail randomly in CI."
Anvil finds the source of non-determinism (wall-clock, ordering, real timers, network), fixes it at the root, and re-runs to show it's stable — instead of adding retries that hide the flake.
# Activation + behavior tests live in evals/. See evals/README.md for the skill-TDD workflow.
python3 -c "import json; json.load(open('anvil/evals/trigger-eval.json')); json.load(open('anvil/evals/evals.json')); print('evals OK')"
# The coverage-gap finder is self-tested (proves it flags untested CRITICAL paths
# and does NOT cry 'uncovered' on generated files):
python3 anvil/scripts/coverage_gaps.py --self-testAnvil produces tests and a coverage assessment — the right tests at the right level, run with shown output, and a clear picture of which critical paths are exercised. It does not, by itself, make a system correct or bug-free. A green suite proves the behavior under test, never the absence of all bugs. Anvil is stack-aware (a test that doesn't fit your stack or doesn't pay is suppressed, with the reason stated), it shows real output for every "passing" claim, and it leaves every change to money, auth, access, or crypto code — and the behavior any regression test locks in — for a human to approve.
Anvil reads the shared Forge DNA and honors its boundary contract — that single file is the entire coordination mechanism: no runtime coupling, just a shared contract every skill agrees to. Anvil composes with Helm, Loom, Facet, Cairn, Lens, Bastion, and Relay:
| Sibling | Owns | How Anvil composes |
|---|---|---|
| Helm | The product loop | A kill verdict's regression cover of what remains is Anvil's; Helm never writes tests. |
| Loom | Feature definition & completeness | Loom's Given/When/Then acceptance criteria are Anvil's starting line — its flow map is the list of valuable paths (T-002). Loom writes no tests. |
| Facet | The interface | Facet's component contracts and variant lists become Anvil's golden/widget tests; Facet writes none. |
| Cairn | Architecture & structure | Cairn says "this must be testable"; Anvil says how, and flags back to Cairn if the code can't be tested without a structural fix. |
| Lens | Code quality & review | Lens says "this is too complex to test"; Anvil confirms the testability cost — the refactor is Lens/Cairn. |
| Bastion | Security & resilience | Bastion says "prove this is fixed"; Anvil writes the failing regression test that reproduces the vuln, then confirms the fix turns it green. Severity is Bastion's call. |
| Relay | Ship & operate | Relay's pipeline runs Anvil's suite as the test stage and gates the deploy on uncovered critical paths. |
The flow is Helm sets the course → Loom defines → Facet gives it a face → Cairn designs → Anvil proves it works → Lens cleans → Bastion guards → Relay ships → Helm reads the results, but each stands alone and you can enter at any skill. Anvil never re-decides another skill's concern — it supplies the evidence they require.
Anvil is open source and contributions are welcome. Open an issue or a pull request on the
GitHub repo. Good contributions: new stack-test profiles, sharper
right-level guardrails, more evals (especially must_not over-test / over-mock / vanity-coverage cases),
and new worked examples. See CONTRIBUTING.md and evals/README.md for
the skill-TDD workflow that keeps Anvil trustworthy.
Anvil is created and maintained by Mohammed Nasher.
- 👤 Author: Mohammed Nasher
- 🐙 GitHub: @mhd-nasher
- 📦 Repository: github.com/mhd-nasher/anvil
- 🧬 Suite: part of Forge — Cairn (architecture), Anvil (testing), Lens (code quality), Bastion (security), Relay (ship & operate).
- 💬 Contact / questions / collaboration: open an issue or start a discussion on the repo.
If you use Anvil in a project, a credit back to @mhd-nasher is appreciated.
See CITATION.cff for citation details.
MIT © Mohammed Nasher (@mhd-nasher). Free to use, modify, and distribute — keep the copyright and license notice.
Built with intent by Mohammed Nasher 🔨
Cairn designs it, Anvil proves it works, Lens cleans it, Bastion guards it, Relay ships it. If Anvil helped you prove something works, drop a ⭐.