[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77JVCKV85FT0AJ8JE7RV6QH":3,"skill-same:01M77JVCKV85FT0AJ8JE7RV6QH":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M77JVCKV85FT0AJ8JE7RV6QH","pr-fix",null,"PR Review Fix: automatically fix all issues identified in a pr-review report.\nUse when: (1) User says \"fix all review issues\", (2) User says \"\u002Fpr-fix\",\n(3) After pr-review skill has produced a report, (4) User wants to address PR review feedback.","finewood2008\u002Fcentaurai-station-solo","finewood2008","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F212194470?v=4","01M75HGRZJ31P9W3T90VHFS1X8","Finewood","01M77JTDCYSHEZ7JPRS5B0CR5W",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-fix\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pr-fix\ndescription: |\n  PR Review Fix: automatically fix all issues identified in a pr-review report.\n  Use when: (1) User says \"fix all review issues\", (2) User says \"\u002Fpr-fix\",\n  (3) After pr-review skill has produced a report, (4) User wants to address PR review feedback.\n---\n\n# PR Review Fix Skill\n\nAutomated workflow to resolve all issues surfaced in a pr-review report — parse summary → detect PR status → create fix branch or checkout original branch → **triage & validate** → fix by priority → quality gate → commit → publish → verify.\n\n**Announce at start:** \"I'm using pr-fix skill to fix all review issues.\"\n\n## Usage\n\n```\n\u002Fpr-fix [pr_number]\n```\n\n`pr_number` is optional. The skill requires a pr-review report to be present in the current session.\n\n---\n\n## Mode Detection\n\nAt the very start of execution, check `$ARGUMENTS` for the `--automation` flag:\n\n```bash\n# $ARGUMENTS example: \"123 --automation\" or \"123\"\nAUTOMATION_MODE=false\nif echo \"$ARGUMENTS\" | grep -q -- '--automation'; then\n  AUTOMATION_MODE=true\nfi\n```\n\nIn **automation mode**:\n\n- Skip all yes\u002Fno confirmation prompts — follow the default best path\n\n---\n\n## Steps\n\n### Step 0 — Locate the Review Report\n\nThe pr-review skill must have been executed in the current session. The review report (containing a \"汇总\" table) must be present in the conversation.\n\nIf no review report is found in the current session, abort immediately with:\n\n> No pr-review report found in this session. Please run `\u002Fpr-review \u003Cpr_number>` first.\n\nExtract the PR number from the report header:\n\n```\n## Code Review：\u003CPR 标题> (#\u003CPR_NUMBER>)\n```\n\nIf `pr_number` is provided as an argument, use it to override the extracted number.\n\n---\n\n### Step 1 — Parse the Summary Table\n\nLocate the **汇总** section in the review report:\n\n```markdown\n| #   | 严重级别    | 文件        | 问题 |\n| --- | ----------- | ----------- | ---- |\n| 1   | 🔴 CRITICAL | `file.ts:N` | ...  |\n```\n\nBuild an ordered issue list, grouped by severity:\n\n| Priority | Severity | Emoji |\n| -------- | -------- | ----- |\n| 1        | CRITICAL | 🔴    |\n| 2        | HIGH     | 🟠    |\n| 3        | MEDIUM   | 🟡    |\n| 4        | LOW      | 🔵    |\n\nIf the 汇总 table is empty, abort with:\n\n> No issues found in the review summary. Nothing to fix.\n\n**LOW issues:** Skip — do not fix.\n\nAfter filtering out LOW issues, if no CRITICAL \u002F HIGH \u002F MEDIUM issues remain, abort with:\n\n> All issues are LOW severity — nothing actionable to fix. (pr-fix only addresses CRITICAL, HIGH, and MEDIUM issues)\n\nThis guard prevents running the full workflow (checkout, quality gate, commit) with no changes to make.\n\n---\n\n### Step 2 — Pre-flight Checks\n\n```bash\ngh pr view \u003CPR_NUMBER> \\\n  --json headRefName,baseRefName,state,isCrossRepository,maintainerCanModify,headRepositoryOwner \\\n  --jq '{head: .headRefName, base: .baseRefName, state: .state, isFork: .isCrossRepository, canModify: .maintainerCanModify, forkOwner: .headRepositoryOwner.login}'\n```\n\nSave `\u003Chead_branch>`, `\u003Cbase_branch>`, `\u003Cstate>`, `\u003CIS_FORK>`, `\u003CCAN_MODIFY>`, and `\u003CFORK_OWNER>` for later steps.\n\n**Determine path based on results:**\n\n| state    | IS_FORK | CAN_MODIFY | Path                                           |\n| -------- | ------- | ---------- | ---------------------------------------------- |\n| `MERGED` | any     | any        | Abort — nothing to fix                         |\n| `OPEN`   | `false` | any        | Same-repo — push to original branch            |\n| `OPEN`   | `true`  | `true`     | Fork — push to fork branch via gh checkout     |\n| `OPEN`   | `true`  | `false`    | Fork fallback — create fix branch on main repo |\n\nIf state is `MERGED`: abort with:\n\n> PR #\u003CPR_NUMBER> has already been merged. Nothing to fix.\n\nIf `IS_FORK=true` AND `CAN_MODIFY=false`: set `FORK_FALLBACK=true` and continue.\nIn this path (Step 3 onwards), fixes are applied on a new branch in the main repo instead of the fork.\nSave `FIX_BRANCH=bot\u002Ffix-pr-\u003CPR_NUMBER>` for use in Step 3 and Step 8.\n\n---\n\n### Step 3 — Create Worktree and Prepare Branch\n\nCreate an isolated worktree for this PR fix. The main repo stays on its current branch.\n\n```bash\nREPO_ROOT=$(git rev-parse --show-toplevel)\nPR_NUMBER=\u003CPR_NUMBER>\nWORKTREE_DIR=\"\u002Ftmp\u002Faionui-pr-${PR_NUMBER}\"\n\n# Clean up any stale worktree from a previous crash\ngit worktree remove \"$WORKTREE_DIR\" --force 2>\u002Fdev\u002Fnull || true\n```\n\n**Same-repo PR (`IS_FORK=false`):**\n\n```bash\ngit fetch origin \u003Chead_branch>\ngit worktree add \"$WORKTREE_DIR\" origin\u002F\u003Chead_branch> --detach\ncd \"$WORKTREE_DIR\"\n```\n\n**Fork PR with maintainer access (`IS_FORK=true`, `CAN_MODIFY=true`):**\n\n```bash\ngit worktree add \"$WORKTREE_DIR\" --detach\ncd \"$WORKTREE_DIR\"\ngh pr checkout \u003CPR_NUMBER>\n```\n\n`gh pr checkout` inside the worktree sets up the fork remote and branch tracking correctly.\n\n**Fork PR without maintainer access (`FORK_FALLBACK=true`):**\n\n```bash\ngit fetch origin \u003Cbase_branch>\ngit worktree add \"$WORKTREE_DIR\" origin\u002F\u003Cbase_branch> --detach\ncd \"$WORKTREE_DIR\"\n# Merge PR's commits into the detached HEAD\ngh pr checkout \u003CPR_NUMBER> --detach\ngit checkout -  # back to the base commit\ngit merge --no-ff --no-edit FETCH_HEAD\n```\n\n**All paths — symlink node_modules and rebuild native modules:**\n\n```bash\nln -s \"$REPO_ROOT\u002Fnode_modules\" \"$WORKTREE_DIR\u002Fnode_modules\"\ncd \"$WORKTREE_DIR\"\nnpx electron-rebuild -f -w better-sqlite3 2>\u002Fdev\u002Fnull || true\n```\n\nThe `electron-rebuild` step recompiles native modules (e.g., `better-sqlite3`) against the Electron version used by this project, ensuring ABI compatibility.\n\nSave `REPO_ROOT` and `WORKTREE_DIR` for later steps. All file reads, edits, lint, and test commands from this point forward run inside `WORKTREE_DIR`.\n\n---\n\n### Step 4 — Triage & Validate\n\nBefore fixing anything, independently verify each issue from the review report. This prevents blind application of potentially incorrect or suboptimal fixes.\n\nAll file operations in this step use worktree paths (`$WORKTREE_DIR\u002F\u003Crelative_path>`).\n\n**For each CRITICAL \u002F HIGH \u002F MEDIUM issue (skip LOW), perform three-layer triage:**\n\n#### Layer 1 — Is the issue real?\n\nRead the target file and the surrounding context. Independently assess whether the reported problem actually exists:\n\n- Does the problematic code pattern still exist at the reported location? (Review may be based on an older version)\n- Is the reported behavior actually a bug, or is it intentional design? (Check PR description, related files, project conventions)\n- Does the reviewer's reasoning hold up given the full context?\n\nIf the issue is **not real** → mark as `DISMISSED` with a clear reason.\n\n#### Layer 2 — Is the suggested fix reasonable?\n\nIf the issue is real, evaluate the review report's \"修复建议\":\n\n- Does the suggested fix actually resolve the problem?\n- Does it introduce side effects (type errors, behavioral changes, broken imports)?\n- Is it consistent with the project's patterns and conventions?\n\nIf the suggestion is **reasonable** → mark as `FIX` (adopt the original suggestion).\n\n#### Layer 3 — Is there a better fix?\n\nIf the suggestion is flawed or suboptimal, consider an alternative:\n\n- The alternative must target the **same file(s) and same code area** — do not expand scope\n- The alternative must solve the **same problem**, just with a different approach\n- The alternative's diff should not be significantly larger than the original suggestion — if it is, the change likely exceeds fix scope and should be a separate PR\n\nIf a better fix exists → mark as `FIX_ALT` with the alternative plan.\nIf no better fix exists → fall back to `FIX` (adopt the original suggestion despite its flaws, as long as it doesn't make things worse).\n\n#### Triage output\n\nBuild an enhanced issue list. Each issue now has:\n\n| Field      | Values                          | Description                                                                  |\n| ---------- | ------------------------------- | ---------------------------------------------------------------------------- |\n| `verdict`  | `FIX` \u002F `FIX_ALT` \u002F `DISMISSED` | Triage decision                                                              |\n| `reason`   | free text                       | Why this verdict was chosen                                                  |\n| `fix_plan` | code\u002Fdescription                | The actual fix to apply (`FIX`: original suggestion; `FIX_ALT`: alternative) |\n\n#### CRITICAL issue constraints\n\n**Automation mode (`--automation`):** CRITICAL issues **cannot** be dismissed. If triage concludes a CRITICAL issue is a false positive, the fixer must escalate — abort the fix workflow and transfer to human review:\n\n```bash\ngh pr edit \u003CPR_NUMBER> --remove-label \"bot:fixing\" --add-label \"bot:needs-human-review\"\ngh pr comment \u003CPR_NUMBER> --body \"\u003C!-- pr-automation-bot -->\n⚠️ Triage 阶段发现 CRITICAL 问题 #\u003Cissue_number> 可能为误报，但自动化流程无法自行驳回 CRITICAL 级别问题，已转交人工确认。\n\n**问题：** \u003Cissue description>\n**驳回理由：** \u003Creason>\"\n```\n\nThen **EXIT**.\n\n**Interactive mode (no `--automation`):** Present the dismissal reasoning to the user and ask for confirmation:\n\n> Triage 认为 CRITICAL 问题 #N 可能是误报：\u003Creason>\n> 是否同意驳回此问题？(yes\u002Fno)\n\n- User says **yes** → mark as `DISMISSED`\n- User says **no** → mark as `FIX` (apply original suggestion)\n\n#### Post-triage check\n\nAfter triage, if all non-LOW issues are `DISMISSED`, abort with:\n\n> All issues were dismissed during triage — nothing to fix.\n\nIn automation mode, also transfer to human review (since at least one issue was CRITICAL\u002FHIGH\u002FMEDIUM but all were dismissed, a human should confirm):\n\n```bash\ngh pr edit \u003CPR_NUMBER> --remove-label \"bot:fixing\" --add-label \"bot:needs-human-review\"\n```\n\n---\n\n### Step 5 — Fix Issues by Priority\n\nAll file operations in this step use worktree paths. The Read tool should target `$WORKTREE_DIR\u002F\u003Crelative_path>`, and the Edit tool should modify files at the same worktree paths.\n\nProcess only issues with verdict `FIX` or `FIX_ALT` from the triage output, in order CRITICAL → HIGH → MEDIUM. For each issue:\n\n1. Read the target file (use Read tool at the file path from the summary table)\n2. Locate the exact problem — match the review report's quoted code and line number\n3. Apply the `fix_plan` from triage (original suggestion for `FIX`, alternative for `FIX_ALT`)\n4. After fixing each file batch, run a quick type check:\n\n```bash\nbunx tsc --noEmit\n```\n\nResolve any type errors before moving to the next issue.\n\n**Batching:** Group issues in the same file into a single pass.\n\n---\n\n### Step 6 — Full Quality Gate\n\nAll commands run inside the worktree (`$WORKTREE_DIR`):\n\n```bash\nbun run lint:fix\nbun run format\nbunx tsc --noEmit\nbun run test\n```\n\n**All four must pass.** Fix any failures caused by the current changes before proceeding.\n\n---\n\n### Step 7 — Commit\n\nFollow the [commit skill](..\u002Fcommit\u002FSKILL.md) workflow. Commit message **must** reference the original PR:\n\n```\nfix(\u003Cscope>): address review issues from PR #\u003CPR_NUMBER>\n\n- Fix \u003CCRITICAL\u002FHIGH issue 1 description>\n- Fix \u003Cissue 2 description>\n- ...\n\nReview follow-up for #\u003CPR_NUMBER>\n```\n\n---\n\n### Step 8 — Publish\n\n**Same-repo PR (`IS_FORK=false`):**\n\n```bash\ncd \"$WORKTREE_DIR\"\ngit push origin HEAD:\u003Chead_branch>\n```\n\n**Fork PR with maintainer access (`IS_FORK=true`, `CAN_MODIFY=true`):**\n\n```bash\ncd \"$WORKTREE_DIR\"\ngit push \u003CFORK_OWNER> HEAD:\u003Chead_branch>\n```\n\n`gh pr checkout` set up `\u003CFORK_OWNER>` as the remote pointing to the fork. Pushing with `HEAD:\u003Chead_branch>` ensures the commit lands on the fork's branch, which is the PR's actual head.\n\nOutput to user:\n\n> 已推送到 `\u003Chead_branch>`，PR #\u003CPR_NUMBER> 已自动更新。无需创建新 PR。\n\n**Fork PR without maintainer access (`FORK_FALLBACK=true`):**\n\nPush the fix branch to the main repo and open a new PR:\n\n```bash\ncd \"$WORKTREE_DIR\"\ngit push origin HEAD:bot\u002Ffix-pr-\u003CPR_NUMBER>\n```\n\nThen open a new PR and immediately enable auto-merge:\n\n```bash\nNEW_PR_URL=$(gh pr create \\\n  --base \u003CBASE_REF> \\\n  --head bot\u002Ffix-pr-\u003CPR_NUMBER> \\\n  --label \"bot:done\" \\\n  --title \"fix: address review issues from fork PR #\u003CPR_NUMBER>\" \\\n  --body \"$(cat \u003C\u003C'EOF'\nThis PR applies fixes identified during review of #\u003CPR_NUMBER>.\n\nThe original fork PR has no maintainer push access, so fixes are applied here as a follow-up.\nLocal quality gate (lint\u002Ftest\u002Ftsc) already passed — auto-merging once CI is green.\n\nCloses #\u003CPR_NUMBER>\nEOF\n)\")\n\nNEW_PR_NUMBER=$(echo \"$NEW_PR_URL\" | grep -o '[0-9]*$')\ngh pr merge \"$NEW_PR_NUMBER\" --squash --auto\n\n# Close original fork PR immediately with a comment (don't wait for Closes #N)\ngh pr close \u003CPR_NUMBER> --comment \"\u003C!-- pr-fix-verification -->\n原 PR 为 fork 且未开启 maintainer 写入权限，无法直接推送修复。\n已在主仓库创建跟进 PR #${NEW_PR_NUMBER}，包含本次 review 的所有修复，CI 通过后将自动合并。\"\n```\n\nClosing immediately ensures pr-automation won't pick up the original PR in the next round (closed PRs are excluded by `--state open` in Step 1). No need to set `bot:done` label since the PR is closed.\n\nOutput to user:\n\n> Fork PR 无 maintainer 写入权限，已在主仓库创建跟进 PR #\u003CNEW_PR_NUMBER>，CI 通过后自动合并。\n\n---\n\n### Step 9 — Verification Report\n\nFor each issue in the original summary table, verify the fix exists in actual code:\n\n1. Read the relevant file (Read tool)\n2. Grep for the original problematic pattern to confirm it is gone\n3. Confirm the corrected code is in place\n\nPost the verification report as a PR comment AND output it in the conversation. The report now includes a **Triage 决策** section before the fix table:\n\n```bash\ngh pr comment \u003CPR_NUMBER> --body \"$(cat \u003C\u003C'EOF'\n\u003C!-- pr-fix-verification -->\n## PR Fix 验证报告\n\n**原始 PR:** #\u003CPR_NUMBER>\n**修复方式:** 直接推送到 `\u003Chead_branch>`\n\n### Triage 决策\n\n| # | 严重级别 | 原始问题 | 判定 | 理由 |\n|---|---------|---------|------|------|\n| 2 | 🟠 HIGH | \u003C问题描述> | ⏭️ 驳回 | \u003C驳回理由，引用具体代码或项目约定> |\n| 3 | 🟡 MEDIUM | \u003C问题描述> | 🔄 替代方案 | \u003C为什么原建议不适用，替代方案是什么> |\n\n> 仅列出被驳回（DISMISSED）或使用替代方案（FIX_ALT）的问题。采纳原建议（FIX）的问题不在此表中。\n> 若所有问题均采纳原建议，省略此区块。\n\n### 修复结果\n\n| # | 严重级别 | 文件 | 问题 | 修复方式 | 状态 |\n|---|---------|------|------|---------|------|\n| 1 | 🔴 CRITICAL | `file.ts:N` | \u003C原始问题> | \u003C修复措施> | ✅ 已修复 |\n| 2 | 🟠 HIGH     | `file.ts:N` | \u003C原始问题> | \u003C修复措施> | ✅ 已修复（替代方案） |\n| 3 | 🟡 MEDIUM   | `file.ts:N` | \u003C原始问题> | — | ⏭️ 驳回 |\n\n**总结：** ✅ 已修复 N 个 | 🔄 替代方案 N 个 | ⏭️ 驳回 N 个 | ❌ 未能修复 N 个\n\n> 🔵 LOW 级别问题已跳过（不阻塞合并，修复优先级低）。\nEOF\n)\"\n```\n\nAfter posting, output the same verification table in the conversation for immediate review.\n\n---\n\n### Step 10 — Cleanup\n\nRemove the worktree. All paths use `--detach` so no local branches were created.\n\n```bash\ncd \"$REPO_ROOT\"\ngit worktree remove \"$WORKTREE_DIR\" --force 2>\u002Fdev\u002Fnull || true\n```\n\n---\n\n## Mandatory Rules\n\n- **No AI signature** — no `Co-Authored-By`, `Generated with`, or any AI byline\n- **Always reference original PR** — every commit and PR body must include `Review follow-up for #\u003CPR_NUMBER>`\n- **No issue creation** — this skill skips the issue-association step in pr skill\n- **Fix, don't workaround** — no `\u002F\u002F @ts-ignore`, no lint suppression; address the root cause\n- **Triage before fix** — never blindly apply review suggestions; independently verify each issue and evaluate the proposed fix\n- **Fix scope = review scope** — alternative fixes must target the same files and same problem; do not expand scope or refactor beyond what the issue requires\n- **CRITICAL cannot be auto-dismissed** — in automation mode, dismissing a CRITICAL issue requires human escalation\n\n---\n\n## Quick Reference\n\n```\n 0. Require pr-review report in current session — abort if not found\n 1. Parse summary table → ordered issue list\n 2. Pre-flight: fetch PR info (state, isCrossRepository, maintainerCanModify, forkOwner)\n    → ABORT: state=MERGED\n 3. Create worktree at \u002Ftmp\u002Faionui-pr-\u003CPR_NUMBER> (all paths use --detach):\n    → same-repo:        git fetch + git worktree add --detach\n    → fork+canModify:   git worktree add --detach + gh pr checkout \u003CPR_NUMBER>\n    → fork+fallback:    git worktree add --detach + merge fork head\n 4. Triage & Validate: verify each issue independently (3-layer check)\n    → Layer 1: is issue real? → DISMISSED if false positive\n    → Layer 2: is suggested fix reasonable? → FIX if yes\n    → Layer 3: is there a better fix? → FIX_ALT if yes\n    → CRITICAL cannot be auto-dismissed in automation mode (escalate to human)\n 5. Fix issues with verdict FIX\u002FFIX_ALT, CRITICAL→HIGH→MEDIUM; tsc after each batch\n 6. bun run lint:fix && bun run format && bunx tsc --noEmit && bun run test (in worktree)\n 7. Commit: fix(\u003Cscope>): address review issues from PR #N\n 8. Push from worktree (same-repo \u002F fork+canModify \u002F fork+fallback)\n 9. Verify → post Triage 决策 + 修复结果 as gh pr comment + output in conversation\n10. Cleanup: git worktree remove + git branch -D (worktree and local branches)\n```\n","# PR Review Fix Skill\n\nAutomated workflow to resolve all issues surfaced in a pr-review report — parse summary → detect PR status → create fix branch or checkout original branch → **triage & validate** → fix by priority → quality gate → commit → publish → verify.\n\n**Announce at start:** \"I'm using pr-fix skill to fix all review issues.\"\n\n## Usage\n\n```\n\u002Fpr-fix [pr_number]\n```\n\n`pr_number` is optional. The skill requires a pr-review report to be present in the current session.\n\n---\n\n## Mode Detection\n\nAt the very start of execution, check `$ARGUMENTS` for the `--automation` flag:\n\n```bash\n# $ARGUMENTS example: \"123 --automation\" or \"123\"\nAUTOMATION_MODE=false\nif echo \"$ARGUMENTS\" | grep -q -- '--automation'; then\n  AUTOMATION_MODE=true\nfi\n```\n\nIn **automation mode**:\n\n- Skip all yes\u002Fno confirmation prompts — follow the default best path\n\n---\n\n## Steps\n\n### Step 0 — Locate the Review Report\n\nThe pr-review skill must have been executed in the current session. The review report (containing a \"汇总\" table) must be present in the conversation.\n\nIf no review report is found in the current session, abort immediately with:\n\n> No pr-review report found in this session. Please run `\u002Fpr-review \u003Cpr_number>` first.\n\nExtract the PR number from the report header:\n\n```\n## Code Review：\u003CPR 标题> (#\u003CPR_NUMBER>)\n```\n\nIf `pr_number` is provided as an argument, use it to override the extracted number.\n\n---\n\n### Step 1 — Parse the Summary Table\n\nLocate the **汇总** section in the review report:\n\n```markdown\n| #   | 严重级别    | 文件        | 问题 |\n| --- | ----------- | ----------- | ---- |\n| 1   | 🔴 CRITICAL | `file.ts:N` | ...  |\n```\n\nBuild an ordered issue list, grouped by severity:\n\n| Priority | Severity | Emoji |\n| -------- | -------- | ----- |\n| 1        | CRITICAL | 🔴    |\n| 2        | HIGH     | 🟠    |\n| 3        | MEDIUM   | 🟡    |\n| 4        | LOW      | 🔵    |\n\nIf the 汇总 table is empty, abort with:\n\n> No issues found in the review summary. Nothing to fix.\n\n**LOW issues:** Skip — do not fix.\n\nAfter filtering out LOW issues, if no CRITICAL \u002F HIGH \u002F MEDIUM issues remain, abort with:\n\n> All issues are LOW severity — nothing actionable to fix. (pr-fix only addresses CRITICAL, HIGH, and MEDIUM issues)\n\nThis guard prevents running the full workflow (checkout, quality gate, commit) with no changes to make.\n\n---\n\n### Step 2 — Pre-flight Checks\n\n```bash\ngh pr view \u003CPR_NUMBER> \\\n  --json headRefName,baseRefName,state,isCrossRepository,maintainerCanModify,headRepositoryOwner \\\n  --jq '{head: .headRefName, base: .baseRefName, state: .state, isFork: .isCrossRepository, canModify: .maintainerCanModify, forkOwner: .headRepositoryOwner.login}'\n```\n\nSave `\u003Chead_branch>`, `\u003Cbase_branch>`, `\u003Cstate>`, `\u003CIS_FORK>`, `\u003CCAN_MODIFY>`, and `\u003CFORK_OWNER>` for later steps.\n\n**Determine path based on results:**\n\n| state    | IS_FORK | CAN_MODIFY | Path                                           |\n| -------- | ------- | ---------- | ---------------------------------------------- |\n| `MERGED` | any     | any        | Abort — nothing to fix                         |\n| `OPEN`   | `false` | any        | Same-repo — push to original branch            |\n| `OPEN`   | `true`  | `true`     | Fork — push to fork branch via gh checkout     |\n| `OPEN`   | `true`  | `false`    | Fork fallback — create fix branch on main repo |\n\nIf state is `MERGED`: abort with:\n\n> PR #\u003CPR_NUMBER> has already been merged. Nothing to fix.\n\nIf `IS_FORK=true` AND `CAN_MODIFY=false`: set `FORK_FALLBACK=true` and continue.\nIn this path (Step 3 onwards), fixes are applied on a new branch in the main repo instead of the fork.\nSave `FIX_BRANCH=bot\u002Ffix-pr-\u003CPR_NUMBER>` for use in Step 3 and Step 8.\n\n---\n\n### Step 3 — Create Worktree and Prepare Branch\n\nCreate an isolated worktree for this PR fix. The main repo stays on its current branch.\n\n```bash\nREPO_ROOT=$(git rev-parse --show-toplevel)\nPR_NUMBER=\u003CPR_NUMBER>\nWORKTREE_DIR=\"\u002Ftmp\u002Faionui-pr-${PR_NUMBER}\"\n\n# Clean up any stale worktree from a previous crash\ngit worktree remove \"$WORKTREE_DIR\" --force 2>\u002Fdev\u002Fnull || true\n```\n\n**Same-repo PR (`IS_FORK=false`):**\n\n```bash\ngit fetch origin \u003Chead_branch>\ngit worktree add \"$WORKTREE_DIR\" origin\u002F\u003Chead_branch> --detach\ncd \"$WORKTREE_DIR\"\n```\n\n**Fork PR with maintainer access (`IS_FORK=true`, `CAN_MODIFY=true`):**\n\n```bash\ngit worktree add \"$WORKTREE_DIR\" --detach\ncd \"$WORKTREE_DIR\"\ngh pr checkout \u003CPR_NUMBER>\n```\n\n`gh pr checkout` inside the worktree sets up the fork remote and branch tracking correctly.\n\n**Fork PR without maintainer access (`FORK_FALLBACK=true`):**\n\n```bash\ngit fetch origin \u003Cbase_branch>\ngit worktree add \"$WORKTREE_DIR\" origin\u002F\u003Cbase_branch> --detach\ncd \"$WORKTREE_DIR\"\n# Merge PR's commits into the detached HEAD\ngh pr checkout \u003CPR_NUMBER> --detach\ngit checkout -  # back to the base commit\ngit merge --no-ff --no-edit FETCH_HEAD\n```\n\n**All paths — symlink node_modules and rebuild native modules:**\n\n```bash\nln -s \"$REPO_ROOT\u002Fnode_modules\" \"$WORKTREE_DIR\u002Fnode_modules\"\ncd \"$WORKTREE_DIR\"\nnpx electron-rebuild -f -w better-sqlite3 2>\u002Fdev\u002Fnull || true\n```\n\nThe `electron-rebuild` step recompiles native modules (e.g., `better-sqlite3`) against the Electron version used by this project, ensuring ABI compatibility.\n\nSave `REPO_ROOT` and `WORKTREE_DIR` for later steps. All file reads, edits, lint, and test commands from this point forward run inside `WORKTREE_DIR`.\n\n---\n\n### Step 4 — Triage & Validate\n\nBefore fixing anything, independently verify each issue from the review report. This prevents blind application of potentially incorrect or suboptimal fixes.\n\nAll file operations in this step use worktree paths (`$WORKTREE_DIR\u002F\u003Crelative_path>`).\n\n**For each CRITICAL \u002F HIGH \u002F MEDIUM issue (skip LOW), perform three-layer triage:**\n\n#### Layer 1 — Is the issue real?\n\nRead the target file and the surrounding context. Independently assess whether the reported problem actually exists:\n\n- Does the problematic code pattern still exist at the reported location? (Review may be based on an older version)\n- Is the reported behavior actually a bug, or is it intentional design? (Check PR description, related files, project conventions)\n- Does the reviewer's reasoning hold up given the full context?\n\nIf the issue is **not real** → mark as `DISMISSED` with a clear reason.\n\n#### Layer 2 — Is the suggested fix reasonable?\n\nIf the issue is real, evaluate the review report's \"修复建议\":\n\n- Does the suggested fix actually resolve the problem?\n- Does it introduce side effects (type errors, behavioral changes, broken imports)?\n- Is it consistent with the project's patterns and conventions?\n\nIf the suggestion is **reasonable** → mark as `FIX` (adopt the original suggestion).\n\n#### Layer 3 — Is there a better fix?\n\nIf the suggestion is flawed or suboptimal, consider an alternative:\n\n- The alternative must target the **same file(s) and same code area** — do not expand scope\n- The alternative must solve the **same problem**, just with a different approach\n- The alternative's diff should not be significantly larger than the original suggestion — if it is, the change likely exceeds fix scope and should be a separate PR\n\nIf a better fix exists → mark as `FIX_ALT` with the alternative plan.\nIf no better fix exists → fall back to `FIX` (adopt the original suggestion despite its flaws, as long as it doesn't make things worse).\n\n#### Triage output\n\nBuild an enhanced issue list. Each issue now has:\n\n| Field      | Values                          | Description                                                                  |\n| ---------- | ------------------------------- | ---------------------------------------------------------------------------- |\n| `verdict`  | `FIX` \u002F `FIX_ALT` \u002F `DISMISSED` | Triage decision                                                              |\n| `reason`   | free text                       | Why this verdict was chosen                                                  |\n| `fix_plan` | code\u002Fdescription                | The actual fix to apply (`FIX`: original suggestion; `FIX_ALT`: alternative) |\n\n#### CRITICAL issue constraints\n\n**Automation mode (`--automation`):** CRITICAL issues **cannot** be dismissed. If triage concludes a CRITICAL issue is a false positive, the fixer must escalate — abort the fix workflow and transfer to human review:\n\n```bash\ngh pr edit \u003CPR_NUMBER> --remove-label \"bot:fixing\" --add-label \"bot:needs-human-review\"\ngh pr comment \u003CPR_NUMBER> --body \"\u003C!-- pr-automation-bot -->\n⚠️ Triage 阶段发现 CRITICAL 问题 #\u003Cissue_number> 可能为误报，但自动化流程无法自行驳回 CRITICAL 级别问题，已转交人工确认。\n\n**问题：** \u003Cissue description>\n**驳回理由：** \u003Creason>\"\n```\n\nThen **EXIT**.\n\n**Interactive mode (no `--automation`):** Present the dismissal reasoning to the user and ask for confirmation:\n\n> Triage 认为 CRITICAL 问题 #N 可能是误报：\u003Creason>\n> 是否同意驳回此问题？(yes\u002Fno)\n\n- User says **yes** → mark as `DISMISSED`\n- User says **no** → mark as `FIX` (apply original suggestion)\n\n#### Post-triage check\n\nAfter triage, if all non-LOW issues are `DISMISSED`, abort with:\n\n> All issues were dismissed during triage — nothing to fix.\n\nIn automation mode, also transfer to human review (since at least one issue was CRITICAL\u002FHIGH\u002FMEDIUM but all were dismissed, a human should confirm):\n\n```bash\ngh pr edit \u003CPR_NUMBER> --remove-label \"bot:fixing\" --add-label \"bot:needs-human-review\"\n```\n\n---\n\n### Step 5 — Fix Issues by Priority\n\nAll file operations in this step use worktree paths. The Read tool should target `$WORKTREE_DIR\u002F\u003Crelative_path>`, and the Edit tool should modify files at the same worktree paths.\n\nProcess only issues with verdict `FIX` or `FIX_ALT` from the triage output, in order CRITICAL → HIGH → MEDIUM. For each issue:\n\n1. Read the target file (use Read tool at the file path from the summary table)\n2. Locate the exact problem — match the review report's quoted code and line number\n3. Apply the `fix_plan` from triage (original suggestion for `FIX`, alternative for `FIX_ALT`)\n4. After fixing each file batch, run a quick type check:\n\n```bash\nbunx tsc --noEmit\n```\n\nResolve any type errors before moving to the next issue.\n\n**Batching:** Group issues in the same file into a single pass.\n\n---\n\n### Step 6 — Full Quality Gate\n\nAll commands run inside the worktree (`$WORKTREE_DIR`):\n\n```bash\nbun run lint:fix\nbun run format\nbunx tsc --noEmit\nbun run test\n```\n\n**All four must pass.** Fix any failures caused by the current changes before proceeding.\n\n---\n\n### Step 7 — Commit\n\nFollow the [commit skill](..\u002Fcommit\u002FSKILL.md) workflow. Commit message **must** reference the original PR:\n\n```\nfix(\u003Cscope>): address review issues from PR #\u003CPR_NUMBER>\n\n- Fix \u003CCRITICAL\u002FHIGH issue 1 description>\n- Fix \u003Cissue 2 description>\n- ...\n\nReview follow-up for #\u003CPR_NUMBER>\n```\n\n---\n\n### Step 8 — Publish\n\n**Same-repo PR (`IS_FORK=false`):**\n\n```bash\ncd \"$WORKTREE_DIR\"\ngit push origin HEAD:\u003Chead_branch>\n```\n\n**Fork PR with maintainer access (`IS_FORK=true`, `CAN_MODIFY=true`):**\n\n```bash\ncd \"$WORKTREE_DIR\"\ngit push \u003CFORK_OWNER> HEAD:\u003Chead_branch>\n```\n\n`gh pr checkout` set up `\u003CFORK_OWNER>` as the remote pointing to the fork. Pushing with `HEAD:\u003Chead_branch>` ensures the commit lands on the fork's branch, which is the PR's actual head.\n\nOutput to user:\n\n> 已推送到 `\u003Chead_branch>`，PR #\u003CPR_NUMBER> 已自动更新。无需创建新 PR。\n\n**Fork PR without maintainer access (`FORK_FALLBACK=true`):**\n\nPush the fix branch to the main repo and open a new PR:\n\n```bash\ncd \"$WORKTREE_DIR\"\ngit push origin HEAD:bot\u002Ffix-pr-\u003CPR_NUMBER>\n```\n\nThen open a new PR and immediately enable auto-merge:\n\n```bash\nNEW_PR_URL=$(gh pr create \\\n  --base \u003CBASE_REF> \\\n  --head bot\u002Ffix-pr-\u003CPR_NUMBER> \\\n  --label \"bot:done\" \\\n  --title \"fix: address review issues from fork PR #\u003CPR_NUMBER>\" \\\n  --body \"$(cat \u003C\u003C'EOF'\nThis PR applies fixes identified during review of #\u003CPR_NUMBER>.\n\nThe original fork PR has no maintainer push access, so fixes are applied here as a follow-up.\nLocal quality gate (lint\u002Ftest\u002Ftsc) already passed — auto-merging once CI is green.\n\nCloses #\u003CPR_NUMBER>\nEOF\n)\")\n\nNEW_PR_NUMBER=$(echo \"$NEW_PR_URL\" | grep -o '[0-9]*$')\ngh pr merge \"$NEW_PR_NUMBER\" --squash --auto\n\n# Close original fork PR immediately with a comment (don't wait for Closes #N)\ngh pr close \u003CPR_NUMBER> --comment \"\u003C!-- pr-fix-verification -->\n原 PR 为 fork 且未开启 maintainer 写入权限，无法直接推送修复。\n已在主仓库创建跟进 PR #${NEW_PR_NUMBER}，包含本次 review 的所有修复，CI 通过后将自动合并。\"\n```\n\nClosing immediately ensures pr-automation won't pick up the original PR in the next round (closed PRs are excluded by `--state open` in Step 1). No need to set `bot:done` label since the PR is closed.\n\nOutput to user:\n\n> Fork PR 无 maintainer 写入权限，已在主仓库创建跟进 PR #\u003CNEW_PR_NUMBER>，CI 通过后自动合并。\n\n---\n\n### Step 9 — Verification Report\n\nFor each issue in the original summary table, verify the fix exists in actual code:\n\n1. Read the relevant file (Read tool)\n2. Grep for the original problematic pattern to confirm it is gone\n3. Confirm the corrected code is in place\n\nPost the verification report as a PR comment AND output it in the conversation. The report now includes a **Triage 决策** section before the fix table:\n\n```bash\ngh pr comment \u003CPR_NUMBER> --body \"$(cat \u003C\u003C'EOF'\n\u003C!-- pr-fix-verification -->\n## PR Fix 验证报告\n\n**原始 PR:** #\u003CPR_NUMBER>\n**修复方式:** 直接推送到 `\u003Chead_branch>`\n\n### Triage 决策\n\n| # | 严重级别 | 原始问题 | 判定 | 理由 |\n|---|---------|---------|------|------|\n| 2 | 🟠 HIGH | \u003C问题描述> | ⏭️ 驳回 | \u003C驳回理由，引用具体代码或项目约定> |\n| 3 | 🟡 MEDIUM | \u003C问题描述> | 🔄 替代方案 | \u003C为什么原建议不适用，替代方案是什么> |\n\n> 仅列出被驳回（DISMISSED）或使用替代方案（FIX_ALT）的问题。采纳原建议（FIX）的问题不在此表中。\n> 若所有问题均采纳原建议，省略此区块。\n\n### 修复结果\n\n| # | 严重级别 | 文件 | 问题 | 修复方式 | 状态 |\n|---|---------|------|------|---------|------|\n| 1 | 🔴 CRITICAL | `file.ts:N` | \u003C原始问题> | \u003C修复措施> | ✅ 已修复 |\n| 2 | 🟠 HIGH     | `file.ts:N` | \u003C原始问题> | \u003C修复措施> | ✅ 已修复（替代方案） |\n| 3 | 🟡 MEDIUM   | `file.ts:N` | \u003C原始问题> | — | ⏭️ 驳回 |\n\n**总结：** ✅ 已修复 N 个 | 🔄 替代方案 N 个 | ⏭️ 驳回 N 个 | ❌ 未能修复 N 个\n\n> 🔵 LOW 级别问题已跳过（不阻塞合并，修复优先级低）。\nEOF\n)\"\n```\n\nAfter posting, output the same verification table in the conversation for immediate review.\n\n---\n\n### Step 10 — Cleanup\n\nRemove the worktree. All paths use `--detach` so no local branches were created.\n\n```bash\ncd \"$REPO_ROOT\"\ngit worktree remove \"$WORKTREE_DIR\" --force 2>\u002Fdev\u002Fnull || true\n```\n\n---\n\n## Mandatory Rules\n\n- **No AI signature** — no `Co-Authored-By`, `Generated with`, or any AI byline\n- **Always reference original PR** — every commit and PR body must include `Review follow-up for #\u003CPR_NUMBER>`\n- **No issue creation** — this skill skips the issue-association step in pr skill\n- **Fix, don't workaround** — no `\u002F\u002F @ts-ignore`, no lint suppression; address the root cause\n- **Triage before fix** — never blindly apply review suggestions; independently verify each issue and evaluate the proposed fix\n- **Fix scope = review scope** — alternative fixes must target the same files and same problem; do not expand scope or refactor beyond what the issue requires\n- **CRITICAL cannot be auto-dismissed** — in automation mode, dismissing a CRITICAL issue requires human escalation\n\n---\n\n## Quick Reference\n\n```\n 0. Require pr-review report in current session — abort if not found\n 1. Parse summary table → ordered issue list\n 2. Pre-flight: fetch PR info (state, isCrossRepository, maintainerCanModify, forkOwner)\n    → ABORT: state=MERGED\n 3. Create worktree at \u002Ftmp\u002Faionui-pr-\u003CPR_NUMBER> (all paths use --detach):\n    → same-repo:        git fetch + git worktree add --detach\n    → fork+canModify:   git worktree add --detach + gh pr checkout \u003CPR_NUMBER>\n    → fork+fallback:    git worktree add --detach + merge fork head\n 4. Triage & Validate: verify each issue independently (3-layer check)\n    → Layer 1: is issue real? → DISMISSED if false positive\n    → Layer 2: is suggested fix reasonable? → FIX if yes\n    → Layer 3: is there a better fix? → FIX_ALT if yes\n    → CRITICAL cannot be auto-dismissed in automation mode (escalate to human)\n 5. Fix issues with verdict FIX\u002FFIX_ALT, CRITICAL→HIGH→MEDIUM; tsc after each batch\n 6. bun run lint:fix && bun run format && bunx tsc --noEmit && bun run test (in worktree)\n 7. Commit: fix(\u003Cscope>): address review issues from PR #N\n 8. Push from worktree (same-repo \u002F fork+canModify \u002F fork+fallback)\n 9. Verify → post Triage 决策 + 修复结果 as gh pr comment + output in conversation\n10. Cleanup: git worktree remove + git branch -D (worktree and local branches)\n```\n",{"name":5,"description":7},"main","6ad540d70c42df777452898d69e6882998780d97",".claude\u002Fskills\u002Fpr-fix","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo","https:\u002F\u002Fgithub.com\u002Ffinewood2008","Founder & CEO of Centaur AI · Humans lead, AI executes — the Centaur Loop is the smallest work unit for building AI employees.","2026-06-23 10:20:30",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add finewood2008\u002Fcentaurai-station-solo --skill pr-fix",{"tool":37,"command":38},"bunx","bunx skills add finewood2008\u002Fcentaurai-station-solo --skill pr-fix",{"tool":40,"command":41},"pnpm","pnpm dlx skills add finewood2008\u002Fcentaurai-station-solo --skill pr-fix","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-fix\u002FSKILL.md",true,[],[46,52,58,65,72,79],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M77JW3M1FSRTHENTNKZ0N9WS","aionui-troubleshooting","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002Fresources\u002Fbutler\u002Fskills\u002Faionui-troubleshooting\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M77JW0HED2G4WHWTPHQ6W04J","aionui-config","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002Fresources\u002Fbutler\u002Fskills\u002Faionui-config\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M77JVX9Y75W73KPVQE9S91TN","testing","Testing workflow and quality standards for writing and running tests.\nUse when: (1) Writing new tests, (2) Adding a new feature that needs tests,\n(3) Modifying logic that has existing tests, (4) Before claiming a task is complete.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftesting\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M77JVS2PQN394E9KZ65A1KXS","pr-verify","PR Verification & Merge: verify bot:ready-to-merge PRs with impact analysis, test supplementation, and one-click merge.\nUse when: (1) User says \"\u002Fpr-verify\", (2) User wants to verify and merge ready PRs.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-verify\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M77JVN4NNJ6GQ81PZEBD1XE7","pr-ship","End-to-end PR lifecycle: create PR, wait for CI, review, fix issues, merge — all in one invocation.\nUse when: (1) User says \"\u002Fpr-ship\", (2) User wants to ship current changes as a complete PR lifecycle,\n(3) User wants to resume shepherding an existing PR.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-ship\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M77JVHW42VFV96ZNPV0ZZ4B1","pr-review","PR Code Review (Local): perform a thorough local code review with full project context.\nUse when: (1) User asks to review a PR, (2) User says \"\u002Fpr-review\", (3) User wants to review code changes before merging.","https:\u002F\u002Fgithub.com\u002Ffinewood2008\u002Fcentaurai-station-solo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-review\u002FSKILL.md",[],[]]