rtk-tdd

Enforce the TDD Red-Green-Refactor cycle for Rust development.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/martinstannard/rtkex --skill rtk-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rtk-tdd
Source: https://github.com/martinstannard/rtkex/tree/main/.claude/skills/rtk-tdd
Command: npx skills add https://github.com/martinstannard/rtkex --skill rtk-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces the Test-Driven Development (TDD) methodology for Rust projects, ensuring code quality and maintainability through a strict Red-Green-Refactor cycle.

Core Features & Use Cases

  • TDD Enforcement: Guides developers through the Red-Green-Refactor steps for writing tests before implementation.
  • Idiomatic Rust Testing: Promotes Rust-specific testing patterns like cfg(test), anyhow/thiserror, and Arrange-Act-Assert.
  • Use Case: When writing a new Rust function, this Skill ensures you first write a failing test, then the minimal code to pass, and finally refactor, all while adhering to best practices.

Quick Start

Follow the Red-Green-Refactor steps outlined in the skill to write a new Rust test and its corresponding implementation.

Frequently Asked Questions about rtk-tdd

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

FAQPage Schema
How do I enforce the Red-Green-Refactor TDD cycle for Rust development?

To enforce Test-Driven Development in Rust, this Skill guides you through writing a failing test first, implementing minimal code to pass it, and then refactoring. It ensures adherence to the Red-Green-Refactor cycle for maintainable code quality.

What are idiomatic Rust testing patterns for structuring TDD workflows?

Idiomatic Rust testing patterns include using cfg(test) for conditional compilation, leveraging anyhow and thiserror for error handling, and structuring tests with Arrange-Act-Assert workflows to ensure clear, isolated test validation.

How do I write a failing Rust test before implementing a new function?

Writing a failing Rust test before implementation requires defining expected behavior using the Arrange-Act-Assert pattern. This Skill enforces the TDD step of creating a failing test to validate requirements before writing the actual logic.

Can I use this TDD workflow with existing Rust refactoring tasks?

Yes, this TDD workflow supports Rust refactoring tasks by ensuring existing tests pass after code modifications. It enforces the Refactor step of the Red-Green-Refactor cycle to maintain code quality without changing external behavior.

When do I need cfg(test) and anyhow in Rust test-driven development?

You need cfg(test) to isolate test modules from production builds and anyhow or thiserror for idiomatic error management. This Skill integrates these Rust patterns to enforce structured Arrange-Act-Assert test workflows.

Why does TDD require failing tests before implementation in Rust?

TDD requires failing tests before implementation to confirm the test accurately validates new logic. This Skill enforces this TDD step in Rust, ensuring tests fail initially and pass after writing minimal code, guaranteeing correct coverage.