tdd-bug-fix

Enforce Test-Driven Bug Fix workflow with failing tests before production changes.

14|8|Updated Aug 9, 2011
One-click install
npx skills add https://github.com/kurko/dotfiles --skill tdd-bug-fix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-bug-fix
Source: https://github.com/kurko/dotfiles/tree/main/ai/skills/tdd-bug-fix
Command: npx skills add https://github.com/kurko/dotfiles --skill tdd-bug-fix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When you fix bugs, production changes should be accompanied by tests. This Skill enforces Kent Beck's TDD discipline: write a failing test first, verify it red, implement the fix, and verify green, ensuring no production change happens without a corresponding test.

Core Features & Use Cases

  • TDD workflow: Reproduce the bug with a failing test, confirm red, then fix and confirm green.
  • Test-driven mindset: Ensure any bug fix is backed by tests and aligned with project testing standards.
  • Guided workflow: Walks through the steps from test creation to verification, including where to place tests and how to run them.

Quick Start

Tell me a bug to fix and I will first write a failing test reproducing it, then implement the fix and run the tests to confirm the bug is resolved.

Frequently Asked Questions about tdd-bug-fix

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

FAQPage Schema
How do I fix bugs using test-driven development?

Test-driven bug fixing means writing a failing test first that reproduces the bug, verifying it fails (red), then implementing the minimal production fix and verifying the test passes (green). This ensures every bug fix has regression protection and follows Kent Beck's Red-Green-Refactor workflow.

Why should I write a test before fixing a bug?

Writing a test first captures the bug's exact behavior, confirms you've reproduced it, and creates a checkpoint to verify your fix works. Tests written before the fix prevent the same bug from reoccurring and document expected behavior for future maintainers.

Where should I place test files when fixing bugs with TDD?

Place tests in your project's standard test directory—commonly spec/, test/, or __tests__/—following your framework and language conventions. This ensures tests are discovered by your test runner and aligned with your project's testing standards.

Can I use TDD bug fixes with RSpec and other test frameworks?

Yes, TDD bug-fix practice works across common languages and test frameworks including RSpec, Jest, pytest, and others. The Red-Green-Refactor workflow applies regardless of framework; the core discipline is writing a failing test, then minimal production code.

What's the difference between TDD bug fixes and regular debugging?

Regular debugging finds and fixes issues ad-hoc; TDD bug fixes enforce a disciplined workflow: failing test first, then fix, then verification. This approach produces regression tests automatically and prevents production changes without accompanying test coverage.

How do I know when my bug fix is complete with TDD?

Your bug fix is complete when the previously failing test now passes (green) and your implementation uses only the minimal code changes needed to make that test pass. Then refactor if needed, ensuring all tests remain green throughout.