1. Habit
  2. Skills
  3. RTK TDD skill
rtk-ai · 2K installs

RTK TDD skill
Runs by itself, Rust task starts.

Every Rust change starts red.

Install the RTK TDD skill and make it a habit: follow https://gethabit.dev/skills/rtk-ai/rtk-tdd.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

2K installs84K starsApache-2.0 licenceSource on GitHub ↗

RTK TDD

by rtk-ai · 2K installs

The skill

The rtk tdd skill enforces red-green-refactor test-driven development for Rust, with cfg(test) modules, Arrange-Act-Assert patterns and a fmt, clippy and test gate before commit.

Only when you ask.

The habit

Every Rust change starts red.

↻ Runs by itselfRust task starts

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after one task and 2 gate retries per run.

  1. 01

    Write the test

    Your agent adds a test in the #[cfg(test)] mod tests of the same file.

  2. 02

    Run red

    It runs cargo test on that test and confirms it fails.

  3. 03

    Go green

    It writes only enough code to pass and reruns the test.

  4. 04

    Refactor

    It cleans up and reruns cargo test.

  5. 05

    Run the gate

    It runs cargo fmt, cargo clippy --all-targets and cargo test.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the RTK TDD skill helps.

Use it when

  • ✓ You implement a Rust feature
  • ✓ You fix a Rust bug
  • ✓ You refactor Rust code

Skip it when

  • – The code is only CLI wiring
  • – The project is not Rust

Questions

RTK TDD skill, answered.

What if the test passes right away?

Then it tests nothing. The red step must fail first.

When is pure TDD not used?

For Command::new calls, process exit, direct I/O and CLI wiring, where it tests the pure logic instead.

How do I install the RTK TDD skill?

Copy the prompt at the top into your agent. It installs the skill from rtk-ai/rtk and sets up the habit. Or run npx skills add rtk-ai/rtk --skill rtk-tdd.

Is the RTK TDD skill free?

Yes. It is published under Apache-2.0. Habit is free too.

RTK TDD. Now as a habit.

Install the RTK TDD skill and make it a habit: follow https://gethabit.dev/skills/rtk-ai/rtk-tdd.md

  • Free
  • No account
  • Undo in one line

All rtk-ai skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by rtk-ai, published under Apache-2.0. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.