Claude Skill

rust-testing

How to write Skill Doctor tests — unit, integration, CLI, fixtures, determinism, additive-only. Use when adding tests, fixtures, snapshots, or changing cargo test layout.

LLM Mart · 0 points · 7 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download kalarislabs-skill-doctor-skills_rust-testing-72aa35f.zip · 0 KB
Part of kalarislabs/skill-doctor — 15 skills

Install

skills CLI npx skills add https://github.com/KalarisLabs/Skill-Doctor/tree/main/skills/rust-testing
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kalarislabs-skill-doctor@llmmart
Git git clone https://github.com/KalarisLabs/Skill-Doctor.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole kalarislabs/skill-doctor collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Testing

Canonical policy: TESTING.md. Do not invent a second harness.

Placement

Kind Where
Unit #[cfg(test)] next to the code
Integration crates/<name>/tests/
CLI / exit codes tests/cli/ against the compiled binary
Fixtures tests/fixtures/{benign,attack,hard_negative,evasion}/
Real malware tests/fixtures/real_malware/, #[ignore], REAL_MALWARE=1

Detector PR checklist (all four)

  1. Engine or YARA rule
  2. Positive fixture (must fire)
  3. Hard-negative (must not fire)
  4. Test asserting both

Always-on property tests

  • Determinism: two scans, equal SHA-256 of JSON.
  • Additive-only: L1 CRITICAL + L2 "benign" → CRITICAL remains.
  • Offline: --offline makes zero network syscalls (at least: no reqwest constructed).
  • Malformed skill: does not panic.

Forbidden

  • Network in unit tests.
  • thread::sleep for sandbox.
  • Snapshots with timestamps or absolute paths.
  • Live secrets. Use canaries like AKIA_TEST_CANARY.
  • Speed assertions in the every-commit suite (see rust-perf).
Files (skill-doctor)
  • SKILL.md 1.3 KB
    ---
    name: rust-testing
    description: How to write Skill Doctor tests — unit, integration, CLI, fixtures, determinism, additive-only. Use when adding tests, fixtures, snapshots, or changing cargo test layout.
    ---
    
    # Testing
    
    Canonical policy: `TESTING.md`. Do not invent a second harness.
    
    ## Placement
    
    | Kind | Where |
    |------|--------|
    | Unit | `#[cfg(test)]` next to the code |
    | Integration | `crates/<name>/tests/` |
    | CLI / exit codes | `tests/cli/` against the compiled binary |
    | Fixtures | `tests/fixtures/{benign,attack,hard_negative,evasion}/` |
    | Real malware | `tests/fixtures/real_malware/`, `#[ignore]`, `REAL_MALWARE=1` |
    
    ## Detector PR checklist (all four)
    
    1. Engine or YARA rule  
    2. Positive fixture (must fire)  
    3. Hard-negative (must not fire)  
    4. Test asserting both
    
    ## Always-on property tests
    
    - **Determinism:** two scans, equal SHA-256 of JSON.
    - **Additive-only:** L1 CRITICAL + L2 "benign" → CRITICAL remains.
    - **Offline:** `--offline` makes zero network syscalls (at least: no `reqwest` constructed).
    - **Malformed skill:** does not panic.
    
    ## Forbidden
    
    - Network in unit tests.
    - `thread::sleep` for sandbox.
    - Snapshots with timestamps or absolute paths.
    - Live secrets. Use canaries like `AKIA_TEST_CANARY`.
    - Speed assertions in the every-commit suite (see `rust-perf`).
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related