GitHub Issue Resolver
Autonomous agent for discovering, analyzing, and fixing open GitHub issues — with a 5-layer guardrail system.
⚠️ GUARDRAILS — Read First
Every action goes through guardrails. Before any operation:
- Load
guardrails.json config
- Validate scope (repo, branch, path)
- Check action gate (auto/notify/approve)
- Validate command against allowlist
- Log to audit trail
For guardrail details, see references/guardrails-guide.md.
Key Rules (Non-Negotiable)
- Never touch protected branches (main, master, production)
- Never modify .env, secrets, CI configs, credentials
- Never force push
- Never modify dependency files without explicit approval
- Never modify own skill/plugin files
- One issue at a time — finish or abandon before starting new
- All dangerous actions require user approval (write code, commit, push, PR)
- Everything is logged to
audit/ directory
Workflow
Phase 1 — Issue Discovery
Trigger: User provides a GitHub repository (owner/repo).
Steps:
Validate repo against guardrails:
python3 scripts/guardrails.py repo <owner> <repo>
If blocked, tell the user and stop.
Fetch, score, and present issues using the recommendation engine:
python3 scripts/recommend.py <owner> <repo>
This automatically fetches open issues, filters out PRs, scores them by severity/impact/effort/freshness, and presents a formatted recommendation.
Always use recommend.py — never manually format issue output. The script ensures consistent presentation every time.
For raw JSON (e.g., for further processing):
python3 scripts/recommend.py <owner> <repo> --json
⏹️ STOP. Wait for user to select an issue.
Phase 2 — Fixing
Trigger: User selects an issue.
Steps:
Lock the issue (one-at-a-time enforcement):
python3 scripts/guardrails.py issue_lock <owner> <repo> <issue_number>
Read full issue thread including comments.
Clone the repo (Gate: notify):
python3 scripts/sandbox.py run git clone https://github.com/<owner>/<repo>.git /tmp/openclaw-work/<repo>
Create a safe branch (Gate: auto):
python3 scripts/sandbox.py run git checkout -b fix-issue-<number>
Explore codebase — read relevant files. For each file:
python3 scripts/guardrails.py path <file_path>
Plan the fix — explain approach to user:
## Proposed Fix
- Problem: [root cause]
- Solution: [what changes]
- Files: [list of files and what changes in each]
- Estimated diff size: [lines]
⏹️ STOP. Wait for user to approve the plan before implementing.
- Implement the fix (Gate:
approve):
- Apply changes
- Check diff size:
python3 scripts/guardrails.py diff <line_count>
- Log:
python3 scripts/audit.py log_action write_code success
Phase 3 — Testing
After implementing:
Find and run tests (Gate: notify):
python3 scripts/sandbox.py run npm test # or pytest, cargo test, etc.
If tests fail AND autoRollbackOnTestFail is true:
- Revert all changes
- Notify user
- Suggest alternative approach
If no tests exist, write basic tests covering the fix.
Report results to user.
Phase 4 — Draft PR for Review (Approval REQUIRED)
⚠️ NEVER create PR automatically. Always ask first.
Do NOT dump full diffs in chat. For any non-trivial project, push the branch
and let the user review on GitHub where they get syntax highlighting, file-by-file
navigation, and inline comments.
Commit changes (Gate: approve):
python3 scripts/sandbox.py run git add .
python3 scripts/sandbox.py run git commit -m "Fix #<number>: <title>"
Show a change summary (NOT the raw diff) — keep it concise:
## Changes
- **src/models.py** — Added field validation (title length, enum checks)
- **app.py** — Added validation to POST endpoint, 400 error responses
- **tests/test_app.py** — 22 new tests covering validation rules
- 4 files changed, ~100 lines of source + ~150 lines of tests
- All tests passing ✅
Ask explicitly: "Ready to push and create a draft PR?"
Only after user says "yes" (Gate: approve):
python3 scripts/sandbox.py run git push -u origin fix-issue-<number>
python3 scripts/sandbox.py run gh pr create --draft --title "..." --body "..."
Note: PRs are always created as draft by default.
The PR body should include a detailed description of all changes, test results,
and link to the issue (Closes #N).
Share the PR link — user reviews on GitHub.
Unlock the issue:
python3 scripts/guardrails.py issue_unlock
Scripts Reference
| Script |
Purpose |
Run Without Reading |
scripts/recommend.py |
Primary entry point — fetch, score, and present issues |
✅ |
scripts/fetch_issues.py |
Raw issue fetcher (used internally by recommend.py) |
✅ |
scripts/analyze_issue.py |
Deep analysis of single issue |
✅ |
scripts/create_pr.py |
PR creation wrapper |
✅ |
scripts/guardrails.py |
Guardrail enforcement engine |
✅ |
scripts/sandbox.py |
Safe command execution wrapper |
✅ |
scripts/audit.py |
Action logger |
✅ |
References
- references/quick-reference.md — GitHub API reference, scoring rubric, test commands
- references/guardrails-guide.md — Full guardrails documentation and customization
1---
2name: github-issue-resolver
3description: Autonomous GitHub Issue Resolver Agent with guardrails. Use when the user wants to discover, analyze, and fix open issues in GitHub repositories. Triggers on requests like "fix GitHub issues", "resolve issues in repo", "work on GitHub bugs", or when the user provides a GitHub repository URL and asks for issue resolution. Supports the full workflow from issue discovery to PR submission with safety guardrails preventing scope creep, unauthorized access, and dangerous operations.
4metadata:
5 source: https://skillmd.com/skills/modbender/github-issue-resolver
6---
7
8# GitHub Issue Resolver
9
10Autonomous agent for discovering, analyzing, and fixing open GitHub issues — with a 5-layer guardrail system.
11
12## ⚠️ GUARDRAILS — Read First
13
14**Every action goes through guardrails.** Before any operation:
15
161. Load `guardrails.json` config
172. Validate scope (repo, branch, path)
183. Check action gate (auto/notify/approve)
194. Validate command against allowlist
205. Log to audit trail
21
22For guardrail details, see [references/guardrails-guide.md](references/guardrails-guide.md).
23
24### Key Rules (Non-Negotiable)
25- **Never touch protected branches** (main, master, production)
26- **Never modify** .env, secrets, CI configs, credentials
27- **Never force push**
28- **Never modify dependency files** without explicit approval
29- **Never modify own skill/plugin files**
30- **One issue at a time** — finish or abandon before starting new
31- **All dangerous actions require user approval** (write code, commit, push, PR)
32- **Everything is logged** to `audit/` directory
33
34---
35
36## Workflow
37
38### Phase 1 — Issue Discovery
39
40**Trigger:** User provides a GitHub repository (`owner/repo`).
41
42**Steps:**
43
441. **Validate repo** against guardrails:
45 ```bash
46 python3 scripts/guardrails.py repo <owner> <repo>
47 ```
48 If blocked, tell the user and stop.
49
502. **Fetch, score, and present issues** using the recommendation engine:
51 ```bash
52 python3 scripts/recommend.py <owner> <repo>
53 ```
54 This automatically fetches open issues, filters out PRs, scores them by severity/impact/effort/freshness, and presents a formatted recommendation.
55
56 **Always use `recommend.py`** — never manually format issue output. The script ensures consistent presentation every time.
57
58 For raw JSON (e.g., for further processing):
59 ```bash
60 python3 scripts/recommend.py <owner> <repo> --json
61 ```
62
63**⏹️ STOP. Wait for user to select an issue.**
64
65---
66
67### Phase 2 — Fixing
68
69**Trigger:** User selects an issue.
70
71**Steps:**
72
731. **Lock the issue** (one-at-a-time enforcement):
74 ```bash
75 python3 scripts/guardrails.py issue_lock <owner> <repo> <issue_number>
76 ```
77
782. **Read full issue thread** including comments.
79
803. **Clone the repo** (Gate: `notify`):
81 ```bash
82 python3 scripts/sandbox.py run git clone https://github.com/<owner>/<repo>.git /tmp/openclaw-work/<repo>
83 ```
84
854. **Create a safe branch** (Gate: `auto`):
86 ```bash
87 python3 scripts/sandbox.py run git checkout -b fix-issue-<number>
88 ```
89
905. **Explore codebase** — read relevant files. For each file:
91 ```bash
92 python3 scripts/guardrails.py path <file_path>
93 ```
94
956. **Plan the fix** — explain approach to user:
96 ```
97 ## Proposed Fix
98 - Problem: [root cause]
99 - Solution: [what changes]
100 - Files: [list of files and what changes in each]
101 - Estimated diff size: [lines]
102 ```
103
104**⏹️ STOP. Wait for user to approve the plan before implementing.**
105
1067. **Implement the fix** (Gate: `approve`):
107 - Apply changes
108 - Check diff size: `python3 scripts/guardrails.py diff <line_count>`
109 - Log: `python3 scripts/audit.py log_action write_code success`
110
111---
112
113### Phase 3 — Testing
114
115**After implementing:**
116
1171. **Find and run tests** (Gate: `notify`):
118 ```bash
119 python3 scripts/sandbox.py run npm test # or pytest, cargo test, etc.
120 ```
121
1222. **If tests fail AND `autoRollbackOnTestFail` is true:**
123 - Revert all changes
124 - Notify user
125 - Suggest alternative approach
126
1273. **If no tests exist**, write basic tests covering the fix.
128
1294. **Report results** to user.
130
131---
132
133### Phase 4 — Draft PR for Review (Approval REQUIRED)
134
135**⚠️ NEVER create PR automatically. Always ask first.**
136
137**Do NOT dump full diffs in chat.** For any non-trivial project, push the branch
138and let the user review on GitHub where they get syntax highlighting, file-by-file
139navigation, and inline comments.
140
1411. **Commit changes** (Gate: `approve`):
142 ```bash
143 python3 scripts/sandbox.py run git add .
144 python3 scripts/sandbox.py run git commit -m "Fix #<number>: <title>"
145 ```
146
1472. **Show a change summary** (NOT the raw diff) — keep it concise:
148 ```
149 ## Changes
150 - **src/models.py** — Added field validation (title length, enum checks)
151 - **app.py** — Added validation to POST endpoint, 400 error responses
152 - **tests/test_app.py** — 22 new tests covering validation rules
153 - 4 files changed, ~100 lines of source + ~150 lines of tests
154 - All tests passing ✅
155 ```
156
1573. **Ask explicitly:** "Ready to push and create a draft PR?"
158
1594. **Only after user says "yes"** (Gate: `approve`):
160 ```bash
161 python3 scripts/sandbox.py run git push -u origin fix-issue-<number>
162 python3 scripts/sandbox.py run gh pr create --draft --title "..." --body "..."
163 ```
164 Note: PRs are always created as **draft** by default.
165 The PR body should include a detailed description of all changes, test results,
166 and link to the issue (Closes #N).
167
1685. **Share the PR link** — user reviews on GitHub.
169
1706. **Unlock the issue:**
171 ```bash
172 python3 scripts/guardrails.py issue_unlock
173 ```
174
175---
176
177## Scripts Reference
178
179| Script | Purpose | Run Without Reading |
180|--------|---------|---------------------|
181| `scripts/recommend.py` | **Primary entry point** — fetch, score, and present issues | ✅ |
182| `scripts/fetch_issues.py` | Raw issue fetcher (used internally by recommend.py) | ✅ |
183| `scripts/analyze_issue.py` | Deep analysis of single issue | ✅ |
184| `scripts/create_pr.py` | PR creation wrapper | ✅ |
185| `scripts/guardrails.py` | Guardrail enforcement engine | ✅ |
186| `scripts/sandbox.py` | Safe command execution wrapper | ✅ |
187| `scripts/audit.py` | Action logger | ✅ |
188
189## References
190
191- [references/quick-reference.md](references/quick-reference.md) — GitHub API reference, scoring rubric, test commands
192- [references/guardrails-guide.md](references/guardrails-guide.md) — Full guardrails documentation and customization