Development skill

Test-first bugs

Enforce a disciplined bug-fixing workflow that prevents regression and parallelizes fix attempts.

When to use

Core workflow

Phase 1

Reproduce and document

  1. Understand the bug - gather details about expected vs actual behavior
  2. Identify the test location - check for tests/, __tests__/, spec/, *.test.*, *.spec.* patterns
  3. Write a failing test that demonstrates the bug
Phase 2

Fix with subagents

  1. Launch fix subagents to attempt fixes in parallel
  2. Run the test to verify the fix
  3. Iterate if needed - launch additional subagents with new approaches
Phase 3

Verify and complete

  1. Run full test suite to ensure no regressions were introduced
  2. Report success with passing test as proof

What's included

Test naming conventions

Patterns for Python (pytest, unittest), JavaScript (Jest, Vitest), and TypeScript test names that describe the bug.

Test structure

Arrange-Act-Assert pattern for bug reproduction tests that fail initially and pass after the fix.

Parallel fix strategies

Direct fix agent, root cause agent, and edge case agent approaches for parallelized debugging.

Quick test setup

Commands for setting up minimal test frameworks when projects lack test infrastructure.

Test structure

Every bug reproduction test follows the Arrange-Act-Assert pattern:

def test_bug_description():
    # 1. ARRANGE - Set up the conditions that trigger the bug
    input_data = create_problematic_input()

    # 2. ACT - Perform the action that causes the bug
    result = function_under_test(input_data)

    # 3. ASSERT - Verify the expected (correct) behavior
    assert result == expected_value  # This should FAIL initially

Installation

# Clone the repository

git clone https://github.com/jamditis/claude-skills-journalism.git

# Copy the skill to your Claude config

cp -r claude-skills-journalism/test-first-bugs ~/.claude/skills/

Or download just this skill from the GitHub repository.

Related skills

A passing test proves the bug is fixed

Test-driven bug fixing, parallel subagents, and regression prevention in one skill.

View on GitHub