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 skills/xobotyi/cc-foundry/rust-testingnpx skills add xobotyi/cc-foundry --skill rust-testinggit clone --depth 1 https://github.com/xobotyi/cc-foundryWrote 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/skills/xobotyi/cc-foundry/rust-testing)<a href="https://agentmods.dev/skills/xobotyi/cc-foundry/rust-testing"><img src="https://agentmods.dev/badge/skills/xobotyi/cc-foundry/rust-testing.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.00070 | $0.02312 |
| Opus 5 | $0.00035 | $0.01156 |
| Sonnet 5 | $0.00014 | $0.00462 |
| Haiku 4.5 | $0.00007 | $0.00231 |
Grade A, and why
rust-testing 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.
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Testing
Prefer real implementations and hand-written fakes over heavy mocking — a test wired to a mock asserts how the code calls its collaborators, not what the code does. Tests are documentation that runs: a reader should learn the intended behavior from the test name, the arrange/act/assert shape, and the doctest examples on public items. Test the public contract, not the private call graph.
Route to Reference
- Test layout depth —
${CLAUDE_SKILL_DIR}/references/layout.mdUnit vs integration vs doctest mechanics,tests/crate-per-file model,tests/common/mod.rsshared-helper pattern, binary-cratelib.rssplit, doctest attributes (no_run,should_panic,ignore, hidden#lines),assert_matches!andpretty_assertionsusage - Property and snapshot testing, benchmarks —
${CLAUDE_SKILL_DIR}/references/property-and-snapshot.mdproptest vs quickcheck strategy authoring and shrinking, insta inline/file snapshots andcargo insta review, criterion harness setup andstd::hint::black_box - Mocking and fixtures —
${CLAUDE_SKILL_DIR}/references/mocking-and-fixtures.mdmockall#[automock]vsmock!, predicates and call counts, the trait-seam pattern for in-memory fakes, rstest#[case]/#[fixture]params, serial_test, assert_cmd + predicates for CLI integration - Async tests —
${CLAUDE_SKILL_DIR}/references/async-tests.md#[tokio::test]flavors,tokio::time::pause/advancefor deterministic timers, tokio-test macros; cross-references therustskill async reference for runtime semantics - Pinned crate versions —
${CLAUDE_SKILL_DIR}/references/versions.mddate-stamped dev-dependency versions for the testing ecosystem crates ("as of 2026-06")
Read the relevant reference before writing non-trivial tests in that area.
Test Layout
- Place unit tests in a
#[cfg(test)] mod testsblock in the same file as the code under test; bring the parent into scope withuse super::*.#[cfg(test)]keeps test code (and its helpers) out of the build artifact. - Use unit tests to exercise private items — Rust's privacy rules let a child
testsmodule reach its ancestors, so testing internals is possible. Reserve this for genuinely tricky private logic; prefer driving private code through the public API. - Place integration tests in the top-level
tests/directory, next tosrc/. Cargo compiles each file as its own crate, so they reach only the public API viause my_crate::...— exactly as an external consumer would. - Share integration-test helpers from
tests/common/mod.rs, nottests/common.rs. Themod.rsform is not compiled as a separate test crate, so it produces no spurious empty "running 0 tests" section. Import it withmod common;. - For a binary crate, keep
main.rsa thin shell that calls intolib.rs; integration tests then exercise the library crate, since only library crates expose items to externaluse. - Write doctests as
///examples on public items. They double as compiled documentation and run undercargo test --doc. Hide setup lines with a leading#and use```no_runfor examples that must compile but not run.
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- yesterday First seen · 145 lines · 70 tokens per session scan A 2e4d27bd2d9c
rust-testing is a skill published in the GitHub repository xobotyi/cc-foundry (20 stars, last pushed 2d ago), licensed MIT. It adds 70 tokens to every session and 2,312 once invoked, about $0.0003 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-04.
Other skills, from other repositories
python-playground
Run and test Python code in a dedicated playground directory. Use when you need to execute Python scripts, test code snippets, investigate CPython behavior, or experiment with Python without affecting the main codebase.
review-usability
Check whether the common Python code an LLM would plausibly write still works on this branch, testing real cases in ./playground against CPython. Use to find behaviour that diverges from CPython or trips up ordinary idiomatic code.
rust-unit-tests
Write, improve, and run Rust unit tests in the warp Rust codebase.
check
Run Rust fmt, clippy, and unit tests. Use after making Rust code changes.
doctest-conventions
Conventions for authoring rustdoc doctests in playwright-rust — the norun annotation, module-level placement, hidden scaffolding lines, and how doctests are exercised in CI vs pre-commit.
rust-development
Idiomatisk Rust-utvikling med cargo, clippy, error handling, async/tokio, unsafe og testing.