Fetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label b...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install gh-issues或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install gh-issues⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/gh-issues/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: gh-issues description: "Fetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]" user-invocable: true metadata: { "openclaw": { "requires": { "bins": ["curl", "git", "gh"] }, "primaryEnv": "GH_TOKEN", "install": [ { "id": "brew", "kind": "brew", "formula": "gh", "bins": ["gh"], "label": "Install GitHub CLI (brew)", }, ], }, } ---
You are an orchestrator. Follow these 6 phases exactly. Do not skip phases.
IMPORTANT — No gh CLI dependency. This skill uses curl + the GitHub REST API exclusively. The GH_TOKEN env var is already injected by OpenClaw. Pass it as a Bearer token in all API calls:
curl -s -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github+json" ...
---
Parse the arguments string provided after /gh-issues.
Positional:
git remote get-url origin Extract owner/repo from the URL (handles both HTTPS and SSH formats). - HTTPS: https://github.com/owner/repo.git → owner/repo - SSH: [email protected]:owner/repo.git → owner/repo If not in a git repo or no remote found, stop with an error asking the user to specify owner/repo.
Flags (all optional): | Flag | Default | Description | |------|---------|-------------| | --label | _(none)_ | Filter by label (e.g. bug, enhancement) | | --limit | 10 | Max issues to fetch per poll | | --milestone | _(none)_ | Filter by milestone title | | --assignee | _(none)_ | Filter by assignee (@me for self) | | --state | open | Issue state: open, closed, all | | --fork | _(none)_ | Your fork (user/repo) to push branches and open PRs from. Issues are fetched from the source repo; code is pushed to the fork; PRs are opened from the fork to the source repo. | | --watch | false | Keep polling for new issues and PR reviews after each batch | | --interval | 5 | Minutes between polls (only with --watch) | | --dry-run | false | Fetch and display only — no sub-agents | | --yes | false | Skip confirmation and auto-process all filtered issues | | --reviews-only | false | Skip issue processing (Phases 2-5). Only run Phase 6 — check open PRs for review comments and address them. | | --cron | false | Cron-safe mode: fetch issues and spawn sub-agents, exit without waiting for results. | | --model | _(none)_ | Model to use for sub-agents (e.g. glm-5, zai/glm-5). If not specified, uses the agent's default model. | | --notify-channel | _(none)_ | Telegram channel ID to send final PR summary to (e.g. -1002381931352). Only the final result with PR links is sent, not status updates. |
Store parsed values for use in subsequent phases.
Derived values:
If --reviews-only is set: Skip directly to Phase 6. Run token resolution (from Phase 2) first, then jump to Phase 6.
If --cron is set:
--yes (skip confirmation)--reviews-only is also set, run token resolution then jump to Phase 6 (cron review mode)---
Token Resolution: First, ensure GH_TOKEN is available. Check environment:
echo $GH_TOKEN
If empty, read from config:
cat ~/.openclaw/openclaw.json | jq -r '.skills.entries["gh-issues"].apiKey // empty'
If still empty, check /data/.clawdbot/openclaw.json:
cat /data/.clawdbot/openclaw.json | jq -r '.skills.entries["gh-issues"].apiKey // empty'
Export as GH_TOKEN for subsequent commands:
export GH_TOKEN="<token>"
Build and run a curl request to the GitHub Issues API via exec:
curl -s -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/{SOURCE_REPO}/issues?per_page={limit}&state={state}&{query_params}"
Where {query_params} is built from:
GET /user)IMPORTANT: The GitHub Issues API also returns pull requests. Filter them out — exclude any item where pull_request key exists in the response object.
If in watch mode: Also filter out any issue numbers already in the PROCESSED_ISSUES set from previous batches.
Error handling:
> "GitHub authentication failed. Please check your apiKey in the OpenClaw dashboard or in ~/.openclaw/openclaw.json under skills.entries.gh-issues."
Parse the JSON response. For each issue, extract: number, title, body, labels (array of label names), assignees, html_url.
---
Display a markdown table of fetched issues:
| # | Title | Labels | | --- | ----------------------------- | ------------- | | 42 | Fix null pointer in parser | bug, critical | | 37 | Add retry logic for API calls | enhancement |
If FORK_MODE is active, also display:
> "Fork mode: branches will be pushed to {PUSH_REPO}, PRs will target {SOURCE_REPO}"
If --dry-run is active:
If --yes is active:
Otherwise: Ask the user to confirm which issues to process:
42, 37) — process only thoseWait for user response before proceeding.
Watch mode note: On the first poll, always confirm with the user (unless --yes is set). On subsequent polls, auto-process all new issues without re-confirming (the user already opted in). Still display the table so they can see what's being processed.
---
Run these checks sequentially via exec:
``` git status --porcelain ```
If output is non-empty, warn the user:
> "Working tree has uncommitted changes. Sub-agents will create branches from HEAD — uncommitted changes will NOT be included. Continue?" > Wait for confirmation. If declined, stop.
``` git rev-parse --abbrev-ref HEAD ```
Store as BASE_BRANCH.
If FORK_MODE: - Verify the fork remote exists. Check if a git remote named fork exists: ``` git remote get-url fork ``` If it doesn't exist, add it: ``` git remote add fork https://x-access-token:[email protected]/{PUSH_REPO}.git ``` - Also verify origin (the source repo) is reachable: ``` git ls-remote --exit-code origin HEAD ```
If not FORK_MODE:
``` git ls-remote --exit-code origin HEAD ```
...
安装 gh-issues 后,可以对 AI 说这些话来触发它
Help me get started with gh-issues
Explains what gh-issues does, walks through the setup, and runs a quick demo based on your current project
Use gh-issues to fetch GitHub issues, spawn sub-agents to implement fixes and open P...
Invokes gh-issues with the right parameters and returns the result directly in the conversation
What can I do with gh-issues in my developer & devops workflow?
Lists the top use cases for gh-issues, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/gh-issues/ 目录(个人级,所有项目可用),或 .claude/skills/gh-issues/(项目级)。重启 AI 客户端后,用 /gh-issues 主动调用,或让 AI 根据上下文自动发现并使用。
gh-issues 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
gh-issues 可免费安装使用。请查阅仓库了解许可证信息。
Fetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label b...
gh-issues 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using gh-issues
Identifies repetitive steps in your workflow and sets up gh-issues to handle them automatically