Tdd Workflow
Tdd Workflow guides developers through test-first development using the red-green-refactor pattern: write failing tests, implement minimal code to pass, then refactor while maintaining test coverage. It covers unit and integration testing strategies for both Rust and TypeScript, with practical examples including validation logic, mocking external dependencies, and coverage verification tools. All new features and fixes must meet an 80% test coverage threshold.
Tdd Workflow implements test-driven development using the red-green-refactor cycle with 80% minimum test coverage requirements.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-01-30
Tdd Workflow implements test-driven development using the red-green-refactor cycle with 80% minimum test coverage requirements. Tdd Workflow guides developers through test-first development using the red-green-refactor pattern: write failing tests, implement minimal code to pass, then refactor while maintaining test coverage. It covers unit and integration testing strategies for both Rust and TypeScript, with practical examples including validation logic, mocking external dependencies, and coverage verification tools. All new features and fixes must meet an 80% test coverage threshold.
Use it when
- Tdd Workflow guides you to write unit and integration tests before implementation code.
- Tdd Workflow enforces an 80% minimum code coverage threshold for all new features and fixes.
Verify before relying
Read SKILL.md below before installing (2 files). Open directory: indexed for reading, not audited.
Install
cacr92/WeReply/tdd-workflow · repository language: Python
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 TDD red green refactor cycle?
Tdd Workflow implements the red-green-refactor cycle as a three-phase process: first, write a failing test (red phase); second, write minimal code to make it pass (green phase); third, refactor the code while keeping tests passing (refactor phase). This cycle ensures tests drive design decisions and maintains code quality throughout development.
How do I write tests first in Tdd Workflow?
Tdd Workflow guides you to write unit and integration tests before implementation code. Start by defining test cases that describe expected behavior, then write minimal code to satisfy those tests. This test-first approach clarifies requirements upfront and prevents over-engineering, making your codebase more maintainable and bug-resistant.
How can Tdd Workflow help achieve 80% code coverage?
Tdd Workflow enforces an 80% minimum code coverage threshold for all new features and fixes. By writing tests first and using coverage verification tools, you systematically identify untested code paths. The workflow includes guidance on coverage measurement and strategies to reach and maintain this benchmark across your Rust and TypeScript projects.
How does Tdd Workflow handle mocking external dependencies?
Tdd Workflow provides practical strategies for mocking databases, APIs, and other external services to ensure test isolation. By replacing real dependencies with controlled mocks during testing, you keep tests fast, independent, and focused on your code's behavior rather than external system reliability.
What common testing pitfalls does Tdd Workflow help avoid?
Tdd Workflow addresses key pitfalls including testing implementation details instead of behavior, writing slow or interdependent tests, inadequate edge case coverage, and mishandling async operations. It emphasizes descriptive test names, proper test isolation, and validation of actual user-facing behavior to ensure test quality and maintainability.
Can Tdd Workflow be applied to bug fixes and refactoring?
Yes. Tdd Workflow extends the red-green-refactor pattern to bug fixes by first writing a test that reproduces the bug (red), then fixing the code (green), then refactoring safely. For refactoring, existing tests serve as a safety net, ensuring changes don't break functionality while you improve code structure and clarity.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
TDD 工作流 Skill
核心原则
强制要求:所有新功能、Bug 修复、重构必须达到 80% 以上测试覆盖率。
RED-GREEN-REFACTOR 循环
1. RED(写测试,测试失败)
先写测试,验证测试会失败(因为功能尚未实现)。
2. GREEN(实现代码,测试通过)
编写最小代码使测试通过。
3. REFACTOR(重构代码,保持测试通过)
优化代码,保持所有测试通过。
工作流程
步骤 1:编写用户故事
描述期望的行为:
作为用户,我希望能够创建新的饲料配方,
以便我可以保存和管理不同的配方方案。
验收标准:
- 配方名称必填,长度 2-50 个字符
- 品种代码必填,必须是有效的品种
- 创建成功后返回配方 ID
- 创建失败时显示错误消息
步骤 2:生成测试用例
覆盖正常路径和边界情况:
Rust 测试用例:
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn test_create_formula_success() {
// 正常创建配方
}
#[tokio::test]
async fn test_create_formula_empty_name() {
// 配方名称为空
}
#[tokio::test]
async fn test_create_formula_name_too_long() {
// 配方名称过长
}
#[tokio::test]
async fn test_create_formula_invalid_species() {
// 品种代码无效
}
#[tokio::test]
async fn test_create_formula_database_error() {
// 数据库连接失败
}
}
TypeScript 测试用例: ```typescript describe('FormulaForm', () => { it('should create formula successfully', async () => { // 正常创建 });
it('should show error when name is empty', async () => { // 名称为空 });
(truncated - see the full file via the links below)
File tree — 2 files
.claude/skills/tdd-workflow/SKILL.md
.claude/skills/tdd-workflow/skill.json
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 test-driven development workflow with red-green-refactor cycle”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
This skill offers structured refactoring strategies to enhance code quality and maintainability. It covers method extraction, eliminating duplication, reducing complexity, improving naming, and addressing technical debt—all while keeping behavior intact. Learn to apply guard clauses, replace magic numbers with constants, and break down large functions into focused, testable pieces.
Testing Strategy provides comprehensive testing patterns for Tauri applications spanning Rust backend and React frontend. It covers unit and integration tests, test fixtures, command mocking, and test coverage strategies to support quality assurance and TDD workflows.
api-design guides you through building robust command interfaces for Tauri applications using type-safe data structures and proven patterns. It covers DTO design, validation at API boundaries, error handling strategies, and documentation practices to ensure your backend contracts are clear and maintainable.
Master error handling across Rust and TypeScript in Tauri applications. Learn custom error types, exception chains, API response patterns, and debugging techniques using tracing and structured logging. Covers database errors, command failures, and React error boundaries.
Master React 19 and TypeScript 5 component development with production-ready patterns for Ant Design, TanStack Query state management, and Tauri desktop apps. Learn Hooks best practices, form validation, performance optimization with React.memo and useCallback, and type-safe command integration without sacrificing developer experience.
ipc-communication provides expert guidance for setting up inter-process messaging between a Rust Orchestrator and Platform Agents using line-delimited JSON over stdin/stdout. It covers message type definitions, bidirectional command and response patterns, and includes production-ready Rust process management and Python agent implementations with timeout handling and error recovery.
More skills Error Handler (NOASSERTION) · Test Driven Development (unlicensed) · deepseek-integration (MIT) · rtk-tdd (Apache-2.0)