DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to fix a bug with a failing test before the fix with Skills

Diagnose a bug in phases, then drive a red-green-refactor loop to fix it.

Short answer: Install the plugin in Claude Code with claude plugin install mattpocock-skills@claude-plugins-official; then describe the failing behavior and run /diagnosing-bugs, working through each gated phase; run /tdd to write a failing test for the bug first. All steps.

Who it is forA developer whose agent keeps producing code that does not work and who needs a disciplined debugging loop.

The problemWithout feedback on how code actually runs, the agent guesses, and fixes often miss the real cause.

The outcomeA written reproduction, a test that fails before the fix and passes after, and a refactored fix.

What you need first

  • A coding agent that supports the plugin or skills install route, such as Claude Code or Codex
  • A project repository the agent can read and edit
  • Optional: an issue tracker such as GitHub or GitLab, or a local folder for tickets

Steps

  1. Install the plugin in Claude Code with claude plugin install mattpocock-skills@claude-plugins-official.
  2. Describe the failing behavior and run /diagnosing-bugs, working through each gated phase.
  3. Run /tdd to write a failing test for the bug first.
  4. Make the test pass, then refactor while keeping it green.

Prompt for your agent

In the mattpocock/skills repo, use diagnosing-bugs on this failure: <bug description>, then use tdd to write a failing test before any fix. Expected output: a root-cause note and a red test that turns green after the fix. Verify that the test fails on the unfixed code before you accept the change.

Caveat. The red-green-refactor loop assumes your project already has a test setup the agent can run.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for mattpocock/skills and "Fix a bug with a failing test before the fix"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer