agentleFS
leaf76leaf76/agent-skills/fix-bug/SKILL.md

fix-bug

Skill0 starsChanged 3 months agoMITView on GitHub

Use when a user reports incorrect, regressed, flaky, failing, or unexpected software behavior that needs evidence-backed diagnosis and a safe fix.

40 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use improvement, build-feature and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • kiminmonacoSkill

    improvement

    Guide for making improvements to existing ClaudeBar functionality using TDD. Use this skill when: (1) Enhancing existing features (not adding new ones) (2) Improving UX, performance, or code quality (3) User asks "improve X", "make Y better", or "enhance Z" (4) Small enhancements that don't require full architecture design For NEW features, use implement-feature skill instead.

    Also in 4 projects that use this

  • sirakinbSkill

    build-feature

    Autonomous task loop that picks ready tasks, implements them, updates progress.txt, commits, and repeats. Use when asked to 'build feature', 'run the loop', or 'implement these tasks'.

    Also in 5 projects that use this

  • kiminmonacoSkill

    implement-feature

    Guide for implementing features in ClaudeBar following architecture-first design, TDD, rich domain models, and Swift 6.2 patterns. Use this skill when: (1) Adding new functionality to the app (2) Creating domain models that follow user's mental model (3) Building SwiftUI views that consume domain models directly (4) User asks "how do I implement X" or "add feature Y" (5) Implementing any feature that spans Domain, Infrastructure, and App layers

    Also in 7 projects that use this

  • JasonPaffSkill

    implement-plan

    Execute implementation plan with structured tracking and validation using subagent architecture

    Also in 3 projects that use this

  • ElasticSkill

    create-skill

    Interactively create a new Claude Code skill and add it to the elastic-docs-skills catalog. Use when the user wants to generate a new skill, scaffold a slash command, or build automation for docs tasks.

    Also in 5 projects that use this

  • NVIDIASkill

    review-code

    Review a code repository for concrete issues in correctness, robustness, security, maintainability, tests, and integration. Use for repository-wide or focused code review where practical engineering judgment and strict scope control matter.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 40 edited versions we read keep these.

  • 15

    Distinctive

    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:

    Treat bugs as non-trivial by default when they touch business logic, critical paths, auth, permissions, payments, data mutation, public API …

    line 13
  2. Distinctive:

    Do not implement speculative permanent fixes.

    line 14
  3. Distinctive:

    Prefer writing a failing test first to lock the behavior.

    line 22
  4. Distinctive:

    If deterministic tests are not yet possible, capture the smallest reliable reproduction artifact first: script, fixture, log slice, request …

    line 23
  5. Distinctive:

    If you cannot reproduce or explain the symptom, do not guess.

    line 25
  6. Distinctive:

    Do not code until you can explain the root cause and show evidence.

    line 29
  7. Very specific:

    Search: rg for keywords, error codes, feature flags, and state transitions.

    line 34
  8. Distinctive:

    If the fix becomes long, multi-purpose, or hard to explain with one rationale, split it or state why it must remain unified.

    line 53
  9. Distinctive:

    If technical debt caused the bug, do only the smallest refactor that prevents recurrence and can be verified.

    line 54
  10. Distinctive:

    Run targeted tests first, then broader checks proportional to the risk.

    line 59
  11. Distinctive:

    Verify success and failure paths when the bug touches state changes, permissions, schema, transactions, or external integrations.

    line 60
  12. Distinctive:

    If only a mitigation was shipped, verify the mitigation path, document the evidence gap, and leave a clear next-step RCA plan.

    line 61
  13. Distinctive:

    Remove temporary instrumentation before finalizing unless the user explicitly approves keeping it as production-safe observability.

    line 62
  14. Distinctive:

    Update docs, developer notes, or runbooks when behavior, operations, or troubleshooting steps changed.

    line 68
  15. Distinctive:

    Keep the answer concise, but do not omit reproduction evidence, root cause, verification, or remaining risk.

    line 73
  16. Distinctive:

    If automation was skipped, state why and provide reproducible manual verification steps.

    line 74

“Common” is measured: kept by at least 6 in 10 of the 40 edited versions of this file we could read. “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

Fix Bug (Root Cause First)

Goal: fix bugs by addressing the root cause, not symptoms. For non-trivial bugs, keep dev-workflow as the outer controller and use this skill for reproduction, RCA, bug-specific TDD, and regression verification.

Trigger Policy

  • Apply when behavior is broken, regressed, flaky, failing in tests or production, or inconsistent with expected output.
  • Treat bugs as non-trivial by default when they touch business logic, critical paths, auth, permissions, payments, data mutation, public API contracts, shared helpers, or cross-module integrations.
  • Do not implement speculative permanent fixes. If evidence is incomplete, add the smallest safe instrumentation or ship only a reversible mitigation.

Workflow

1. Understand + Reproduce

  • Collect symptoms: error message, logs, inputs, environment, version, expected vs actual, affected users or surfaces, and known non-goals.
  • Reproduce with the smallest reliable case.
  • Prefer writing a failing test first to lock the behavior.
  • If deterministic tests are not yet possible, capture the smallest reliable reproduction artifact first: script, fixture, log slice, request sample, browser/screenshot scenario, or telemetry query.
  • For flaky or production-only bugs, use sampled logs, traces, source inspection, temporary instrumentation, and repeated attempts to separate signal from noise.
  • If you cannot reproduce or explain the symptom, do not guess. Ask for missing context, add reversible instrumentation, or propose a reversible mitigation with the evidence gap clearly documented.

2. Root Cause Analysis (Mandatory)

Do not code until you can explain the root cause and show evidence.

Use:

  • Static analysis: jump-to-def, find refs, type hovers, call hierarchy.
  • Search: rg for keywords, error codes, feature flags, and state transitions.
  • Git history: git blame, git log -p, and related PR context to learn intent.
  • Data-flow tracing: input -> validation -> transformation -> side effect -> output.
  • Hypothesis testing: form one hypothesis, verify or falsify it with test/log/source evidence, then continue.
  • Instrumentation: temporary JSON logs with trace_id when applicable; never log secrets, tokens, passwords, OTPs, or sensitive personal data.

Required RCA output before implementation:

  • Bug symptom:
  • Reproduction artifact:
  • Root cause:
  • Evidence:
  • Scope / blast radius:

3. Design the Fix

  • Minimize blast radius; prefer small, atomic, reviewable changes.
  • State the fix rationale and why it addresses the root cause rather than only the symptom.
  • Preserve existing contracts unless the user explicitly approves a behavior or API change.
  • If the fix becomes long, multi-purpose, or hard to explain with one rationale, split it or state why it must remain unified.
  • If technical debt caused the bug, do only the smallest refactor that prevents recurrence and can be verified.

4. Implement + Verify

  • Make the failing test pass, or make the reproduction artifact pass when automated tests are not practical.
  • Run targeted tests first, then broader checks proportional to the risk.
  • Verify success and failure paths when the bug touches state changes, permissions, schema, transactions, or external integrations.
  • If only a mitigation was shipped, verify the mitigation path, document the evidence gap, and leave a clear next-step RCA plan.
  • Remove temporary instrumentation before finalizing unless the user explicitly approves keeping it as production-safe observability.

5. Review + Document

  • Re-review the diff for security, error handling, logging hygiene, compatibility, and hidden scope expansion.
  • Confirm unrelated changes remain untouched.
  • Update docs, developer notes, or runbooks when behavior, operations, or troubleshooting steps changed.

Output Contract

  • For significant bugs, report sections in this order: Symptom, RCA, Fix, Verification, Risks.
  • Keep the answer concise, but do not omit reproduction evidence, root cause, verification, or remaining risk.
  • If automation was skipped, state why and provide reproducible manual verification steps.

Suggested Short Template

  • Symptom:
  • Reproduction artifact:
  • Root cause:
  • Evidence:
  • Fix:
  • Verified:
  • Skipped / blocked:
  • Risks / assumptions:
  • Rollback:

Example Snippets

Reproducible API Bug

  • Symptom: Retried POST /invoices creates duplicate invoices.
  • Reproduction artifact: Integration test sends the same idempotency key twice and observes two rows.
  • Root cause: Retry path bypasses the idempotency lookup before the create operation.
  • Fix: Route retry creates through the existing idempotency guard without changing the public API.
  • Verified: Failing regression test now passes; targeted invoice tests pass.

Production-Only Flaky Bug

  • Symptom: Checkout occasionally returns 500 after payment provider timeout.
  • Reproduction artifact: Sampled logs with shared trace_id show timeout followed by a duplicate state transition.
  • Root cause: Timeout handler retries a non-idempotent transition without checking current order state.
  • Fix: Add state guard before retry and keep temporary safe metrics only if approved.
  • Verified: Targeted state-transition test covers timeout retry; log query confirms no matching failures after mitigation window.

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.