agentleFS
poshan0126poshan0126/dotclaude/skills/debug-fix/SKILL.md

debug-fix

Skill871 starsChanged 5 months agoMITView on GitHub

Find and fix a bug. Default is careful (reproduce, investigate, test). Add `--fast` for emergency production mode (hotfix branch, minimal change, ship a PR fast).

  • Commits and pushes

3 other projects use a version of this, 1 of them edited.

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

25 rules. About 0 are common, 21 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈21

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Check $ARGUMENTS for --fast.

    line 24
  2. Distinctive:

    If unclear, ask clarifying questions before proceeding.

    line 36
  3. Very specific:

    Create and switch to hotfix/<short-description> branched from production.

    line 44
  4. Distinctive:

    If you can't reproduce:

    line 55
  5. Distinctive:

    Environment-specific?: Check env vars, OS, runtime version, database state.

    line 56
  6. Distinctive:

    Don't skip ahead to guessing:

    line 64
  7. Distinctive:

    Read the code path backwards.

    line 67
  8. Very specific:

    Check git history: git log --oneline -20 -- <file>, git log --all --grep="<keyword>".

    line 68
  9. Distinctive:

    Verify the hypothesis with a targeted log or assertion.

    line 71
  10. Distinctive:

    If wrong, trace a different path.

    line 72
  11. Distinctive:

    Don't patch symptoms. Trace back to where bad data originates and fix it there.

    line 77
  12. Distinctive:

    Don't refactor surrounding code while fixing.

    line 78
  13. Distinctive:

    Don't add defensive checks that mask the problem.

    line 79
  14. Distinctive:

    If the fix needs more than ~50 lines changed, warn the user.

    line 82
  15. Distinctive:

    Do NOT add features, change formatting, clean up unrelated issues, or add non-essential comments.

    line 83
  16. Distinctive:

    Write a test that reproduces the bug and now passes.

    line 88
  17. Distinctive:

    Run related tests for regressions.

    line 89
  18. Distinctive:

    Run lint and typecheck.

    line 90
  19. Distinctive:

    Run only tests directly relevant to the changed code, not the full suite.

    line 94
  20. Distinctive:

    If you can reproduce the original error, verify it's fixed.

    line 96
  21. Distinctive:

    Create a branch if not already on one.

    line 102
  22. Distinctive:

    Create a PR targeting production:

    line 110
  23. Very specific:

    NEVER skip confirmation steps in --fast mode (branch name, commit message, push).

    line 118
  24. Distinctive:

    NEVER commit secrets or unrelated changes.

    line 120
  25. Distinctive:

    If the user says "skip" at any step, skip and move on.

    line 121

≈ “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

Find and fix the following issue:

Problem: $ARGUMENTS

Mode

Check $ARGUMENTS for --fast. Strip it before parsing the problem description.

  • Default: careful debug-fix. Use when you have time to do this right.
  • --fast: emergency hotfix. Use when production is broken and shipping speed matters more than thoroughness. Triggers a hotfix/* branch from production, minimal-change discipline, critical-tests-only verification, and ships a [HOTFIX] PR. Before committing to fast mode, briefly confirm with the user that this is genuinely emergency-grade. If not, suggest dropping --fast.

Step 1: Understand

  • Issue number: gh issue view $ARGUMENTS (or the project's issue tracker).
  • Error or stack trace: parse it for file, line, error type, and call chain.
  • Description: identify expected vs actual.
  • URL or screenshot: examine the referenced resource.

If unclear, ask clarifying questions before proceeding.

Step 2: Hotfix branch (--fast only)

In --fast mode only:

  • Detect the production branch: git symbolic-ref refs/remotes/origin/HEAD or git remote show origin.
  • Stash uncommitted work if needed.
  • Create and switch to hotfix/<short-description> branched from production.
  • ASK the user to confirm the branch name first.

In default mode, skip this. Branch creation happens in Step 7.

Step 3: Reproduce (default only)

In --fast mode, skip this step. Trust the report and move to Step 5.

  • Find the simplest way to trigger the issue (a test, curl, script).
  • Confirm you can reproduce reliably.
  • If you can't reproduce:
    • Environment-specific? Check env vars, OS, runtime version, database state.
    • Intermittent? Likely a race condition. Look for shared mutable state, timing dependencies, async ordering assumptions.
    • Already fixed? git log for recent commits mentioning the issue.

Step 4: Investigate (default only)

In --fast mode, skip this and go to Step 5. Trust the report and minimize investigation depth.

Don't skip ahead to guessing:

  1. Locate the symptom. Which file and line produces the wrong output?
  2. Read the code path backwards. What called this? What data was passed?
  3. Check git history: git log --oneline -20 -- <file>, git log --all --grep="<keyword>".
  4. Narrow scope with git bisect or targeted grep.
  5. Form a hypothesis: "X is wrong because Y."
  6. Verify the hypothesis with a targeted log or assertion.
  7. If wrong, trace a different path. Don't keep guessing the same hypothesis.

Step 5: Fix

  • Make the smallest correct change.
  • Don't patch symptoms. Trace back to where bad data originates and fix it there.
  • Don't refactor surrounding code while fixing.
  • Don't add defensive checks that mask the problem.

In --fast mode specifically:

  • If the fix needs more than ~50 lines changed, warn the user. This may not actually be a hotfix.
  • Do NOT add features, change formatting, clean up unrelated issues, or add non-essential comments.

Step 6: Verify

Default:

  • Write a test that reproduces the bug and now passes.
  • Run related tests for regressions.
  • Run lint and typecheck.
  • Temporarily revert your fix and confirm the new test fails (proves the test catches the bug).

--fast:

  • Run only tests directly relevant to the changed code, not the full suite.
  • Run the build.
  • If you can reproduce the original error, verify it's fixed.
  • ASK the user if they want extra verification before shipping.

Step 7: Wrap up or ship

Default:

  • Create a branch if not already on one.
  • Stage only the fix and test files.
  • Commit: fix: <what was wrong and why> (#number).

--fast:

  • Stage only the fix files (never secrets, locks, or build output).
  • Draft commit: hotfix: <short description>. ASK the user to confirm.
  • Push: git push -u origin hotfix/<description>.
  • Create a PR targeting production:
    • Title: [HOTFIX] <description>.
    • Body: what broke, what caused it, what this fixes.
    • Try to add the hotfix label: gh pr create ... --label hotfix. Fall back to no label on failure.
  • Show the PR URL.

Rules

  • NEVER skip confirmation steps in --fast mode (branch name, commit message, push).
  • NEVER force-push.
  • NEVER commit secrets or unrelated changes.
  • If the user says "skip" at any step, skip and move on.
  • In --fast mode specifically: if the fix turns out to be complex, tell the user and suggest dropping --fast to use the careful path.

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.