一键导入
resolve-issue
Resolve a GitHub issue end-to-end — explore, plan, implement, clean up, and open a draft PR.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Resolve a GitHub issue end-to-end — explore, plan, implement, clean up, and open a draft PR.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Diagnose and fix failing CI on a PR. Capped at 3 attempts. Load repo-setup first.
Refresh /workspace/repo and prepare the correct branch. Load this before any situation skill.
Review a pull request. Self-fix on own PRs, post a review on others'. Load repo-setup first.
Review the current branch's changes against intent. Returns a structured list of findings the caller can hand to a fix-applier, or an empty list when there's nothing to address. Use this for both self-review of your own work and reviewing someone else's PR.
Apply review findings as the smallest code changes, then commit and push. Used on the bot's own PRs.
Triage and respond to comments on a PR. Fix if actionable, reply either way. Load repo-setup first.
| name | resolve-issue |
| description | Resolve a GitHub issue end-to-end — explore, plan, implement, clean up, and open a draft PR. |
| license | Apache-2.0 |
| metadata | {"audience":"autonomous-agents"} |
Take an issue from labeled to "draft PR opened." Load repo-setup
first to prepare /workspace/repo on a feature branch.
Default to shipping a draft PR. A best-effort first cut is more valuable than a "too big" comment. Other agents will review it, fix CI, and respond to feedback.
Read the issue. Lean toward the smallest interpretation.
Check for existing PRs that reference this issue:
gh api "repos/<owner>/<repo>/issues/<number>/timeline" --paginate \
--jq '[.[] | select(.event=="cross-referenced" and .source.issue.pull_request != null) | {number: .source.issue.number, state: .source.issue.state, title: .source.issue.title, url: .source.issue.html_url}]'
Also search PR titles and bodies for the issue number:
gh pr list --search "<number>" --repo <owner>/<repo> --json number,title,state,headRefName,url
gh pr checkout <number>),
review what's done, and continue from there instead of starting
fresh. Load review skill to assess quality first.Understand repo conventions. Delegate this survey to the
explore subagent (read-only, cheaper model) and use its brief; ask
it to report:
CONTRIBUTING.md, AGENTS.md, DEVELOPMENT.md, or similar docsgit log --oneline -20 (commit style)biome.json, .eslintrc*, .prettierrc*,
ruff.toml, pyproject.toml [tool.ruff], .golangci.yml, etc.jest.config*, vitest.config*,
pytest.ini, pyproject.toml [tool.pytest], go.mod, etc..github/workflows/*.yml — note the test
command and count the number of check/job namesClassify the issue: bug report or feature request.
Verify the bug exists. You may delegate the code-path reading
to explore (e.g. "find and summarize the code paths involved in
"), but make the root-cause judgment yourself:
a. Read the relevant code paths identified in the issue body.
b. Cross-check against the default branch HEAD — is the described
behavior actually present in the current code?
c. Try to write a minimal reproduction: a test case, a script, or
a specific input that triggers the bug.
d. If reproducible: report the root cause ("This breaks because
X, in Y path, after Z condition.").
e. If not reproducible: report what was tried and why it failed.
If the bug cannot be reproduced:
issue_comment
webhook will arrive in this session when the reporter replies,
and work will resume from this step.Implement the plan. Once your plan from step 6 is precise, hand
the first-pass edits to the worker subagent (cheaper model), giving
it: the full plan, the working directory (/workspace/repo), the coding
conventions from step 3, and the exact files/changes/tests to write.
Then review worker's output yourself before trusting it — the
correctness judgment stays with you. For small or subtle changes,
just do them directly.
Verify the implementation.
worker.Loop if failing. If tests fail or the issue isn't resolved:
Clean up.
deslop skill — strip AI noise from the diff.review skill — self-review. If findings exist, fix them,
re-run deslop and review. Repeat at most 3 rounds.Commit and push.
Fixes #<number> in the message.Open a draft PR. Load pr skill with:
Closes #<number>).Before pushing, check for conflicts with the default branch:
DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
git fetch origin "$DEFAULT_BRANCH"
git rebase "origin/$DEFAULT_BRANCH"
If the rebase has conflicts:
git diff --name-only --diff-filter=U for conflicted files.<<<<<<<, =======,
>>>>>>>), understand both sides, and resolve.git add <resolved-file> then git rebase --continue.git rebase --abort and note it in the PR description.Never force-push to someone else's branch. On your own feature branch,
a rebase followed by git push --force-with-lease is acceptable.
Before committing, find and run the project's test suite. Check these locations in order and use the first match:
package.json (Node/JS/TS):
jq -r '.scripts.test // empty' package.json
Run with npm test, bun test, pnpm test, or yarn test
depending on the lockfile present.
Makefile / Justfile:
grep -E '^test[ :]' Makefile Justfile 2>/dev/null
Run with make test or just test.
Python (pytest / unittest):
test -f pytest.ini || test -f pyproject.toml || test -f setup.cfg
Run with pytest or python -m pytest.
Go:
test -f go.mod
Run with go test ./....
CI workflows (fallback):
grep -r 'run:.*test' .github/workflows/ 2>/dev/null | head -5
Extract the test command from the workflow file.
If no test command is found within 30 seconds of searching, skip and note "no test suite found" in the PR description. Don't spend more than 2 minutes on a failing test suite that's unrelated to your changes — note it and move on.
Always set a timeout on bash commands that might hang. Use the
timeout parameter (milliseconds) on every bash tool call that
runs tests, builds, or installs dependencies:
pnpm install / npm install / bun install: 120000 (2 min)tsc --noEmit / typecheck: 120000 (2 min)vitest run / jest / test suites: 180000 (3 min)biome check / eslint / lint: 60000 (1 min)If a command times out, that's fine — note it in the PR description and move on. Never run test/build commands without a timeout.
Also: many repos require a codegen or build step before typecheck/tests
work (e.g. pnpm run generate:sdk, pnpm run build). Check
package.json scripts for generate*, codegen*, or prebuild*
scripts and run them first. If they fail or are slow, skip them — the
typecheck/test failures from missing generated files are pre-existing
and not your fault.
Reserve BLOCKED for genuine impossibility (missing auth, deleted repo, contradictory requirements). A best-effort draft PR is almost always better than blocking.