From 067f327fe6874e9da74618782e2a9847ba96e076 Mon Sep 17 00:00:00 2001 From: "Terry.Mao" Date: Wed, 4 Nov 2026 17:15:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs(skill):=20=E8=AE=A9=20resolve-pr=20?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=20PR=20=E5=88=86=E6=94=AF=E5=B9=B6=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agents/skills/resolve-pr/SKILL.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.agents/skills/resolve-pr/SKILL.md b/.agents/skills/resolve-pr/SKILL.md index 5ee5d9f..41e0519 100644 --- a/.agents/skills/resolve-pr/SKILL.md +++ b/.agents/skills/resolve-pr/SKILL.md @@ -8,9 +8,18 @@ description: Address actionable feedback on an existing pull request, including ## Workflow 1. Identify the PR from the supplied URL or number, otherwise from the current - branch. Verify the repository and that this checkout matches the PR head - before editing. If the target is ambiguous, stop before editing. Preserve - unrelated local changes; do not rebase or reset without a request. + branch. Read its head repository, branch, and SHA; check the current branch, + worktree status, and other worktrees before editing. If already on the PR + head branch in the right repository, stay in this worktree. Otherwise reuse + its existing worktree, or follow `git-worktree` safety checks to create an + isolated worktree at `.worktrees/` from the PR head, leaving the + current branch and unrelated changes untouched. Fetch the PR head when + needed; fast-forward a clean local branch only when safe. Verify the chosen + branch tracks the PR head and can push to its repository. If local commits + or dirty changes already exist on that branch, inspect them and continue + only when they belong to this PR. Stop before editing if the branch diverged, + the target path is occupied, fork access is unavailable, or the target is + ambiguous. Do not rebase or reset without a request. 2. Read repository guidance, worktree status, the current diff, unresolved review threads (including replies), non-empty review bodies, and top-level PR comments. Paginate each surface and deduplicate repeated feedback. Ignore @@ -20,6 +29,11 @@ description: Address actionable feedback on an existing pull request, including it is already addressed, or explain factually why it is incorrect or out of scope. Group related fixes by root cause. 4. For code changes, make the smallest coherent fix and run relevant validation. + If Git reports unmerged paths during the requested PR work, verify they + belong to this PR, then use `resolve-merge-conflicts` to inspect and resolve + them. Complete the interrupted Git operation, rerun affected validation, + and only then continue with the PR fix. This does not authorize starting a + rebase or reset merely to sync the branch. Use `git-commit` and `git-push` to commit and publish fixes. Do not commit when feedback only needs an answer or verification. 5. Resolve a review thread only after its requested outcome is complete and @@ -39,7 +53,8 @@ are needed. ## Report -Report fixes, answers, already-addressed or declined items, reviewer follow-up, -resolved threads, commits pushed, validation, and CI state. Do not call review +Report the PR branch/worktree used, fixes, answers, already-addressed or +declined items, reviewer follow-up, resolved threads, commits pushed, +validation, and CI state. Do not call review bodies or top-level comments resolved, or imply a commit or push when none was needed. From 7eb214aeb46c6409b50da7dc8f166b2d36f947de Mon Sep 17 00:00:00 2001 From: "Terry.Mao" Date: Wed, 4 Nov 2026 17:39:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs(skill):=20=E4=BF=AE=E6=AD=A3=20resolve?= =?UTF-8?q?-pr=20=E7=9A=84=20worktree=20=E5=88=86=E6=94=AF=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agents/skills/resolve-pr/SKILL.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.agents/skills/resolve-pr/SKILL.md b/.agents/skills/resolve-pr/SKILL.md index 41e0519..0e26b4d 100644 --- a/.agents/skills/resolve-pr/SKILL.md +++ b/.agents/skills/resolve-pr/SKILL.md @@ -10,16 +10,24 @@ description: Address actionable feedback on an existing pull request, including 1. Identify the PR from the supplied URL or number, otherwise from the current branch. Read its head repository, branch, and SHA; check the current branch, worktree status, and other worktrees before editing. If already on the PR - head branch in the right repository, stay in this worktree. Otherwise reuse - its existing worktree, or follow `git-worktree` safety checks to create an - isolated worktree at `.worktrees/` from the PR head, leaving the - current branch and unrelated changes untouched. Fetch the PR head when - needed; fast-forward a clean local branch only when safe. Verify the chosen - branch tracks the PR head and can push to its repository. If local commits - or dirty changes already exist on that branch, inspect them and continue - only when they belong to this PR. Stop before editing if the branch diverged, - the target path is occupied, fork access is unavailable, or the target is - ambiguous. Do not rebase or reset without a request. + head branch in the right repository, stay in this worktree; if that branch + is checked out in another worktree, use that worktree. Otherwise follow + `git-worktree` safety checks, validate the branch name and target path, and + create `.worktrees/` without disturbing the current worktree: + - For an existing local PR branch, use `git worktree add `; + do not pass `-b` or create a second branch. + - For a missing local branch, fetch the PR head from its repository, verify + the fetched SHA, then use `git worktree add --track -b + /`. Do not branch from the PR base. + Verify the selected branch's upstream points to a writable remote for the + PR head. If an existing branch has no upstream, first verify the remote ref + matches the PR head, then run `git branch --set-upstream-to=/ + `; stop if its upstream points elsewhere. Fast-forward a + clean branch that is behind the PR head only when safe. Inspect local commits + or dirty changes and continue only when they belong to this PR. Stop before + editing if the branch diverged, the path is occupied, fork access is + unavailable, or the target is ambiguous. Do not rebase or reset without a + request. 2. Read repository guidance, worktree status, the current diff, unresolved review threads (including replies), non-empty review bodies, and top-level PR comments. Paginate each surface and deduplicate repeated feedback. Ignore