agentleFS
oxbshwoxbshw/Agent-Span/AGENTS.md

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 checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 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.

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
  1. Very specific:

    Add MCP tools in crates/agentspan-mcp/src/tools.rs.

    line 38
  2. Very specific:

    Add a format rule in crates/agentspan-cli/src/commands/format.rs.

    line 39
  3. Very specific:

    Run cargo test -p agentspan-channels — the registry count test will tell you the expected count.

    line 40
  4. Very specific:

    Add a ToolDef entry in crates/agentspan-mcp/src/tools.rs.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.

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

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

CrateWhat lives here
agentspan-coreChannel/Backend traits, types, config, errors
agentspan-probeCommand execution + 6-state health classification
agentspan-routerBackend selection, retry, circuit breaker, adaptive routing
agentspan-cache3-tier cache (memory/disk/Redis), singleflight, optimizer
agentspan-authAPI keys (SHA-256), tenants, RBAC, rate limiting, audit
agentspan-channelsAll 52 channel implementations + registry
agentspan-apiAxum REST server, SSE, OpenAPI spec, middleware
agentspan-mcpMCP server (stdio + HTTP), 91 tools
agentspan-cliThe agentspan binary — install, doctor, serve, skill, etc.

Adding a channel

  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. 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.
  • thiserror for library errors, anyhow at binary boundaries.
  • tracing for structured logging (never println! in library code).
  • Tests live in #[cfg(test)] mod tests at the bottom of each file.
  • No todo!() or unimplemented!() in production code paths.

Known constraints

See KNOWN_ISSUES.md for build quirks (windows-gnu slow builds, WebSocket feature-gate) and feature gaps.

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.