自动获取并筛选 GitHub issues,生成修复分支、PR及评审处理流程。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "gh-issues" 技能: 1. 下载 https://raw.githubusercontent.com/openclaw/openclaw/main/skills/gh-issues/SKILL.md 2. 保存为 ~/.claude/skills/gh-issues/SKILL.md 3. 装好后重载技能,告诉我可以用了
获取这个仓库最近两周新开的 GitHub issues,筛选出适合快速修复的 5 个问题,为每个问题启动后台修复代理,并在完成后自动创建 PR。
返回已筛选的问题列表、各修复任务状态,以及创建好的 PR 链接。
从仓库中获取带有 bug 和 high-priority 标签的未关闭 issues,按修复价值排序,选择最值得处理的 3 个,并为它们分别创建修复 PR。
输出优先级排序结果、入选原因说明,以及对应的修复 PR。
检查这个自动生成 PR 上的 GitHub review comments,总结需要修改的点,更新代码后推送新提交,并回复已处理的评论。
给出评审意见摘要、已实施的修改说明,以及更新后的 PR 状态。
Use for issue-to-PR automation. Prefer gh CLI; fall back to gh api only when a high-level command lacks the needed field.
owner/repo: optional; else infer from git remote get-url origin.--label <label>: filter.--limit <n>: default 10.--milestone <title>: filter.--assignee <login|@me>: filter.--state open|closed|all: default open.--fork <owner/repo>: push branches to fork, PR to source.--watch: poll issues + reviews.--interval <minutes>: default 5.--dry-run: list only.--yes: no confirmation.--reviews-only: skip issue fixing; handle PR reviews.--cron: spawn and exit; implies --yes.--model <id>: pass to workers when supported.--notify-channel <id>: optional final notification target.git remote get-url origin
if [ -z "${GH_TOKEN:-}" ]; then
CONFIG_PATH="${OPENCLAW_CONFIG_PATH:-${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/openclaw.json}"
GH_TOKEN=$(jq -r '.skills.entries["gh-issues"].apiKey // empty' "$CONFIG_PATH" 2>/dev/null || true)
if [ -n "$GH_TOKEN" ]; then export GH_TOKEN; fi
fi
gh auth status
gh repo view OWNER/REPO --json nameWithOwner,defaultBranchRef
If gh auth status fails and GH_TOKEN is missing, stop and ask for GitHub auth/config.
Derived:
SOURCE_REPO: issue repo.PUSH_REPO: fork if set, else source.BASE_BRANCH: source default branch unless user says otherwise.PUSH_REMOTE: fork in fork mode, else origin.Stop on dirty worktree unless user confirms that workers should ignore uncommitted changes.
In fork mode, do not mutate remotes before confirmation or during --dry-run.
Verify auth/read access only:
gh auth token >/dev/null || test -n "${GH_TOKEN:-}"
gh repo view "$PUSH_REPO" --json nameWithOwner
git ls-remote --exit-code origin HEAD
Build filters and fetch:
gh issue list --repo "$SOURCE_REPO" --state open --limit 10 --json number,title,labels,url,body,assignees,milestone
Add --label, --milestone, --assignee, --state, --limit as requested. gh issue list already excludes PRs.
If none found: report no matches. If --dry-run: show compact list and stop.
For each candidate:
gh pr list --repo "$SOURCE_REPO" --search "$SOURCE_REPO#<n>" --state open --json number,url,title,headRefName
gh pr list --repo "$SOURCE_REPO" --head "fix/issue-<n>" --state open --json number,url
gh api "repos/$PUSH_REPO/branches/fix/issue-<n>" >/dev/null
Skip candidates with an open PR, existing branch, or active local claim.
Claim file:
${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/gh-issues-<owner>-<repo>.json
Expire claims older than 2 hours. Create the parent directory before writing.
Unless --yes or --cron, ask user to choose:
allcancelAfter confirmation, in fork mode, configure the push remote before handing work to agents:
gh auth setup-git
git remote get-url fork || git remote add fork "https://github.com/$PUSH_REPO.git"
git remote set-url fork "https://github.com/$PUSH_REPO.git"
git ls-remote --exit-code fork HEAD
Launch up to 8 background workers. Do not block on each worker when --cron.
Before each spawn, write a claim for SOURCE_REPO#<n> with the current ISO timestamp. After a worker reports PR/failure, remove or update the claim. This prevents watch/cron overlap before a branch or PR exists.
Worker prompt must include:
SOURCE_REPO, PUSH_REPO, BASE_BRANCH, PUSH_REMOTE, fork mode.fix/issue-<n>.Worker instructions:
Use gh and git. Do not handwave.
Checkout/create fix/issue-<n> from BASE_BRANCH.
Implement minimal fix.
Run relevant tests.
Commit with conventional message.
…
帮助团队检索重复的 PR 与问题单,并自动分组同步重复状态。
帮助你用 gh CLI 处理当前分支 GitHub PR 的评审与问题评论。