agentleFS
PatriotAgenticLLCPatriotAgenticLLC/better_claude_skillz/skills/implement-fix/SKILL.md

implement-fix

Skill3 starsChanged 4 months agoMITView on GitHub

Implement bug fix based on RCA

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 16 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the test to confirm it fails as expected:

    line 61
  2. Distinctive:

    Follow the fix strategy from the RCA:

    line 71
  3. Distinctive:

    Don't refactor unrelated code

    line 75
  4. Distinctive:

    Follow existing code patterns

    line 76
  5. Distinctive:

    Add comments explaining the fix if non-obvious

    line 77
  6. Distinctive:

    Update related code if needed

    line 84
  7. Distinctive:

    Run the specific test again:

    line 88
  8. Distinctive:

    All tests should pass.

    line 104
  9. Distinctive:

    Test the fix manually following original reproduction steps:

    line 108
  10. Distinctive:

    No new issues introduced

    line 117
  11. Distinctive:

    Update or create documentation:

    line 142
  12. Very specific:

    Create implementation report: .claude/code-reviews/YYYY-MM-DD-bug-fix-[issue].md

    line 185
  13. Distinctive:

    When ready to commit, use this format:

    line 251
  14. Distinctive:

    Always write the test BEFORE fixing the bug

    line 289
  15. Distinctive:

    Ensure full test suite passes (no regressions)

    line 292
  16. Distinctive:

    Update RCA with implementation details

    line 293
  17. Distinctive:

    Don't skip manual verification

    line 294

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Implement Fix: Bug Fix Implementation

Overview

Implement a bug fix based on the root cause analysis, following test-driven development principles.

Input

RCA file: $ARGUMENTS

Process

1. Read RCA Document

Thoroughly read the RCA to understand:

  • Root cause
  • Fix strategy
  • Impact assessment
  • Prevention measures

2. Write Failing Test (TDD)

Before fixing the bug, write a test that reproduces it:

# Create or update test file
# Run test to confirm it fails

Test should:

  • Reproduce the exact bug scenario
  • Fail with the current code
  • Pass once the fix is implemented

Example test structure:

def test_bug_issue_123():
    """Test for bug: [description]

    GitHub Issue: #123
    RCA: .claude/plans/rca-issue-123.md
    """
    # Arrange: Set up conditions that trigger bug
    [setup code]

    # Act: Execute the buggy code path
    result = [function_that_has_bug]()

    # Assert: Verify expected behavior (currently fails)
    assert result == expected_value

3. Verify Test Fails

Run the test to confirm it fails as expected:

[test command for project]

Output should show the test failing, confirming we've reproduced the bug.

4. Implement the Fix

Follow the fix strategy from the RCA:

Implementation guidelines:

  • Make minimal changes to fix the specific issue
  • Don't refactor unrelated code
  • Follow existing code patterns
  • Add comments explaining the fix if non-obvious
  • Consider edge cases

Code changes:

  • Update affected files
  • Add necessary validation
  • Improve error handling
  • Update related code if needed

5. Verify Test Passes

Run the specific test again:

[test command]

The previously failing test should now pass.

6. Run Full Test Suite

Ensure no regressions:

[full test suite command]

All tests should pass.

7. Manual Verification

Test the fix manually following original reproduction steps:

  1. [Step 1 from reproduction]
  2. [Step 2]
  3. [Step 3]

Verify:

  • Bug no longer occurs
  • Expected behavior works
  • No new issues introduced

8. Implement Prevention Measures

From the RCA, implement prevention steps:

  • Add additional test cases for edge cases
  • Update validation logic
  • Add documentation
  • Update error messages
  • Add logging if appropriate

9. Code Review

Perform self-review:

  • Fix addresses root cause (not just symptoms)
  • Code follows project conventions
  • Tests are comprehensive
  • No over-engineering
  • Comments explain "why" not "what"
  • Error handling is appropriate

10. Document the Fix

Update or create documentation:

In code:

# Fix for GitHub Issue #123: [brief description]
# Root cause: [one-line explanation]
# See: .claude/plans/rca-issue-123.md

Update RCA document with implementation notes:

## Implementation

**Date Implemented:** YYYY-MM-DD
**Files Changed:**
- `[file]` - [what was changed]

**Test Added:**
- `[test file]` - [test description]

**Verification:**
- Test passes
- Full suite passes
- Manual verification successful

Validation Checklist

Before committing:

  • Failing test created that reproduces bug
  • Test failed before fix
  • Fix implemented following RCA strategy
  • Test now passes
  • Full test suite passes (no regressions)
  • Manual verification successful
  • Prevention measures implemented
  • Code reviewed
  • Documentation updated
  • RCA document updated with implementation notes

Output Format

Create implementation report: .claude/code-reviews/YYYY-MM-DD-bug-fix-[issue].md

# Bug Fix Implementation: [Bug Title]

**Issue:** #[number]
**RCA:** [path to RCA file]
**Date:** YYYY-MM-DD

## Summary

[Brief description of what was fixed and how]

## Changes Made

### Files Modified

- `[file-path]` - [description of changes]
- `[file-path]` - [description of changes]

### Tests Added

- `[test-file]` - [test description]
- Coverage added: [X] test cases

## Verification

### Test Results

**Before Fix:**
\`\`\`
[output showing failing test]
\`\`\`

**After Fix:**
\`\`\`
[output showing passing test]
\`\`\`

**Full Suite:**
\`\`\`
[output showing all tests pass]
\`\`\`

### Manual Testing

- [x] Followed original reproduction steps
- [x] Bug no longer occurs
- [x] Expected behavior confirmed
- [x] No new issues observed

## Prevention Measures

- [x] Test case added for bug scenario
- [x] Test case added for edge cases
- [ ] Documentation updated (if applicable)
- [ ] Validation logic strengthened (if applicable)

## Ready for Commit

All validation passed. Ready to commit with:
`/commit`

Commit Message Template

When ready to commit, use this format:

fix(scope): [brief description of fix]

Fixes #[issue-number]

Root cause: [one-line explanation]
Solution: [one-line explanation]

RCA: .claude/plans/rca-[issue].md

Output

After implementation, provide:

Bug fix implemented and verified

Issue: #[number]
Root Cause: [brief description]
Fix: [brief description]

Changes:
- Modified: X files
- Tests added: Y test cases

Verification:
Specific test passes
Full test suite passes (N tests)
Manual verification successful

Ready for commit.

Notes

  • Always write the test BEFORE fixing the bug
  • The test should fail initially (confirming bug exists)
  • Make minimal changes to fix the specific issue
  • Ensure full test suite passes (no regressions)
  • Update RCA with implementation details
  • Don't skip manual verification

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.