tdd-workflow
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
Security Assessment
About tdd-workflow
The tdd-workflow skill enforces a Test-Driven Development (TDD) approach to software development. This skill ensures that all new features, bug fixes, and refactorings are backed by tests with at least 80% coverage, encompassing unit, integration, and end-to-end (E2E) tests. The focus on writing tests before code guarantees that software is developed with comprehensive validation from the outset. By adhering to TDD principles, developers can ensure higher-quality code, better test coverage, and fewer bugs, leading to a more stable and maintainable codebase over time.
Key features of this skill include strict adherence to writing tests first, covering all edge cases, and testing all relevant scenarios, such as error handling and boundary conditions. The skill emphasizes the importance of creating checkpoint commits in Git after each TDD stage, allowing for clear tracking of development progress. It includes clear guidelines for writing user journeys, generating test cases, and running tests to confirm that they initially fail (RED state). Only after reaching the GREEN state, where tests pass, should code modifications be made. This workflow is ideal for developers working on new features, bug fixes, or code refactoring.
This skill is primarily aimed at software developers and teams adopting or improving their TDD practices. It is useful for those working in environments that require high-quality, bug-free code and those looking to improve their development workflows with a focus on automated testing and continuous integration.
FAQ
When should I activate the tdd-workflow skill?
You should activate this skill when writing new features, fixing bugs, refactoring code, adding API endpoints, or creating new components. It is designed to enforce TDD practices across these tasks.
What is the minimum test coverage required?
The skill enforces a minimum of 80% test coverage, including unit, integration, and E2E tests. It is important to ensure all edge cases, error scenarios, and boundary conditions are tested.
How does this skill integrate with version control?
If the repository is under Git, the skill recommends creating checkpoint commits after each stage of the TDD workflow. This ensures that each step (such as failing tests and minimal fixes) is properly tracked and not squashed until the workflow is complete.
What happens if my tests are not in the RED state?
If your tests do not fail (RED state), you should not modify the production code. Only after confirming the RED state, which indicates a valid failure due to business logic errors or missing implementation, can you proceed to the next stage.
Can I use this skill for non-JavaScript projects?
Yes, the tdd-workflow skill can be applied to any project using TDD principles. The examples provided are in JavaScript, but the core principles are language-agnostic and can be adapted for other languages.
Install tdd-workflow
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
affaan-m/everything-claude-code