tdd-rust

Featured

TDD workflow for RTK filter development. Red-Green-Refactor with Rust idioms. Real fixtures, token savings assertions, snapshot tests with insta. Auto-triggers on new filter implementation.

Testing & QA 57,145 stars 3516 forks Updated yesterday Apache-2.0

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# RTK TDD Workflow Enforce Red-Green-Refactor for all RTK filter development. ## The Loop ``` 1. RED — Write failing test with real fixture 2. GREEN — Implement minimum code to pass 3. REFACTOR — Clean up, verify still passing 4. SAVINGS — Verify ≥60% token reduction 5. SNAPSHOT — Lock output format with insta ``` ## Step 1: Real Fixture First Never write synthetic test data. Capture real command output: ```bash # Capture real output from the actual command git log -20 > tests/fixtures/git_log_raw.txt cargo test 2>&1 > tests/fixtures/cargo_test_raw.txt cargo clippy 2>&1 > tests/fixtures/cargo_clippy_raw.txt gh pr view 42 > tests/fixtures/gh_pr_view_raw.txt # For commands with ANSI codes — capture as-is script -q /dev/null cargo test 2>&1 > tests/fixtures/cargo_test_ansi_raw.txt ``` Fixture naming: `tests/fixtures/<command>_raw.txt` ## Step 2: Write the Test (Red) ```rust #[cfg(test)] mod tests { use super::*; use insta::assert_snapshot; fn count_tokens(s: &str) -> usize { s.split_whitespace().count() } // Test 1: Output format (snapshot) #[test] fn test_filter_output_format() { let input = include_str!("../tests/fixtures/mycmd_raw.txt"); let output = filter_mycmd(input).expect("filter should not fail"); assert_snapshot!(output); } // Test 2: Token savings ≥60% #[test] fn test_token_savings() { let input = include_str!("../tests/fixtures/mycmd_raw.txt"); let output = filt...

Details

Author
rtk-ai
Repository
rtk-ai/rtk
Created
4 months ago
Last Updated
yesterday
Language
Rust
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Featured

rtk-tdd

Enforces TDD (Red-Green-Refactor) for Rust development. Auto-triggers on implementation, testing, refactoring, and bug fixing tasks. Provides Rust-idiomatic testing patterns with anyhow/thiserror, cfg(test), and Arrange-Act-Assert workflow.

57,145 Updated yesterday
rtk-ai
Testing & QA Listed

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

2 Updated today
caovinhphuc
Testing & QA Solid

rust-testing

Rust测试模式,包括单元测试、集成测试、异步测试、基于属性的测试、模拟和覆盖率。遵循TDD方法学。

201,447 Updated yesterday
affaan-m
Testing & QA Listed

rust-testing

Rust测试模式,包括单元测试、集成测试、异步测试、基于属性的测试、模拟和覆盖率。遵循TDD方法学。

0 Updated 2 months ago
SakulaPor
Testing & QA Listed

tdd-patterns

Guide test-driven development through the mandatory Red-Green-Refactor cycle (failing test before code), enforce test quality (one behavior per test, real code over mocks, no implementation-detail testing), and enforce test runner discipline (run mode, no watch mode). Use when implementing features or fixing bugs (with `testing.tddMode='enforce'` blocking implementation without a failing test). This skill MUST be consulted because test-first is the primary quality enforcement point; tests that pass on first write are suspect (likely testing the wrong thing).

5 Updated 3 days ago
synaptiai