rust-tdd

Enforces failing-before-passing, red-green-refactor workflows for Rust projects.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/hwatkins/my-skills --skill rust-tdd-hwatkins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-tdd
Source: https://github.com/hwatkins/my-skills/tree/main/skills/rust-tdd
Command: npx skills add https://github.com/hwatkins/my-skills --skill rust-tdd-hwatkins

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust projects often suffer from insufficient test-driven development adoption, leading to delayed feedback and fragile code. This skill enforces test-driven development by requiring a failing test before implementation, ensuring code changes are driven by tests.

Core Features & Use Cases

  • Enforces the red-green-refactor workflow for Rust codebases.
  • Guides organization of unit tests and integration tests, with guardrails for test coverage and maintainability.
  • Applies to feature work, bug fixes, and quality improvements in Rust ecosystems (cargo projects, crates, libraries).

Quick Start

Write a failing test before implementing a new Rust feature and progressively refactor while keeping tests green.

Frequently Asked Questions about rust-tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce test-driven development in a Rust project?

You can enforce test-driven development in Rust by writing a failing test before implementing new code. This approach uses the red-green-refactor workflow to ensure code changes are driven by tests across features, bug fixes, and quality improvements.

What is the best way to organize unit and integration tests in a cargo workspace?

The best way to organize unit and integration tests in a cargo workspace is following test organization patterns with guardrails for coverage and maintainability. This ensures tests drive design while keeping the Rust ecosystem structured.

How does the red-green-refactor workflow apply to Rust bug fixes?

The red-green-refactor workflow applies to Rust bug fixes by requiring a failing test that reproduces the bug first. You then implement the fix to make the test green and progressively refactor while keeping tests passing.

Can I use this TDD approach for both library crates and binary projects in Rust?

Yes, you can use this TDD approach for library crates, binary projects, and broader cargo workspaces. It applies across feature work and quality improvements, ensuring tests drive design and maintainability throughout the Rust ecosystem.

Why should I write a failing test before implementing a new Rust feature?

You should write a failing test before implementing a new Rust feature to enforce fail-fast feedback and prevent fragile code. This test-driven development practice ensures delayed feedback is minimized and code changes are explicitly validated.

Does this Rust TDD workflow require any external testing frameworks or dependencies?

No, this Rust TDD workflow does not require external testing frameworks or dependencies. It leverages standard Rust testing practices and cargo's built-in test organization patterns for unit and integration tests.