$npx skillfedfor your agent

tdd-rust

tdd-rust guides you through test-driven filter implementation for RTK using the Red-Green-Refactor cycle. Start with real command output fixtures, write failing tests that verify both output format and ≥60% token reduction, then implement the minimum code to pass. Lock output format with snapshot tests and integrate into your CLI.

tdd-rust enforces Red-Green-Refactor discipline for RTK filter development with real fixtures and token-savings verification.

AI-generated summary based on this skill's SKILL.md

73,568 4,597 Apache-2.0updated by rtk-ai

Decision gist · record as of 2026-07-27

tdd-rust enforces Red-Green-Refactor discipline for RTK filter development with real fixtures and token-savings verification. tdd-rust guides you through test-driven filter implementation for RTK using the Red-Green-Refactor cycle. Start with real command output fixtures, write failing tests that verify both output format and ≥60% token reduction, then implement the minimum code to pass. Lock output format with snapshot tests and integrate into your CLI.

manual: git clone https://github.com/rtk-ai/rtk → cp -r rtk/.claude/skills/tdd-rust ~/.claude/skills/tdd-rust
.claude/skills/tdd-rust/SKILL.md · version 9393da8b

Use it when

  • tdd-rust includes test patterns that measure token reduction in your filter output.
  • Yes.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

rtk-ai/rtk/tdd-rust · repository language: Rust

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is the red green refactor rust testing workflow in tdd-rust?

tdd-rust teaches the Red-Green-Refactor cycle for filter development. First, write a failing test (red) against real command output fixtures. Second, implement the minimum code to make it pass (green). Third, refactor while keeping tests green. This cycle enforces quality gates via cargo test, clippy, and fmt, ensuring your RTK filter implementation stays maintainable and correct.

How does tdd-rust verify token savings of ≥60% in filter implementations?

tdd-rust includes test patterns that measure token reduction in your filter output. Your tests compare the original command output size against the filtered result, asserting that the reduction meets or exceeds 60%. This verification runs automatically during cargo test, so token savings become a testable requirement rather than a manual check.

Can tdd-rust lock filter output format using snapshot testing with insta?

Yes. tdd-rust integrates insta snapshot testing to lock your filter's output format. Once you approve a snapshot, any unintended change to the filter output will cause the test to fail, preventing regressions. This pairs with real fixtures to ensure your RTK filter produces consistent, predictable results across runs.

What role do real fixtures play in tdd-rust filter development?

tdd-rust emphasizes real command output fixtures as your test foundation. Rather than mocking, you capture actual CLI output and use it as test input. This grounds your tests in reality, ensures your filter handles genuine edge cases, and makes snapshot tests meaningful. Real fixtures also support fallback behavior testing and ANSI stripping validation.

How does tdd-rust enforce quality gates in the test workflow?

tdd-rust integrates cargo test, cargo clippy, and cargo fmt into your development loop. These tools enforce code quality and consistency automatically. Combined with the Red-Green-Refactor discipline, quality gates prevent low-quality code from entering your filter implementation, keeping your RTK filter robust and maintainable.

Does tdd-rust cover edge case and fallback behavior testing for Rust filters?

Yes. tdd-rust includes patterns for testing edge cases and fallback behavior in your RTK filters. Examples include ANSI stripping edge cases, missing fields, and graceful degradation when filters encounter unexpected input. These tests ensure your filter remains reliable even when real-world data deviates from the happy path.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

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

(truncated - see the full file via the links below)

File tree — 1 file
.claude/skills/tdd-rust/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Implement RTK filters using test-driven development with real fixtures”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

Performance
by rtk-ai · rtk-ai/rtk

This skill provides systematic performance analysis for the RTK CLI tool, measuring startup time against a <10ms target, memory usage under 5MB, and token savings between 60–90%. It includes baseline capture, regression detection with flamegraph profiling, and common optimization techniques like LazyLock initialization and zero-copy string processing.

Apache-2.0for claude-codeupdated Jul 2026
★ 73,568repo stars
rtk-tdd
by rtk-ai · rtk-ai/rtk

rtk-tdd enforces the red-green-refactor cycle for Rust development, automatically guiding you through failing tests, minimal implementations, and refactoring phases. It provides Rust-idiomatic testing patterns using anyhow/thiserror, cfg(test) modules, and Arrange-Act-Assert workflows, with pre-commit gates ensuring code quality.

Apache-2.0for claude-codeupdated Jul 2026
★ 73,568repo stars
Rtk Optimizer
by FlorianBruniaux · FlorianBruniaux/claude-code-ultimate-guide

RTK Optimizer detects high-verbosity shell commands and suggests RTK wrappers to dramatically reduce token usage—achieving up to 92% savings on git log, 90% on cargo test and pytest, and similar gains across build tools and package managers. The skill automatically proposes optimizations when it spots commands like git diff, find, or test frameworks, then executes the wrapped version to preserve context window space.

CC-BY-SA-4.0updated Jul 2026
★ 5,576repo stars
Ship
by rtk-ai · rtk-ai/rtk

Ship orchestrates the full release cycle for RTK projects: quality verification, semantic versioning, changelog generation, git tagging, and remote push to activate CI/CD pipelines. Follow pre-release checklists, execute the multi-step workflow, and verify post-release artifacts automatically.

Apache-2.0for claude-codeupdated Jul 2026
★ 73,568repo stars
Rtk
by akillness · akillness/jeo-skills

Rtk helps you set up and troubleshoot Rust Token Killer, a CLI tool that rewrites shell commands into token-efficient versions for AI agents. Install via Homebrew, script, or Cargo, then initialize RTK for your specific agent—Claude Code, Codex, Gemini CLI, Cursor, Copilot, Windsurf, Cline, or OpenCode. Use direct `rtk` commands like `rtk git status` or `rtk read` when automatic hooks aren't available.

no license declared → metadata onlyupdated Jul 2026
★ 38repo stars
design-patterns
by rtk-ai · rtk-ai/rtk

This skill covers seven Rust design patterns applied to RTK's CLI filter architecture, from type-safe wrappers and configuration builders to stateful parsers and resource management. Each pattern includes practical examples showing when to use it, when to skip it, and how it fits RTK's single-threaded, zero-overhead design philosophy.

Apache-2.0for claude-codeupdated Jul 2026
★ 73,568repo stars

More skills add-rtk (MIT) · phx-mix-compression (MIT) · tdd (MIT) · Test Driven Development (unlicensed) · mix-compression (MIT)

Tags
fixture-driven-testingtoken-optimizationsnapshot-validationquality-gatestest-automationedge-case-coverageregression-preventioncode-cleanupintegration-testingerror-handling