write-rust-tests — Claude Code skill: tests and setup
The write-rust-tests skill writes Rust tests for public APIs, edge cases, errors, and branches. Use it when a Rust crate needs targeted coverage.
no license ★ 6,244 updated 2026-10-29
npx skills add RediSearch/RediSearch --skill write-rust-tests -a claude-codeWhat write-rust-tests does
The skill creates tests for a Rust file, crate, or directory. It can work with several paths at once; a directory makes the skill consider the Rust files inside it. A path without src/ is resolved under src/redisearch_rs, so numeric_range_tree points to that module location.
Before adding a test, it checks which new branch or execution path the case would cover. Inputs that leave control flow unchanged are treated as duplicates, and simple Default or From delegations are skipped when the constructor already exercises them. Coverage gaps can be inspected with check-rust-coverage, while test structure follows rust-tests-guidelines.
A file, crate, or directory path is required so the skill knows which Rust code to examine.
What it helps with
- write tests for a Rust crate or file
- cover public APIs and edge cases
- exercise error branches
- inspect uncovered lines with
check-rust-coverage - remove tests that duplicate existing paths
Example prompts for the agent
- Use
write-rust-teststo add tests forsrc/redisearch_rs/numeric_range_tree. - Apply
write-rust-teststosrc/redisearch_rs/query.rsand cover its error cases and edge conditions. - Run
write-rust-testsonsrc/redisearch_rswithout adding tests for branches already covered.
How to install write-rust-tests
1Skills CLI (Vercel)
npx skills add RediSearch/RediSearch --skill write-rust-tests -a claude-code2Manually: put the files in place
~/.claude/skills/write-rust-tests/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/write-rust-tests/
1Skills CLI (Vercel)
npx skills add RediSearch/RediSearch --skill write-rust-tests -a codex2Manually: put the files in place
.agents/skills/write-rust-tests/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add RediSearch/RediSearch --skill write-rust-tests -a cursor2Manually: put the files in place
.cursor/skills/write-rust-tests/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install RediSearch/RediSearch .skills/write-rust-tests/SKILL.md2Manually: put the files in place
.github/skills/write-rust-tests/SKILL.md1Skills CLI (Vercel)
npx skills add RediSearch/RediSearch --skill write-rust-tests -a gemini-cli2Platform CLI
gemini skills install https://github.com/RediSearch/RediSearch --path .skills/write-rust-testsManually: put the files in place
.devin/skills/write-rust-tests/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add RediSearch/RediSearch --skill write-rust-tests -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about write-rust-tests
How do I install write-rust-tests in Claude Code?
Run npx skills add RediSearch/RediSearch --skill write-rust-tests -a claude-code. The installed skill file is then available at ~/.claude/skills/write-rust-tests/SKILL.md.
What does the write-rust-tests skill do?
It adds Rust tests for public APIs, edge cases, errors, and uncovered branches. It checks each proposed case against existing coverage to avoid duplicate scenarios.
Which paths can write-rust-tests handle?
It accepts a file, crate, directory, or several paths. Paths without src/ are resolved under src/redisearch_rs, and a directory covers the Rust files it contains.