rust-test-design
Skill4 starsChanged 2 months agoApache-2.0View on GitHub
Create or strengthen Rust regression, property, differential, fuzz, and concurrency tests. Use when evidence is missing or weak; use rust-nextest for runner mechanics.
In this repository81 other files it gives its agents.
- agent-cli-designSkill
- agent-tool-boundariesSkill
- behavior-first-implementationSkill
- bounded-prototypeSkill
- bounded-pr-sliceSkill
- building-fdd-validationSkill
- context-efficiencySkill
- cross-language-contractsSkill
- cross-platform-agent-instructionsSkill
- design-interviewSkill
- diagnosis-loopSkill
- domain-languageSkill
- edge-cloud-syncSkill
- handoff-continuitySkill
- immutable-pr-reviewSkill
- memory-context-hygieneSkill
- module-designSkill
- orchestrateSkill
- owner-decision-gateSkill
- parallel-portfolioSkill
- pr-gate-loopSkill
- pyo3-async-lifecycleSkill
- pyo3-buffer-performanceSkill
- pyo3-free-threadingSkill
- pyo3-ownership-errorsSkill
- pyo3-wheel-releaseSkill
- python-api-typingSkill
- python-async-concurrencySkill
- python-ci-releaseSkill
- python-data-boundariesSkill
- python-packaging-environmentsSkill
- python-performanceSkill
- python-pytestSkill
- python-reviewSkill
- python-test-designSkill
- python-threading-workersSkill
- python-workflowSkill
- react-components-stateSkill
- react-performanceSkill
- repository-groundingSkill
- rust-api-designSkill
- rust-async-concurrencySkill
- rust-build-diagnosticsSkill
- rust-ci-releaseSkill
- rust-memory-layoutSkill
- rust-nextestSkill
- rust-numerics-simdSkill
- rust-performanceSkill
- rust-protocol-codecsSkill
- rust-python-bindingsSkill
- rust-reviewSkill
- rust-storage-durabilitySkill
- rust-unsafe-ffiSkill
- rust-workflowSkill
- rust-workspace-dependenciesSkill
- shadcn-react-componentsSkill
- shadcn-svelte-componentsSkill
- simplify-existing-codeSkill
- source-verificationSkill
- svelte-components-runesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Read risk-to-test recipes for this repository family.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust Behavioral Testing
Identify the behavior that could be wrong before choosing a test framework. Work within the existing test architecture; this skill does not require a new dependency, test service, or CI job.
Build a small behavioral model
Read the contract, relevant call sites, implementation, and existing tests. Identify a concrete failure mode and the observable result that should distinguish it from correct behavior. Write the smallest regression first; confirm that it fails for the bug when practical, or explain why a pre-fix run is unavailable.
Cover representative boundaries rather than a long list of arbitrary examples: empty/one/max/over-limit inputs, zero and overflow, malformed nested data, exact deadline transitions, duplicate/stale messages, cancellation at resource acquisition, partial I/O, and cleanup after failure. Test the error variant and side effects, not just is_err().
Choose evidence for the risk
Use unit tests for local transformations and boundary arithmetic; integration tests for crate contracts and real lifecycle behavior. Property tests should generate valid domain values as well as deliberate invalid encodings, shrink failures, and retain actionable regressions. Bound generators so they can reach deep behavior rather than mostly reject input.
A round trip proves encoder/decoder agreement, not conformance: both can share a bug. Add independently derived vectors or a separately implemented reference model. A stored snapshot of the engine's own output is a regression/determinism check, not an independent correctness oracle. Record the origin of reference outputs and acknowledge shared formulas or kernels.
Use fuzzing for hostile bytes and bounded event sequences. Assert progress, resource limits, and semantic invariants, not merely absence of a panic. Promote interesting minimized inputs to ordinary regression tests. Use deterministic clocks or explicit timestamp events for timeout state machines; real sleeps alone are noisy and weak at exact boundaries.
For a synchronization change, consider a small Loom model using Loom synchronization types around the actual relevant algorithm. Model limits and uninstrumented dependencies restrict the claim. Add a real runtime integration test as a complementary check; neither is a substitute for the other.
Challenge the test itself
Deliberately imagine or locally introduce one plausible incorrect implementation: swap a comparison, ignore an ID, skip invalidation, omit a tail, or acknowledge before persistence. Does the test detect it? A narrow mutation experiment can be more informative than a higher line-coverage percentage. Restore any experimental mutation immediately; never ship it or regenerate expectations to hide it.
Make parallel execution safe with unique temporary resources, explicit lifecycle ownership, and no implicit test ordering. Keep expensive fuzzing, exhaustive schedules, and broad coverage out of the ordinary PR path unless already required. Run focused tests now and describe deeper unrun validation honestly.
Return
State the bug class, why these assertions would detect it, the test scope actually executed, and remaining blind spots. Do not equate test count, compilation, coverage, or a replayed golden with correctness.
Read risk-to-test recipes for this repository family.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

