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.
npx agentmods add instructions/thorchain/swap.thorchain/agents-mdgit clone --depth 1 https://github.com/thorchain/swap.thorchainWrote 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.
[](https://agentmods.dev/instructions/thorchain/swap.thorchain/agents-md)<a href="https://agentmods.dev/instructions/thorchain/swap.thorchain/agents-md"><img src="https://agentmods.dev/badge/instructions/thorchain/swap.thorchain/agents-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02052 | $0.02052 |
| Opus 5 | $0.01026 | $0.01026 |
| Sonnet 5 | $0.00410 | $0.00410 |
| Haiku 4.5 | $0.00205 | $0.00205 |
Grade A, and why
swap.thorchain 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — working on this codebase
Instructions for AI coding agents contributing to swap.thorchain.org (the runtime guidance served to browsing agents lives at /AGENTS.md on the
site, generated from src/lib/agent/discovery.ts — this file is about the code).
What this is
Next.js (App Router, TypeScript, Tailwind) web UI for native cross-chain swaps, powered by THORChain and Maya Protocol. Users sign in their own wallets, or use memoless ("instant") swaps with no wallet connection.
Two-component architecture:
- UI — this repo.
- Backend API — the swap aggregator:
https://api.thorchain.org/v1(quotes/routing,x-api-keygated) andhttps://api.thorchain.org/memoless/api/v1(memoless swaps, no key). Protocol metadata (pools, mimir, THORNames, balances) comes from THORNode/Midgard gateways — seesrc/lib/api.tsandsrc/lib/thorchain-api.ts.
Commands
npm run dev— dev server (Turbopack). Check whether one is already running before starting another.npx tsc --noEmit -p tsconfig.json— typecheck; this is the CI-relevant check (next lintis currently broken).npm run build— production build (standalone output, single instance — in-memory rate limiting and idempotency stores rely on this).
Key areas
src/components/swap/— swap flow UI;src/lib/wallets.ts— wallet/TCSwap SDK config (env vars in.env.example).public/widget.js+src/app/widget/— the embeddable swap iframe. The loader mirrors the host page's dark/light mode into the iframe: it reads the effective background painted behind the widget (so a.darkclass,data-theme, or a CSS-variable swap all work without configuration), boots the iframe with?theme=, and pushes later changes overpostMessage—src/app/widget/theme.tsholds that contract plus the pre-paint script that stops the embed flashing the wrong theme. Keepwidget.jsplain unbundled ES5-style script — it runs as-is on third-party sites.src/lib/agent/discovery-files.ts— single registry of every static discovery file (/llms.txt,/AGENTS.md,/openapi.json,/.well-known/*, …), served bysrc/proxy.tsbefore filesystem routes. Add new agent/developer surfaces here, not as route folders.src/lib/agent/discovery.ts— markdown content for/AGENTS.md,/llms.txt,/llms-full.md,/auth.md, and the agent skill;src/lib/agent/openapi.ts— the OpenAPI document.src/lib/agent/developer-portal.ts— content for/developers.md;src/app/developers/page.tsxis a hand-built HTML mirror — keep the two in sync.src/lib/agent/developer-docs.ts— the named developer resources at/developers/<topic>(quickstart, api, mcp, auth, sdks, webhooks). One markdown source per topic feeds both the HTML page (src/app/developers/[topic]/page.tsx, rendered bysrc/components/markdown-article.tsx) and the.mdtwin, so they cannot drift. Topic metadata lives indeveloper-topics.ts— split out sodeveloper-portal.tscan link the pages without an import cycle.- The MCP server is anonymous and must stay that way: publish no
/.well-known/oauth-*metadata and no registration endpoint, and never link one from a discovery document either — a linked path reads as published metadata. MCP connectors read protected-resource metadata as "OAuth required" and then fail a sign-in flow against a site with no accounts — see the note indocs/agent-readiness/orank.md,testNoAuthorizationSurfaceBlocksConnectors, and the link guard intestDiscoveryDocsAreTruthful(test/agent-contracts.test.mjs), which also asserts that every own-origin URL a discovery document links resolves. sdk/python,sdk/go— dependency-free clients over this site's keyless public surfaces (the MCP tools and the support endpoints). The TypeScript SDK is the already-published@tcswap/sdkfrom the TCSwap monorepo — do not add a second npm client for the same APIs.src/lib/agent/sdks.tsis the single list the developer docs, llms.txt, and AGENTS.md render from; PyPI publication is still a manual step (seedocs/agent-readiness/orank.md).src/lib/agent/skills.ts— published agent skills (one per capability area, YAML frontmatter); routes and the skills index are generated fromAGENT_SKILLS.src/lib/agent/markdown-pages.ts— markdown twins:.mdappended to any content page URL, plusAccept: text/markdownnegotiation, resolved insrc/proxy.ts.src/lib/agent/pricing.ts— content for/pricing.md;src/lib/agent/agent-mode.ts— the/?mode=agentview (JSON or markdown byAccept), derived fromMCP_TOOLSanddeveloperEndpointsso it stays in sync.src/lib/agent/mcp-tools.ts— tool definitions and the server card (edge-safe, nonode:crypto);src/lib/agent/mcp-server.ts+src/lib/agent/mcp-ui.ts— public MCP server at/mcp(stateless streamable HTTP, read-only THORNode tools, MCP Apps quote view).public/robots.txtcarries AI Content-Signal lines whose ordering matters.src/app/api/— support endpoints (/api/v1/*canonical, unversioned aliases kept); JSON errors viasrc/lib/api-error.ts, idempotency viasrc/lib/agent/idempotency.ts.src/lib/rate-limit.ts— per-client limiter shared by/mcpand the support endpoints. Key oncf-connecting-ip(or the last forwarded hop), never the firstx-forwarded-forentry: the edge appends to whatever the caller sent, so the leftmost value is forgeable.src/lib/chatwoot.ts— bug reports and feature requests are delivered into a Chatwoot API-channel inbox via its unauthenticated public Client API (CHATWOOT_BASE_URL+CHATWOOT_INBOX_IDENTIFIER);/api/report-bugfalls back to Brevo email when Chatwoot is unset or fails.src/components/chatwoot-widget.tsxis the separate live-chat Website-channel widget, rendered only whenNEXT_PUBLIC_CHATWOOT_WEBSITE_TOKENis set. Agent replies only reach a reporter by email if the Chatwoot account has theemail_continuity_on_api_channelfeature enabled — it is off by default and replies are silently dropped without it.server.json(repo root) +src/app/.well-known/mcp-registry-auth/route.ts— the official MCP Registry record and its domain-ownership proof (served fromMCP_REGISTRY_AUTH). Keepserver.json'sversionin step withMCP_SERVER_INFO.version; publishing steps are indocs/agent-readiness/mcp-registry.md.docs/agent-readiness/— notes on agent-readiness scanners and decisions; read before changing discovery surfaces.src/content/banner.json— the whole announcement banner (on/off, id, icon, link, andlocales.<locale>copy), baked in at build time; only one banner is live at a time. Only thelocales.enblock is hand-written:tools/i18n-translate.mjsfolds banner strings into its normal key space asbanner.<field>and writes the other locales back into this same file, so they get the same protection as any message. New copy means a freshid(it keys dismissals) and clearing the other locale blocks. Seedocs/banner.md.
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.
- today Changed · +5 lines · +152 tokens per session b1925b3f85f7
- 4d ago First seen · 81 lines · 1,900 tokens per session scan A 11f8e1e595de
swap.thorchain AGENTS.md is an instructions file published in the GitHub repository thorchain/swap.thorchain (1 stars, last pushed yesterday), licensed MIT. It adds 2,052 tokens to every session, about $0.0103 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-31.
Other instructions, from other repositories
evmole AGENTS.md
Instructions for cdump/evmole: EVMole extracts structured facts from deployed EVM runtime bytecode.
experiencer CLAUDE.md
Claude Code instructions for vincentlaucsb/experiencer: The canonical repository instructions are in AGENTS.md. Read and follow that file; this compatibility entrypoint intentionally defines no independent rules.
plamen CLAUDE.md
Claude Code instructions for PlamenTSV/plamen, covering plamen — security auditor, execution model, reference files and shared.
pip-web CLAUDE.md
Claude Code instructions for playpip/pip-web, covering claude.md — agent guide for pip, read first (by task), the three layers (respect the boundaries), non-negotiables and commands / definition of done.
bitcoin-mcp copilot-instructions.md
Instructions for Bortlesboat/bitcoin-mcp, covering bitcoin-mcp copilot instructions, rules, satoshi api reference and verification.
kya-hub AGENTS.md
AGENTS.md instructions for UMBRAXON/kya-hub, covering agents.md — instructions for ai agents, 1. what kya-hub is, in one paragraph, 2. should you integrate?, 3. quickstart for an llm agent and 4. signing rules — the part that breaks everyone.