github-issue-autofix
Skill1 starsChanged 8 days agoApache-2.0View on GitHub
Implement a GitHub Issue fix on a branch and open a PR (Fixes #N). Use in conversation when the user gives an Issue number or URL and asks to implement or fix it. Also the L2 loop entry skill after autofix label, repository_dispatch, or workflow_dispatch. Interactive default is survey only; implement the fix when the request asks for changes to be made (for example fix, apply, or update) or automation sets agent_edit_allowed in Constraints. Detect skips when an open/draft PR already closes the Issue. Agent must not fire repository_dispatch.
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .apm/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .github/workflows/CLAUDE.mdCLAUDE.md
- .cursor/rules/agent-skills.mdcCursor rule
- .cursor/rules/bats.mdcCursor rule
- .cursor/rules/github-actions-workflow.mdcCursor rule
- .cursor/rules/go.mdcCursor rule
- .cursor/rules/go-test.mdcCursor rule
- .cursor/rules/instructions.mdcCursor rule
- .cursor/rules/markdown.mdcCursor rule
- .cursor/rules/shell-script.mdcCursor rule
- .cursor/rules/terraform.mdcCursor rule
- agent-skills-reviewSkill
- changelogSkill
- ci-sweeperSkill
- docs-creatorSkill
- docs-updaterSkill
- github-actions-reviewSkill
- github-actions-validationSkill
- github-issue-triageSkill
- github-pr-bodySkill
- github-pr-reviewSkill
- github-pr-reviseSkill
- go-reviewSkill
- go-validationSkill
- instructions-reviewSkill
- loop-verifierSkill
- markdown-validationSkill
- refactorSkill
- shell-script-reviewSkill
- shell-script-validationSkill
- tech-debtSkill
- test-gapSkill
- agent-skills-reviewSkill
- changelogSkill
- ci-sweeperSkill
- docs-creatorSkill
- docs-updaterSkill
- github-actions-reviewSkill
- github-actions-validationSkill
- github-issue-autofixSkill
- github-issue-triageSkill
- github-pr-bodySkill
- github-pr-reviewSkill
- github-pr-reviseSkill
- go-reviewSkill
- go-validationSkill
- instructions-reviewSkill
- loop-verifierSkill
- markdown-validationSkill
- refactorSkill
- shell-script-reviewSkill
- shell-script-validationSkill
- tech-debtSkill
- test-gapSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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
- Distinctive: line 62
When intent is unclear, survey and offer to apply — edits are harder to undo than a report.
- Very specific: line 64
When agent_edit_allowed is true, resolve agent_edit_target: on the interactive path use fix (this skill).
- Very specific: line 70
IF agent_edit_allowed is false → emit survey shape.
- Very specific: line 74
Do not fire repository_dispatch or start other loops from the Agent.
≈ “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.
Files
UTILITY SKILL — Issue→PR autofix on the branch caller (not entity observe).
Input
- Automation: detect JSON from
detect_autofix.shwithresult.issue_number. Readagent_edit_allowed/agent_edit_targetfrom## Constraints. - Interactive: Issue number (or URL resolved to a number) plus optional failure context; there is no detect JSON. Read the Issue with read-only
gh issue view <n> --json number,title,body,state,labels,comments.agent_edit_allowedfollows the edit gate in Workflow: survey unless the request asks for changes to be made.
Output Specification
Report per common-output-format.md. On the automation path, follow category-automation-envelope.md. Apply shape: PR body includes the literal Fixes #<N>. Survey shape: reference the Issue as Refs #<N> and never use a closing keyword (Fixes, Closes, Resolves) — merging a survey PR must not close the Issue.
Execution Scope
USE FOR:
- Implement a minimal fix for the Issue on the integration branch worktree when
agent_edit_allowed: true - Synthesize PR body from
assets/pr-body-template.mdincludingFixes #<N>
DO NOT USE FOR:
- Issue triage labels/comments (github-issue-triage)
- PR revision from review comments (github-pr-revise)
- Calling
repository_dispatchfrom the Agent
Reference Files Guide
- common-checklist.md (always read)
- common-output-format.md (always read)
- category-automation-envelope.md (read on automation path)
- category-pr-body-links.md (read when synthesizing PR body)
assets/pr-body-template.md(read when synthesizing apply PR body)assets/pr-body-template-survey.md(read when synthesizing survey PR body)
Workflow
Resolve agent_edit_allowed before implementing:
| Source | agent_edit_allowed |
| Interactive — default: the request asks to look, check, triage, or survey, or only names the skill | false — survey only; do not edit files |
| Interactive — the request asks for changes to be made (for example fix, apply, 修正して, 適用して, update, add) | true — implement the fix for the Issue |
| Interactive — follow-up after a survey asking to apply | true — implement the surveyed fix candidates |
Automation — ## Constraints | agent_edit_allowed: true or agent_edit_allowed: false from category-automation-envelope.md |
When intent is unclear, survey and offer to apply — edits are harder to undo than a report.
When agent_edit_allowed is true, resolve agent_edit_target: on the interactive path use fix (this skill); on the automation path read agent_edit_target from ## Constraints. Do not branch on other caller metadata outside ## Constraints.
Delivery. Interactive: leave edits in the working tree and report them; commit, push, or open a PR only when the user explicitly asks for that step, because those change shared state that other people see and cannot be quietly taken back. Automation: do not push or open a PR yourself; the caller delivers the branch and composes the PR body from your report.
- Automation: read detect JSON; if
skip: trueorstatus: error, report the reason and stop. Interactive: resolve the Issue from the user's URL or number withgh issue view; if the Issue is closed, report that and stop. Check for an open or draft PR that already closes the Issue (for examplegh pr list --state open --search "<n> in:body"and confirm a closing keyword for#<n>in its body); if one exists, report it as a skip and stop — same as the detect skip. - On the automation path, read category-automation-envelope.md for Constraints and PR templates.
- IF
agent_edit_allowedisfalse→ emit survey shape; loadassets/pr-body-template-survey.mdat synthesis when on automation path; stop. - ELSE IF
agent_edit_allowedistrueANDagent_edit_targetis notfix→ emit survey shape; note expectedagent_edit_target: fix; stop. - ELSE IF
agent_edit_allowedistrueANDagent_edit_targetisfix→ implement the minimal fix for Issue#Non the worktree. - At synthesis, load the apply PR template; ensure body includes
Fixes #<N>(interactive: the body is written for a PR the user asks you to open, or reported in chat). - Do not fire
repository_dispatchor start other loops from the Agent.
Error Handling
| Condition | Severity | Action |
Detect status: error | Fatal | Stop; do not mutate repository files |
Detect skip: true | Info | Report skip reason; do not open a PR |
| Interactive: Issue is closed | Info | Report that the Issue is closed; do not edit files or open a PR |
| Interactive: an open or draft PR already closes the Issue | Info | Report it as a skip with the PR number; do not open another PR |
agent_edit_allowed: false | Info | Survey only; do not edit files |
agent_edit_target not fix when edits expected | Recoverable | Survey only; note mismatch in Overview |
| Validation tooling missing after edits | Recoverable | Defer in report; do not claim passing checks |
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.

