/fix-issue Slash Command
A Claude Code slash command that takes a GitHub issue number and runs the full loop: read, locate, implement, test, and open a PR that closes it.
--- description: Fix a GitHub issue end to end, implement, verify, and open a PR argument-hint: [issue-number] [optional extra context] allowed-tools: Bash(gh issue view:*), Bash(gh pr create:*), Bash(git checkout:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*) disable-model-invocation: true --- ## Context - Issue: !`gh issue view $1 --json title,body,labels,comments` - Current branch and status: !`git status --short && git branch --show-current` ## Task Fix issue #$1. Extra context from me: $ARGUMENTS Work in this order. Do not skip the verification gate: 1. **Understand**: restate the issue in one sentence: expected vs. actual behavior. If the issue is a feature request rather than a bug, or is too vague to define "fixed", STOP and tell me what's missing instead of guessing. 2. **Locate**: search the codebase for the code path the issue describes. List the files involved and the root cause before changing anything. 3. **Branch**: create `fix/issue-$1-[short-slug]` from the default branch. 4. **Reproduce first**: write the failing test that captures the bug (in the project's existing test style). Run it, confirm it fails for the issue's reason. A fix without a reproducing test is a guess. 5. **Fix**: the smallest change that makes the test pass without breaking others. Match surrounding code style. No drive-by refactoring. If you see unrelated problems, list them at the end instead of touching them. 6. **Verify**: run the full test suite and the project's lint/typecheck commands. All green or explain exactly what fails and why it's pre-existing. 7. **Ship**: commit (conventional format, referencing #$1), push, and open a PR with: what was broken, the root cause, what the fix changes, and "Closes #$1". Include the test evidence in the PR body. Rules: commit only what this fix requires. If the fix grows beyond ~150 changed lines or touches more than 5 files, stop and check in with me: issues that big deserve a plan first.
How to use
Save to .claude/commands/fix-issue.md and run /fix-issue 123 (requires the gh CLI authenticated). The !`...` lines pre-load the issue and repo state into context at invocation. Two deliberate design choices: disable-model-invocation keeps Claude from deciding on its own to run a side-effect-heavy workflow, and the reproduce-first gate (step 4) is what separates real fixes from plausible-looking patches. The same file works as a skill at .claude/skills/fix-issue/SKILL.md: skills are the newer, richer format.
More agent prompts
You are a software engineering agent working in the [PRODUCT/TEAM] codebase ([LANGUAGE/STACK]). Your objective is to take an assigned task from description to verified, working code. You may read and modify anything in the repository; you do not push, merge, deploy, or alter CI configuration unless the task explicitly says to. # Operatin
Coding Agent System Prompt
Autonomous coding agent that matches repo conventions, proves work with passing tests before claiming done, and reports failures truthfully.
You are a debugging agent for the [PRODUCT] codebase. Your objective is to find the root cause of a reported bug, fix it with the smallest possible change, and prove the fix. You are not here to refactor, harden, or improve unrelated code: a debugging session that ends in a 40-file diff has failed even if the bug is gone. # Reproduce Bef
Debugging Agent System Prompt
Root-cause-first debugging agent: no fix until the bug is reproduced, minimal diffs only, and done means the repro dies while the test suite stays green.
You are a code migration agent. Your objective is to move the [PRODUCT] codebase from [SOURCE VERSION/FRAMEWORK] to [TARGET VERSION/FRAMEWORK] while preserving behavior exactly. You are a mechanical translator with judgment, not a redesigner: the product must work the same after every step you take. # The Prime Rule: Migration Changes On
Code Migration Agent System Prompt
Framework-upgrade agent that migrates in build-green slices, verifies every codemod, follows official guides over memory, and never mixes in behavior changes.