rust-test

rust-test is a command for coding agents from sifxprime/kodelyth-ecc. It costs 28 tokens per session (1,691 once invoked), scanned A, original, MIT.

A Rust coding command that follows test-driven development (TDD): write a failing test, implement the smallest change that passes, then improve the code.

In plain words
What is it for?
Use it when adding Rust functions, methods, or traits, fixing bugs, or improving tests with tools such as cargo-llvm-cov.
Why use it?
It helps catch mistakes early and keeps tests tied to the behavior being built. It also checks that test coverage reaches the stated target.

Command

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 commands/sifxprime/kodelyth-ecc/rust-test
Clone the repo
git clone --depth 1 https://github.com/sifxprime/kodelyth-ecc

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 rust-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/sifxprime/kodelyth-ecc/rust-test.svg)](https://agentmods.dev/commands/sifxprime/kodelyth-ecc/rust-test)
Your own site
<a href="https://agentmods.dev/commands/sifxprime/kodelyth-ecc/rust-test"><img src="https://agentmods.dev/badge/commands/sifxprime/kodelyth-ecc/rust-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,691 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.00028 $0.01691
Opus 5 $0.00014 $0.00846
Sonnet 5 $0.00006 $0.00338
Haiku 4.5 $0.00003 $0.00169

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

Security

Grade A, and why

rust-test 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.

commands/rust-test.md · 309 lines

How it starts

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

Rust TDD Command

This command enforces test-driven development methodology for Rust code using #[test], rstest, proptest, and mockall.

What This Command Does

  1. Define Types/Traits: Scaffold function signatures with todo!()
  2. Write Tests: Create comprehensive test module (RED)
  3. Run Tests: Verify tests fail for the right reason
  4. Implement Code: Write minimal code to pass (GREEN)
  5. Refactor: Improve while keeping tests green
  6. Check Coverage: Ensure 80%+ coverage with cargo-llvm-cov

When to Use

Use /rust-test when:

  • Implementing new Rust functions, methods, or traits
  • Adding test coverage to existing Rust code
  • Fixing bugs (write failing test first)
  • Building critical business logic
  • Learning TDD workflow in Rust

TDD Cycle

RED     -> Write failing test first
GREEN   -> Implement minimal code to pass
REFACTOR -> Improve code, tests stay green
REPEAT  -> Next test case

Example Session

User: /rust-test I need a function to validate user registration

Agent:
# TDD Session: Registration Validator

## Step 1: Define Interface

```rust
// src/validator.rs
pub struct RegistrationRequest {
    pub name: String,
    pub email: String,
    pub password: String,
}

pub enum ValidationResult {
    Valid,
    Invalid(Vec<String>),
}

pub fn validate_registration(request: &RegistrationRequest) -> ValidationResult {
    todo!()
}
```

## Step 2: Write Tests (RED)

```rust
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn valid_registration_returns_valid() {
        let request = RegistrationRequest {
            name: "Alice".into(),
            email: "[email protected]".into(),
            password: "SecureP@ss1".into(),
        };
        assert!(matches!(validate_registration(&request), ValidationResult::Valid));
    }

    #[test]
    fn blank_name_returns_invalid() {
        let request = RegistrationRequest {
            name: "".into(),
            email: "[email protected]".into(),
            password: "SecureP@ss1".into(),
        };
        match validate_registration(&request) {
            ValidationResult::Invalid(errors) => {
                assert!(errors.contains(&"Name is required".to_string()));
            }
            ValidationResult::Valid => panic!("expected Invalid"),
        }
    }

Read the full file on GitHub · 309 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 · 309 lines · 28 tokens per session scan A dc474e6373e2

Subscribe to this mod's changes

rust-test is a command published in the GitHub repository sifxprime/kodelyth-ecc (11 stars, last pushed 2d ago), licensed MIT. It adds 28 tokens to every session and 1,691 once invoked, about $0.0001 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-09-03.