A TDD-based workflow for fixing bugs and implementing features, mandating that a failing test is written before code changes.

Install

mkdir -p .claude/skills/fix-jvm-skills && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11872" && unzip -o skill.zip -d .claude/skills/fix-jvm-skills && rm skill.zip

Installs to .claude/skills/fix-jvm-skills

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Fix a bug or missing feature using TDD — write failing test first, then fix, refactor, verify, beautify. Use when a bug is discovered or a feature doesn't work as expected.
172 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Understand and classify bugs or missing features
  • Write failing tests to reproduce issues
  • Implement minimum code to make tests pass
  • Refactor code for quality and efficiency
  • Verify fixes through screenshots or browser automation

How it works

The skill guides the user through a Test-Driven Development (TDD) process, starting with writing a failing test, then implementing the fix, refactoring, and verifying the changes.

Inputs & outputs

You give it
Description of a bug or missing behavior
You get back
Fixed code with passing tests and verified behavior

When to use fix

  • Fix a known bug
  • Implement a missing feature
  • Add test coverage for broken paths
  • Refactor code with TDD verification

About this skill

Fix with TDD

Fix a bug or missing feature by writing a failing test first, then making it pass.

Process

1. Understand

Describe the bug or missing behavior. Explore the codebase to find the relevant code paths.

  • If UI-related: screenshot the current broken state (if browser automation is available)
  • Find the relevant service, controller, and template/view files
  • Check if there's an existing test class for this area

2. Classify — pick test approach

ScenarioTest approach
Service/repository logic, DB queriesIntegration tests with real DB
File uploads, external storageIntegration tests with mocks/stubs
Browser-visible UI, full user flowsEnd-to-end browser tests

3. Red — write a failing test

MANDATORY GATE — do NOT write any fix code until this step is complete.

Write a test that reproduces the bug or asserts the missing behavior. Add to an existing test class if one covers this area, otherwise create a new one.

Run /test *FilterPattern and paste the failure output to confirm the test fails for the right reason.

<rules> - If you cannot write a test, you MUST use AskUserQuestion to explain why and get explicit approval before skipping. Do not rationalize the skip yourself. - "It's just a template change" is NOT a valid reason to skip — template bugs often have testable service/controller behavior behind them. - The test name should describe the expected behavior, not the bug (e.g. `Should transition to REVEAL when voting ends` not `Fix end button`) - If the fix requires a DB migration, do that first: migration → run codegen → then write test </rules>

4. Green — make the test pass

Write the minimum code to make the test pass.

  1. Compile the code
  2. Run the test — paste the green output to confirm pass

5. Refactor

Run /simplify to review changed code for reuse, quality, and efficiency. Then clean up anything remaining: remove duplication, extract methods if needed, ensure naming is consistent with surrounding code.

Run the test again — confirm still green after refactoring.

6. Verify

  • UI fixes: /restart-spring-boot → verify the fix (screenshot or browser automation) → compare with the broken state from step 1
  • Backend fixes: test output is sufficient proof

7. Beautify (UI fixes only)

If the fix introduced new UI elements:

design skill → refine → verify the UI

8. Commit

/commit

When not to use it

  • When a failing test cannot be written
  • When the fix does not require TDD principles
  • When the user wants to skip the mandatory failing test step

Limitations

  • A failing test must be written before any fix code.
  • Skipping the test writing step requires explicit user approval.
  • UI fixes require manual verification via screenshot or browser automation.

How it compares

This skill enforces a TDD workflow, ensuring that a failing test is written before any fix, which provides a verifiable and structured approach to bug fixing compared to direct code changes.

Compared to similar skills

fix side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
fix (this skill)04moNo flagsIntermediate
reproduce-reduce-regress17moNo flagsIntermediate
fix-file025dNo flagsIntermediate
python-testing-patterns772moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry