ton-rs AGENTS.md

ton-rs AGENTS.md is an instructions file for Codex, OpenCode from ston-fi/ton-rs. It costs 764 tokens per session, scanned A, original, Apache-2.0.

A development guide for ton-rs, a group of public Rust libraries for building software around TON, a blockchain network. It explains where different code belongs and how public interfaces and serialized data should be maintained.

In plain words
What is it for?
Use it when adding or reviewing TON types, wallets, contracts, providers, macros, or other Rust library changes. It helps decide whether code belongs in the core library, the main library, or the macro package.
Why use it?
It gives agents rules for changing shared Rust libraries without breaking their public interfaces or TON’s fixed data formats. It also directs review of changes involving APIs, dependencies, features, serialization, documentation, or releases.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ston-fi/ton-rs/agents-md
Clone the repo
git clone --depth 1 https://github.com/ston-fi/ton-rs

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ton-rs AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ston-fi/ton-rs/agents-md.svg)](https://agentmods.dev/instructions/ston-fi/ton-rs/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/ston-fi/ton-rs/agents-md"><img src="https://agentmods.dev/badge/instructions/ston-fi/ton-rs/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 764 This file is loaded in full into every session.
When invoked 764 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00764 $0.00764
Opus 5 $0.00382 $0.00382
Sonnet 5 $0.00153 $0.00153
Haiku 4.5 $0.00076 $0.00076

Measured 5d ago against content hash 83cf69ba1090, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ton-rs AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ton-rs agent guide

Repository

This workspace contains public Rust libraries for TON:

  • ton_core: cells, addresses, TLB primitives, and provider traits.
  • ton: block and contract types, wallets, clients, and optional emulators.
  • ton_macros: derives and attributes used by the two libraries.
  • examples and benchmarks: consumers, not reusable API crates.

Use the rust-library-review workflow for public API, dependency, feature, serialization, documentation, or release changes.

Boundaries

Keep provider-neutral types in ton_core. Networking, contract wrappers, wallet logic, and native tonlib adapters belong in ton. Procedural macros must emit paths that work when dependencies are renamed.

Do not add convenience re-exports or parallel constructors. Prefer the existing module-qualified paths and one canonical construction path.

Public API

  • Mark open errors, enums, returned state, responses, and result records #[non_exhaustive] so variants and fields can grow compatibly.
  • Keep fixed TLB/TL wire records exhaustive when callers must construct them and adding a field would change serialization. Document this exception near the type or in its crate guide.
  • A non-exhaustive struct must have a constructor, builder, or another supported construction path.
  • Keep Rustdoc short and behavioral. Document errors, panics, ownership, timeouts, caching, and feature requirements when relevant.
  • Public enum additions, serialized names, feature changes, and dependency types are compatibility-sensitive even when code still compiles.

Any public surface change must review the applicable AGENTS.md, README, Rustdoc, examples, tests, package include rules, and changelog.

TON invariants

  • Cell limits are 1023 data bits and four references.
  • TLB prefixes, field order, reference layout, and signed-message layout are wire contracts. Never change them as cleanup.
  • TVMStack pops from the end; serialized stack order is reversed while reading.
  • Wallet code and initial data determine the address. Signing layout differs by wallet version.
  • Provider state requested for a transaction must describe that exact transaction. Do not silently substitute latest state.

Read the full file on GitHub · 92 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 92 lines · 764 tokens per session scan A 83cf69ba1090

Subscribe to this mod's changes

ton-rs AGENTS.md is an instructions file published in the GitHub repository ston-fi/ton-rs (172 stars, last pushed 3d ago), licensed Apache-2.0. It adds 764 tokens to every session, about $0.0038 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.