rsun-tdd

Enforces vertical-slice tracer-bullet TDD with one RED-GREEN-commit cycle per behavior slice.

Updated May 20, 2026
One-click install
npx skills add https://github.com/EZoneLai/claude-plugin-ronsunai-os --skill rsun-tdd-ezonelai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rsun-tdd
Source: https://github.com/EZoneLai/claude-plugin-ronsunai-os/tree/main/commands/rsun-tdd
Command: npx skills add https://github.com/EZoneLai/claude-plugin-ronsunai-os --skill rsun-tdd-ezonelai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Horizontal slicing (writing all tests first, then all implementations) produces tests that describe imagined behavior, mega-commits reviewers cannot read, and expensive rework. This Skill forces a disciplined vertical-slice TDD workflow so every commit is working software backed by a real test. ## Core Features & Use Cases - Vertical Slice Enforcement: Mandates one failing test, one minimal implementation, and one commit per slice, with each diff kept under roughly 50 lines. - RED-GREEN Verification: Requires actually running pytest or vitest to confirm the test fails before implementation and passes after, preventing vacuous tests. - Commit Discipline: Standardizes commit messages containing "TDD RED → GREEN" plus a one-line description and next-slice note. - Mocking Rules: Permits mocking only external dependencies (APIs, DB, time, randomness) via factory functions, forbidding mocks of internal collaborators. - Use Case: When building a booking API endpoint, write one integration test for POST returning 201 with an id, implement the minimal handler, commit, then add persistence, validation, and email slices in subsequent cycles. ## Quick Start Ask the AI to run the rsun-tdd skill before writing any production code, starting with one failing test for the smallest user-facing behavior.

Frequently Asked Questions about rsun-tdd

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

FAQPage Schema
How do I practice TDD with vertical slices instead of horizontal slicing?

Write one failing test for the smallest user-facing behavior, implement the minimal code to pass it, commit, then repeat for the next slice. Never batch multiple tests before implementations, since that produces tests describing imagined rather than real behavior.

What is the tracer bullet approach in test-driven development?

Tracer bullet TDD builds a thin end-to-end slice through the real code path first, such as an API endpoint returning a hardcoded id, then thickens it slice by slice with persistence, validation, and side effects. Each slice is a working, committable increment.

When should I mock dependencies in unit tests?

Mock only external dependencies like third-party APIs, databases, time, and randomness, using factory functions that return default objects with overridable fields. Never mock internal collaborators, since that tests implementation details and breaks on harmless refactors.

Does this TDD workflow work with both pytest and vitest?

Yes, the same RED-GREEN-commit discipline applies to Python pytest and TypeScript vitest. The skill includes examples for both, covering integration-style tests through public interfaces like HTTP endpoints.

When is TDD not required for a code change?

Skip the TDD cycle for pure documentation or comment updates, configuration value changes, and static HTML content edits. Any production code, deliverable code, cron agent change, or new MCP tool must start with a failing test.

Why do my tests break after refactoring without behavior changes?

Tests that fail during behavior-preserving refactors are testing implementation details rather than public behavior. Rewrite them to exercise the public interface through real code paths instead of asserting on private methods or mocked internals.