@runweave/server-linux-x64 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/manifest.json +1494 -161
  2. package/native.tar.gz +0 -0
  3. package/package.json +1 -1
  4. package/payload/.agents/plugins/marketplace.json +20 -0
  5. package/payload/app-server/build-info.json +4 -4
  6. package/payload/app-server/index.cjs +6 -2
  7. package/payload/app-server/index.cjs.map +1 -1
  8. package/payload/backend/activity-sqlite-worker.cjs +2 -0
  9. package/payload/backend/build-info.json +4 -4
  10. package/payload/backend/dev-resources/control.cjs +5 -1
  11. package/payload/backend/index.cjs +466 -295
  12. package/payload/backend/ios-simulators/pool.py +3 -3
  13. package/payload/backend/scheduled-tasks-sqlite-worker.cjs +2 -0
  14. package/payload/frontend/dist/assets/{_baseUniq-vo4uuhMd.js → _baseUniq--CWv8e7O.js} +1 -1
  15. package/payload/frontend/dist/assets/{access-_jCu7Rgu.js → access-BCF23Qto.js} +1 -1
  16. package/payload/frontend/dist/assets/{advanced-CqOhObYj.js → advanced-D8viCLue.js} +1 -1
  17. package/payload/frontend/dist/assets/{appearance-CrrD5gzC.js → appearance-wPVMx-tB.js} +1 -1
  18. package/payload/frontend/dist/assets/{arc-dbfyHSF0.js → arc-BXffHD7A.js} +1 -1
  19. package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-CntSCAsO.js → architectureDiagram-Q4EWVU46-BXHN9QCj.js} +1 -1
  20. package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-Chp0D4qy.js → blockDiagram-DXYQGD6D-DoZjab_0.js} +1 -1
  21. package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-CF91pOuW.js → c4Diagram-AHTNJAMY-Ds2E62Z8.js} +1 -1
  22. package/payload/frontend/dist/assets/channel-83CTXkVl.js +1 -0
  23. package/payload/frontend/dist/assets/{chunk-4BX2VUAB-B1gxlVu2.js → chunk-4BX2VUAB-Dk1H2-5_.js} +1 -1
  24. package/payload/frontend/dist/assets/{chunk-4TB4RGXK-Cxt3mj9b.js → chunk-4TB4RGXK-Sg0gzSvg.js} +1 -1
  25. package/payload/frontend/dist/assets/{chunk-55IACEB6-BJT6qNik.js → chunk-55IACEB6-Du_EJG4S.js} +1 -1
  26. package/payload/frontend/dist/assets/{chunk-EDXVE4YY-yI59bCa0.js → chunk-EDXVE4YY-BM1Cs5dU.js} +1 -1
  27. package/payload/frontend/dist/assets/{chunk-FMBD7UC4-CDvncKKJ.js → chunk-FMBD7UC4-BM9thfyY.js} +1 -1
  28. package/payload/frontend/dist/assets/{chunk-OYMX7WX6-BblOIU57.js → chunk-OYMX7WX6-C9Bvn4fo.js} +1 -1
  29. package/payload/frontend/dist/assets/{chunk-QZHKN3VN-rODzNdO0.js → chunk-QZHKN3VN-CaakbFhJ.js} +1 -1
  30. package/payload/frontend/dist/assets/{chunk-YZCP3GAM-B6D4wQwk.js → chunk-YZCP3GAM-DkVNrd40.js} +1 -1
  31. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-oR8IYJwC.js +1 -0
  32. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-oR8IYJwC.js +1 -0
  33. package/payload/frontend/dist/assets/clone-BIDF-bd9.js +1 -0
  34. package/payload/frontend/dist/assets/connection-DIdF_3aa.js +12 -0
  35. package/payload/frontend/dist/assets/{connections-DqDmxS-O.js → connections-DBYC8SFl.js} +1 -1
  36. package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-BvwVWp29.js → cose-bilkent-S5V4N54A-B4-fwllY.js} +1 -1
  37. package/payload/frontend/dist/assets/{dagre-KV5264BT-h_K1TH11.js → dagre-KV5264BT-Byu4wqLk.js} +1 -1
  38. package/payload/frontend/dist/assets/{desktop-BQ3kGtKG.js → desktop-aESkh0HL.js} +1 -1
  39. package/payload/frontend/dist/assets/{diagram-5BDNPKRD-B8g2SV6L.js → diagram-5BDNPKRD-DJW8DuCX.js} +1 -1
  40. package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-BOEnrqYm.js → diagram-G4DWMVQ6-DTBvds5J.js} +1 -1
  41. package/payload/frontend/dist/assets/{diagram-MMDJMWI5-DlaN_z71.js → diagram-MMDJMWI5-D42e4xzm.js} +1 -1
  42. package/payload/frontend/dist/assets/{diagram-TYMM5635-C_pSKftn.js → diagram-TYMM5635-BjV43-C_.js} +1 -1
  43. package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-C2dL-h3I.js → erDiagram-SMLLAGMA-DE47Ibp_.js} +1 -1
  44. package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-BmXhKWFj.js → flowDiagram-DWJPFMVM-CjGBlzS4.js} +1 -1
  45. package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-D_Odnssf.js → ganttDiagram-T4ZO3ILL-vfj40KZi.js} +1 -1
  46. package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-DcQdcwKZ.js → gitGraphDiagram-UUTBAWPF-DT5xfRNb.js} +1 -1
  47. package/payload/frontend/dist/assets/{graph-C_XsxefA.js → graph-D-AF6yQT.js} +1 -1
  48. package/payload/frontend/dist/assets/{image-D3hgVr8O.js → image-D9gtSsD9.js} +1 -1
  49. package/payload/frontend/dist/assets/{index-CEUsFFQq.js → index-BPVP2P-2.js} +95 -105
  50. package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-C6TnRyMi.js → infoDiagram-42DDH7IO-C7ew_uLJ.js} +1 -1
  51. package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-BL7rfALJ.js → ishikawaDiagram-UXIWVN3A-B6-YebU9.js} +1 -1
  52. package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-C_6407GW.js → journeyDiagram-VCZTEJTY-BOFgJDA5.js} +1 -1
  53. package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-CK61Fd0p.js → kanban-definition-6JOO6SKY-jh06wZYz.js} +1 -1
  54. package/payload/frontend/dist/assets/{layout-DVn6JKbl.js → layout-B4p7V5fB.js} +1 -1
  55. package/payload/frontend/dist/assets/{linear-DyWskq8H.js → linear-D2JWfvdc.js} +1 -1
  56. package/payload/frontend/dist/assets/main-CuRgiPQf.js +706 -0
  57. package/payload/frontend/dist/assets/main-D4_uoZQa.css +33 -0
  58. package/payload/frontend/dist/assets/{min-apbLpSJ3.js → min--jD4Arnm.js} +1 -1
  59. package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-MVHZZbma.js → mindmap-definition-QFDTVHPH-DmzjmSuf.js} +1 -1
  60. package/payload/frontend/dist/assets/{monitoring-BApsVez_.js → monitoring-Tvvk6TfB.js} +1 -1
  61. package/payload/frontend/dist/assets/{notifications-CjxSNLU1.js → notifications-CqP2AQrW.js} +1 -1
  62. package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-Dhbb0AYU.js → pieDiagram-DEJITSTG-B79qIVe5.js} +1 -1
  63. package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-Yk6LOF0S.js → quadrantDiagram-34T5L4WZ-DIOj1DhE.js} +1 -1
  64. package/payload/frontend/dist/assets/{record-content-BCJ80KS5.js → record-content-CzGGCbNs.js} +1 -1
  65. package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-BUhS0PEq.js → requirementDiagram-MS252O5E-C-n1j3tN.js} +1 -1
  66. package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-D2sdxz14.js → sankeyDiagram-XADWPNL6-BVKqWE6C.js} +1 -1
  67. package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-CRere4Fy.js → sequenceDiagram-FGHM5R23-B980Icqs.js} +1 -1
  68. package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-_pk-OMlm.js → stateDiagram-FHFEXIEX-C-mJHzhL.js} +1 -1
  69. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-B4L4fK9G.js +1 -0
  70. package/payload/frontend/dist/assets/{status-Dk5rRVQF.js → status-Bv4Czr9-.js} +1 -1
  71. package/payload/frontend/dist/assets/suiji-DyzQqRTE.js +1 -0
  72. package/payload/frontend/dist/assets/{svg-X7YkMMvx.js → svg-C6Aj62ig.js} +1 -1
  73. package/payload/frontend/dist/assets/{tabs-BmKbcPVh.js → tabs-BTUOhdAF.js} +1 -1
  74. package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-BPsI2pMC.js → timeline-definition-GMOUNBTQ-Dr9yRuVq.js} +1 -1
  75. package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-BNJkZ1Az.js → vennDiagram-DHZGUBPP-B0Xsg1-Z.js} +1 -1
  76. package/payload/frontend/dist/assets/{wardley-RL74JXVD-CVcYeATS.js → wardley-RL74JXVD-BjIKKaA_.js} +1 -1
  77. package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-BpLJ0alk.js → wardleyDiagram-NUSXRM2D-DMJ7MEA9.js} +1 -1
  78. package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-BdsYYk4M.js → xychartDiagram-5P7HB3ND-2tvgfdab.js} +1 -1
  79. package/payload/frontend/dist/build-info.json +4 -4
  80. package/payload/frontend/dist/companion.html +1 -1
  81. package/payload/frontend/dist/index.html +3 -3
  82. package/payload/packages/agent-bridge/src/install-pi.mjs +81 -0
  83. package/payload/plugins/pi/dist/SKILL.md +22 -0
  84. package/payload/plugins/pi/dist/bridge/app-server-client.cjs +82 -0
  85. package/payload/plugins/pi/dist/bridge/feishu_stop_notify.sh +169 -0
  86. package/payload/plugins/pi/dist/bridge/runweave-hook-bridge.cjs +583 -0
  87. package/payload/plugins/pi/dist/bridge/runweave-hook-completion.cjs +42 -0
  88. package/payload/plugins/pi/dist/bridge/runweave-hook-payload.cjs +578 -0
  89. package/payload/plugins/pi/dist/bridge/runweave-task-supervision.cjs +167 -0
  90. package/payload/plugins/pi/dist/runweave.js +316 -0
  91. package/payload/plugins/toolkit/.codex-plugin/plugin.json +31 -0
  92. package/payload/plugins/toolkit/README.md +185 -0
  93. package/payload/plugins/toolkit/hooks/AGENTS.md +6 -0
  94. package/payload/plugins/toolkit/hooks/app-server-client.cjs +82 -0
  95. package/payload/plugins/toolkit/hooks/feishu_stop_notify.sh +169 -0
  96. package/payload/plugins/toolkit/hooks/runweave-hook-bridge.cjs +583 -0
  97. package/payload/plugins/toolkit/hooks/runweave-hook-completion.cjs +42 -0
  98. package/payload/plugins/toolkit/hooks/runweave-hook-dispatch.cjs +123 -0
  99. package/payload/plugins/toolkit/hooks/runweave-hook-payload.cjs +578 -0
  100. package/payload/plugins/toolkit/hooks/runweave-task-supervision.cjs +167 -0
  101. package/payload/plugins/toolkit/hooks.json +108 -0
  102. package/payload/plugins/toolkit/skills/acceptance/SKILL.md +70 -0
  103. package/payload/plugins/toolkit/skills/acceptance/agents/openai.yaml +4 -0
  104. package/payload/plugins/toolkit/skills/acceptance/references/capture.md +38 -0
  105. package/payload/plugins/toolkit/skills/acceptance/references/delivery.md +54 -0
  106. package/payload/plugins/toolkit/skills/acceptance/references/gallery-contract.md +84 -0
  107. package/payload/plugins/toolkit/skills/acceptance/references/gallery-copy.md +34 -0
  108. package/payload/plugins/toolkit/skills/acceptance/references/video.md +52 -0
  109. package/payload/plugins/toolkit/skills/acceptance/scripts/capture.py +137 -0
  110. package/payload/plugins/toolkit/skills/acceptance/scripts/common.py +63 -0
  111. package/payload/plugins/toolkit/skills/acceptance/scripts/gallery.py +353 -0
  112. package/payload/plugins/toolkit/skills/acceptance/scripts/preview.py +109 -0
  113. package/payload/plugins/toolkit/skills/acceptance/scripts/video.py +283 -0
  114. package/payload/plugins/toolkit/skills/acceptance/templates/reader.css +576 -0
  115. package/payload/plugins/toolkit/skills/acceptance/templates/reader.html +63 -0
  116. package/payload/plugins/toolkit/skills/acceptance/templates/reader.js +326 -0
  117. package/payload/plugins/toolkit/skills/acceptance/templates/viewer.css +55 -0
  118. package/payload/plugins/toolkit/skills/acceptance-gallery/SKILL.md +8 -0
  119. package/payload/plugins/toolkit/skills/acceptance-gallery/agents/openai.yaml +6 -0
  120. package/payload/plugins/toolkit/skills/acceptance-gallery/references/capture-and-copy.md +3 -0
  121. package/payload/plugins/toolkit/skills/acceptance-gallery/references/content-contract.md +3 -0
  122. package/payload/plugins/toolkit/skills/acceptance-gallery/scripts/gallery.py +9 -0
  123. package/payload/plugins/toolkit/skills/acceptance-video/SKILL.md +8 -0
  124. package/payload/plugins/toolkit/skills/acceptance-video/agents/openai.yaml +6 -0
  125. package/payload/plugins/toolkit/skills/acceptance-video/references/input-and-capture.md +3 -0
  126. package/payload/plugins/toolkit/skills/acceptance-video/references/mobile-review.md +3 -0
  127. package/payload/plugins/toolkit/skills/acceptance-video/scripts/capture.py +9 -0
  128. package/payload/plugins/toolkit/skills/acceptance-video/scripts/video.py +9 -0
  129. package/payload/plugins/toolkit/skills/agent-device/SKILL.md +86 -0
  130. package/payload/plugins/toolkit/skills/agent-device/agents/openai.yaml +4 -0
  131. package/payload/plugins/toolkit/skills/agent-device/references/ios-setup.md +36 -0
  132. package/payload/plugins/toolkit/skills/agent-device/scripts/device.py +398 -0
  133. package/payload/plugins/toolkit/skills/agent-device/scripts/resources.py +248 -0
  134. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/SKILL.md +128 -0
  135. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/agents/openai.yaml +4 -0
  136. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-checklist.md +59 -0
  137. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-guide.md +135 -0
  138. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-handoff-template.md +57 -0
  139. package/payload/plugins/toolkit/skills/ask-first/SKILL.md +81 -0
  140. package/payload/plugins/toolkit/skills/brainstorming/SKILL.md +41 -0
  141. package/payload/plugins/toolkit/skills/browse-record/SKILL.md +35 -0
  142. package/payload/plugins/toolkit/skills/browse-record/references/app-usage.md +19 -0
  143. package/payload/plugins/toolkit/skills/browse-record/references/daily-reporting.md +115 -0
  144. package/payload/plugins/toolkit/skills/browse-record/references/zhihu.md +33 -0
  145. package/payload/plugins/toolkit/skills/browse-record/scripts/app_usage.py +110 -0
  146. package/payload/plugins/toolkit/skills/browse-record/scripts/browse_job.py +385 -0
  147. package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu-read.js +126 -0
  148. package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu_http.py +273 -0
  149. package/payload/plugins/toolkit/skills/clear-technical-explanations/LICENSE +21 -0
  150. package/payload/plugins/toolkit/skills/clear-technical-explanations/SKILL.md +103 -0
  151. package/payload/plugins/toolkit/skills/code-grounded-requirements/SKILL.md +54 -0
  152. package/payload/plugins/toolkit/skills/daily-doc-maintenance/SKILL.md +151 -0
  153. package/payload/plugins/toolkit/skills/daily-record/SKILL.md +63 -0
  154. package/payload/plugins/toolkit/skills/daily-record/agents/openai.yaml +4 -0
  155. package/payload/plugins/toolkit/skills/daily-record/references/browser-history.md +6 -0
  156. package/payload/plugins/toolkit/skills/daily-record/references/feishu.md +90 -0
  157. package/payload/plugins/toolkit/skills/daily-record/references/scheduled-reporting.md +144 -0
  158. package/payload/plugins/toolkit/skills/daily-record/references/scheduled-task.template.json +15 -0
  159. package/payload/plugins/toolkit/skills/daily-record/references/suiji-work-records.md +57 -0
  160. package/payload/plugins/toolkit/skills/daily-record/scripts/feishu.py +280 -0
  161. package/payload/plugins/toolkit/skills/daily-record/scripts/job.py +416 -0
  162. package/payload/plugins/toolkit/skills/daily-record/scripts/job_browser.py +77 -0
  163. package/payload/plugins/toolkit/skills/daily-record/scripts/job_facts.py +132 -0
  164. package/payload/plugins/toolkit/skills/daily-record/scripts/job_isolation.py +69 -0
  165. package/payload/plugins/toolkit/skills/daily-record/scripts/job_materials.py +154 -0
  166. package/payload/plugins/toolkit/skills/daily-record/scripts/job_screen.py +77 -0
  167. package/payload/plugins/toolkit/skills/daily-record/scripts/job_state.py +309 -0
  168. package/payload/plugins/toolkit/skills/daily-refactor/SKILL.md +101 -0
  169. package/payload/plugins/toolkit/skills/daily-refactor/scripts/compare-architecture-reports.mjs +168 -0
  170. package/payload/plugins/toolkit/skills/debugging-strategies/SKILL.md +38 -0
  171. package/payload/plugins/toolkit/skills/debugging-strategies/resources/implementation-playbook.md +520 -0
  172. package/payload/plugins/toolkit/skills/diagnostic-log-debugging/SKILL.md +79 -0
  173. package/payload/plugins/toolkit/skills/doc-coauthoring/SKILL.md +64 -0
  174. package/payload/plugins/toolkit/skills/eli5/LICENSE +21 -0
  175. package/payload/plugins/toolkit/skills/eli5/SKILL.md +18 -0
  176. package/payload/plugins/toolkit/skills/experience/SKILL.md +71 -0
  177. package/payload/plugins/toolkit/skills/experience/package.json +13 -0
  178. package/payload/plugins/toolkit/skills/git-advanced-workflows/SKILL.md +457 -0
  179. package/payload/plugins/toolkit/skills/github-pr/SKILL.md +109 -0
  180. package/payload/plugins/toolkit/skills/github-pr/scripts/github-access.mjs +292 -0
  181. package/payload/plugins/toolkit/skills/github-pr/scripts/preflight.mjs +191 -0
  182. package/payload/plugins/toolkit/skills/github-pr/scripts/source-worktree.mjs +354 -0
  183. package/payload/plugins/toolkit/skills/grill-with-docs/SKILL.md +66 -0
  184. package/payload/plugins/toolkit/skills/grill-with-docs/agents/openai.yaml +6 -0
  185. package/payload/plugins/toolkit/skills/grilling/SKILL.md +14 -0
  186. package/payload/plugins/toolkit/skills/handoff/SKILL.md +98 -0
  187. package/payload/plugins/toolkit/skills/karpathy-guidelines/SKILL.md +73 -0
  188. package/payload/plugins/toolkit/skills/playwright-cli/SKILL.md +562 -0
  189. package/payload/plugins/toolkit/skills/playwright-cli/references/element-attributes.md +23 -0
  190. package/payload/plugins/toolkit/skills/playwright-cli/references/playwright-tests.md +39 -0
  191. package/payload/plugins/toolkit/skills/playwright-cli/references/request-mocking.md +87 -0
  192. package/payload/plugins/toolkit/skills/playwright-cli/references/running-code.md +240 -0
  193. package/payload/plugins/toolkit/skills/playwright-cli/references/session-management.md +226 -0
  194. package/payload/plugins/toolkit/skills/playwright-cli/references/spec-driven-testing.md +312 -0
  195. package/payload/plugins/toolkit/skills/playwright-cli/references/storage-state.md +275 -0
  196. package/payload/plugins/toolkit/skills/playwright-cli/references/test-generation.md +138 -0
  197. package/payload/plugins/toolkit/skills/playwright-cli/references/tracing.md +142 -0
  198. package/payload/plugins/toolkit/skills/playwright-cli/references/video-recording.md +157 -0
  199. package/payload/plugins/toolkit/skills/playwright-cli/templates/standalone.config.json +7 -0
  200. package/payload/plugins/toolkit/skills/product-exploration/SKILL.md +64 -0
  201. package/payload/plugins/toolkit/skills/product-exploration/agents/openai.yaml +5 -0
  202. package/payload/plugins/toolkit/skills/prototype-first-development/SKILL.md +134 -0
  203. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/README.md +88 -0
  204. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/app.js +145 -0
  205. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/index.html +229 -0
  206. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/mock-state.json +60 -0
  207. package/payload/plugins/toolkit/skills/prototype-first-development/references/implementation-plan-handoff-template.md +61 -0
  208. package/payload/plugins/toolkit/skills/prototype-first-development/references/prototype-workflow-checklist.md +64 -0
  209. package/payload/plugins/toolkit/skills/publish-runweave-server/SKILL.md +69 -0
  210. package/payload/plugins/toolkit/skills/publish-runweave-server/agents/openai.yaml +4 -0
  211. package/payload/plugins/toolkit/skills/react-best-practices/AGENTS.md +3227 -0
  212. package/payload/plugins/toolkit/skills/react-best-practices/README.md +127 -0
  213. package/payload/plugins/toolkit/skills/react-best-practices/SKILL.md +143 -0
  214. package/payload/plugins/toolkit/skills/react-best-practices/metadata.json +15 -0
  215. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/event-handler-refs.md +55 -0
  216. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/init-once.md +42 -0
  217. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/use-latest.md +39 -0
  218. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/api-routes.md +38 -0
  219. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/defer-await.md +80 -0
  220. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/dependencies.md +52 -0
  221. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/parallel.md +28 -0
  222. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/suspense-boundaries.md +99 -0
  223. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/barrel-imports.md +59 -0
  224. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/conditional.md +37 -0
  225. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/defer-third-party.md +49 -0
  226. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/dynamic-imports.md +35 -0
  227. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/preload.md +46 -0
  228. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/event-listeners.md +78 -0
  229. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/localstorage-schema.md +77 -0
  230. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/passive-event-listeners.md +48 -0
  231. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/swr-dedup.md +56 -0
  232. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/batch-dom-css.md +110 -0
  233. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-function-results.md +80 -0
  234. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-property-access.md +28 -0
  235. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-storage.md +70 -0
  236. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/combine-iterations.md +32 -0
  237. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/early-exit.md +50 -0
  238. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/flatmap-filter.md +55 -0
  239. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/hoist-regexp.md +45 -0
  240. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/index-maps.md +37 -0
  241. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/length-check-first.md +50 -0
  242. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/min-max-loop.md +82 -0
  243. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/set-map-lookups.md +24 -0
  244. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/tosorted-immutable.md +57 -0
  245. package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/sections.md +46 -0
  246. package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/template.md +28 -0
  247. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/activity.md +26 -0
  248. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/animate-svg-wrapper.md +38 -0
  249. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/conditional-render.md +32 -0
  250. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/content-visibility.md +38 -0
  251. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hoist-jsx.md +36 -0
  252. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-no-flicker.md +72 -0
  253. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-suppress-warning.md +26 -0
  254. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/resource-hints.md +89 -0
  255. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/script-defer-async.md +71 -0
  256. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/svg-precision.md +28 -0
  257. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/usetransition-loading.md +75 -0
  258. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/defer-reads.md +39 -0
  259. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/dependencies.md +45 -0
  260. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state-no-effect.md +40 -0
  261. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state.md +29 -0
  262. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/functional-setstate.md +77 -0
  263. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/lazy-state-init.md +58 -0
  264. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo-with-default-value.md +36 -0
  265. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo.md +44 -0
  266. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/move-effect-to-event.md +45 -0
  267. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/no-inline-components.md +83 -0
  268. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/simple-expression-in-memo.md +35 -0
  269. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/transitions.md +40 -0
  270. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/use-ref-transient-values.md +73 -0
  271. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/after-nonblocking.md +74 -0
  272. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/auth-actions.md +96 -0
  273. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-lru.md +41 -0
  274. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-react.md +76 -0
  275. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/dedup-props.md +65 -0
  276. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/hoist-static-io.md +139 -0
  277. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/parallel-fetching.md +83 -0
  278. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/serialization.md +38 -0
  279. package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/SKILL.md +8 -0
  280. package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/agents/openai.yaml +6 -0
  281. package/payload/plugins/toolkit/skills/reproduce-before-fix/SKILL.md +93 -0
  282. package/payload/plugins/toolkit/skills/reproduce-before-fix/agents/openai.yaml +7 -0
  283. package/payload/plugins/toolkit/skills/review-only/SKILL.md +72 -0
  284. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/SKILL.md +134 -0
  285. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/agents/openai.yaml +7 -0
  286. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/references/contracts.md +114 -0
  287. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/classify-runtime-verdict.mjs +140 -0
  288. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/run-static-review.mjs +389 -0
  289. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/static-review-contract.mjs +243 -0
  290. package/payload/plugins/toolkit/skills/run-test-cases/SKILL.md +63 -0
  291. package/payload/plugins/toolkit/skills/runweave-change-validation/SKILL.md +196 -0
  292. package/payload/plugins/toolkit/skills/runweave-change-validation/agents/openai.yaml +7 -0
  293. package/payload/plugins/toolkit/skills/runweave-change-validation/scripts/assert-dev-session-status.mjs +181 -0
  294. package/payload/plugins/toolkit/skills/runweave-dev-session/SKILL.md +126 -0
  295. package/payload/plugins/toolkit/skills/runweave-dev-session/agents/openai.yaml +7 -0
  296. package/payload/plugins/toolkit/skills/runweave-management/SKILL.md +47 -0
  297. package/payload/plugins/toolkit/skills/scheduled-task/SKILL.md +35 -0
  298. package/payload/plugins/toolkit/skills/shadcn/SKILL.md +245 -0
  299. package/payload/plugins/toolkit/skills/shadcn/agents/openai.yml +5 -0
  300. package/payload/plugins/toolkit/skills/shadcn/assets/shadcn-small.png +0 -0
  301. package/payload/plugins/toolkit/skills/shadcn/assets/shadcn.png +0 -0
  302. package/payload/plugins/toolkit/skills/shadcn/cli.md +276 -0
  303. package/payload/plugins/toolkit/skills/shadcn/customization.md +209 -0
  304. package/payload/plugins/toolkit/skills/shadcn/evals/evals.json +47 -0
  305. package/payload/plugins/toolkit/skills/shadcn/mcp.md +94 -0
  306. package/payload/plugins/toolkit/skills/shadcn/rules/base-vs-radix.md +310 -0
  307. package/payload/plugins/toolkit/skills/shadcn/rules/composition.md +197 -0
  308. package/payload/plugins/toolkit/skills/shadcn/rules/forms.md +198 -0
  309. package/payload/plugins/toolkit/skills/shadcn/rules/icons.md +101 -0
  310. package/payload/plugins/toolkit/skills/shadcn/rules/styling.md +163 -0
  311. package/payload/plugins/toolkit/skills/suiji/SKILL.md +54 -0
  312. package/payload/plugins/toolkit/skills/suiji/references/api.md +72 -0
  313. package/payload/plugins/toolkit/skills/suiji/references/source-adapter.md +40 -0
  314. package/payload/plugins/toolkit/skills/suiji/references/work-records.md +36 -0
  315. package/payload/plugins/toolkit/skills/suiji/scripts/source_adapter.py +46 -0
  316. package/payload/plugins/toolkit/skills/suiji/scripts/suiji.py +358 -0
  317. package/payload/plugins/toolkit/skills/suiji/scripts/work_records.py +328 -0
  318. package/payload/plugins/toolkit/skills/suiji/scripts/work_reports.py +75 -0
  319. package/payload/plugins/toolkit/skills/sync-branch-hard-reset/SKILL.md +59 -0
  320. package/payload/plugins/toolkit/skills/update-runweave-backend/SKILL.md +90 -0
  321. package/payload/plugins/toolkit/skills/update-runweave-backend/agents/openai.yaml +4 -0
  322. package/payload/plugins/toolkit/skills/update-runweave-backend/references/npm-update.md +68 -0
  323. package/payload/plugins/toolkit/skills/update-runweave-backend/references/systemd.md +34 -0
  324. package/payload/plugins/toolkit/skills/update-runweave-desktop/SKILL.md +102 -0
  325. package/payload/plugins/toolkit/skills/update-runweave-ios/SKILL.md +16 -0
  326. package/payload/plugins/toolkit/skills/update-runweave-ios/references/ios-wireless-recovery.md +54 -0
  327. package/payload/plugins/toolkit/skills/using-rw/SKILL.md +265 -0
  328. package/payload/plugins/toolkit/skills/write-plan/SKILL.md +72 -0
  329. package/payload/plugins/toolkit/skills/write-test-cases/SKILL.md +100 -0
  330. package/payload/plugins/toolkit/skills/write-test-cases/assets/test-plan-template.yaml +15 -0
  331. package/payload/plugins/toolkit/skills/write-test-cases/references/coverage-checklist.md +75 -0
  332. package/payload/plugins/toolkit/skills/write-test-cases/references/design-techniques.md +91 -0
  333. package/payload/plugins/toolkit/skills/youtube-reading/SKILL.md +35 -0
  334. package/payload/plugins/toolkit/skills/youtube-reading/agents/openai.yaml +4 -0
  335. package/payload/plugins/toolkit/skills/youtube-reading/assets/runtime-lock.json +92 -0
  336. package/payload/plugins/toolkit/skills/youtube-reading/references/content-contract.md +52 -0
  337. package/payload/plugins/toolkit/skills/youtube-reading/references/setup.md +70 -0
  338. package/payload/plugins/toolkit/skills/youtube-reading/requirements.lock +9 -0
  339. package/payload/plugins/toolkit/skills/youtube-reading/scripts/artifacts.py +206 -0
  340. package/payload/plugins/toolkit/skills/youtube-reading/scripts/runtime.py +424 -0
  341. package/payload/plugins/toolkit/skills/youtube-reading/scripts/youtube_reading.py +314 -0
  342. package/payload/plugins/toolkit-release.json +1 -0
  343. package/payload/pty-host/index.cjs +99 -31
  344. package/payload/scripts/toolkit/codex-state.mjs +75 -0
  345. package/payload/scripts/toolkit/release.mjs +210 -0
  346. package/payload/scripts/toolkit/sync-runtime.mjs +108 -0
  347. package/payload/scripts/toolkit/sync.mjs +585 -0
  348. package/payload/server/index.cjs +5 -1
  349. package/payload/frontend/dist/assets/channel-Bf3IeONI.js +0 -1
  350. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-CFsG2SvG.js +0 -1
  351. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-CFsG2SvG.js +0 -1
  352. package/payload/frontend/dist/assets/clone-CeQXm2YN.js +0 -1
  353. package/payload/frontend/dist/assets/connection-XriXysSc.js +0 -12
  354. package/payload/frontend/dist/assets/main-Cg6Oo1xK.css +0 -33
  355. package/payload/frontend/dist/assets/main-H5R-3_w1.js +0 -696
  356. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-CzpdUl_0.js +0 -1
  357. package/payload/frontend/dist/assets/suiji-CO_L5W1X.js +0 -1
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: experience
3
+ description: 排查当前项目反复出现的故障、查找以前验证过的处理办法,或选择有历史证据的验证路径时,检索该项目的经验并记录实际采用结果。适用于任意 Git 项目;不检索其他项目,不用于每次任务的例行搜索。
4
+ ---
5
+
6
+ # 当前项目的经验
7
+
8
+ 当历史处理可能改变本次排查、修复或验证路线时使用。先用当前问题里的具体症状、
9
+ 错误文本和工具名检索;普通新功能、改文案或无历史线索的简单任务无需例行调用。
10
+ 不要要求项目提供或修改 `AGENTS.md`,也不要将经验写进它。
11
+
12
+ ## 检索
13
+
14
+ 在用户当前任务所在目录执行已安装的 CLI,保留该目录作为 cwd:
15
+
16
+ ```bash
17
+ rw experience search --cwd "$PWD" --query '具体症状及相关工具' --json
18
+ ```
19
+
20
+ - 使用宿主提供的 CLI 及连接配置;已明确提供绝对 CLI 入口时用它替代 `rw`。
21
+ 保持任务所在目录,不切到 CLI 的安装目录再检索。
22
+ - 沿用 CLI 已配置的连接与认证;仅在宿主明确给出目标时覆盖。
23
+ 端口只负责连接,不是项目身份;不要遍历端口寻找记录。
24
+ - 未安装 CLI、没有 experience 命令、API 404 或认证失败,说明入口不可用并继续原任务。
25
+ 不将这些错误说成“没有经验”,不读取凭据或自行启动服务。
26
+ - 核对响应的 `repositoryId` 和 `namespace`。同仓库 worktree 共用身份;独立仓库隔离,
27
+ 即使同名、相同 remote 或错误文本也不混用。非 Git 目录目前不支持,不回退到全局经验。
28
+ - 无匹配就继续正常排查,不换 cwd 到别的仓库,也不反复扩大查询直到命中。
29
+ - 查询用自然问题中的组件或工具名加具体症状,例如“rw 全局 CLI 更新后版本相同”,
30
+ 不需要猜记录标题或拼接完整命令。零命中也是真实结果,不为补回执制造一次命中。
31
+
32
+ ## 核对与采用
33
+
34
+ `matches` 最多三条。先读取 `record.applicability`、`avoid`、`actions`、`verification` 和
35
+ `evidence` 索引,结合当前代码、版本、环境和实际结果判断是否适用。检索响应不附带历史摘录。
36
+ 明确不适用时直接否决,不因命中扩大任务范围,也不为完成流程读取全部历史日志。
37
+
38
+ 需要原始证据才能判断适用前提或选择处理路线时,再读取完整记录;不要求每次命中都调用:
39
+
40
+ ```bash
41
+ rw experience show EXPERIENCE_ID --cwd "$PWD" --json
42
+ ```
43
+
44
+ 原始证据由绝对路径与行范围定位;原文件已清理时可读完整记录中的 `evidence[].archived.text`,
45
+ 明确它是历史脱敏摘录,不能代替本次现场验证。`excluded` 中的记录不作为当前建议,
46
+ 必要时也可通过 `show` 调查失效原因。结果回执仍使用本次检索命中的版本。
47
+
48
+ 经验独立存储,源码变化不自动使其失效;可选的 `codePaths` 仅供定位。
49
+ 同仓库 worktree 共用经验,但各自的版本、配置和环境仍须现场核对。经验是线索,
50
+ 用户要求与现场事实优先。保留历史反例和未验收范围,不重复实现已经存在的修复。
51
+
52
+ ## 结果回执
53
+
54
+ 经验实际改变了行动,或经核对被明确否决时,写一份本次结果 JSON,再提交:
55
+
56
+ ```bash
57
+ rw experience feedback --cwd "$PWD" --file /absolute/receipt.json --json
58
+ ```
59
+
60
+ JSON 字段:`lookupId`(本次查询)、`id`、`revision`(命中记录)、`task`(当前任务标识)、
61
+ `decision`(`used` / `dismissed`)、`reason`、`action`、`outcome`、
62
+ `result`(`succeeded` / `failed` / `unknown`)、`evidence`。
63
+ 每项 evidence 包含 `path`(本机绝对路径)、`startLine`、`endLine`(从 1 起)与 `note`。
64
+ `used` 必须附本次实际结果证据;`dismissed` 可用空 evidence。
65
+ 沿用实际采用时的 `lookupId`、`id` 和 `revision`,不为提交反馈重新检索或换成最新版。
66
+ 项目代码变化、经验更新或过期后,仍可记录该次历史结果。只附必要片段,不保存凭据。
67
+ 未验证不能写 succeeded;采用失败须记录 failed。当前版本的失败会停止推荐,旧版本的
68
+ 失败保留在历史中,不直接停用新版。回执是 Agent 报告,不能单凭它宣称因果收益。
69
+
70
+ 向用户说明哪条经验改变了什么操作,以及本次观察到什么结果。召回和采纳次数不是效果。
71
+ 验收夹具、离线命中探针及为复盘构造的任务必须注明用途,不能作为自然任务的复用收益。
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@runweave/experience-skill",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "files": [
6
+ "SKILL.md"
7
+ ],
8
+ "pi": {
9
+ "skills": [
10
+ "./SKILL.md"
11
+ ]
12
+ }
13
+ }
@@ -0,0 +1,457 @@
1
+ ---
2
+ name: git-advanced-workflows
3
+ description: "Manage advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog. Use when managing complex Git history or when an Agent needs to create, inspect, reuse, or remove a Git Worktree; newly created Worktrees must live under the current parent Project's .worktree directory."
4
+ metadata:
5
+ risk: unknown
6
+ source: community
7
+ date_added: "2026-02-27"
8
+ ---
9
+
10
+ # Git Advanced Workflows
11
+
12
+ Master advanced Git techniques to maintain clean history, collaborate effectively, and recover from any situation with confidence.
13
+
14
+ ## Do not use this skill when
15
+
16
+ - The task is unrelated to git advanced workflows
17
+ - You need a different domain or tool outside this scope
18
+
19
+ ## Instructions
20
+
21
+ - Clarify goals, constraints, and required inputs.
22
+ - Apply relevant best practices and validate outcomes.
23
+ - Provide actionable steps and verification.
24
+ - If detailed examples are required, open `resources/implementation-playbook.md`.
25
+
26
+ ## Use this skill when
27
+
28
+ - Cleaning up commit history before merging
29
+ - Applying specific commits across branches
30
+ - Finding commits that introduced bugs
31
+ - Working on multiple features simultaneously
32
+ - Recovering from Git mistakes or lost commits
33
+ - Managing complex branch workflows
34
+ - Preparing clean PRs for review
35
+ - Synchronizing diverged branches
36
+
37
+ ## Core Concepts
38
+
39
+ ### 1. Interactive Rebase
40
+
41
+ Interactive rebase is the Swiss Army knife of Git history editing.
42
+
43
+ **Common Operations:**
44
+
45
+ - `pick`: Keep commit as-is
46
+ - `reword`: Change commit message
47
+ - `edit`: Amend commit content
48
+ - `squash`: Combine with previous commit
49
+ - `fixup`: Like squash but discard message
50
+ - `drop`: Remove commit entirely
51
+
52
+ **Basic Usage:**
53
+
54
+ ```bash
55
+ # Rebase last 5 commits
56
+ git rebase -i HEAD~5
57
+
58
+ # Rebase all commits on current branch
59
+ git rebase -i $(git merge-base HEAD main)
60
+
61
+ # Rebase onto specific commit
62
+ git rebase -i abc123
63
+ ```
64
+
65
+ ### 2. Cherry-Picking
66
+
67
+ Apply specific commits from one branch to another without merging entire branches.
68
+
69
+ ```bash
70
+ # Cherry-pick single commit
71
+ git cherry-pick abc123
72
+
73
+ # Cherry-pick range of commits (exclusive start)
74
+ git cherry-pick abc123..def456
75
+
76
+ # Cherry-pick without committing (stage changes only)
77
+ git cherry-pick -n abc123
78
+
79
+ # Cherry-pick and edit commit message
80
+ git cherry-pick -e abc123
81
+ ```
82
+
83
+ ### 3. Git Bisect
84
+
85
+ Binary search through commit history to find the commit that introduced a bug.
86
+
87
+ ```bash
88
+ # Start bisect
89
+ git bisect start
90
+
91
+ # Mark current commit as bad
92
+ git bisect bad
93
+
94
+ # Mark known good commit
95
+ git bisect good v1.0.0
96
+
97
+ # Git will checkout middle commit - test it
98
+ # Then mark as good or bad
99
+ git bisect good # or: git bisect bad
100
+
101
+ # Continue until bug found
102
+ # When done
103
+ git bisect reset
104
+ ```
105
+
106
+ **Automated Bisect:**
107
+
108
+ ```bash
109
+ # Use script to test automatically
110
+ git bisect start HEAD v1.0.0
111
+ git bisect run ./test.sh
112
+
113
+ # test.sh should exit 0 for good, 1-127 (except 125) for bad
114
+ ```
115
+
116
+ ### 4. Worktrees
117
+
118
+ Work on multiple branches simultaneously without stashing or switching.
119
+
120
+ For every Worktree created by an Agent, use the task's assigned parent Project root and place the Worktree at the direct-child path `<projectRoot>/.worktree/<managedName>`.
121
+
122
+ - Treat `projectRoot` as the current Runweave parent Project, not the Git common-dir checkout. A parent Project may itself be a linked Worktree.
123
+ - If the current cwd is already `<projectRoot>/.worktree/<name>`, create any additional Worktree as its sibling under the same parent Project; never create nested `.worktree/<name>/.worktree/<other>` directories.
124
+ - Use a short lowercase ASCII slug for `managedName`. Keep the directory name separate from a branch name containing `/`.
125
+ - Before creation, reject a symlinked `.worktree` root, ensure the root `/.worktree/` path is Git-ignored, and inspect `git worktree list --porcelain` for path or branch collisions.
126
+ - Do not create new Worktrees in `/tmp`, `/private/tmp`, repository siblings, `.trae/worktrees`, or another tool-private directory. Existing Worktrees outside `.worktree` may continue to be used when the task is already bound to them; do not migrate them implicitly.
127
+ - Remove only the exact managed Worktree after checking that it is clean and no task-owned runtime still uses it. Do not use broad `git worktree prune` or forced removal as routine cleanup.
128
+
129
+ ```bash
130
+ # Run from the assigned parent Project root
131
+ project_root="$(git rev-parse --show-toplevel)"
132
+ worktree_root="$project_root/.worktree"
133
+ baseline_revision="<exact-baseline-revision>"
134
+
135
+ # The repository must ignore /.worktree/ before creation
136
+ test ! -L "$worktree_root"
137
+ mkdir -p "$worktree_root"
138
+ git -C "$project_root" check-ignore -q .worktree/
139
+
140
+ # Inspect exact registered identities before changing them
141
+ git -C "$project_root" worktree list --porcelain
142
+
143
+ # Add new worktree for feature branch
144
+ git -C "$project_root" worktree add \
145
+ "$worktree_root/feature-new-feature" \
146
+ feature/new-feature
147
+
148
+ # Add worktree and create new branch
149
+ git -C "$project_root" worktree add \
150
+ -b bugfix/urgent \
151
+ "$worktree_root/bugfix-urgent" \
152
+ main
153
+
154
+ # Add detached validation worktree from an exact baseline
155
+ git -C "$project_root" worktree add \
156
+ --detach \
157
+ "$worktree_root/validate-terminal-state" \
158
+ "$baseline_revision"
159
+
160
+ # Remove one clean, no-longer-used worktree and verify the registration is gone
161
+ git -C "$worktree_root/feature-new-feature" status --short
162
+ git -C "$project_root" worktree remove \
163
+ "$worktree_root/feature-new-feature"
164
+ git -C "$project_root" worktree list --porcelain
165
+ ```
166
+
167
+ ### 5. Reflog
168
+
169
+ Your safety net - tracks all ref movements, even deleted commits.
170
+
171
+ ```bash
172
+ # View reflog
173
+ git reflog
174
+
175
+ # View reflog for specific branch
176
+ git reflog show feature/branch
177
+
178
+ # Restore deleted commit
179
+ git reflog
180
+ # Find commit hash
181
+ git checkout abc123
182
+ git branch recovered-branch
183
+
184
+ # Restore deleted branch
185
+ git reflog
186
+ git branch deleted-branch abc123
187
+ ```
188
+
189
+ ## Practical Workflows
190
+
191
+ ### Workflow 1: Clean Up Feature Branch Before PR
192
+
193
+ ```bash
194
+ # Start with feature branch
195
+ git checkout feature/user-auth
196
+
197
+ # Interactive rebase to clean history
198
+ git rebase -i main
199
+
200
+ # Example rebase operations:
201
+ # - Squash "fix typo" commits
202
+ # - Reword commit messages for clarity
203
+ # - Reorder commits logically
204
+ # - Drop unnecessary commits
205
+
206
+ # Force push cleaned branch (safe if no one else is using it)
207
+ git push --force-with-lease origin feature/user-auth
208
+ ```
209
+
210
+ ### Workflow 2: Apply Hotfix to Multiple Releases
211
+
212
+ ```bash
213
+ # Create fix on main
214
+ git checkout main
215
+ git commit -m "fix: critical security patch"
216
+
217
+ # Apply to release branches
218
+ git checkout release/2.0
219
+ git cherry-pick abc123
220
+
221
+ git checkout release/1.9
222
+ git cherry-pick abc123
223
+
224
+ # Handle conflicts if they arise
225
+ git cherry-pick --continue
226
+ # or
227
+ git cherry-pick --abort
228
+ ```
229
+
230
+ ### Workflow 3: Find Bug Introduction
231
+
232
+ ```bash
233
+ # Start bisect
234
+ git bisect start
235
+ git bisect bad HEAD
236
+ git bisect good v2.1.0
237
+
238
+ # Git checks out middle commit - run tests
239
+ npm test
240
+
241
+ # If tests fail
242
+ git bisect bad
243
+
244
+ # If tests pass
245
+ git bisect good
246
+
247
+ # Git will automatically checkout next commit to test
248
+ # Repeat until bug found
249
+
250
+ # Automated version
251
+ git bisect start HEAD v2.1.0
252
+ git bisect run npm test
253
+ ```
254
+
255
+ ### Workflow 4: Multi-Branch Development
256
+
257
+ ```bash
258
+ # Run from the assigned parent Project root
259
+ project_root="$(git rev-parse --show-toplevel)"
260
+ hotfix_worktree="$project_root/.worktree/hotfix-critical-bug"
261
+ mkdir -p "$project_root/.worktree"
262
+ git -C "$project_root" check-ignore -q .worktree/
263
+
264
+ # Create a direct-child worktree for the existing hotfix branch
265
+ git -C "$project_root" worktree add \
266
+ "$hotfix_worktree" \
267
+ hotfix/critical-bug
268
+
269
+ # Work on hotfix in separate directory
270
+ cd "$hotfix_worktree"
271
+ # Make changes, commit
272
+ git commit -m "fix: resolve critical bug"
273
+ git push origin hotfix/critical-bug
274
+
275
+ # Return to main work without interruption
276
+ cd "$project_root"
277
+ git fetch origin
278
+ git cherry-pick hotfix/critical-bug
279
+
280
+ # Clean up the exact path when it is clean and no runtime uses it
281
+ git -C "$hotfix_worktree" status --short
282
+ git -C "$project_root" worktree remove "$hotfix_worktree"
283
+ ```
284
+
285
+ ### Workflow 5: Recover from Mistakes
286
+
287
+ ```bash
288
+ # Accidentally reset to wrong commit
289
+ git reset --hard HEAD~5 # Oh no!
290
+
291
+ # Use reflog to find lost commits
292
+ git reflog
293
+ # Output shows:
294
+ # abc123 HEAD@{0}: reset: moving to HEAD~5
295
+ # def456 HEAD@{1}: commit: my important changes
296
+
297
+ # Recover lost commits
298
+ git reset --hard def456
299
+
300
+ # Or create branch from lost commit
301
+ git branch recovery def456
302
+ ```
303
+
304
+ ## Advanced Techniques
305
+
306
+ ### Rebase vs Merge Strategy
307
+
308
+ **When to Rebase:**
309
+
310
+ - Cleaning up local commits before pushing
311
+ - Keeping feature branch up-to-date with main
312
+ - Creating linear history for easier review
313
+
314
+ **When to Merge:**
315
+
316
+ - Integrating completed features into main
317
+ - Preserving exact history of collaboration
318
+ - Public branches used by others
319
+
320
+ ```bash
321
+ # Update feature branch with main changes (rebase)
322
+ git checkout feature/my-feature
323
+ git fetch origin
324
+ git rebase origin/main
325
+
326
+ # Handle conflicts
327
+ git status
328
+ # Fix conflicts in files
329
+ git add .
330
+ git rebase --continue
331
+
332
+ # Or merge instead
333
+ git merge origin/main
334
+ ```
335
+
336
+ ### Autosquash Workflow
337
+
338
+ Automatically squash fixup commits during rebase.
339
+
340
+ ```bash
341
+ # Make initial commit
342
+ git commit -m "feat: add user authentication"
343
+
344
+ # Later, fix something in that commit
345
+ # Stage changes
346
+ git commit --fixup HEAD # or specify commit hash
347
+
348
+ # Make more changes
349
+ git commit --fixup abc123
350
+
351
+ # Rebase with autosquash
352
+ git rebase -i --autosquash main
353
+
354
+ # Git automatically marks fixup commits
355
+ ```
356
+
357
+ ### Split Commit
358
+
359
+ Break one commit into multiple logical commits.
360
+
361
+ ```bash
362
+ # Start interactive rebase
363
+ git rebase -i HEAD~3
364
+
365
+ # Mark commit to split with 'edit'
366
+ # Git will stop at that commit
367
+
368
+ # Reset commit but keep changes
369
+ git reset HEAD^
370
+
371
+ # Stage and commit in logical chunks
372
+ git add file1.py
373
+ git commit -m "feat: add validation"
374
+
375
+ git add file2.py
376
+ git commit -m "feat: add error handling"
377
+
378
+ # Continue rebase
379
+ git rebase --continue
380
+ ```
381
+
382
+ ### Partial Cherry-Pick
383
+
384
+ Cherry-pick only specific files from a commit.
385
+
386
+ ```bash
387
+ # Show files in commit
388
+ git show --name-only abc123
389
+
390
+ # Checkout specific files from commit
391
+ git checkout abc123 -- path/to/file1.py path/to/file2.py
392
+
393
+ # Stage and commit
394
+ git commit -m "cherry-pick: apply specific changes from abc123"
395
+ ```
396
+
397
+ ## Best Practices
398
+
399
+ 1. **Always Use --force-with-lease**: Safer than --force, prevents overwriting others' work
400
+ 2. **Rebase Only Local Commits**: Don't rebase commits that have been pushed and shared
401
+ 3. **Descriptive Commit Messages**: Future you will thank present you
402
+ 4. **Atomic Commits**: Each commit should be a single logical change
403
+ 5. **Test Before Force Push**: Ensure history rewrite didn't break anything
404
+ 6. **Keep Reflog Aware**: Remember reflog is your safety net for 90 days
405
+ 7. **Branch Before Risky Operations**: Create backup branch before complex rebases
406
+
407
+ ```bash
408
+ # Safe force push
409
+ git push --force-with-lease origin feature/branch
410
+
411
+ # Create backup before risky operation
412
+ git branch backup-branch
413
+ git rebase -i main
414
+ # If something goes wrong
415
+ git reset --hard backup-branch
416
+ ```
417
+
418
+ ## Common Pitfalls
419
+
420
+ - **Rebasing Public Branches**: Causes history conflicts for collaborators
421
+ - **Force Pushing Without Lease**: Can overwrite teammate's work
422
+ - **Losing Work in Rebase**: Resolve conflicts carefully, test after rebase
423
+ - **Unsafe Worktree Placement or Cleanup**: Create only under `<projectRoot>/.worktree/<managedName>` and remove only the verified exact target
424
+ - **Not Backing Up Before Experiment**: Always create safety branch
425
+ - **Bisect on Dirty Working Directory**: Commit or stash before bisecting
426
+
427
+ ## Recovery Commands
428
+
429
+ ```bash
430
+ # Abort operations in progress
431
+ git rebase --abort
432
+ git merge --abort
433
+ git cherry-pick --abort
434
+ git bisect reset
435
+
436
+ # Restore file to version from specific commit
437
+ git restore --source=abc123 path/to/file
438
+
439
+ # Undo last commit but keep changes
440
+ git reset --soft HEAD^
441
+
442
+ # Undo last commit and discard changes
443
+ git reset --hard HEAD^
444
+
445
+ # Recover deleted branch (within 90 days)
446
+ git reflog
447
+ git branch recovered-branch abc123
448
+ ```
449
+
450
+ ## Resources
451
+
452
+ - **references/git-rebase-guide.md**: Deep dive into interactive rebase
453
+ - **references/git-conflict-resolution.md**: Advanced conflict resolution strategies
454
+ - **references/git-history-rewriting.md**: Safely rewriting Git history
455
+ - **assets/git-workflow-checklist.md**: Pre-PR cleanup checklist
456
+ - **assets/git-aliases.md**: Useful Git aliases for advanced workflows
457
+ - **scripts/git-clean-branches.sh**: Clean up merged and stale branches
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: github-pr
3
+ description: 当用户要求提交代码并合并到 GitHub(提交 PR、走完 PR 全流程、合并到主分支)时使用。一键完成:提交工作区代码 → 创建 PR → 轮询状态并解决冲突/门禁失败 → CR 通过后合并。
4
+ ---
5
+
6
+ # GitHub PR 全流程
7
+
8
+ 一条命令把当前工作区的改动**提交、开 PR、跟到通过、合并进目标分支**。基于 `gh` CLI(GitHub)。
9
+
10
+ 这是随插件安装的跨仓库技能,适用于 GitHub 仓库。目标仓库无需包含本技能、预检脚本或插件源码;所有 Git 操作都在用户要提交的目标仓库执行。
11
+
12
+ 技能资源从实际加载的 `SKILL.md` 所在目录解析,使用绝对路径调用;不要到目标仓库寻找 `plugins/toolkit`,也不要硬编码某台机器的路径或缓存版本。辅助脚本依赖 Node.js 内置模块、Git 和 `gh`,有 `curl` 时额外检查无凭证网络连通性;缺少 `curl` 时明确跳过该探测,仍执行 GitHub API 检查。不需要在目标仓库安装 npm/pnpm 依赖。没有 Node.js 或脚本资源缺失时,按下述规则逐项执行 Git/gh 只读检查,不要求目标项目引入 Node.js。
13
+
14
+ 提交格式及 PR 模板以目标仓库的说明和现有配置为准,不沿用技能开发仓库的约定。已有 commit/push hook 和远端 CI 属于本流程;构建、lint、测试、Dev Session、UI/CDP 验收及其他主动验证,只有用户在当前请求中明确要求,或显式调用对应验证技能时才执行。目标仓库列出可用验证命令,不等于纯 Git/PR 请求已经授权执行。Husky 和提交钩子都可选,不存在时记录为缺省,不自动创建或安装。
15
+
16
+ ## 参数
17
+
18
+ - 目标分支可选:用户指定则用指定分支;未指定默认远程主分支(`origin/HEAD`,回退 `main` → `master`)。
19
+ - 默认新建分支提交并基于它开 PR;仅当用户明确要求「当前分支」时在当前分支提交。
20
+ - “所有代码”“全部改动”只扩大本次核对与暂存范围,不授权主动运行全量或范围相称的验证,不授权启动 Dev Session、浏览器或设备验收,也不授权修复由自选验证发现的其他问题。
21
+ - 以下命令以 `origin` 为常见示例。使用其他 remote、fork/upstream 或 GitHub Enterprise 时,先从用户请求和远端配置确定发布仓库、PR 目标仓库及主机,再替换命令参数;不能把它们默认当作同一个仓库。非 GitHub 平台使用对应流程;仅在可用时转用 create_mr 技能。
22
+
23
+ ## 前置检查
24
+
25
+ - 在目标工作区调用随技能分发的 [预检脚本](scripts/preflight.mjs):`node "<技能安装目录>/scripts/preflight.mjs" "<目标工作区路径>"`;省略工作区参数时检查当前目录,不要为了运行脚本切换到技能目录。脚本只读,不执行 hook、fetch、暂存或账号切换;输出 JSON 和各项退出码,全部检查收集完成后才以 0/1 表示预检通过/存在失败。
26
+ - 检查内容包括当前提交、分支(允许 detached HEAD)、工作区与暂存区、worktree 占用、origin 的读取/推送目标、有效 hook 路径及 Husky 入口、活跃账号和目标仓库访问权限。脏工作区属于待确认范围,不自动判失败;`passed` 只表示预检完成且无失败,不代表已获写权限或可以合并。
27
+ - 认证使用 `gh auth status --active --hostname github.com`,并通过当前账号及目标仓库 API 验证。非活跃账号失效不阻断,不自动登出或切换账号。不要用普通 `gh auth status` 的整体失败判定当前账号失效;也不要用 `gh auth status --json` 的退出码判断认证成功,它可能在认证失败时仍返回 0。
28
+ - 脚本失败时检查 `failedChecks` 和 `hooks`;网络错误、超时、缺少 CLI 与权限不足分别处理。脚本隐藏认证原文,必要时单独重跑失败检查,不使用 `--show-token`。确实缺少当前身份或所需权限时才找用户授权。
29
+ - `checks.credential` 独立探测当前主机凭证是否可读,只记录布尔结果,不打印或保存 Token;`checks.network` 用 `curl` 探测 GitHub API 与 Git HTTPS 主机,仅作为诊断,探测失败记录为 `warning`。凭证可读时始终执行 `gh` 账号及仓库检查,以实际 `gh` 结果决定阻塞和恢复,不因 `curl` 自身的证书或代理问题阻断提交。`gh auth status` 的 `(keyring)` 表示凭证来源,后面的 `Timeout` 不能证明 keyring 读取失败。API 超时不等于凭证失效,后台没有交互式终端也不意味着不能使用当前系统账号已有的合法凭证。
30
+ - 网络失败先读 `diagnosis`、`recovery.attempts` 和网络错误分类,再检查当前进程代理环境、DNS 与电脑已配置的备用路线。已有获准的 HTTP(S) 备用代理时用 `node "<技能安装目录>/scripts/preflight.mjs" "<工作区>" --fallback-proxy "<代理 URL>"` 验证;URL 不允许内嵌密码,脚本不修改系统网络、Git 配置或账号。不要猜代理地址、永久写死 GitHub IP、关闭 TLS 校验或因超时要求换 Token。
31
+ - 预检最多执行三轮(初次加两次网络重试),仅网络或检查超时进入恢复;认证拒绝、仓库无权限和限流直接保留准确原因。验证备用路线成功后,将 `recovery.connectionEnvironment` 中的环境变量应用于后续所有 `git` 和 `gh` 命令,不能只让预检走备用路线。没有可用路线或次数耗尽时返回网络阻塞,并分别说明凭证探测结果与已尝试路线;不要编造成 keyring 权限拒绝。创建 PR、合并等写操作超时仍先查询远端事实,不能照搬只读探测的重试方式。
32
+ - `recovery.gitTransport` 为 `ssh` 时,HTTP 代理仅恢复 GitHub API;Git SSH 还须使用已有的 SSH 代理配置并独立验证 `git ls-remote`。不要因 API 已恢复就声称 SSH 推送可用,也不要自动改 remote 或 SSH 配置。
33
+ - 独立只读检查分别保留结果,不用 `&&` 串联,也不用 `|| true` 吞错。依赖操作仍需前一步成功才能执行;异步命令返回运行中标识时,等待其真正完成。手动回退也遵守这些规则。
34
+ - 辅助脚本自动检查的范围是 `origin` 指向 github.com 且读写目标一致。其他 remote、fork、SSH 主机别名、Enterprise 等配置使用手动预检:独立检查工作区、暂存区、worktree 和实际钩子路径;解析真实主机与仓库后检查 `gh auth status --active --hostname <主机>`、当前身份及仓库权限。脚本不支持某种配置不等于该仓库不能使用本技能;目标能从现有配置确定时无需再次询问。
35
+
36
+ ## 流程
37
+
38
+ 用户委托全流程后,只有实际 commit hook、push hook、远端 CI 或必需评审明确报告的失败,才是本技能所说的门禁失败。不要为了预判门禁而主动运行验证命令、调用其他验证技能、启动运行环境或设计额外验收场景;前置脚本的只读预检不属于代码验证。
39
+
40
+ 确认失败由本次改动引起且修复不改变用户目标时,先读失败输出、修复并重跑原门禁,再继续提交、推送或合并;不要在可修复时停下询问用户是否要处理,也不要把失败日志当作最终交付。自选检查或自建验收场景发现的问题不自动取得修复授权。只有用户显式要求对应验证,或修复来自实际门禁,才按本流程修复;需要改变用户目标、扩大到无关代码,或确实缺少权限、外部资源时,说明具体阻塞并请求必要输入。
41
+
42
+ ### 1. 提交代码
43
+
44
+ - 在暂存、提交或复制补丁前,记录改动来源目录与提交目录;使用 [来源工作区脚本](scripts/source-worktree.mjs) 的 `capture <来源目录> <恢复回执.json> <范围.json>` 保存来源 HEAD、完整暂存区和脏文件恢复快照。范围文件是本次已核对的仓库相对路径 JSON 数组;回执放在来源工作区外的私有目录,不上传或打印其内容。在独立 worktree 提交时,来源目录仍属于本次交付的收尾范围,不能只清理提交目录。来源本身直接提交后变干净时,按下文普通干净工作区流程处理,无需复用提交前快照强行同步。
45
+ - 根据用户请求和 diff 确定本次范围,检查已有暂存内容;使用 `git add -- <本次路径>`,同文件混有其他任务改动时按 hunk 暂存。只有用户明确要求全部改动且已核对范围时才用 `git add -A`。已有无关暂存内容也不能夹带提交或擅自取消暂存,必要时使用独立 worktree 承载本次补丁。
46
+ - `git fetch origin` 后核对目标分支与本次提交范围;如改动已合并,核实对应 PR 的合并事实后直接执行第 5 步来源工作区收尾,避免重复 PR,也不能只报告已合并就留下原始改动。新分支不能夹带当前分支上无关的领先提交。脏工作区不要直接 rebase,也不要为方便操作而 stash、reset 或清理他人改动。
47
+ - 读 `git diff --cached` 复核最终范围,按目标仓库惯例生成 commit message;无明确惯例时使用 Conventional Commits,描述意图而非文件列表。
48
+ - 默认基于 commit subject 新建分支:`git checkout -b <type>/<slug>`;用户要求当前分支则跳过。
49
+ - 若用户未显式要求验证或调用验证技能,完成范围复核后直接进入提交;不要插入“运行与改动范围相称的验证”、完整验收或类似计划项。
50
+ - `git commit`。pre-commit hook 失败时按输出处理依赖/环境问题或本次代码问题,复核 hook 生成的改动、只暂存本次修复再重试。不修改无关代码来凑检查通过,不跳过 hook。
51
+ - 工作区无改动但分支已有领先提交时,直接进入开 PR。
52
+
53
+ ### 2. 创建 PR
54
+
55
+ - `git push -u origin <branch>`;等待 hook 与推送成功退出后再开 PR。推送失败先区分本地 pre-push 门禁、远端保护规则与 non-fast-forward,不把它们统称为 GitHub 故障。
56
+ - **本地 pre-push 门禁失败**:读取具体失败项并核对是否由本次改动引起;若是,直接修复、只暂存修复范围、提交并重跑原门禁,再推送。例如架构检查报 `New >600 line file is not in the legacy baseline` 时,核对文件和行数,按职责抽取独立逻辑并保持行为,重新运行架构检查;不要压缩排版、扩大历史基线、跳过 hook,或把“是否修复”交给用户选择。若失败来自既有无关代码,也先核对能否在授权范围内安全修复;确实不能时报告准确的失败项与阻塞原因。
57
+ - 远端拒绝为 non-fast-forward 时先 fetch 并检查远端新增提交的归属,再在工作区安全时 rebase,不能覆盖其他人的更新。分支保护拒绝时核对实际规则,不用强推或绕过保护制造成功。
58
+ - 创建前按明确仓库、head/base 查询 open PR;存在则复用。命令超时或返回不确定时先查询远端是否已成功,避免盲目重试。
59
+ - 把说明写入临时文件,再用 `gh pr create --repo <仓库> --base <目标分支> --head <branch> --title <subject> --body-file <文件>`,保留换行和字面量。body 写清改动要点与实际验证情况。
60
+ - 记录 PR 编号/URL 供后续轮询。
61
+
62
+ ### 3. 轮询状态,解决冲突与门禁失败
63
+
64
+ 目标:把 PR 推进到「可合并 + CR 通过」。用 JSON 读权威状态,不要靠页面文本猜:
65
+
66
+ ```bash
67
+ gh pr view <pr> --repo <仓库> --json number,state,headRefOid,reviewDecision,mergeable,mergeStateStatus,statusCheckRollup
68
+ gh pr checks <pr> --repo <仓库> --json name,state,bucket,link
69
+ ```
70
+
71
+ 关键字段:
72
+
73
+ - `mergeable`:`MERGEABLE` 可合 / `CONFLICTING` 有冲突 / `UNKNOWN` 计算中(稍等重查)。
74
+ - `mergeStateStatus`:`CLEAN` / `BLOCKED`(缺 CR 或门禁)/ `BEHIND`(落后基线)/ `DIRTY`(冲突)。
75
+ - `reviewDecision`:`APPROVED` / `CHANGES_REQUESTED` / `REVIEW_REQUIRED`。
76
+ - `statusCheckRollup` 同时可能包含 CheckRun 的 `status/conclusion` 和 StatusContext 的 `state`,不能统一只读 `state`。可用 `gh pr checks` 的 `bucket` 归类:`pass/fail/pending/skipping/cancel`。
77
+
78
+ 处理策略:
79
+
80
+ - **CI pending**:优先 `gh pr checks <pr> --repo <仓库> --watch --interval 20 --fail-fast`,通过异步执行等待并定期更新进度。普通 checks 的退出码 8 表示 pending,不是失败;查询/API 错误也不能当作 CI 失败。检查尚未注册、返回为空时核对仓库工作流,不能直接认定通过。等待超时报告仍在等待,不宣称完成。
81
+ - **代码冲突(CONFLICTING/DIRTY)**:本地 `git fetch origin && git rebase origin/<目标分支>`,解决冲突后 `git push --force-with-lease`(GitHub 仓库允许 `--force-with-lease`)。
82
+ - **落后基线(BEHIND)**:仓库门禁要求更新时,同上 rebase 后重推;仅目标分支有新提交且仍可正常合并时不重复 rebase。每次重推后,旧 SHA 的检查和评审结论不能替代新 SHA 的状态。
83
+ - **门禁失败**:拉取失败 check 的日志,定位并修复,提交后重新推送触发重跑;与 pre-push 一样,本次改动造成的确定性失败由 Agent 负责修复,不停下让用户决定是否继续。取消的检查、非预期跳过的必需检查也要查明原因。只在明确瞬时故障时有限重试,同一错误无新证据不循环重跑。
84
+ - **CHANGES_REQUESTED**:这是人工评审要求改动;总结评审意见,做出修改后重推,不要绕过评审。
85
+ - 合并前重新读取 `headRefOid`:当前提交的应运行检查已通过、评审要求已满足、无冲突且无其他阻塞才允许直接合并。`APPROVED` 不代表 CI 通过,`CLEAN` 不替代检查明细;`UNKNOWN` 继续等待。不要仅查 `--required` 而漏掉本次应运行的检查。若读取期间 head 改变,重新验证新 head。
86
+
87
+ ### 4. CR 通过后合并
88
+
89
+ - 满足条件后执行 `gh pr merge <pr> --repo <仓库> --squash --match-head-commit <刚验证的headRefOid>`;按仓库惯例可改合并策略。远端合并与本地清理分步执行,默认不加 `--delete-branch`,避免 main 被其他 worktree 占用或脏工作区使整个操作表现为失败。
90
+ - 若启用了合并队列或仍需等待门禁,可登记 auto-merge/入队,登记时同样使用 `--match-head-commit`,并继续跟进当前 head;登记成功不等于已合并,不绕过门禁。
91
+ - 不论合并命令成功、失败或超时,都单独运行 `gh pr view <pr> --repo <仓库> --json state,mergedAt,mergeCommit,headRefOid` 确认远端事实。只有 `state=MERGED` 才报告合并完成;未知状态先查明再重试。
92
+
93
+ ### 5. 合并后清理
94
+
95
+ - 先确认已合并,再 fetch 并重读来源目录、提交目录的 `git status`、分支指向及 `git worktree list`。固定最新目标分支的完整 commit SHA,确认包含合并提交;远端成功、本地同步和残留改动分别核对。全流程委托包含本次来源改动的安全收尾;不删除来源目录,也不处理无关 worktree。
96
+ - 来源目录仍脏时,用 `node "<技能安装目录>/scripts/source-worktree.mjs" inspect <恢复回执.json> <目标SHA>` 核对:`covered` 是本次范围内、内容和文件模式(或删除状态)与目标提交一致的路径;`retained` 是未交付或无关的路径。`changed`、`sourceHeadChanged`、`sourceIndexChanged`、`historyUncovered` 或 `indexUncovered` 非空/为 true 时不自动同步;先核对后续改动与归属,不能用旧快照清掉新内容。脚本不会用“新增字段已收录”替代整份文件比较,同文件部分交付时保留该文件。
97
+ - `canFinish=true` 且已确认来源没有其他 Agent、编辑器或自动化正在写入、允许本次工作区切换到目标提交时,执行 `node "<技能安装目录>/scripts/source-worktree.mjs" finish <恢复回执.json> <目标SHA> --source-idle`。它保留恢复回执和来源 HEAD 的 backup 分支,仅暂存已覆盖的本次路径,将已覆盖的未跟踪文件从原目录移开,再用不带 force 的 checkout detach 到目标 SHA;Git 拒绝覆盖剩余改动时恢复原暂存区和移开的文件,保留具体阻塞。`--source-idle` 是调用者已核实独占写入的声明,不是锁。禁止对正在被其他任务写入的来源执行此命令。
98
+ - 来源变干净(例如直接在来源提交)时,确认本次提交已合并、没有未交付的独有提交且不存在其他任务写入后,可 detach 到目标 SHA。用户明确要求保持当前分支、来源有后续改动、源 HEAD 有未交付提交、剩余改动与目标更新冲突,或同文件混有部分交付内容时,保留现场并逐项说明原因和后续处理;不能为了干净使用 reset --hard、clean、整文件恢复或重放旧 stash。目标分支被其他 worktree 占用时不切换或拉取那个目录。
99
+ - 同步后独立回读来源 HEAD、工作区与暂存区:本次已覆盖路径不再显示为脏,保留路径的内容、文件模式、删除状态及暂存语义仍正确。只删除本次创建且干净、无运行会话使用的交付 worktree/分支;恢复快照和 backup 分支保留并报告位置。squash 后 `git branch -d` 拒绝时不直接升级为 `-D`。
100
+ - 远端源分支只在确认属于本次任务、仍指向已合并的 head 时删除。若用 `git push --delete`,须带针对该 ref 和已验证 SHA 的显式 `--force-with-lease`;该操作可能触发 pre-push,不能为省检查禁用 hook。分支已被自动删除则无需再处理。
101
+ - 最终分别报告 PR/合并提交、来源工作区同步状态、剩余改动的路径及原因、恢复位置和实际验证结果。清理失败不改写已合并事实,也不触发重复合并;来源本次旧改动仍残留时,不能宣称全流程收尾完成。
102
+
103
+ ## 安全与边界
104
+
105
+ - 只在确认 GitHub 仓库且已登录时执行;缺权限就停下找用户要授权。
106
+ - **不用 `--admin` 绕过门禁,不跳过人工评审**(CHANGES_REQUESTED 必须真实改完)。
107
+ - 冲突/落后用 `--force-with-lease`,不用 `--force`。
108
+ - 检测到疑似敏感信息(密钥/密码)时警告用户再继续。
109
+ - 全程可观测:每一步输出分支、commit、PR URL、当前状态;失败不静默,报出关键字段与错误。