- Home
- Skills
- Testing & Debugging
- Root-Cause Debugger: Proven Bug Fixes
Works with the AI Agents you already use
Root-Cause Debugger: Proven Bug Fixes
Ask a coding agent to fix a bug and it often patches the line that threw, loosens the check that caught the problem, deletes the failing test, or wraps the error in a try/except.
$12
Root-Cause Debugger: Proven Bug Fixes
Example session with this skill installed
Checkout started failing for some German orders after we shipped v1.3.0: "PaymentError: capture amount 2378 does not match authorized amount 2379". Example: one €19.99 mug shipped to DE. v1.2.0 was fine. Find out why and fix it.
- Read your context and instructions
- Compiled the root-cause debugger
Bug: German checkouts fail with "capture amount 2378 does not match authorized amount 2379"
Status: Fixed and proven
Root cause: toCents at src/currency.js:2 truncates with Math.floor. In binary floating point, 19.99 * 100 is 1998.9999999999998, so toCents(19.99) returns 1998 instead of 1999. buildInvoice (src/invoice.js:8) builds each line from that value: net 1998 + VAT 380 = 2378, one cent below the 2379 the customer authorized, and capture (src/payments.js:10) correctly refuses the mismatch. Any price that floats can't represent exactly is affected (19.99, 1.15 and 4.35 each lose a cent). Round prices like 10.00 and 2.50 aren't, which is why the existing tests stayed green.
Introduced in: 4cced21 "refactor: simplify currency helpers, add formatEUR" (2026-10-06). The refactor replaced Math.round with Math.floor while converting the helpers to arrow functions. Found by git bisect over 10 commits in 4 test runs.
Fix: restore rounding in toCents (src/currency.js:2, +1 −1 lines). This is where the wrong value is created. The invoice code and the payment check are correct and stay untouched; relaxing the payment check would only have hidden the bug. Longer term, storing catalogue prices as integer cents would remove the float conversion entirely.
Proof
| Check | Result |
|---|---|
Repro test/checkout-rounding.test.js on the original code | ✗ fails: PaymentError: capture amount 2378 does not match authorized amount 2379 |
| Repro with the fix | ✓ passes |
| Repro with only the fix reverted | ✗ fails again: PaymentError |
| Full suite against the baseline | ✓ 9 of 10 pass. The one failure, "orders from 50 euros ship free", was already failing in the baseline (8 of 9 passing); 0 new failures |
| Integrity check | ✓ 1 line changed, 1 test added; no deleted, skipped or weakened tests; no swallowed errors; no retries; no instrumentation left |
The pre-existing failure is unrelated: de8b5d3 "chore: raise free-shipping threshold to 60 euros" changed src/shipping.js without updating test/shipping.test.js. Decide whether the test or the threshold is right.
Same bug elsewhere
src/refunds.js:4:Math.floor(euros * 100)truncates the same way, so a €1.15 refund pays out 114 cents and a €19.99 refund pays out 1998. It was added inc65c00e"feat: partial refunds" (2026-10-15). Not changed. Say "fix these too" to apply it, usingtoCentsfromcurrency.jsinstead of a local conversion.- Callers whose behaviour the fix changes: only
buildInvoice(src/invoice.js:8). Invoice amounts for prices like 19.99 go back up by one cent, matching v1.2.0.
Ruled out
- The payment check got stricter:
src/payments.jsandsrc/checkout.jsare unchanged since v1.2.0. - Germany's VAT rate changed: the
src/tax.jsdiff since v1.2.0 only adds BE and AT; DE is still 0.19.
Changes (uncommitted)
src/currency.js:Math.floor→Math.roundintoCentstest/checkout-rounding.test.js: new regression test for a €19.99 order shipped to DE
Connects securely to your tools. The creator never sees your data.
About this skill
Ask a coding agent to fix a bug and it often patches the line that threw, loosens the check that caught the problem, deletes the failing test, or wraps the error in a try/except. The tests go green and the bug ships anyway.
This skill doesn't accept a fix until it can prove four things:
- Reproduced: a new test fails on the current code, for the reported reason.
- Explained: the root cause is traced from a specific line to the symptom. For regressions,
git bisectruns that test across your history and names the exact commit that broke it. - Proven: the test passes with the fix, fails again with only the fix reverted, and your suite is no worse than its baseline, so pre-existing failures are never blamed on the fix.
- Clean: the diff is audited for the classic agent cheats: deleted or skipped tests, weakened assertions, swallowed errors, retries and sleeps, special-casing the test input, and leftover debug logging.
Then it searches the codebase for the same bug in other places, and hands you a report ready to paste into a pull request: root cause, the commit that introduced it, the fix, a proof table with real test output, hypotheses ruled out, and sibling bugs.
Built-in expertise:
- A bisect recipe that never touches your checkout (it runs in a temporary git worktree), keeps the new test available in old commits, and skips commits that can't be tested instead of mis-blaming them.
- Playbooks for the hard bug classes: flaky tests, CI-only failures, performance regressions, race conditions, time zones and DST, money and floating point, encoding, dependency upgrades, memory leaks, caching, and bugs you can only see in production.
- One-test and full-suite commands for Node (node:test, Jest, Vitest, Mocha, Playwright), Python (pytest, unittest, Django), Go, Rust, Ruby, Java (Maven, Gradle), .NET and PHP.
Safe with your repository: it never commits, pushes, stashes, rewrites history or switches your branch. The fix and the new test are left uncommitted for you to review. It asks before anything destructive or external.
How to use it: paste the error or describe the bug ("checkout fails since v1.3.0", "this test is flaky", "it used to work last week").
What it doesn't do: security audits, open-ended performance tuning, or building features. If a bug only happens where code can't be run, such as production data, you get an instrumentation plan instead of a guess.
The demo below is a real, unedited run on a sample repository with a regression planted in its git history.
Needs git and a working test runner in the project.
Bisecting a regression needs git history that reaches back to a version that worked.
For bugs that only happen where code can't be run (production data, customer devices), it delivers an instrumentation plan instead of a fix.
Not for security audits, open-ended performance tuning, or building new features.
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 any payment.
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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 14 days ago
Requires
Permissions
File Scopes
Edits only the files the fix needs, plus one new regression test, and leaves everything uncommitted. Runs git bisect in a temporary git worktree outside your project and removes it afterwards. Never commits, pushes, stashes, rewrites history or switches your branch. Asks before migrations, writes to real databases, or calls to real services.