bInference
AGENTS.md2 starsChanged 2 days agoMITView on GitHub
binference is an open-source AI agent that trades on BNB Smart Chain for its owner. It runs on the owner's machine, talks on Telegram, in a web console and in the terminal, and asks before every transaction. This file holds the rules every engineer and coding agent follows. Each package has its own AGENTS.md; read it before you change a file there. The full rules are in docs/ENGINEERING.md, the architecture in docs/ARCHITECTURE.md, the specs in docs/specs/, and the decisions in…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository26 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-chainSkill
- add-mcp-toolSkill
- add-migrationSkill
- add-protocol-operationSkill
- add-venueSkill
- clean-diffSkill
- debug-failureSkill
- handle-security-reportSkill
- releaseSkill
- review-diffSkill
- review-money-pathSkill
- review-testsSkill
- run-testsSkill
- shape-commitSkill
- speed-up-testsSkill
- test-telegramSkill
- tune-ciSkill
- vet-releaseSkill
- write-adrSkill
- binference-toolsSkill
- copy-tradingSkill
- dca-planSkill
- meme-huntingSkill
- safe-swapSkill
- token-due-diligenceSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Every action has a visible outcome, and an error tells the reader the next step.
- Distinctive: line 28
Every name comes from docs/GLOSSARY.md.
- Very specific: line 44
Every async I/O takes an AbortSignal and has a timeout.
- Distinctive: line 54
Every port has one contract test suite that each adapter passes.
- Distinctive: line 55
No duplication: extract the second copy into the lowest shared package.
- Distinctive: line 74
No em or en dashes as punctuation.
- Very specific: line 75
No filler or hype words (easy, simple, just, seamless, robust, delve, utilize, very, really, powerful, effortless, elevate, streamline).
- Very specific: line 77
No plan or task ids, no people's names, no as discussed.
- Distinctive: line 79
Every word a person sees ships in English and Simplified Chinese in the same PR.
- Distinctive: line 83
Every PR is squashed into one commit on master, and its title becomes the subject.
- Very specific: line 99
No AI attribution lines. Co-authored-by names people only.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
binference
binference is an open-source AI agent that trades on BNB Smart Chain for its owner. It runs on the
owner's machine, talks on Telegram, in a web console and in the terminal, and asks before every
transaction. This file holds the rules every engineer and coding agent follows. Each package has
its own AGENTS.md; read it before you change a file there.
The full rules are in docs/ENGINEERING.md, the architecture in docs/ARCHITECTURE.md, the specs in docs/specs/, and the decisions in docs/DECISIONS.md. When those are silent, write a short ADR and get the maintainers' yes before coding. Never make a random choice.
Principles
- The engine is the trust boundary. Keys, confirmations, limits and the ledger live only in the engine and the signer; everything else reads and proposes.
- One owner per responsibility. One module decides and writes each piece of state.
- Small core, capable plugins. A new venue, chain, model provider or chat surface is an adapter
behind an existing port, never an
ifin the core. - Chain-agnostic and OS-agnostic. Core code never names a chain, an operating system, a model provider or a database.
- Fail closed on money, fail soft on telemetry.
- A change moves every caller and deletes the old path in the same PR.
- Every action has a visible outcome, and an error tells the reader the next step.
Names
Every name comes from docs/GLOSSARY.md. Never borrow file names, commands, config keys, protocol names, tool names or terms from other agent frameworks; add a new name to the glossary first.
TypeScript
- TypeScript 7, ESM only, Node
>=26.1.strict,noUncheckedIndexedAccess,exactOptionalPropertyTypes,verbatimModuleSyntax,isolatedDeclarations. - No
any, no non-null!, noenum, nonamespace, no default export, no@ts-ignore.asonly in tests and named assertion helpers. unknownonly at a boundary, parsed by zod at once. An exported shape has a declared type and a schema annotated with it (decision 0098); noz.inferin an exported position.- Branded types for ids, accounts, assets and amounts. Money is
bigintbase units, nevernumber. Rates are integer basis points. - Exhaustive
switch;readonlydata; never mutate an input. - Every async I/O takes an
AbortSignaland has a timeout. No floating promises. - Pure packages read time and randomness only through the
ClockandRandomports.
Clean code
- File 300 code lines (tests 600), function 50, complexity 10, nesting 3, parameters 3.
- One concept per file, named after its main export. No
utils.tsorhelpers.ts. No barrel files except a package'ssrc/index.ts. - Factory functions and interfaces; classes only for errors. One composition root in
cli. - Ports and adapters: domain code depends on ports; adapters are wired in the composition root. Every port has one contract test suite that each adapter passes.
- No duplication: extract the second copy into the lowest shared package. No speculative helpers or one-use wrappers.
- Expected outcomes return
Result; faults throwBinferenceErrorwith a dotted code. - An outside service (a venue, custody, a chat app, a data feed) is reached through its official SDK when one fits, at its latest release and the way its docs recommend; endpoints and addresses come from its official docs. Its client handles every error, limit and edge case those docs list, and follows their performance guidance (docs/ENGINEERING.md section 17).
Comments
- TSDoc on every public export: what it does and what a caller must know.
- A
//comment only for a non-obvious constraint (ownership, ordering, cleanup, platform). Never narrate code. NoTODO; open an issue.
Writing
Docs, UI messages, comments, commits and PR text:
- No em or en dashes as punctuation. No emojis outside the card icons the design names.
- No filler or hype words (
easy,simple,just,seamless,robust,delve,utilize,very,really,powerful,effortless,elevate,streamline). - No plan or task ids, no people's names, no
as discussed. - Short sentences, active voice, present tense.
- Every word a person sees ships in English and Simplified Chinese in the same PR.
Commits
Every PR is squashed into one commit on master, and its title becomes the subject. The release
notes are written from those subjects, so each one must read as a line of release notes. The full
rules are in docs/ENGINEERING.md section 19.
The subject: type(scope): description, 72 characters at most.
type:feat(something new),fix(wrong behavior made right),perf,refactor(same behavior, existing tests unchanged),test,docs,ci,build(toolchain and dependencies) orchore. When two fit, use the one the user notices.scope: one name, never two. The package (engine,signer,telegram), the plugin (pancakeswap), a feature folder ofengineorruntime(orders,policy), ordeps,skills,dev-skills,docs,release. No scope only for a change across the repo.description: lowercase, no period, says exactly what changed in a teammate's words. A fix names what the user saw. No vague words ("improve", "enhance"), no emojis, no dashes as punctuation, no issue numbers (Closes #Ngoes in the PR body).- A breaking change adds
!(feat(protocol)!: ...) and a body paragraph startingBreaking:. - No AI attribution lines.
Co-authored-bynames people only. - Example:
fix(orders): stop a trailing stop from firing twice after a restart.
What one commit holds:
- One reason to exist. If the subject needs "and" to join two unrelated changes, split it.
- Everything that reason needs: code, tests, TSDoc, English and Chinese messages, docs, the config migration, the ADR. Callers move and the old path is deleted in the same commit.
- Green on its own on each OS CI runs (macOS alone today, decision 0453), and revertable alone.
- Apart, each in its own commit: a refactor or rename a feature needs (first), formatting-only changes, one dependency update, an unrelated fix found on the way.
- Together: a migration and the code that needs it; generated files and their cause.
- Over about 400 changed lines: a stack of PRs (ports and types, then the adapter, then the wiring), each useful alone, unfinished behavior behind a config switch.
- Stage only what the change needs and read
git diff --staged. Never commit secrets,.envfiles, keystores or local paths.
Branches: <type>/<short-name>, one task each. Commits are signed and the author is the real
person.
Commands
Node 26.1 or later. pnpm switches itself to the version in package.json.
| Command | What it does |
pnpm install | Installs dependencies at their exact, 7-day-old versions |
pnpm setup | Links .claude/skills to .agents/skills |
pnpm check | Runs every gate through Turborepo; a second run comes from the cache |
pnpm format | Formats with oxfmt |
pnpm lint | Oxlint with the type-aware rules and the guards plugin |
pnpm typecheck | TypeScript 7 over packages and repo scripts |
pnpm test | Vitest with coverage bars by package tier |
pnpm test:after-merge [<range>] | After each merge: changed and dependent packages, tables, checks |
pnpm test:fork | The fork suite on an anvil fork of BSC; needs anvil and the network |
pnpm test:replay | Replays a recorded day on the fork at the chain's pace; needs anvil |
pnpm test:crash | The crash suite: kills and restarts the engine; needs anvil |
pnpm crash:times <results> | Refreshes the crash suite's measured times from a pass's results |
pnpm test:image | Builds and runs the Docker image with a paper trade; needs Docker |
pnpm test:console | Builds the console and runs its headless Playwright smoke test |
pnpm privy:sweep [--dry-run] | Deletes what live Privy suite runs left on the Privy test app |
pnpm build | tsdown for each package, ESM and .d.ts |
pnpm release:dry <tag> | Builds, packs and checks a release; publishes nothing |
pnpm release:dry --pack-only <v> | Packs a -nightly.N build that nothing publishes, for the smoke |
pnpm release:smoke <folder> | Installs a dry run's packed files and trades on paper by chat there |
pnpm update:smoke | Packs three releases, updates to a failing one and a good one |
pnpm node:pins [--version <v>] | Checks or sets the install scripts' Node pins from its signed sums |
pnpm install:smoke <folder> | Runs the install one-liner on a dry run's files from 127.0.0.1 |
pnpm gen:package <name> | A new package with its files and its row in the package graph |
pnpm docs:gen | Writes the docs site's references from the code, in both languages |
pnpm check:package-graph --write | Regenerates the import rules after a change to the package graph |
pnpm check:style --files <file> | The style guard on one file |
pnpm check:gates | Plants a violation for each gate and checks that the gate fails |
pnpm mutation | Stryker on the money core |
pnpm skill:run | Claude Code proposes a paper swap with the binference-tools skill |
What each package may import is in config/package-graph.json; edit the graph, never the
generated rules in config/oxlint/.
Skills
Skills live in .agents/skills/. Run the first two on every change, in this order:
clean-diff: strips filler from your diff before review.review-diff: reviews the diff against the rules no tool checks.shape-commit: checks that the change is one commit's worth and writes its subject.review-money-path: the checklist for a change that can move funds.add-migration: adds a migration to the store.add-chain: adds a chain, or tokens and contracts, to the registry.add-venue: adds a trading venue as a plugin.add-protocol-operation: adds an operation to the engine protocol.add-mcp-tool: exposes a read or propose operation to MCP clients.write-adr: records a load-bearing decision.run-tests: picks the tests that prove a change and runs them.review-tests: judges whether a test earns its place.speed-up-tests: measures a slow test and fixes the cause.debug-failure: finds a failure's cause from the evidence at its boundary.test-telegram: proves what the owner sees in Telegram, on the synthetic and a live bot.tune-ci: changes a workflow without making CI slower, costlier or less safe.vet-release: checks a release against its checklist, npm and a fresh install.release: cuts a beta or stable release: the dry run, the signed tag, the publish by hand.handle-security-report: weighs a security report or a leaked secret and drafts the answer.
Before you finish
- The behavior is tested at the cheapest layer that proves it.
- Public exports carry TSDoc; new user-facing words exist in English and Chinese.
- A config change has its migration; a load-bearing decision has its ADR.
pnpm checkpasses. CI runs it on macOS on each push tomasterwhile the release supports macOS alone (decision 0453), never on a branch or pull request, so prove an OS-specific path on its OS before the merge.
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
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.

