Skip to content
Back to skills

Fix

ASecurity

Diagnose the root cause of a bug and fix it with a regression test, from a description, a stack trace or error output, or a GitHub issue link. Stops with a working tree to review. Use for 'fix this', 'this is broken', a pasted traceback, or an issue link where a patch is expected. For a feature use /wf:feature.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 19, 2026
developmenttestingrefactoringgitapidatabasesecurity

Works with

  • api

Security analysis

A100/100

Scanned November 19, 2026

npx -y skills add rafagomes/ai-workflow --skill fix --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fix?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Fix
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rafagomes-fix/badge)](https://www.skillsdirectory.com/skills/rafagomes-fix)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: fix
description: "Diagnose the root cause of a bug and fix it with a regression test, from a description, a stack trace or error output, or a GitHub issue link. Stops with a working tree to review. Use for 'fix this', 'this is broken', a pasted traceback, or an issue link where a patch is expected. For a feature use /wf:feature."
argument-hint: "<description | issue link | error text>"
---
Fix the bug described in $ARGUMENTS.

In hosts that do not substitute `$ARGUMENTS` (e.g. Codex), it is the text the user wrote after the skill name.

## Parse arguments

- **Description:** `/wf:fix users can't login when password contains special chars`
- **Issue link or number:** `/wf:fix https://github.com/org/repo/issues/42`. Run `gh issue view <url|N> --comments` and read the description, comments and labels. If `gh` is unavailable, ask for the issue text.
- **Error output or stack trace:** use it as the reproduction.

## Branch

Run `git fetch origin`, and if the tree is dirty with unrelated changes, say so before starting. Resolve the trunk branch as `<base>`: `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`, falling back to `git symbolic-ref --short refs/remotes/origin/HEAD` with `origin/` stripped. Work on a short-lived branch cut from `origin/<base>`, not from another feature branch: `fix/<N>-<slug>` when there is an issue, `fix/<slug>` otherwise. Worktree conventions are in your global agent instructions (`~/.claude/CLAUDE.md` or `~/.codex/AGENTS.md`) (Trunk-Based Workflow).

## Steps

1. **Reproduce and locate.** Check the project's agent instructions (`CLAUDE.md` or `AGENTS.md`), `README.md` and `docs/` for context (for a UI bug, `docs/design/DESIGN_SYSTEM.md` too, if it exists). Find the code path, then reproduce the failure by running the failing test or the reported steps, telling the user what you are doing. Check `git log` on the affected files for the change that may have introduced it. If you cannot reproduce it, say so, list what you tried and ask for the missing input; do not patch on a guess.

2. **Diagnose the root cause.** Trace the data flow from input to the failure point. Explain the cause, not the symptom, in 1-2 sentences before changing code.

3. **Pick the test layer** as in `/wf:feature` step 2 (`docs/ARCHITECTURE.md` Testing Strategy, else inferred from the project): unit for pure logic, integration at a boundary (API, database, service interaction), e2e only if a critical user flow broke and had no e2e coverage.

4. **Fix.** Write the regression test first and watch it fail for the right reason. Then make the minimal change that fixes the root cause, without refactoring surrounding code, and confirm the test passes. If the bug is at a security trigger (see **Security triggers** in your global agent instructions (`~/.claude/CLAUDE.md` or `~/.codex/AGENTS.md`)), note that it needs `/security-review` before the PR.

5. **Quality checks.** Run the project's lint, typecheck and the full test suite (so a regression elsewhere shows up); report each in one line (command, result) and paste output only for a failure.

   **Risk tier.** Derive the tier from the diff (see **Risk tiers** in your global agent instructions (`~/.claude/CLAUDE.md` or `~/.codex/AGENTS.md`)). A T2 fix needs a human merge however small; say so in the report.

   **Size gate.** Measure the hand-written source this change adds:
   Measure as in `/wf:feature` step 5 (Size gate): added source lines and changed source files, tests, generated files, lockfiles and pure moves excluded. Past roughly 1,000 lines or ~40 files, decide whether it is still one concern. One concern: carry on, and say in the report how large it is and why it stays together. More than one (a fix that grows into a refactor is two slices): stop and propose a split via AskUserQuestion (or, where it is unavailable but the user can answer in chat, as a short numbered list), and do not leave it in the working tree without the user's override.

6. **Report and stop.** Do not review your own fix: `/wf:pr` dispatches `wf:reviewer` (`wf-reviewer` in Codex) once the commits exist. Summarize:
   - **Root cause** - 1-2 sentences on what was broken.
   - **Files changed** - `git diff --stat`, or a short list.
   - **Regression tests** - layers added, where they live, how to re-run them.
   - **Verification** - each check in one line.
   - **Risk** - `T1 — <why>`.
   - **Issue link** - if one was provided.

   Then stop. The user reviews the working tree and decides next steps, typically `/wf:commit` then `/wf:pr`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.