rust-testing-quality
БесплатноБез исполняемых скриптовНе проверенUse when writing, organizing, or running Rust tests — unit, integration, doc-tests, proptest, criterion benchmarks, or cargo-mutants. Not for CI pipeline…
от Fusengine★ 36 звёзд на GitHubОб этом скилле
It also covers the nextest doctest pitfall: cargo nextest run never runs doc-tests, so
cargo test --doc must always be paired alongside it — a green nextest run alone is not
full coverage.
Out of scope: CI pipeline wiring and gate ordering belong to rust-tooling-cicd; non-Rust test suites are not covered.
Rust Testing & Quality
Agent Workflow (MANDATORY)
Before ANY test work, spawn 3 agents in parallel, one Agent call each with a name:
- fuse-ai-pilot:explore-codebase - Map existing
tests/,#[cfg(test)],benches/ - fuse-ai-pilot:research-expert - Verify current nextest/proptest/criterion docs via Context7/Exa
- mcp__context7__query-docs - Check crate-specific API (proptest strategies, criterion groups)
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
| Test kind | Location | Runs the code as |
|---|---|---|
| Unit | #[cfg(test)] mod tests inside the source file |
Same crate, sees private items |
| Integration | tests/*.rs (each file = own crate) |
External consumer, public API only |
| Doc-test | ```rust blocks in /// docs |
Compiled + run as examples |
| Property | proptest, inside unit or integration | Generated random inputs + shrinking |
| Benchmark | benches/*.rs with criterion |
Statistical timing, not correctness |
Critical Rules
- nextest does NOT run doc-tests -
cargo nextest runskips them by design. ALWAYS pair withcargo test --doc. Never treat a green nextest run as full coverage. - Integration tests see only the public API - if a test needs private items, it belongs in
#[cfg(test)], nottests/. - Commit
proptest-regressions/- persisted failing seeds must be under version control so failures are reproducible. harness = falsefor criterion benches - required inCargo.toml, or the built-in bench harness collides.- Mutation testing is a gate, not a smoke test -
cargo mutantsis slow; run it in scheduled CI, not on every push.
Architecture
my_crate/
├── src/
│ └── lib.rs # unit tests in #[cfg(test)] + doc-tests in ///
├── tests/
│ └── api.rs # integration tests (public API)
├── benches/
│ └── throughput.rs # criterion, harness = false
└── proptest-regressions/ # committed failing seeds
→ See test-suite.md for the complete example
Reference Guide
Concepts
| Topic | Reference | When to Consult |
|---|---|---|
| Test organization | test-organization.md | Deciding unit vs integration vs doc, running with nextest |
| Property & mutation | property-and-mutation.md | Adding proptest strategies or cargo-mutants |
Templates
| Template | When to Use |
|---|---|
| test-suite.md | Scaffolding unit + integration + doc + proptest |
| criterion-bench.md | Adding a criterion benchmark |
Quick Reference
Run everything (the correct pair)
cargo nextest run --all-features # unit + integration, fast, parallel
cargo test --doc # doc-tests — NOT covered by nextest
Property test skeleton
use proptest::prelude::*;
proptest! {
#[test]
fn round_trips(n in 0u32..10_000) {
prop_assert_eq!(decode(&encode(n)), n);
}
}
→ See test-suite.md for the full file
Best Practices
DO
- Run
cargo nextest run+cargo test --doctogether in every CI gate - Keep integration tests black-box against the public API
- Start proptest with the cheapest property: "does not panic"
- Name benches by the operation measured, not the function name
DON'T
- Assume nextest covered doc-tests — it never does
- Put timing benchmarks in
#[test](use criterion inbenches/) - Gitignore
proptest-regressions/— commit it - Run
cargo mutantson every push (schedule it instead)
Установить rust-testing-quality в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rust-testing-quality?
Use when writing, organizing, or running Rust tests — unit, integration, doc-tests, proptest, criterion benchmarks, or cargo-mutants. Not for CI pipeline wiring (rust-tooling-cicd).
Как установить скилл rust-testing-quality?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rust-testing-quality запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic