plugins/rust-expert/skills/rust-testing-quality/SKILL.md
Use when writing, organizing, or running Rust tests — unit, integration, doc-tests, property-based (proptest), benchmarks (criterion), or mutation testing (cargo-mutants). Covers test layout, the nextest doctest pitfall, and quality gates. Do NOT use for CI pipeline wiring (use rust-tooling-cicd) or non-Rust test suites.
npx skillsauth add fusengine/agents rust-testing-qualityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before ANY test work, use TeamCreate to spawn 3 agents:
tests/, #[cfg(test)], benches/After implementation, run fuse-ai-pilot:sniper for validation.
| 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 |
cargo nextest run skips them by design. ALWAYS pair with cargo test --doc. Never treat a green nextest run as full coverage.#[cfg(test)], not tests/.proptest-regressions/ - persisted failing seeds must be under version control so failures are reproducible.harness = false for criterion benches - required in Cargo.toml, or the built-in bench harness collides.cargo mutants is slow; run it in scheduled CI, not on every push.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
| 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 |
| Template | When to Use | |----------|-------------| | test-suite.md | Scaffolding unit + integration + doc + proptest | | criterion-bench.md | Adding a criterion benchmark |
cargo nextest run --all-features # unit + integration, fast, parallel
cargo test --doc # doc-tests — NOT covered by nextest
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
cargo nextest run + cargo test --doc together in every CI gate#[test] (use criterion in benches/)proptest-regressions/ — commit itcargo mutants on every push (schedule it instead)testing
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.