agentleFS
bInference-LabbInference-Lab/bInference/.agents/skills/debug-failure/SKILL.md

debug-failure

Skill2 starsChanged 2 days agoMITView on GitHub

Finds the cause of a failure in a running install, a test or CI by naming the boundary it crosses and reading the signal there before changing code. Use when behavior differs from the spec, a call fails with an error code, or a test passes locally and fails in CI.

6 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use audit-test-suite, change-data-safely and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yaohuangguanSkill

    audit-test-suite

    Find where an existing test suite is weak and decide what to test next, ranked by risk. Use this when asked to add missing tests, find gaps, raise coverage, assess test quality or see which areas are thin, even if the request only mentions a coverage percentage.

    Also in 3 projects that use this

  • yaohuangguanSkill

    change-data-safely

    Change a database schema or stored data without breaking running code or losing data. Use this for any migration, new or changed column, backfill, bulk update, delete, index, or change to a stored format, including in small projects. Data mistakes are often impossible to undo.

    Also in 3 projects that use this

  • MicrosoftSkill

    fix-flaky-test

    Reproduces and fixes flaky or quarantined tests. Tries local reproduction first (fast), then falls back to CI reproduce workflow (reproduce-flaky-tests.yml). Use this when asked to investigate, reproduce, debug, or fix a flaky test, a quarantined test, or an intermittently failing test.

    Also in 3 projects that use this

  • dabstractorSkill

    write-pull-request

    Write a pull request to an open source repository. Lead with the user-facing problem in a personal voice, then a scannable technical fix. Use when opening or drafting a PR or contribution.

    Also in 3 projects that use this

  • Codagent-AISkill

    implement-change

    Implements an approved change in one continuous session, with tiered test runs. Use when asked to implement a change from its approved definition, or to invoke codagent:implement-change.

    Also in 3 projects that use this

  • srclightSkill

    refactor-safely

    This skill should be used when the user asks to "refactor", "rename", "move", "change a function signature", "extract a method", "delete unused code", "clean up", or any modification that could break callers or dependents. Provides a pre-change safety checklist using srclight's graph tools to assess blast radius before touching code.

    Also in 3 projects that use this

  • +6 more from yaohuangguan

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run that test, then its folder, then the neighbors that share the module.

    line 66
  2. Distinctive:

    Never print a secret, a key, a seed phrase or a bot token, and never paste one into a test, a log or an issue.

    line 72
  3. Distinctive:

    Never point a debug session at a live wallet.

    line 74
  4. Very specific:

    Remove any debug output before clean-diff.

    line 75

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debug a failure

Guessing costs more than looking. Name the boundary where the failure could start, read the evidence there, then change the one thing that is wrong.

1. Name the boundary

Pick the first place where what happened can differ from what should happen:

BoundaryWhere to look
Configconfig.json5, its layers and issues: binference check
Protocol callthe operation's row in packages/protocol, the error code it returns
Engine use casepackages/engine/src/<feature>/, its handler in src/operations/
Wallet and signerthe wallet queue, the executor, the signer's hard rules
ChainRPC answers, the relay, the receipt, the stored raw transaction
Venuethe plugin's src/api/ answers and its decoder
Telegramthe inbox, the outbox, the throttler, the synthetic Bot API in tests
MCP clientthe tools the client listed, each call's args and the engine's answer
Platformpaths, the keychain, the service manager, IPC, file permissions
CI onlythe OS of the failing job, the runner, the Node version

2. Read the evidence

On an install, never the owner's real one. Use a state folder of your own:

export BINFERENCE_HOME="$(mktemp -d)"
binference status
binference health
binference logs --follow
binference check
binference safety status
  • Logs are JSON lines in $BINFERENCE_HOME/logs/, one subsystem per child logger (engine.policy, chain-evm.relay), with ids and error codes, never content. Find the intentId or traceId and follow it.
  • An error code is dotted (quote.venue_down, auth.scope). Search the code for it: one module raises it, and the fail frame's retryable says whether the same call may pass later.
  • Stored state is SQLite (engine.sqlite, agent.sqlite). Copy the file before you read it, and open the copy read-only. Never write to the files of a running engine: one engine holds the lock, and the ledger is append-only.
  • For an intent, read its state and history before its card: the state machine is the one owner of what happened.

In a test, read the first failing assertion, then the fake's recorded calls (the synthetic Bot API's calls(), a fake store's rows). A fake that disagrees with its contract suite is a bug in the fake.

3. Compare what is configured with what ran

Many failures are a gap between the two: a venue enabled in config but not installed for lack of its key, a chain in config whose registry has no such contract, a scope the token lacks, an agent that is paper while you expected live, a frozen agent. Check the running values, not the file.

4. Fix and prove

  1. Reproduce with the smallest test that shows the failure. Keep that run.
  2. Change the cause, at the module that owns it.
  3. Run that test, then its folder, then the neighbors that share the module.
  4. For CI only: read the failing job's log for its OS and Node version and run the same test on that OS when you can. Never retry a job to get green without a cause.

5. Rules while you look

  • Never print a secret, a key, a seed phrase or a bot token, and never paste one into a test, a log or an issue. Use the test values the fakes give.
  • Never point a debug session at a live wallet. Paper mode or a fork.
  • Remove any debug output before clean-diff. Logging through the Logger port stays only when it carries ids a person will need again.

6. Report

The boundary, the evidence that pinned it (the command with secrets left out, and what it showed), the fix's location, the test that proves it, and any doubt that remains.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.