Skip to content

Bugfix workflow: Write regression test before implementing fix (test-first) #112

@jwm4

Description

@jwm4

Context

During testing of the skill invocation cleanup (PR #107), the review phase noted that the test skill's "test the test" requirement — "verify the test fails without your fix" — is impractical in speedrun mode because the fix is already applied. Reverting it mid-workflow risks losing work and creating git confusion.

A better approach: write the regression test before implementing the fix, as part of the fix phase. This way the test naturally fails (proving it catches the bug), then the fix makes it pass.

Proposal

Move regression test creation from the test skill to the fix skill:

  1. Fix skill Step 2.5 (new): Write a regression test that reproduces the bug. Verify it fails. This proves the test actually catches the problem.
  2. Fix skill Step 3: Implement the fix. The regression test should now pass.
  3. Test skill: Focus on running the full suite, adding edge case coverage, and integration testing. Remove or soften the "test the test" requirement since it was already satisfied during fix.

This is essentially test-driven bug fixing — write the failing test first, then make it pass.

Benefits

  • "Test the test" happens naturally instead of requiring an awkward revert
  • Works in both controller and speedrun modes
  • Aligns with TDD practices
  • The regression test serves as a concrete specification of what "fixed" means before any code is written

Scope

  • workflows/bugfix/.claude/skills/fix/SKILL.md — add regression test step
  • workflows/bugfix/.claude/skills/test/SKILL.md — adjust "test the test" guidance
  • workflows/bugfix/.claude/skills/speedrun/SKILL.md — no changes needed (phase order unchanged)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions