Agent-Span
AGENTS.md42 starsChanged 5 months agoMITView on GitHub
AgentSpan is an async-Rust web access gateway for AI agents. This file is for AI coding assistants (Claude Code, Cursor, Codex) working in this repo. Python SDK: pip install -e sdk/python[dev] then pytest -q in sdk/python/. 1. Copy crates/agentspan-channels/src/hackernews.rs (free API) or spotify.rs (OAuth) as a template. 2. Implement Channel + Backend traits. Use BackendRouter for fallback. 3. Register in src/lib.rs (module + re-export) and src/registry.rs. 4. Add MCP tools in crates/agentspan-mcp/src/tools.rs. 5. Add a format rule in crates/agentspan-cli/src/commands/format.rs. 6.…
- Installs packages
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 35,337 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 repositoryOne other file it gives its agents.
- docs/llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 38
Add MCP tools in crates/agentspan-mcp/src/tools.rs.
- Very specific: line 39
Add a format rule in crates/agentspan-cli/src/commands/format.rs.
- Very specific: line 40
Run cargo test -p agentspan-channels — the registry count test will tell you the expected count.
- Very specific: line 45
Add a ToolDef entry in crates/agentspan-mcp/src/tools.rs.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
AGENTS.md
AgentSpan is an async-Rust web access gateway for AI agents. This file is for AI coding assistants (Claude Code, Cursor, Codex) working in this repo.
Build & test
cargo test --workspace # run all tests
cargo clippy --workspace --all-targets -- -D warnings # lint
cargo fmt --all -- --check # format check
cargo run --bin agentspan -- serve # start the API on :8080
cargo run --bin agentspan-mcp # start the MCP server (stdio)Python SDK: pip install -e sdk/python[dev] then pytest -q in sdk/python/.
Crate layout
| Crate | What lives here |
agentspan-core | Channel/Backend traits, types, config, errors |
agentspan-probe | Command execution + 6-state health classification |
agentspan-router | Backend selection, retry, circuit breaker, adaptive routing |
agentspan-cache | 3-tier cache (memory/disk/Redis), singleflight, optimizer |
agentspan-auth | API keys (SHA-256), tenants, RBAC, rate limiting, audit |
agentspan-channels | All 52 channel implementations + registry |
agentspan-api | Axum REST server, SSE, OpenAPI spec, middleware |
agentspan-mcp | MCP server (stdio + HTTP), 91 tools |
agentspan-cli | The agentspan binary — install, doctor, serve, skill, etc. |
Adding a channel
- Copy
crates/agentspan-channels/src/hackernews.rs(free API) orspotify.rs(OAuth) as a template. - Implement
Channel+Backendtraits. UseBackendRouterfor fallback. - Register in
src/lib.rs(module + re-export) andsrc/registry.rs. - Add MCP tools in
crates/agentspan-mcp/src/tools.rs. - Add a format rule in
crates/agentspan-cli/src/commands/format.rs. - Run
cargo test -p agentspan-channels— the registry count test will tell you the expected count.
Adding an MCP tool
Add a ToolDef entry in crates/agentspan-mcp/src/tools.rs. The channel
field must match a registered channel name. Use Op::Read for URL-based
fetch, Op::Search for keyword queries, Op::Doctor for health.
Conventions
- Edition 2021, async/await, tokio runtime.
thiserrorfor library errors,anyhowat binary boundaries.tracingfor structured logging (neverprintln!in library code).- Tests live in
#[cfg(test)] mod testsat the bottom of each file. - No
todo!()orunimplemented!()in production code paths.
Known constraints
See KNOWN_ISSUES.md for build quirks (windows-gnu slow builds, WebSocket feature-gate) and feature gaps.
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.

