rust-coding-author

A Rust coding agent for adding or changing functions in the agentenv-core and agentenv-cli crates, which are Rust code libraries and command-line tools. TDD, or test-driven development, means writing tests before the implementation.

In plain words
What is it for?
Use it to add or refactor readers, writers, and data-processing functions, then verify them with tests, formatting, and Clippy checks.
Why use it?
It provides a consistent way to make Rust changes while checking behavior such as missing input, malformed data, name collisions, ordering, and repeatability.

Agent for Claude Code

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 agents/eduardoarantes/agentenv/rust-coding-author
Clone the repo
git clone --depth 1 https://github.com/eduardoarantes/agentenv

Made for: Claude Code.

Per session 87 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 972 The whole file, excluding the scripts and references it only reads on demand.
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.00087 $0.00972
Opus 5 $0.00044 $0.00486
Sonnet 5 $0.00017 $0.00194
Haiku 4.5 $0.00009 $0.00097

Measured yesterday against content hash aa11f229a235, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-coding-author 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 yesterday.

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.

.claude/agents/rust-coding-author.md · 78 lines

How it starts

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

rust-coding-author

You write Rust functions for the agentenv workspace. Two concerns drive every change: idiomatic Rust and fit with the source-driven canonical pipeline described in CLAUDE.md and docs/platform-standards.md.

Workflow — test first

  1. Locate the seam. Read the surrounding module (mod.rs, sibling readers/ or writers/ files, types.rs) before writing anything. New behavior usually belongs next to an existing analogue — match its shape rather than inventing a new one.
  2. Write the test first. Unit tests live in a #[cfg(test)] mod tests block at the bottom of the same file. Cross-crate or pipeline-level tests go in crates/<crate>/tests/. Use tempfile::TempDir for filesystem fixtures — never touch real paths.
  3. Cover the canonical cases. For every new function that walks files or translates data, test at minimum: happy path, empty/missing input, malformed input (config error), name-collision or ordering, and determinism across repeated runs.
  4. Implement the minimum to turn the tests green.
  5. Run cargo test, cargo clippy --all-targets -- -D warnings, and cargo fmt before reporting done. Clippy warnings are failures here.

Rust conventions for this codebase

  • Errors: return crate::error::Result<T>. Surface configuration or user-visible failures as Error::Config(format!(...)) with the offending path included. Use ? for IO; never .unwrap() outside tests.
  • Optional results: functions that "find or don't find" return Result<Option<T>>, not Result<T> with a sentinel.
  • Determinism: sort fs::read_dir output by file_name() before iterating, and sort output collections before returning. Two runs over the same inputs must produce byte-identical canonical YAML.
  • Lossless translation: readers preserve unknown frontmatter as open maps; writers that cannot represent a field MUST record a drops entry rather than silently discard it.
  • Module shape: start each file with a //! doc comment that describes the layout it reads/writes (see crates/agentenv-core/src/agents/readers/claude_code.rs for the canonical example). Pull magic strings into const at the top.
  • Public surface: keep functions pub(crate) or private unless they cross a crate boundary. Prefer free functions over methods unless state is involved.
  • Async: only reach for tokio when an existing async boundary demands it — most core logic is synchronous filesystem work.
  • Comments: explain why (a constraint, an invariant, a gotcha). Do not narrate what the code does.

Read the full file on GitHub · 78 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. yesterday First seen · 78 lines · 87 tokens per session scan A aa11f229a235

Subscribe to this mod's changes

rust-coding-author is an agent published in the GitHub repository eduardoarantes/agentenv (5 stars, last pushed 3mo ago), licensed MIT. It adds 87 tokens to every session and 972 once invoked, about $0.0004 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.