fix-issue
Skill2 starsChanged 4 months agoMITView on GitHub
Fix a GitHub issue end-to-end - sync the repo, verify the issue still reproduces by reading code, write a fix spec, pause for human approval, implement with TDD, open a PR and request review from every collaborator. Trigger: /fix-issue <github-issue-url>
- Commits and pushes
16 other projects use a version of this.
Adopted by
Most recently taken up by
- maioio/genesis-architecttheir own version, first seen Oct 2, 2026
- domengabrovsek/agent-configtheir own version, first seen Oct 2, 2026
- getsentry/sentry-javascripttheir own version, first seen Sep 27, 2026
- elfrost/ai-patchlabtheir own version, first seen Sep 22, 2026
- r3bl-org/r3bl-open-coretheir own version, first seen Sep 21, 2026
- smartwhale8/claude-playbooktheir own version, first seen Sep 20, 2026
Used with
Projects with it also use refactor, ship and 3 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.
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 3 projects that use this
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 3 projects that use this
SentrySkillreview
Fixture review skill.
Also in 3 projects that use this
AWSSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- getsentry/sentry-javascript★ 8.8ksame name
- docker/docs★ 4.7ksame name
- r3bl-org/r3bl-open-core★ 485same name
- frappe/skills★ 145same name
- dlupiak/claude-session-dashboard★ 71same name
- maioio/genesis-architect★ 49same name
- smartwhale8/claude-playbook★ 41same name
- iamneilroberts/claude-skills★ 26same name
- domengabrovsek/agent-config★ 17same name
- viknesh20-20/claude-code-tool-kit★ 7same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- file-issueSkill
- fix-repoSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
7
Distinctive
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
- Very specific: line 12
Do not run this unattended: If the person who invoked /fix-issue is not present to approve the spec at Step 6, stop and wait there.
- Distinctive: line 57
If this prints anything at all (modified, staged, or untracked files), stop and ask the user how to proceed — do not stash or discard …
- Distinctive: line 75
If this errors (bad URL, no access, issue deleted), stop and report the error to the user — do not guess at issue content.
- Very specific: line 95
Write a markdown spec to $repo_dir/docs/issue-fixes/<repo>-<issue_number>-spec.md (create the docs/issue-fixes/ directory if it doesn't …
- Distinctive: line 122
Do not leave any section empty — if a section genuinely doesn't apply, say why in one sentence rather than omitting it.
- Very specific: line 143
Never proceed past this step without an explicit approval from ExitPlanMode.
- Distinctive: line 149
Only reachable after Step 6's approval.
- Distinctive: line 151
Write a failing test that reproduces the issue, following the spec's "Test plan" section.
- Distinctive: line 154
Run the full test suite for the affected package/module (not just the new test).
- Distinctive: line 156
If the suite isn't green: stop here, do not proceed to Step 8.
- Very specific: line 184
If the collaborators call fails or returns nothing (permissions, rate limit): still run gh pr create without --reviewer, and tell the user …
“Common” is measured: kept by at least 6 in 10 of the 15 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.
Files
fix-issue
Fixes one GitHub issue end-to-end inside a single interactive session, with exactly one human approval gate — before any code is written. A second gate, PR review, happens on GitHub afterward and is outside this skill's control.
Do not run this unattended. If the person who invoked /fix-issue is not present to
approve the spec at Step 6, stop and wait there. Never skip Step 6 and go straight to
implementation, no matter how small the fix looks.
Announce at start: "Using fix-issue to work <issue-url>."
Step 1: Resolve the target repo
Parse <owner>/<repo> and the issue number out of the issue URL, e.g.
https://github.com/<org>/<org>-app/issues/565 → owner=<org>, repo=<org>-app,
issue_number=565. If the URL doesn't match this pattern, stop and tell the user the URL
couldn't be parsed — do not guess at owner/repo/issue values.
Find the local checkout by matching git remotes — never hardcode a repo-name → path table,
since this workspace's repo layout has drifted before. Substitute the owner/repo values
parsed above before running this — the variables are shown unquoted here for clarity, but
must be bound to real values first.
for d in */; do
if [ -d "$d/.git" ]; then
remote=$(git -C "$d" remote get-url origin 2>/dev/null)
case "$remote" in
*"$owner/$repo".git|*"$owner/$repo") echo "$d" ;;
esac
fi
done- Exactly one match → that directory is
$repo_dir. Use it as the working directory for every remaining step. - No match → ask: "No local checkout of
$owner/$repofound here. Clone it into this workspace?" On yes, rungh repo clone $owner/$repofrom the workspace root, then use the newly created directory as$repo_dir. On no, stop the pipeline here — do not guess at a repo location. - More than one match → stop and ask the user which directory to use. Never guess.
Step 2: Sync
In $repo_dir:
git status --shortIf this prints anything at all (modified, staged, or untracked files), stop and ask the user how to proceed — do not stash or discard anything automatically. Only continue once the tree is confirmed clean (empty output).
Find the default branch and sync it:
default_branch=$(git remote show origin | grep "HEAD branch" | awk '{print $NF}')
git checkout "$default_branch"
git pullStep 3: Fetch the issue
gh issue view <issue-url> --json title,body,comments,labels,urlIf this errors (bad URL, no access, issue deleted), stop and report the error to the user — do not guess at issue content.
Step 4: Verify the issue still reproduces
Using the issue's title/body/comments, identify the code paths it implicates and read them on the current default branch (the one just synced in Step 2). This is code-read only — never start services, run the app, or execute a repro script to check this.
Reason explicitly about whether the described behavior is still present given what the code does today. Two outcomes:
- Already fixed: state clearly what changed (or why the described behavior can no longer occur) and stop the pipeline entirely — do not write a spec, do not touch code, do not open a PR. Report this to the user as the final output of this run.
- Still reproduces: continue to Step 5 with a concrete understanding of the root cause — Step 5's spec depends on being able to cite exact files/lines, not just repeat the issue text.
Step 5: Write the fix spec
Write a markdown spec to $repo_dir/docs/issue-fixes/<repo>-<issue_number>-spec.md
(create the docs/issue-fixes/ directory if it doesn't exist yet — this is a new,
per-repo convention, not tied to any existing spec location in that repo). Use exactly
these sections:
# Issue #<issue_number>: <issue title>
## Problem
<what's broken, user-visible symptom, copied/paraphrased from the issue>
## Root cause
<why, in the current code, tied to specific file/line references found in Step 4>
## Proposed fix
<the approach — describe the change, not a full diff>
## Affected files
- `path/to/file.ext` — <what changes here>
## Risks / edge cases
<anything that could make this fix incomplete or regress something else>
## Test plan
<what a passing fix looks like — the failing test to write in Step 7, at minimum>Do not leave any section empty — if a section genuinely doesn't apply, say why in one sentence rather than omitting it.
Step 6: Gate 1 — get spec approval (STOP AND WAIT)
This is the pipeline's one required human approval gate. Call EnterPlanMode. Once inside
plan mode, write the full content of the Step 5 spec file into the plan file specified in
the plan-mode system message (copy it in — don't just reference its path). Then call
ExitPlanMode, which reads that file and surfaces it to the user for approval.
- Approved → before continuing to Step 7, make sure the repo spec file at
$repo_dir/docs/issue-fixes/<repo>-<issue_number>-spec.mdmatches exactly what was approved — if the spec was revised during this gate (edited in the plan file rather than the repo file, since only the plan file is writable inside plan mode), overwrite the repo spec file with the approved content now, before moving on. Do not re-summarize or re-confirm the approval itself — the approval is the gate. - Changes requested → go back to Step 5, revise the spec file with the requested changes, and re-present it through this same gate. Repeat until approved or the user says to stop.
- User aborts → end the pipeline here. Do not implement anything, do not open a PR.
Never proceed past this step without an explicit approval from ExitPlanMode. If the
person who ran /fix-issue is not available to respond, wait — do not time out into
"assume approved."
Step 7: Implement with TDD
Only reachable after Step 6's approval.
- Write a failing test that reproduces the issue, following the spec's "Test plan" section. Run it and confirm it fails for the expected reason (not a setup error).
- Implement the fix described in the spec's "Proposed fix" section.
- Run the full test suite for the affected package/module (not just the new test).
If the suite isn't green: stop here, do not proceed to Step 8. Report exactly what's failing and ask the user how to proceed — do not open a PR against a red suite, and do not loosen the new test to force it to pass.
For unfamiliar failures, use the superpowers:systematic-debugging skill rather than
guessing at fixes.
Step 8: Branch, commit, push, open PR, request reviewers
branch="fix/issue-<issue_number>-<short-slug>"
git checkout -b "$branch"
git add <changed files> docs/issue-fixes/<repo>-<issue_number>-spec.md
git commit -m "fix: <one-line summary>
Fixes #<issue_number>"
git push -u origin "$branch"Open the PR and request review from every collaborator except the PR author in one call:
pr_author=$(gh api user --jq .login)
reviewers=$(gh api repos/<owner>/<repo>/collaborators --jq '.[].login' | grep -v "^${pr_author}$" | paste -sd, -)
default_branch=$(git remote show origin | grep "HEAD branch" | awk '{print $NF}')
gh pr create --title "<title>" --body "Fixes #<issue_number>. See docs/issue-fixes/<repo>-<issue_number>-spec.md for the fix spec." --base "$default_branch" --reviewer "$reviewers"If the collaborators call fails or returns nothing (permissions, rate limit): still run
gh pr create without --reviewer, and tell the user reviewers weren't auto-assigned —
do not block PR creation on this. The same fallback applies if gh pr create itself fails
because of a bad/rejected reviewer list (GitHub rejects requesting review from the PR's own
author with a 422) — still create the PR, note reviewers weren't auto-assigned, don't
block.
Report the PR URL (printed by gh pr create) as the final output of this skill. Gate 2 —
human review — now happens on GitHub; this skill's job is done.
Error handling
| Situation | Behavior |
Uncommitted changes in $repo_dir before sync | Stop, ask — never auto-stash or discard |
| Issue URL doesn't parse, or repo not found and user declines the clone | Stop, ask |
| Multiple local repos match the same remote | Stop, ask the user to disambiguate |
| Issue no longer reproduces (Step 4) | Stop after Step 4, report, no spec/code/PR |
| User requests spec changes at Gate 1 (Step 6) | Revise spec, re-present; loop until approved or aborted |
| Test suite fails after implementation (Step 7) | Stop before Step 8, report failure, ask how to proceed |
| Collaborator lookup fails or is empty (Step 8) | Open the PR anyway; note reviewers weren't auto-assigned |
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
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.

