agentleFS
rafagomesrafagomes/ai-workflow/skills/fix/SKILL.md

fix

Skill9 starsChanged 8 months agoMITView on GitHub

Diagnose and fix a bug from a description, a stack trace, or a GitHub issue link — reproduce and patch. Stops with a working tree the user can review. Use when the user says 'fix this', 'debug X', 'something is broken', 'why isn't Y working', pastes an error/traceback, or links an issue expecting a patch. Covers root-cause diagnosis, not just symptom patching.

44 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pr-creator, frontend-code-review and 7 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.
  • GoogleSkill

    pr-creator

    Also in 3 projects that use this

  • DauQuangThanhSkill

    frontend-code-review

    Conducts comprehensive frontend code reviews including React/Vue/Angular component analysis, TypeScript/JavaScript quality assessment, CSS/styling review, performance optimization, accessibility compliance, security vulnerabilities, and best practices validation. Produces detailed review reports with specific issues, severity ratings, and actionable recommendations. Use when reviewing frontend code, analyzing React/Vue/Angular components, checking JavaScript/TypeScript quality, validating CSS/SCSS, assessing web performance, or when users mention "review frontend code", "check React components", "analyze JavaScript", "review TypeScript", "validate accessibility", or "frontend code quality".

    Also in 3 projects that use this

  • Microsoft AzureSkill

    test

    Also in 10 projects that use this

  • MicrosoftSkill

    merge

    Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.

    Also in 3 projects that use this

  • VercelSkill

    deploy

    Deploy applications to Vercel. Use when the user says "deploy", "deploy to Vercel", "push to production", "deploy my app", or "go live".

    Also in 8 projects that use this

  • OpenAISkill

    audit

    Audit or critique a product flow, journey, workflow, funnel, onboarding path, checkout path, settings path, screen, or multi-step product experience by capturing screenshots first, then reporting UX, design, and accessibility findings inline from that evidence. Use Figma only when the user explicitly asks for a board. Use when the user asks to audit, review, critique, inspect, assess, analyze, evaluate, or give feedback on a product experience.

    Also in 10 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 11 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 36 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before writing code, ensure you are on a short-lived branch named fix/<slug>.

    line 15
  2. Very specific:

    If given an issue link: fetch it with gh issue view and read the full description, comments, and labels.

    line 21
  3. Distinctive:

    If given a description: use it directly.

    line 22
  4. Very specific:

    Check for existing docs (CLAUDE.md, README.md, docs/) to understand the project context.

    line 23
  5. Distinctive:

    Search the codebase for the relevant code paths (use Grep, Glob, read key files).

    line 27
  6. Distinctive:

    If there are existing tests, run them to see the current failure state.

    line 29
  7. Distinctive:

    If reproduction requires specific steps, tell the user what you're doing.

    line 30
  8. Distinctive:

    Read the relevant code carefully.

    line 34
  9. Distinctive:

    Check git log on the affected files for recent changes that may have introduced the bug.

    line 35
  10. Distinctive:

    Add regression tests at the appropriate layer(s):

    line 47
  11. Distinctive:

    Unit test: Always — proves the root cause logic is fixed

    line 48
  12. Distinctive:

    Integration test: If the bug is at a component boundary (API, database, service interaction)

    line 49
  13. Distinctive:

    E2E test: Only if the bug broke a critical user flow and no e2e coverage existed for it

    line 50
  14. Distinctive:

    Run the project's test suite and fix any failures.

    line 52

“Common” is measured: kept by at least 6 in 10 of the 36 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 the bug described in $ARGUMENTS.

Parse Arguments

The argument can be:

  • Bug description: /fix users can't login when password contains special chars
  • Issue link: /fix https://github.com/org/repo/issues/42

Branch

Before writing code, ensure you are on a short-lived branch named fix/<slug>. If currently on main/master, create the branch now. See the global Trunk-Based Workflow in root CLAUDE.md for branch/worktree conventions.

Steps

  1. Understand the bug

    • If given an issue link: fetch it with gh issue view and read the full description, comments, and labels.
    • If given a description: use it directly.
    • Check for existing docs (CLAUDE.md, README.md, docs/) to understand the project context.
  2. Reproduce and locate

    • Search the codebase for the relevant code paths (use Grep, Glob, read key files).
    • Identify the component, module, or layer where the bug lives.
    • If there are existing tests, run them to see the current failure state.
    • If reproduction requires specific steps, tell the user what you're doing.
  3. Diagnose root cause

    • Read the relevant code carefully. Trace the data flow from input to failure point.
    • Check git log on the affected files for recent changes that may have introduced the bug.
    • Identify the root cause — not just the symptom. Explain it to the user in 1-2 sentences before proceeding.
  4. Discover test strategy — Before writing the fix, understand the project's test approach:

    a. Check for TDD: Read docs/TECHNICAL_DESIGN_DOCUMENT.md — if it has a Testing Strategy section, follow it. b. If no TDD: Infer from the codebase — look for existing test directories, frameworks, patterns, and naming conventions (same discovery as /feature step 3b). c. Determine which test layers the bug touches — a bug in a pure function needs a unit test; a bug in an API endpoint needs an integration test; a bug in a user flow may need an e2e test.

  5. Fix

    • Make the minimal change that fixes the root cause. Don't refactor surrounding code.
    • Add regression tests at the appropriate layer(s):
      • Unit test: Always — proves the root cause logic is fixed
      • Integration test: If the bug is at a component boundary (API, database, service interaction)
      • E2E test: Only if the bug broke a critical user flow and no e2e coverage existed for it
    • Each regression test must fail without the fix and pass with it.
    • Run the project's test suite and fix any failures.
  6. Run quality checks — Run the project's lint, typecheck, and test commands (check CLAUDE.md or Makefile for the right commands). Run ALL test layers, not just unit tests.

    Slice-size gate (trunk-based). Before reporting completion, run git diff --stat main...HEAD -- . ':(exclude)**/tests/**' ':(exclude)**/*_test.*' ':(exclude)**/*.test.*' ':(exclude)**/test_*' (or the same pathspec against git diff if working changes are unstaged). If the non-test diff exceeds ~200 lines, stop and propose a split via AskUserQuestion — a "fix" that balloons into a refactor is two slices, not one. Never silently leave a >200-line fix in the working tree without the user's explicit override.

  7. Stack-aware code review — Prefer Anthropic's official code-review skill (from claude-code-plugins) if installed. Otherwise, run /sec-review for security and spawn an architecture-reviewer subagent for architecture, passing the matching language guide from reviews/ as stack-specific criteria.

    This is a self-check, not a trust boundary — reviewer subagents have fresh context, but you (the writer) are reading and acting on their findings. A fresh-session /review or a human reviewer is still expected before merge.

  8. Address findings — Fix any HIGH severity issues from the review. For MEDIUM issues, use your judgment.
  9. Report and stop. Summarize for the user:

    • Root cause — 1–2 sentences on what was actually broken.
    • Files changed — git diff --stat output, or a short list.
    • Regression tests — which layers (unit/integration/e2e) you added, where they live, how to re-run them.
    • Verification — lint / typecheck / test commands run and their tail output.
    • Self-review verdict — Security: PASS / REVIEW / FAIL from step 7.
    • Issue link — if one was provided, so the user can reference it later.

    Suggested conventional-commit subject for when the user commits: fix: <what was broken> (describe the bug, not the change). Example: fix: login fails when password contains special characters.

    Then stop. The user reviews the working tree and decides next steps (typically /commit then /pr).

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.