Agent skill

Rust Testing Strategy

by hashintel in hashintel/hash

HASH Rust testing strategy. An agent skill from hashintel/hash.

AGPL-3.0Auto-check passedTesting & QA

Install Rust Testing Strategy

skills CLI
$ npx skills add hashintel/hash --skill rust-testing-strategy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hashintel/hash rust-testing-strategy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hashintel/hash.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/rust-testing-strategy .claude/skills/rust-testing-strategy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rust-testing-strategy
GitHub stars
1.7k
Token cost
~1.7k tokens
SKILL.md length
729 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
AGPL-3.0

At a glance

HASH Rust testing strategy. An agent skill from hashintel/hash.

  • Writing Rust unit
  • SKILL.md covers Verification Commands, Test Execution, Test Subject and Test Design Principles, plus 4 more sections
  • Calls cargo
  • Choosing assertion and test-organization patterns

What it does

Rust Testing Strategy is an agent skill from hashintel/hash. HASH Rust testing strategy. Use when writing Rust unit, integration, or snapshot tests, or choosing assertion and test-organization patterns.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test strategy. It works with Rust. The repository describes itself as: 🚀 The open-source, multi-tenant platform for self-building knowledge graphs and simulation. The licence is AGPL-3.0.

When your agent uses it

  • Writing Rust unit
  • Choosing assertion and test-organization patterns

Example prompts

  • “/rust-testing-strategy”

What it can do on your machine

Read from SKILL.md and the folder at commit e189ab2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rust Testing Strategy loads about 1.7k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 729 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hashintel/hash at commit e189ab2, republished under its AGPL-3.0 licence (© hashintel). 729 words, ~1,670 tokens.

Download SKILL.mdSave it as .claude/skills/rust-testing-strategy/SKILL.md (or your agent's skills folder).
name
rust-testing-strategy
description
HASH Rust testing strategy. Use when writing Rust unit, integration, or snapshot tests, or choosing assertion and test-organization patterns.
license
AGPL-3.0

Rust Testing Strategy

Verification Commands

  • When modifying Rust code, run clippy to detect issues:

    bash
    cargo clippy --all-features --all-targets --workspace --no-deps
  • Use cargo doc --no-deps --all-features to check documentation

Test Execution

  • Use cargo-nextest for running unit and integration tests
  • Use the default test runner for documentation tests
  • For comprehensive verification, run the complete test suite
  • Database seeding can be performed using yarn commands in the project's package.json

Test Subject

Test behavior implemented by our code or its composition. Assume dependencies implement their documented behavior correctly. Do not add tests whose only subject is a dependency's parser, serializer or generated implementation. Deriving or wrapping that API on an application type does not make its implementation ours.

A test that only calls try_parse_from on a #[derive(clap::Parser)] type and checks the declared fields or built-in validation re-tests clap. Test the logic of an application-owned value parser, validation rule or use of the parsed options when the case can expose a bug in our behavior with clap's behavior held fixed. Parsing can be setup for the test without being its whole assertion. Moving a dependency-conformance case into an integration target does not change its subject.

Test Design Principles

  • Choose success and error cases that distinguish our intended behavior from a plausible defect
  • Do not add a test merely to mirror a trivial mapping or immediate rejection branch
  • Test boundary conditions and edge cases explicitly
  • Include tests for invalid or malformed inputs
  • For streaming encoders/decoders, test partial data handling and buffer management
  • Aim for high test coverage but prioritize test quality over quantity
  • Structure tests following the Arrange-Act-Assert pattern

Assertion Standards

  • Use descriptive assertion messages that explain the expected behavior

  • All assertion messages (including expect(), unwrap() and assert*()) should follow the "should..." format:

    rust
    // Good examples:
    value.expect("should contain a valid configuration");
    assert_eq!(result, expected, "Result should match the expected value");
  • Use expect() or expect_err() with clear messages instead of unwrap() or unwrap_err()

  • Prefer assert_eq! with custom messages over bare assertions when comparing values

  • When testing errors, assert on specific error types or message contents, not just that an error occurred

  • Balance assertions to verify functionality without creating brittle tests

Test Organization

  • Group related tests into appropriate modules
  • Use helper functions to avoid code duplication in tests
  • Consider using parameterized tests for testing similar functionality with different inputs
Show full SKILL.md (371 more words)Show less

Test Naming

A test name is a short label with the shape <subject>_<case>[_<variant>]:

  • <subject> is the operation, type or function under test. It does not repeat the name of the enclosing module, because the test path already carries that.
  • <case> is what distinguishes this test from its siblings under the same subject: an operand shape, an input class, a code path, or an active verb and its object where the behaviour is the distinguishing part (load_redacts_mistyped_values). An active verb is not narration; should, works and correctly are.
  • <variant> narrows the case further when two tests share one, and is otherwise absent.

Tests of one subject share a prefix, so a module's test list reads as a table of subject × case and cargo nextest run -E 'test(<subject>_)' selects the family. The name identifies the case and the assertions establish its result. A comment adds setup, reasoning or a contract that those do not explain. A self-explanatory test needs no comment.

What a name never carries:

  • A test_ prefix, an article, a narration verb (should, works, correctly) or a when/with/that clause. Put necessary explanation in a comment or assertion message rather than in the name.
  • More than about six words. Three to five is the norm, and a longer name is a test doing too much, where the fix is one test per case.
  • The rejection, for a negative case. The name is the input class (ice_invalid_subscript_type, rank_positions_short, rows_out_of_domain), with no err_ prefix or _err suffix. An outcome word is the final token only when the case alone is ambiguous (eq_same_type_accepted).

Where the shape meets a test framework:

  • A property test, or an rstest case set, takes its name from the property it tests (lattice_laws, solve_anti_symmetry, condensation_is_dag).
  • Renaming a snapshot test renames the snapshot files derived from its name in the same change.
rust
// Before: a sentence, three cases in one test, the outcome in the name.
async fn rank_pair_tampers_name_their_own_variants() { /* … */ }
async fn short_node_identity_table_refuses() { /* … */ }

// After: one label per case, the outcome in the doc comment.
/// Open refuses a reverse rank permutation short of the code column, under `Columns`.
async fn rank_positions_short() { /* … */ }
/// Open refuses a reverse rank permutation that is no permutation, under `RankInverse`.
async fn rank_positions_constant() { /* … */ }
/// Open refuses a node identity table short of the code column, under `Identities`.
async fn node_identities_short() { /* … */ }

Test Code Quality

  • Follow the same code quality standards in test code as in production code
  • Add appropriate assertions for array/slice access to avoid clippy warnings
  • Add comments for non-obvious setup, reasoning or contracts that the test's name and body leave unclear. Self-explanatory tests may omit comments.
  • Consider adding custom test utilities to simplify common testing patterns
  • Use the json! macro from serde_json instead of constructing JSON as raw strings
rust
// Bad:
let json_str = "{\"name\":\"value\",\"nested\":{\"key\":42}}";

// Good:
use serde_json::json;
let json_value = json!({
    "name": "value",
    "nested": {
        "key": 42
    }
});

© hashintel, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/rust-testing-strategy of hashintel/hash.

Open the folder on GitHubat commit e189ab2

Compare with similar skills

Rust Testing Strategy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rust Testing Strategy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Testing Strategy this skillhashintel/hash1.7k—~1.7kAutomated safety check: PassAGPL-3.0
Testing OpenLogi UIAprilNEA/OpenLogi23k—~1.1kAutomated safety check: PassApache-2.0
OpenLogi Change VerificationAprilNEA/OpenLogi23k—~1.4kAutomated safety check: PassApache-2.0
Warp Rust Unit Testswarpdotdev/warp65k1 repos~3.4kAutomated safety check: PassAGPL-3.0
Rust Testingkurealnum/dotfiles2906 repos~2.9kAutomated safety check: PassNone
Mutation Testing Triagetrailofbits/skills7.4k—~3.2kAutomated safety check: PassCC-BY-SA-4.0

Similar skills

  • Testing OpenLogi UI

    AprilNEA/OpenLogi

    Verifies OpenLogi's native GPUI interface with focused tests, the component gallery and a mock agent, choosing the evidence that fits each change.

    23k GitHub stars~1.1k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Plans the smallest check that could disprove a code change in the OpenLogi project, then escalates through reproduction, focused tests and a final gate before a push.

    23k GitHub stars~1.4k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Warp Rust Unit Tests

    warpdotdev/warp

    Guides writing, improving and running crate-level Rust unit tests in the Warp codebase, and says when a unit test is the wrong level.

    65k GitHub starsUsed in 1 repo~3.4k tokens
    Testing & QAAuto-check passed
  • Rust Testing

    kurealnum/dotfiles

    Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage.

    290 GitHub starsUsed in 6 repos~2.9k tokens
    Testing & QAAuto-check passed
  • Mutation Testing Triage

    trailofbits/skills

    Official

    Triages survived mutants and unnecessary test statements using Trailmark call-graph data, sorting them into false positives, missing unit tests and fuzzing targets.

    7.4k GitHub stars~3.2k tokensUpdated 5 days ago
    Testing & QAAuto-check passed
  • Testing Strategies

    ancoleman/ai-design-components

    Strategic guidance for choosing and implementing testing approaches across the test pyramid.

    526 GitHub stars~3.8k tokensUpdated 10 mo ago
    Testing & QAAuto-check passed

More from hashintel/hash

All 17 skills in this repo
  • Documenting Rust Code

    hashintel/hash

    Rust documentation practices for HASH codebase. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Handling Rust Errors

    hashintel/hash

    HASH error handling patterns using error-stack crate. An agent skill from hashintel/hash.

    1.7k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Cargo.toml dependency management patterns for HASH workspace.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Testing Hashql

    hashintel/hash

    HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

    1.7k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • HashQL diagnostic writing patterns using hashql-diagnostics crate.

    1.7k GitHub stars~724 tokensUpdated today
    Auto-check passed
  • Writing Hashql Jexpr

    hashintel/hash

    HashQL J-Expr syntax for writing queries. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Rust Testing Strategy

What does Rust Testing Strategy do?

HASH Rust testing strategy. An agent skill from hashintel/hash. Rust Testing Strategy is an agent skill from hashintel/hash. HASH Rust testing strategy.

When should I use Rust Testing Strategy?

Rust Testing Strategy fits situations like: writing Rust unit; choosing assertion and test-organization patterns.

How do I install Rust Testing Strategy in Claude Code?

Run `npx skills add hashintel/hash --skill rust-testing-strategy -a claude-code`. Or copy the skill folder (.agents/skills/rust-testing-strategy in hashintel/hash) into .claude/skills/rust-testing-strategy in your project. Claude Code loads it when a task matches its description.

How do I install Rust Testing Strategy in Codex?

Run `npx skills add hashintel/hash --skill rust-testing-strategy -a codex`. Or copy the skill folder (.agents/skills/rust-testing-strategy in hashintel/hash) into .agents/skills/rust-testing-strategy in your project. Codex loads it when a task matches its description.

Can I use Rust Testing Strategy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hashintel/hash --skill rust-testing-strategy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-testing-strategy, .gemini/skills/rust-testing-strategy, .github/skills/rust-testing-strategy and .opencode/skills/rust-testing-strategy in your project.

What does Rust Testing Strategy need to run?

Going by SKILL.md and its folder, Rust Testing Strategy needs the command-line tools its instructions call (cargo).

Does Rust Testing Strategy access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rust Testing Strategy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Rust Testing Strategy use?

Rust Testing Strategy is published under the AGPL-3.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Testing Strategy use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Rust Testing Strategy?

Skills that share tags, products or a category with Rust Testing Strategy: Testing OpenLogi UI (AprilNEA/OpenLogi, 23k stars), OpenLogi Change Verification (AprilNEA/OpenLogi, 23k stars), Warp Rust Unit Tests (warpdotdev/warp, 65k stars) and Rust Testing (kurealnum/dotfiles, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Testing Strategy?

hashintel (a GitHub organization) maintains it in hashintel/hash, which has 1,668 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: hashintel/hash on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.