← 返回
数据分析 Key 中文

GitHub Issue Resolver

Autonomous GitHub Issue Resolver Agent with guardrails. Use when the user wants to discover, analyze, and fix open issues in GitHub repositories. Triggers on...
带有防护措施的自主GitHub问题解决代理。适用于用户想要发现、分析并修复GitHub仓库中的开放问题时触发。
ashwinhegde19
数据分析 clawhub v1.0.0 1 版本 99810.1 Key: 需要
★ 1
Stars
📥 2,082
下载
💾 41
安装
1
版本
#latest

概述

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:

  1. Load guardrails.json config
  2. Validate scope (repo, branch, path)
  3. Check action gate (auto/notify/approve)
  4. Validate command against allowlist
  5. 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:

  1. Validate repo against guardrails:

```bash

python3 scripts/guardrails.py repo

```

If blocked, tell the user and stop.

  1. Fetch, score, and present issues using the recommendation engine:

```bash

python3 scripts/recommend.py

```

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):

```bash

python3 scripts/recommend.py --json

```

⏹️ STOP. Wait for user to select an issue.


Phase 2 — Fixing

Trigger: User selects an issue.

Steps:

  1. Lock the issue (one-at-a-time enforcement):

```bash

python3 scripts/guardrails.py issue_lock

```

  1. Read full issue thread including comments.
  1. Clone the repo (Gate: notify):

```bash

python3 scripts/sandbox.py run git clone https://github.com//.git /tmp/openclaw-work/

```

  1. Create a safe branch (Gate: auto):

```bash

python3 scripts/sandbox.py run git checkout -b fix-issue-

```

  1. Explore codebase — read relevant files. For each file:

```bash

python3 scripts/guardrails.py path

```

  1. 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.

  1. Implement the fix (Gate: approve):
    • Apply changes
    • Check diff size: python3 scripts/guardrails.py diff
    • Log: python3 scripts/audit.py log_action write_code success

Phase 3 — Testing

After implementing:

  1. Find and run tests (Gate: notify):

```bash

python3 scripts/sandbox.py run npm test # or pytest, cargo test, etc.

```

  1. If tests fail AND autoRollbackOnTestFail is true:
    • Revert all changes
    • Notify user
    • Suggest alternative approach
  1. If no tests exist, write basic tests covering the fix.
  1. 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.

  1. Commit changes (Gate: approve):

```bash

python3 scripts/sandbox.py run git add .

python3 scripts/sandbox.py run git commit -m "Fix #: "</p><p> ```</p><ol><li><strong>Show a change summary</strong> (NOT the raw diff) — keep it concise:</li></ol><p> ```</p><p> ## Changes</p><ul><li><strong>src/models.py</strong> — Added field validation (title length, enum checks)</li><li><strong>app.py</strong> — Added validation to POST endpoint, 400 error responses</li><li><strong>tests/test_app.py</strong> — 22 new tests covering validation rules</li><li>4 files changed, ~100 lines of source + ~150 lines of tests</li><li>All tests passing ✅</li></ul><p> ```</p><ol><li><strong>Ask explicitly:</strong> "Ready to push and create a draft PR?"</li></ol><ol><li><strong>Only after user says "yes"</strong> (Gate: <code>approve</code>):</li></ol><p> ```bash</p><p> python3 scripts/sandbox.py run git push -u origin fix-issue-<number></p><p> python3 scripts/sandbox.py run gh pr create --draft --title "..." --body "..."</p><p> ```</p><p> Note: PRs are always created as <strong>draft</strong> by default.</p><p> The PR body should include a detailed description of all changes, test results,</p><p> and link to the issue (Closes #N).</p><ol><li><strong>Share the PR link</strong> — user reviews on GitHub.</li></ol><ol><li><strong>Unlock the issue:</strong></li></ol><p> ```bash</p><p> python3 scripts/guardrails.py issue_unlock</p><p> ```</p><hr><h2>Scripts Reference</h2><table><thead><tr><th>Script</th><th>Purpose</th><th>Run Without Reading</th></tr></thead><tbody><tr><td>--------</td><td>---------</td><td>---------------------</td></tr><tr><td><code>scripts/recommend.py</code></td><td><strong>Primary entry point</strong> — fetch, score, and present issues</td><td>✅</td></tr><tr><td><code>scripts/fetch_issues.py</code></td><td>Raw issue fetcher (used internally by recommend.py)</td><td>✅</td></tr><tr><td><code>scripts/analyze_issue.py</code></td><td>Deep analysis of single issue</td><td>✅</td></tr><tr><td><code>scripts/create_pr.py</code></td><td>PR creation wrapper</td><td>✅</td></tr><tr><td><code>scripts/guardrails.py</code></td><td>Guardrail enforcement engine</td><td>✅</td></tr><tr><td><code>scripts/sandbox.py</code></td><td>Safe command execution wrapper</td><td>✅</td></tr><tr><td><code>scripts/audit.py</code></td><td>Action logger</td><td>✅</td></tr></tbody></table><h2>References</h2><ul><li><a href="references/quick-reference.md" target="_blank" rel="noopener">references/quick-reference.md</a> — GitHub API reference, scoring rubric, test commands</li><li><a href="references/guardrails-guide.md" target="_blank" rel="noopener">references/guardrails-guide.md</a> — Full guardrails documentation and customization</li></ul></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 1 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v1.0.0</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-03-29 04:50 安全 安全 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=28b5adc09981d609a7429eab78916097" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/25/401440_802730df5c1e985fdb278458cc194d8a.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1781291295%3B1812827295&q-key-time=1781291295%3B1812827295&q-header-list=host&q-url-param-list=&q-signature=a777c687cf9b9f4891ec6762cbec090427402eae" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">data-analysis</span> <h3><a href="/s/stock-analysis">Stock Analysis</a></h3> <div class="rec-owner">udiedrichsen</div> <div class="rec-desc">{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 270</span> <span style="color:#5b6abf;">📥 56,946</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">data-analysis</span> <h3><a href="/s/excel-xlsx">Excel / XLSX</a></h3> <div class="rec-owner">ivangdavila</div> <div class="rec-desc">创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 368</span> <span style="color:#5b6abf;">📥 140,370</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">data-analysis</span> <h3><a href="/s/data-analysis">Data Analysis</a></h3> <div class="rec-owner">ivangdavila</div> <div class="rec-desc">{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 198</span> <span style="color:#5b6abf;">📥 65,069</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>