agentleFS
DankosikDankosik/cargo-modernize/.agents/skills/rust-testing/SKILL.md

rust-testing

Skill0 starsChanged 5 days agoApache-2.0View on GitHub

Behavior. Use when writing or reviewing Rust tests: assertions, proving layer, real dependencies, time control, and defect detection.

44 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust-cli, rust-api-design and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • tumfSkill

    rust-cli

    Design and implementation guidance for maintainable Rust CLIs with strong ergonomics, machine-friendly behavior, testable structure, and release automation. Use when creating or refactoring a Rust command-line tool, choosing crates like clap/anyhow/tracing/serde_json, improving command UX, adding JSON output, tightening test/release workflows, or making an existing CLI safer for agents and automation.

    Also in 4 projects that use this

  • adxptivedSkill

    rust-api-design

    Rust API Design guidelines, naming conventions, and best practices. Use when: - User is designing a library, crate, or public APIs - Implementing patterns like Builder, Typestate, or Extension traits - Designing public structures, enums, or traits - Working with common traits (From/Into, Default, AsRef, Debug, Clone) - Applying #[must_use] or #[non_exhaustive] attributes - Restricting trait implementation via Sealed Traits - Formatting naming structures and lifetime designs

    Also in 3 projects that use this

  • dawidpereiraSkill

    rust-macros

    Rust macros — macro_rules!, proc macros, derive macros, attribute macros, fragment specifiers, repetition, hygiene, cargo expand, when to use macros vs generics. Use when writing or debugging declarative or procedural macros, choosing between macros and other abstractions, understanding expansion errors, or generating repetitive code.

    Also in 3 projects that use this

  • klauswgSkill

    rust-async-patterns

    Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or debugging async code.

    Also in 5 projects that use this

  • MicrosoftSkill

    rust-best-practices

    Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.

    Also in 9 projects that use this

  • junimnjwSkill

    rust-patterns

    Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 43 edited versions we read keep these.

  • 1

    Distinctive

    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
  1. Distinctive:

    Determinism: Keep output order, paths, and fingerprints independent of thread scheduling, filesystem iteration order, host path separators, …

    line 14

“Common” is measured: kept by at least 6 in 10 of the 43 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rust Testing

Behavior first. Name the observable contract a defect would break, select the smallest layer able to watch it fail, and assert concrete user-visible outcomes (reported finding id and span, rendered replacement, .fixed.rs output, report JSON, stderr bytes, exit code, or untouched working tree) against independent expected values.

Smallest proving layer. Match the harness to the boundary under test: unit tests beside pure logic in cargo-modernize-core, paired catalog fixtures (<id>.rs with //~ <id> markers and <id>.fixed.rs) plus a negative twin for every rule, metamorphic property tests (metamorphic_proptest.rs) for matcher and renderer invariants, and binary-level tests in crates/cargo-modernize/tests over tempfile workspaces for discovery, MSRV/edition resolution, --diff, --verify, --fix, --check, and exit codes. Assert public behavior so internal refactors stay green.

Real inputs versus doubles. Exercise real cargo, git, and parser behavior whenever their semantics belong to the claim (generated workspaces, real repositories for VCS diffs, real cargo check for --verify/--fix); reserve doubles such as the test-only panic detector for injected faults. Cover every supported edition (2015–2024), no_std/alloc/std variants, MSRV boundaries one release below and at requires, and const and macro contexts when a rule's admission depends on them.

Determinism. Keep output order, paths, and fingerprints independent of thread scheduling, filesystem iteration order, host path separators, and environment; normalize only what the contract declares unstable, and never sleep to synchronize.

Defect reproduction and discovery. Organize tests by behavior with small fixtures and explicit boundary limits. Reproduce bugs with a failing test first, verify non-zero executed test counts, and use cargo mutants, property tests, Miri, cargo xtask stress-ui, or fuzzing selectively as discovery aids rather than mandatory gates.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.