@runweave/server-linux-x64 0.1.8 → 0.1.9

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 (351) hide show
  1. package/manifest.json +1482 -151
  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 +3 -3
  6. package/payload/app-server/index.cjs +1 -1
  7. package/payload/backend/build-info.json +4 -4
  8. package/payload/backend/index.cjs +45 -9
  9. package/payload/backend/ios-simulators/pool.py +3 -3
  10. package/payload/frontend/dist/assets/{_baseUniq-vo4uuhMd.js → _baseUniq-qHFga5V8.js} +1 -1
  11. package/payload/frontend/dist/assets/{access-_jCu7Rgu.js → access-DgHvmn15.js} +1 -1
  12. package/payload/frontend/dist/assets/{advanced-CqOhObYj.js → advanced-C1Fh14vw.js} +1 -1
  13. package/payload/frontend/dist/assets/{appearance-CrrD5gzC.js → appearance-Bs7cSXqO.js} +1 -1
  14. package/payload/frontend/dist/assets/{arc-dbfyHSF0.js → arc-E3iYHQG_.js} +1 -1
  15. package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-CntSCAsO.js → architectureDiagram-Q4EWVU46-DgpYpTb9.js} +1 -1
  16. package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-Chp0D4qy.js → blockDiagram-DXYQGD6D-CfFOEKZ7.js} +1 -1
  17. package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-CF91pOuW.js → c4Diagram-AHTNJAMY-BxlHBUj3.js} +1 -1
  18. package/payload/frontend/dist/assets/channel-amxyNKnk.js +1 -0
  19. package/payload/frontend/dist/assets/{chunk-4BX2VUAB-B1gxlVu2.js → chunk-4BX2VUAB-xWocgDo8.js} +1 -1
  20. package/payload/frontend/dist/assets/{chunk-4TB4RGXK-Cxt3mj9b.js → chunk-4TB4RGXK-Bl1cNICf.js} +1 -1
  21. package/payload/frontend/dist/assets/{chunk-55IACEB6-BJT6qNik.js → chunk-55IACEB6-DVtE836u.js} +1 -1
  22. package/payload/frontend/dist/assets/{chunk-EDXVE4YY-yI59bCa0.js → chunk-EDXVE4YY-Dbd3tDCr.js} +1 -1
  23. package/payload/frontend/dist/assets/{chunk-FMBD7UC4-CDvncKKJ.js → chunk-FMBD7UC4-MPJaTsyN.js} +1 -1
  24. package/payload/frontend/dist/assets/{chunk-OYMX7WX6-BblOIU57.js → chunk-OYMX7WX6-D3LuudlW.js} +1 -1
  25. package/payload/frontend/dist/assets/{chunk-QZHKN3VN-rODzNdO0.js → chunk-QZHKN3VN-Dn1aF6iQ.js} +1 -1
  26. package/payload/frontend/dist/assets/{chunk-YZCP3GAM-B6D4wQwk.js → chunk-YZCP3GAM-jZYbHnCw.js} +1 -1
  27. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-B8cTijjT.js +1 -0
  28. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-B8cTijjT.js +1 -0
  29. package/payload/frontend/dist/assets/clone-xzI2eGRI.js +1 -0
  30. package/payload/frontend/dist/assets/connection-V2iI-6rM.js +12 -0
  31. package/payload/frontend/dist/assets/{connections-DqDmxS-O.js → connections-G_Q7342g.js} +1 -1
  32. package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-BvwVWp29.js → cose-bilkent-S5V4N54A-75FLD3RS.js} +1 -1
  33. package/payload/frontend/dist/assets/{dagre-KV5264BT-h_K1TH11.js → dagre-KV5264BT-DEm-DpJL.js} +1 -1
  34. package/payload/frontend/dist/assets/{desktop-BQ3kGtKG.js → desktop-g5JC-CQd.js} +1 -1
  35. package/payload/frontend/dist/assets/{diagram-5BDNPKRD-B8g2SV6L.js → diagram-5BDNPKRD-BV6P2UTy.js} +1 -1
  36. package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-BOEnrqYm.js → diagram-G4DWMVQ6-DuCK-MM2.js} +1 -1
  37. package/payload/frontend/dist/assets/{diagram-MMDJMWI5-DlaN_z71.js → diagram-MMDJMWI5-D5_GlPgO.js} +1 -1
  38. package/payload/frontend/dist/assets/{diagram-TYMM5635-C_pSKftn.js → diagram-TYMM5635-QRbOYR1P.js} +1 -1
  39. package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-C2dL-h3I.js → erDiagram-SMLLAGMA-DefCheAw.js} +1 -1
  40. package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-BmXhKWFj.js → flowDiagram-DWJPFMVM-DVzyWIso.js} +1 -1
  41. package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-D_Odnssf.js → ganttDiagram-T4ZO3ILL-BJaClUEF.js} +1 -1
  42. package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-DcQdcwKZ.js → gitGraphDiagram-UUTBAWPF-BLfbApNz.js} +1 -1
  43. package/payload/frontend/dist/assets/{graph-C_XsxefA.js → graph-C-YqFh68.js} +1 -1
  44. package/payload/frontend/dist/assets/{image-D3hgVr8O.js → image-CZo_2Awc.js} +1 -1
  45. package/payload/frontend/dist/assets/{index-CEUsFFQq.js → index-6q2aeqkt.js} +95 -105
  46. package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-C6TnRyMi.js → infoDiagram-42DDH7IO-BakVOutT.js} +1 -1
  47. package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-BL7rfALJ.js → ishikawaDiagram-UXIWVN3A-D_1Oa5Dc.js} +1 -1
  48. package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-C_6407GW.js → journeyDiagram-VCZTEJTY-Y8TVFv6B.js} +1 -1
  49. package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-CK61Fd0p.js → kanban-definition-6JOO6SKY-DxeNhTIB.js} +1 -1
  50. package/payload/frontend/dist/assets/{layout-DVn6JKbl.js → layout-5cMeOTAp.js} +1 -1
  51. package/payload/frontend/dist/assets/{linear-DyWskq8H.js → linear-Bnc3ev5g.js} +1 -1
  52. package/payload/frontend/dist/assets/main-3TPtEl66.js +706 -0
  53. package/payload/frontend/dist/assets/main-D4_uoZQa.css +33 -0
  54. package/payload/frontend/dist/assets/{min-apbLpSJ3.js → min-BRXKkrS8.js} +1 -1
  55. package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-MVHZZbma.js → mindmap-definition-QFDTVHPH-RYZO_BEr.js} +1 -1
  56. package/payload/frontend/dist/assets/{monitoring-BApsVez_.js → monitoring-Fv7kZ4s6.js} +1 -1
  57. package/payload/frontend/dist/assets/{notifications-CjxSNLU1.js → notifications-BzrYqyMH.js} +1 -1
  58. package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-Dhbb0AYU.js → pieDiagram-DEJITSTG-Bzw0dhjz.js} +1 -1
  59. package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-Yk6LOF0S.js → quadrantDiagram-34T5L4WZ-CQJY_msa.js} +1 -1
  60. package/payload/frontend/dist/assets/{record-content-BCJ80KS5.js → record-content-B7-6olQt.js} +1 -1
  61. package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-BUhS0PEq.js → requirementDiagram-MS252O5E-DuP8hAV8.js} +1 -1
  62. package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-D2sdxz14.js → sankeyDiagram-XADWPNL6-D-fQnCZZ.js} +1 -1
  63. package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-CRere4Fy.js → sequenceDiagram-FGHM5R23-DaZNEccV.js} +1 -1
  64. package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-_pk-OMlm.js → stateDiagram-FHFEXIEX-CkOLt5R1.js} +1 -1
  65. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-atg1K4nB.js +1 -0
  66. package/payload/frontend/dist/assets/{status-Dk5rRVQF.js → status-CIIPajZp.js} +1 -1
  67. package/payload/frontend/dist/assets/suiji-C453W-Sg.js +1 -0
  68. package/payload/frontend/dist/assets/{svg-X7YkMMvx.js → svg-BUqAWGtg.js} +1 -1
  69. package/payload/frontend/dist/assets/{tabs-BmKbcPVh.js → tabs-Cwlp1Meu.js} +1 -1
  70. package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-BPsI2pMC.js → timeline-definition-GMOUNBTQ-BOKDMwHS.js} +1 -1
  71. package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-BNJkZ1Az.js → vennDiagram-DHZGUBPP-fSZjDS41.js} +1 -1
  72. package/payload/frontend/dist/assets/{wardley-RL74JXVD-CVcYeATS.js → wardley-RL74JXVD-D1KIsvoD.js} +1 -1
  73. package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-BpLJ0alk.js → wardleyDiagram-NUSXRM2D-FMe67dwE.js} +1 -1
  74. package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-BdsYYk4M.js → xychartDiagram-5P7HB3ND-B9AM9_9w.js} +1 -1
  75. package/payload/frontend/dist/build-info.json +4 -4
  76. package/payload/frontend/dist/companion.html +1 -1
  77. package/payload/frontend/dist/index.html +3 -3
  78. package/payload/packages/agent-bridge/src/install-pi.mjs +81 -0
  79. package/payload/plugins/pi/dist/SKILL.md +22 -0
  80. package/payload/plugins/pi/dist/bridge/app-server-client.cjs +82 -0
  81. package/payload/plugins/pi/dist/bridge/feishu_stop_notify.sh +169 -0
  82. package/payload/plugins/pi/dist/bridge/runweave-hook-bridge.cjs +583 -0
  83. package/payload/plugins/pi/dist/bridge/runweave-hook-completion.cjs +42 -0
  84. package/payload/plugins/pi/dist/bridge/runweave-hook-payload.cjs +578 -0
  85. package/payload/plugins/pi/dist/bridge/runweave-task-supervision.cjs +167 -0
  86. package/payload/plugins/pi/dist/runweave.js +316 -0
  87. package/payload/plugins/toolkit/.codex-plugin/plugin.json +31 -0
  88. package/payload/plugins/toolkit/README.md +185 -0
  89. package/payload/plugins/toolkit/hooks/AGENTS.md +6 -0
  90. package/payload/plugins/toolkit/hooks/app-server-client.cjs +82 -0
  91. package/payload/plugins/toolkit/hooks/feishu_stop_notify.sh +169 -0
  92. package/payload/plugins/toolkit/hooks/runweave-hook-bridge.cjs +583 -0
  93. package/payload/plugins/toolkit/hooks/runweave-hook-completion.cjs +42 -0
  94. package/payload/plugins/toolkit/hooks/runweave-hook-dispatch.cjs +123 -0
  95. package/payload/plugins/toolkit/hooks/runweave-hook-payload.cjs +578 -0
  96. package/payload/plugins/toolkit/hooks/runweave-task-supervision.cjs +167 -0
  97. package/payload/plugins/toolkit/hooks.json +108 -0
  98. package/payload/plugins/toolkit/skills/acceptance/SKILL.md +70 -0
  99. package/payload/plugins/toolkit/skills/acceptance/agents/openai.yaml +4 -0
  100. package/payload/plugins/toolkit/skills/acceptance/references/capture.md +38 -0
  101. package/payload/plugins/toolkit/skills/acceptance/references/delivery.md +54 -0
  102. package/payload/plugins/toolkit/skills/acceptance/references/gallery-contract.md +84 -0
  103. package/payload/plugins/toolkit/skills/acceptance/references/gallery-copy.md +34 -0
  104. package/payload/plugins/toolkit/skills/acceptance/references/video.md +52 -0
  105. package/payload/plugins/toolkit/skills/acceptance/scripts/capture.py +137 -0
  106. package/payload/plugins/toolkit/skills/acceptance/scripts/common.py +63 -0
  107. package/payload/plugins/toolkit/skills/acceptance/scripts/gallery.py +353 -0
  108. package/payload/plugins/toolkit/skills/acceptance/scripts/preview.py +109 -0
  109. package/payload/plugins/toolkit/skills/acceptance/scripts/video.py +283 -0
  110. package/payload/plugins/toolkit/skills/acceptance/templates/reader.css +576 -0
  111. package/payload/plugins/toolkit/skills/acceptance/templates/reader.html +63 -0
  112. package/payload/plugins/toolkit/skills/acceptance/templates/reader.js +326 -0
  113. package/payload/plugins/toolkit/skills/acceptance/templates/viewer.css +55 -0
  114. package/payload/plugins/toolkit/skills/acceptance-gallery/SKILL.md +8 -0
  115. package/payload/plugins/toolkit/skills/acceptance-gallery/agents/openai.yaml +6 -0
  116. package/payload/plugins/toolkit/skills/acceptance-gallery/references/capture-and-copy.md +3 -0
  117. package/payload/plugins/toolkit/skills/acceptance-gallery/references/content-contract.md +3 -0
  118. package/payload/plugins/toolkit/skills/acceptance-gallery/scripts/gallery.py +9 -0
  119. package/payload/plugins/toolkit/skills/acceptance-video/SKILL.md +8 -0
  120. package/payload/plugins/toolkit/skills/acceptance-video/agents/openai.yaml +6 -0
  121. package/payload/plugins/toolkit/skills/acceptance-video/references/input-and-capture.md +3 -0
  122. package/payload/plugins/toolkit/skills/acceptance-video/references/mobile-review.md +3 -0
  123. package/payload/plugins/toolkit/skills/acceptance-video/scripts/capture.py +9 -0
  124. package/payload/plugins/toolkit/skills/acceptance-video/scripts/video.py +9 -0
  125. package/payload/plugins/toolkit/skills/agent-device/SKILL.md +86 -0
  126. package/payload/plugins/toolkit/skills/agent-device/agents/openai.yaml +4 -0
  127. package/payload/plugins/toolkit/skills/agent-device/references/ios-setup.md +36 -0
  128. package/payload/plugins/toolkit/skills/agent-device/scripts/device.py +398 -0
  129. package/payload/plugins/toolkit/skills/agent-device/scripts/resources.py +248 -0
  130. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/SKILL.md +128 -0
  131. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/agents/openai.yaml +4 -0
  132. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-checklist.md +59 -0
  133. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-guide.md +135 -0
  134. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-handoff-template.md +57 -0
  135. package/payload/plugins/toolkit/skills/ask-first/SKILL.md +81 -0
  136. package/payload/plugins/toolkit/skills/brainstorming/SKILL.md +41 -0
  137. package/payload/plugins/toolkit/skills/browse-record/SKILL.md +35 -0
  138. package/payload/plugins/toolkit/skills/browse-record/references/app-usage.md +19 -0
  139. package/payload/plugins/toolkit/skills/browse-record/references/daily-reporting.md +115 -0
  140. package/payload/plugins/toolkit/skills/browse-record/references/zhihu.md +33 -0
  141. package/payload/plugins/toolkit/skills/browse-record/scripts/app_usage.py +110 -0
  142. package/payload/plugins/toolkit/skills/browse-record/scripts/browse_job.py +385 -0
  143. package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu-read.js +126 -0
  144. package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu_http.py +273 -0
  145. package/payload/plugins/toolkit/skills/clear-technical-explanations/LICENSE +21 -0
  146. package/payload/plugins/toolkit/skills/clear-technical-explanations/SKILL.md +103 -0
  147. package/payload/plugins/toolkit/skills/code-grounded-requirements/SKILL.md +54 -0
  148. package/payload/plugins/toolkit/skills/daily-doc-maintenance/SKILL.md +151 -0
  149. package/payload/plugins/toolkit/skills/daily-record/SKILL.md +63 -0
  150. package/payload/plugins/toolkit/skills/daily-record/agents/openai.yaml +4 -0
  151. package/payload/plugins/toolkit/skills/daily-record/references/browser-history.md +6 -0
  152. package/payload/plugins/toolkit/skills/daily-record/references/feishu.md +90 -0
  153. package/payload/plugins/toolkit/skills/daily-record/references/scheduled-reporting.md +144 -0
  154. package/payload/plugins/toolkit/skills/daily-record/references/scheduled-task.template.json +15 -0
  155. package/payload/plugins/toolkit/skills/daily-record/references/suiji-work-records.md +57 -0
  156. package/payload/plugins/toolkit/skills/daily-record/scripts/feishu.py +280 -0
  157. package/payload/plugins/toolkit/skills/daily-record/scripts/job.py +416 -0
  158. package/payload/plugins/toolkit/skills/daily-record/scripts/job_browser.py +77 -0
  159. package/payload/plugins/toolkit/skills/daily-record/scripts/job_facts.py +132 -0
  160. package/payload/plugins/toolkit/skills/daily-record/scripts/job_isolation.py +69 -0
  161. package/payload/plugins/toolkit/skills/daily-record/scripts/job_materials.py +154 -0
  162. package/payload/plugins/toolkit/skills/daily-record/scripts/job_screen.py +77 -0
  163. package/payload/plugins/toolkit/skills/daily-record/scripts/job_state.py +309 -0
  164. package/payload/plugins/toolkit/skills/daily-refactor/SKILL.md +101 -0
  165. package/payload/plugins/toolkit/skills/daily-refactor/scripts/compare-architecture-reports.mjs +168 -0
  166. package/payload/plugins/toolkit/skills/debugging-strategies/SKILL.md +38 -0
  167. package/payload/plugins/toolkit/skills/debugging-strategies/resources/implementation-playbook.md +520 -0
  168. package/payload/plugins/toolkit/skills/diagnostic-log-debugging/SKILL.md +79 -0
  169. package/payload/plugins/toolkit/skills/doc-coauthoring/SKILL.md +64 -0
  170. package/payload/plugins/toolkit/skills/eli5/LICENSE +21 -0
  171. package/payload/plugins/toolkit/skills/eli5/SKILL.md +18 -0
  172. package/payload/plugins/toolkit/skills/experience/SKILL.md +71 -0
  173. package/payload/plugins/toolkit/skills/experience/package.json +13 -0
  174. package/payload/plugins/toolkit/skills/git-advanced-workflows/SKILL.md +457 -0
  175. package/payload/plugins/toolkit/skills/github-pr/SKILL.md +109 -0
  176. package/payload/plugins/toolkit/skills/github-pr/scripts/github-access.mjs +292 -0
  177. package/payload/plugins/toolkit/skills/github-pr/scripts/preflight.mjs +191 -0
  178. package/payload/plugins/toolkit/skills/github-pr/scripts/source-worktree.mjs +354 -0
  179. package/payload/plugins/toolkit/skills/grill-with-docs/SKILL.md +66 -0
  180. package/payload/plugins/toolkit/skills/grill-with-docs/agents/openai.yaml +6 -0
  181. package/payload/plugins/toolkit/skills/grilling/SKILL.md +14 -0
  182. package/payload/plugins/toolkit/skills/handoff/SKILL.md +98 -0
  183. package/payload/plugins/toolkit/skills/karpathy-guidelines/SKILL.md +73 -0
  184. package/payload/plugins/toolkit/skills/playwright-cli/SKILL.md +562 -0
  185. package/payload/plugins/toolkit/skills/playwright-cli/references/element-attributes.md +23 -0
  186. package/payload/plugins/toolkit/skills/playwright-cli/references/playwright-tests.md +39 -0
  187. package/payload/plugins/toolkit/skills/playwright-cli/references/request-mocking.md +87 -0
  188. package/payload/plugins/toolkit/skills/playwright-cli/references/running-code.md +240 -0
  189. package/payload/plugins/toolkit/skills/playwright-cli/references/session-management.md +226 -0
  190. package/payload/plugins/toolkit/skills/playwright-cli/references/spec-driven-testing.md +312 -0
  191. package/payload/plugins/toolkit/skills/playwright-cli/references/storage-state.md +275 -0
  192. package/payload/plugins/toolkit/skills/playwright-cli/references/test-generation.md +138 -0
  193. package/payload/plugins/toolkit/skills/playwright-cli/references/tracing.md +142 -0
  194. package/payload/plugins/toolkit/skills/playwright-cli/references/video-recording.md +157 -0
  195. package/payload/plugins/toolkit/skills/playwright-cli/templates/standalone.config.json +7 -0
  196. package/payload/plugins/toolkit/skills/product-exploration/SKILL.md +64 -0
  197. package/payload/plugins/toolkit/skills/product-exploration/agents/openai.yaml +5 -0
  198. package/payload/plugins/toolkit/skills/prototype-first-development/SKILL.md +134 -0
  199. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/README.md +88 -0
  200. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/app.js +145 -0
  201. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/index.html +229 -0
  202. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/mock-state.json +60 -0
  203. package/payload/plugins/toolkit/skills/prototype-first-development/references/implementation-plan-handoff-template.md +61 -0
  204. package/payload/plugins/toolkit/skills/prototype-first-development/references/prototype-workflow-checklist.md +64 -0
  205. package/payload/plugins/toolkit/skills/publish-runweave-server/SKILL.md +64 -0
  206. package/payload/plugins/toolkit/skills/publish-runweave-server/agents/openai.yaml +4 -0
  207. package/payload/plugins/toolkit/skills/react-best-practices/AGENTS.md +3227 -0
  208. package/payload/plugins/toolkit/skills/react-best-practices/README.md +127 -0
  209. package/payload/plugins/toolkit/skills/react-best-practices/SKILL.md +143 -0
  210. package/payload/plugins/toolkit/skills/react-best-practices/metadata.json +15 -0
  211. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/event-handler-refs.md +55 -0
  212. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/init-once.md +42 -0
  213. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/use-latest.md +39 -0
  214. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/api-routes.md +38 -0
  215. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/defer-await.md +80 -0
  216. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/dependencies.md +52 -0
  217. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/parallel.md +28 -0
  218. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/suspense-boundaries.md +99 -0
  219. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/barrel-imports.md +59 -0
  220. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/conditional.md +37 -0
  221. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/defer-third-party.md +49 -0
  222. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/dynamic-imports.md +35 -0
  223. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/preload.md +46 -0
  224. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/event-listeners.md +78 -0
  225. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/localstorage-schema.md +77 -0
  226. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/passive-event-listeners.md +48 -0
  227. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/swr-dedup.md +56 -0
  228. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/batch-dom-css.md +110 -0
  229. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-function-results.md +80 -0
  230. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-property-access.md +28 -0
  231. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-storage.md +70 -0
  232. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/combine-iterations.md +32 -0
  233. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/early-exit.md +50 -0
  234. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/flatmap-filter.md +55 -0
  235. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/hoist-regexp.md +45 -0
  236. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/index-maps.md +37 -0
  237. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/length-check-first.md +50 -0
  238. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/min-max-loop.md +82 -0
  239. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/set-map-lookups.md +24 -0
  240. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/tosorted-immutable.md +57 -0
  241. package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/sections.md +46 -0
  242. package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/template.md +28 -0
  243. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/activity.md +26 -0
  244. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/animate-svg-wrapper.md +38 -0
  245. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/conditional-render.md +32 -0
  246. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/content-visibility.md +38 -0
  247. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hoist-jsx.md +36 -0
  248. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-no-flicker.md +72 -0
  249. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-suppress-warning.md +26 -0
  250. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/resource-hints.md +89 -0
  251. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/script-defer-async.md +71 -0
  252. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/svg-precision.md +28 -0
  253. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/usetransition-loading.md +75 -0
  254. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/defer-reads.md +39 -0
  255. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/dependencies.md +45 -0
  256. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state-no-effect.md +40 -0
  257. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state.md +29 -0
  258. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/functional-setstate.md +77 -0
  259. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/lazy-state-init.md +58 -0
  260. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo-with-default-value.md +36 -0
  261. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo.md +44 -0
  262. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/move-effect-to-event.md +45 -0
  263. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/no-inline-components.md +83 -0
  264. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/simple-expression-in-memo.md +35 -0
  265. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/transitions.md +40 -0
  266. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/use-ref-transient-values.md +73 -0
  267. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/after-nonblocking.md +74 -0
  268. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/auth-actions.md +96 -0
  269. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-lru.md +41 -0
  270. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-react.md +76 -0
  271. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/dedup-props.md +65 -0
  272. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/hoist-static-io.md +139 -0
  273. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/parallel-fetching.md +83 -0
  274. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/serialization.md +38 -0
  275. package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/SKILL.md +8 -0
  276. package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/agents/openai.yaml +6 -0
  277. package/payload/plugins/toolkit/skills/reproduce-before-fix/SKILL.md +93 -0
  278. package/payload/plugins/toolkit/skills/reproduce-before-fix/agents/openai.yaml +7 -0
  279. package/payload/plugins/toolkit/skills/review-only/SKILL.md +72 -0
  280. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/SKILL.md +134 -0
  281. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/agents/openai.yaml +7 -0
  282. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/references/contracts.md +114 -0
  283. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/classify-runtime-verdict.mjs +140 -0
  284. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/run-static-review.mjs +389 -0
  285. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/static-review-contract.mjs +243 -0
  286. package/payload/plugins/toolkit/skills/run-test-cases/SKILL.md +63 -0
  287. package/payload/plugins/toolkit/skills/runweave-change-validation/SKILL.md +196 -0
  288. package/payload/plugins/toolkit/skills/runweave-change-validation/agents/openai.yaml +7 -0
  289. package/payload/plugins/toolkit/skills/runweave-change-validation/scripts/assert-dev-session-status.mjs +181 -0
  290. package/payload/plugins/toolkit/skills/runweave-dev-session/SKILL.md +126 -0
  291. package/payload/plugins/toolkit/skills/runweave-dev-session/agents/openai.yaml +7 -0
  292. package/payload/plugins/toolkit/skills/runweave-management/SKILL.md +47 -0
  293. package/payload/plugins/toolkit/skills/scheduled-task/SKILL.md +35 -0
  294. package/payload/plugins/toolkit/skills/shadcn/SKILL.md +245 -0
  295. package/payload/plugins/toolkit/skills/shadcn/agents/openai.yml +5 -0
  296. package/payload/plugins/toolkit/skills/shadcn/assets/shadcn-small.png +0 -0
  297. package/payload/plugins/toolkit/skills/shadcn/assets/shadcn.png +0 -0
  298. package/payload/plugins/toolkit/skills/shadcn/cli.md +276 -0
  299. package/payload/plugins/toolkit/skills/shadcn/customization.md +209 -0
  300. package/payload/plugins/toolkit/skills/shadcn/evals/evals.json +47 -0
  301. package/payload/plugins/toolkit/skills/shadcn/mcp.md +94 -0
  302. package/payload/plugins/toolkit/skills/shadcn/rules/base-vs-radix.md +310 -0
  303. package/payload/plugins/toolkit/skills/shadcn/rules/composition.md +197 -0
  304. package/payload/plugins/toolkit/skills/shadcn/rules/forms.md +198 -0
  305. package/payload/plugins/toolkit/skills/shadcn/rules/icons.md +101 -0
  306. package/payload/plugins/toolkit/skills/shadcn/rules/styling.md +163 -0
  307. package/payload/plugins/toolkit/skills/suiji/SKILL.md +54 -0
  308. package/payload/plugins/toolkit/skills/suiji/references/api.md +72 -0
  309. package/payload/plugins/toolkit/skills/suiji/references/source-adapter.md +40 -0
  310. package/payload/plugins/toolkit/skills/suiji/references/work-records.md +36 -0
  311. package/payload/plugins/toolkit/skills/suiji/scripts/source_adapter.py +46 -0
  312. package/payload/plugins/toolkit/skills/suiji/scripts/suiji.py +358 -0
  313. package/payload/plugins/toolkit/skills/suiji/scripts/work_records.py +328 -0
  314. package/payload/plugins/toolkit/skills/suiji/scripts/work_reports.py +75 -0
  315. package/payload/plugins/toolkit/skills/sync-branch-hard-reset/SKILL.md +59 -0
  316. package/payload/plugins/toolkit/skills/update-runweave-backend/SKILL.md +90 -0
  317. package/payload/plugins/toolkit/skills/update-runweave-backend/agents/openai.yaml +4 -0
  318. package/payload/plugins/toolkit/skills/update-runweave-backend/references/npm-update.md +68 -0
  319. package/payload/plugins/toolkit/skills/update-runweave-backend/references/systemd.md +34 -0
  320. package/payload/plugins/toolkit/skills/update-runweave-desktop/SKILL.md +102 -0
  321. package/payload/plugins/toolkit/skills/update-runweave-ios/SKILL.md +16 -0
  322. package/payload/plugins/toolkit/skills/update-runweave-ios/references/ios-wireless-recovery.md +54 -0
  323. package/payload/plugins/toolkit/skills/using-rw/SKILL.md +265 -0
  324. package/payload/plugins/toolkit/skills/write-plan/SKILL.md +72 -0
  325. package/payload/plugins/toolkit/skills/write-test-cases/SKILL.md +100 -0
  326. package/payload/plugins/toolkit/skills/write-test-cases/assets/test-plan-template.yaml +15 -0
  327. package/payload/plugins/toolkit/skills/write-test-cases/references/coverage-checklist.md +75 -0
  328. package/payload/plugins/toolkit/skills/write-test-cases/references/design-techniques.md +91 -0
  329. package/payload/plugins/toolkit/skills/youtube-reading/SKILL.md +35 -0
  330. package/payload/plugins/toolkit/skills/youtube-reading/agents/openai.yaml +4 -0
  331. package/payload/plugins/toolkit/skills/youtube-reading/assets/runtime-lock.json +92 -0
  332. package/payload/plugins/toolkit/skills/youtube-reading/references/content-contract.md +52 -0
  333. package/payload/plugins/toolkit/skills/youtube-reading/references/setup.md +70 -0
  334. package/payload/plugins/toolkit/skills/youtube-reading/requirements.lock +9 -0
  335. package/payload/plugins/toolkit/skills/youtube-reading/scripts/artifacts.py +206 -0
  336. package/payload/plugins/toolkit/skills/youtube-reading/scripts/runtime.py +424 -0
  337. package/payload/plugins/toolkit/skills/youtube-reading/scripts/youtube_reading.py +314 -0
  338. package/payload/plugins/toolkit-release.json +1 -0
  339. package/payload/scripts/toolkit/codex-state.mjs +75 -0
  340. package/payload/scripts/toolkit/release.mjs +210 -0
  341. package/payload/scripts/toolkit/sync-runtime.mjs +108 -0
  342. package/payload/scripts/toolkit/sync.mjs +585 -0
  343. package/payload/frontend/dist/assets/channel-Bf3IeONI.js +0 -1
  344. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-CFsG2SvG.js +0 -1
  345. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-CFsG2SvG.js +0 -1
  346. package/payload/frontend/dist/assets/clone-CeQXm2YN.js +0 -1
  347. package/payload/frontend/dist/assets/connection-XriXysSc.js +0 -12
  348. package/payload/frontend/dist/assets/main-Cg6Oo1xK.css +0 -33
  349. package/payload/frontend/dist/assets/main-H5R-3_w1.js +0 -696
  350. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-CzpdUl_0.js +0 -1
  351. package/payload/frontend/dist/assets/suiji-CO_L5W1X.js +0 -1
@@ -0,0 +1,127 @@
1
+ # React Best Practices
2
+
3
+ A structured repository for creating and maintaining React Best Practices optimized for agents and LLMs.
4
+
5
+ ## Structure
6
+
7
+ - `rules/` - Rule files grouped by category
8
+ - `meta/sections.md` - Section metadata (titles, impacts, descriptions)
9
+ - `meta/template.md` - Template for creating new rules
10
+ - `<category>/<description>.md` - Individual rule files
11
+ - `src/` - Build scripts and utilities
12
+ - `metadata.json` - Document metadata (version, organization, abstract)
13
+ - **`AGENTS.md`** - Compiled output (generated)
14
+ - **`test-cases.json`** - Test cases for LLM evaluation (generated)
15
+
16
+ ## Getting Started
17
+
18
+ 1. Install dependencies:
19
+
20
+ ```bash
21
+ pnpm install
22
+ ```
23
+
24
+ 2. Build AGENTS.md from rules:
25
+
26
+ ```bash
27
+ pnpm build
28
+ ```
29
+
30
+ 3. Validate rule files:
31
+
32
+ ```bash
33
+ pnpm validate
34
+ ```
35
+
36
+ 4. Extract test cases:
37
+ ```bash
38
+ pnpm extract-tests
39
+ ```
40
+
41
+ ## Creating a New Rule
42
+
43
+ 1. Copy `rules/meta/template.md` into the appropriate category directory.
44
+ 2. Choose the category directory matching the section:
45
+ - `async/` for Eliminating Waterfalls (Section 1)
46
+ - `bundle/` for Bundle Size Optimization (Section 2)
47
+ - `server/` for Server-Side Performance (Section 3)
48
+ - `client/` for Client-Side Data Fetching (Section 4)
49
+ - `rerender/` for Re-render Optimization (Section 5)
50
+ - `rendering/` for Rendering Performance (Section 6)
51
+ - `js/` for JavaScript Performance (Section 7)
52
+ - `advanced/` for Advanced Patterns (Section 8)
53
+ 3. Fill in the frontmatter and content
54
+ 4. Ensure you have clear examples with explanations
55
+ 5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json
56
+
57
+ ## Rule File Structure
58
+
59
+ Each rule file should follow this structure:
60
+
61
+ ````markdown
62
+ ---
63
+ title: Rule Title Here
64
+ impact: MEDIUM
65
+ impactDescription: Optional description
66
+ tags: tag1, tag2, tag3
67
+ ---
68
+
69
+ ## Rule Title Here
70
+
71
+ Brief explanation of the rule and why it matters.
72
+
73
+ **Incorrect (description of what's wrong):**
74
+
75
+ ```typescript
76
+ // Bad code example
77
+ ```
78
+ ````
79
+
80
+ **Correct (description of what's right):**
81
+
82
+ ```typescript
83
+ // Good code example
84
+ ```
85
+
86
+ Optional explanatory text after examples.
87
+
88
+ Reference: [Link](https://example.com)
89
+
90
+ ## File Naming Convention
91
+
92
+ - Files under `meta/` are support files and are excluded from rule lists.
93
+ - Rule files use `<category>/<description>.md` (for example, `async/parallel.md`).
94
+ - The parent directory identifies the section.
95
+ - Rules are sorted alphabetically by title within each section
96
+ - IDs (e.g., 1.1, 1.2) are auto-generated during build
97
+
98
+ ## Impact Levels
99
+
100
+ - `CRITICAL` - Highest priority, major performance gains
101
+ - `HIGH` - Significant performance improvements
102
+ - `MEDIUM-HIGH` - Moderate-high gains
103
+ - `MEDIUM` - Moderate performance improvements
104
+ - `LOW-MEDIUM` - Low-medium gains
105
+ - `LOW` - Incremental improvements
106
+
107
+ ## Scripts
108
+
109
+ - `pnpm build` - Compile rules into AGENTS.md
110
+ - `pnpm validate` - Validate all rule files
111
+ - `pnpm extract-tests` - Extract test cases for LLM evaluation
112
+ - `pnpm dev` - Build and validate
113
+
114
+ ## Contributing
115
+
116
+ When adding or modifying rules:
117
+
118
+ 1. Put the file in the correct category directory.
119
+ 2. Follow the `meta/template.md` structure.
120
+ 3. Include clear bad/good examples with explanations
121
+ 4. Add appropriate tags
122
+ 5. Run `pnpm build` to regenerate AGENTS.md and test-cases.json
123
+ 6. Rules are automatically sorted by title - no need to manage numbers!
124
+
125
+ ## Acknowledgments
126
+
127
+ Originally created by [@shuding](https://x.com/shuding) at [Vercel](https://vercel.com).
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: vercel-react-best-practices
3
+ description: React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
4
+ license: MIT
5
+ metadata:
6
+ author: vercel
7
+ version: "1.0.0"
8
+ ---
9
+
10
+ # Vercel React Best Practices
11
+
12
+ Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 62 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
13
+
14
+ ## When to Apply
15
+
16
+ Reference these guidelines when:
17
+
18
+ - Writing new React components or Next.js pages
19
+ - Implementing data fetching (client or server-side)
20
+ - Reviewing code for performance issues
21
+ - Refactoring existing React/Next.js code
22
+ - Optimizing bundle size or load times
23
+
24
+ ## Rule Categories by Priority
25
+
26
+ | Priority | Category | Impact | Directory |
27
+ | -------- | ------------------------- | ----------- | ------------ |
28
+ | 1 | Eliminating Waterfalls | CRITICAL | `async/` |
29
+ | 2 | Bundle Size Optimization | CRITICAL | `bundle/` |
30
+ | 3 | Server-Side Performance | HIGH | `server/` |
31
+ | 4 | Client-Side Data Fetching | MEDIUM-HIGH | `client/` |
32
+ | 5 | Re-render Optimization | MEDIUM | `rerender/` |
33
+ | 6 | Rendering Performance | MEDIUM | `rendering/` |
34
+ | 7 | JavaScript Performance | LOW-MEDIUM | `js/` |
35
+ | 8 | Advanced Patterns | LOW | `advanced/` |
36
+
37
+ ## Quick Reference
38
+
39
+ ### 1. Eliminating Waterfalls (CRITICAL)
40
+
41
+ - `async/defer-await` - Move await into branches where actually used
42
+ - `async/parallel` - Use Promise.all() for independent operations
43
+ - `async/dependencies` - Use better-all for partial dependencies
44
+ - `async/api-routes` - Start promises early, await late in API routes
45
+ - `async/suspense-boundaries` - Use Suspense to stream content
46
+
47
+ ### 2. Bundle Size Optimization (CRITICAL)
48
+
49
+ - `bundle/barrel-imports` - Import directly, avoid barrel files
50
+ - `bundle/dynamic-imports` - Use next/dynamic for heavy components
51
+ - `bundle/defer-third-party` - Load analytics/logging after hydration
52
+ - `bundle/conditional` - Load modules only when feature is activated
53
+ - `bundle/preload` - Preload on hover/focus for perceived speed
54
+
55
+ ### 3. Server-Side Performance (HIGH)
56
+
57
+ - `server/auth-actions` - Authenticate server actions like API routes
58
+ - `server/cache-react` - Use React.cache() for per-request deduplication
59
+ - `server/cache-lru` - Use LRU cache for cross-request caching
60
+ - `server/dedup-props` - Avoid duplicate serialization in RSC props
61
+ - `server/hoist-static-io` - Hoist static I/O (fonts, logos) to module level
62
+ - `server/serialization` - Minimize data passed to client components
63
+ - `server/parallel-fetching` - Restructure components to parallelize fetches
64
+ - `server/after-nonblocking` - Use after() for non-blocking operations
65
+
66
+ ### 4. Client-Side Data Fetching (MEDIUM-HIGH)
67
+
68
+ - `client/swr-dedup` - Use SWR for automatic request deduplication
69
+ - `client/event-listeners` - Deduplicate global event listeners
70
+ - `client/passive-event-listeners` - Use passive listeners for scroll
71
+ - `client/localstorage-schema` - Version and minimize localStorage data
72
+
73
+ ### 5. Re-render Optimization (MEDIUM)
74
+
75
+ - `rerender/defer-reads` - Don't subscribe to state only used in callbacks
76
+ - `rerender/memo` - Extract expensive work into memoized components
77
+ - `rerender/memo-with-default-value` - Hoist default non-primitive props
78
+ - `rerender/dependencies` - Use primitive dependencies in effects
79
+ - `rerender/derived-state` - Subscribe to derived booleans, not raw values
80
+ - `rerender/derived-state-no-effect` - Derive state during render, not effects
81
+ - `rerender/functional-setstate` - Use functional setState for stable callbacks
82
+ - `rerender/lazy-state-init` - Pass function to useState for expensive values
83
+ - `rerender/simple-expression-in-memo` - Avoid memo for simple primitives
84
+ - `rerender/move-effect-to-event` - Put interaction logic in event handlers
85
+ - `rerender/transitions` - Use startTransition for non-urgent updates
86
+ - `rerender/use-ref-transient-values` - Use refs for transient frequent values
87
+ - `rerender/no-inline-components` - Don't define components inside components
88
+
89
+ ### 6. Rendering Performance (MEDIUM)
90
+
91
+ - `rendering/animate-svg-wrapper` - Animate div wrapper, not SVG element
92
+ - `rendering/content-visibility` - Use content-visibility for long lists
93
+ - `rendering/hoist-jsx` - Extract static JSX outside components
94
+ - `rendering/svg-precision` - Reduce SVG coordinate precision
95
+ - `rendering/hydration-no-flicker` - Use inline script for client-only data
96
+ - `rendering/hydration-suppress-warning` - Suppress expected mismatches
97
+ - `rendering/activity` - Use Activity component for show/hide
98
+ - `rendering/conditional-render` - Use ternary, not && for conditionals
99
+ - `rendering/usetransition-loading` - Prefer useTransition for loading state
100
+ - `rendering/resource-hints` - Use React DOM resource hints for preloading
101
+ - `rendering/script-defer-async` - Use defer or async on script tags
102
+
103
+ ### 7. JavaScript Performance (LOW-MEDIUM)
104
+
105
+ - `js/batch-dom-css` - Group CSS changes via classes or cssText
106
+ - `js/index-maps` - Build Map for repeated lookups
107
+ - `js/cache-property-access` - Cache object properties in loops
108
+ - `js/cache-function-results` - Cache function results in module-level Map
109
+ - `js/cache-storage` - Cache localStorage/sessionStorage reads
110
+ - `js/combine-iterations` - Combine multiple filter/map into one loop
111
+ - `js/length-check-first` - Check array length before expensive comparison
112
+ - `js/early-exit` - Return early from functions
113
+ - `js/hoist-regexp` - Hoist RegExp creation outside loops
114
+ - `js/min-max-loop` - Use loop for min/max instead of sort
115
+ - `js/set-map-lookups` - Use Set/Map for O(1) lookups
116
+ - `js/tosorted-immutable` - Use toSorted() for immutability
117
+ - `js/flatmap-filter` - Use flatMap to map and filter in one pass
118
+
119
+ ### 8. Advanced Patterns (LOW)
120
+
121
+ - `advanced/event-handler-refs` - Store event handlers in refs
122
+ - `advanced/init-once` - Initialize app once per app load
123
+ - `advanced/use-latest` - useLatest for stable callback refs
124
+
125
+ ## How to Use
126
+
127
+ Read individual rule files for detailed explanations and code examples:
128
+
129
+ ```
130
+ rules/async/parallel.md
131
+ rules/bundle/barrel-imports.md
132
+ ```
133
+
134
+ Each rule file contains:
135
+
136
+ - Brief explanation of why it matters
137
+ - Incorrect code example with explanation
138
+ - Correct code example with explanation
139
+ - Additional context and references
140
+
141
+ ## Full Compiled Document
142
+
143
+ For the complete guide with all rules expanded: `AGENTS.md`
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "organization": "Vercel Engineering",
4
+ "date": "January 2026",
5
+ "abstract": "Comprehensive performance optimization guide for React and Next.js applications, designed for AI agents and LLMs. Contains 40+ rules across 8 categories, prioritized by impact from critical (eliminating waterfalls, reducing bundle size) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation.",
6
+ "references": [
7
+ "https://react.dev",
8
+ "https://nextjs.org",
9
+ "https://swr.vercel.app",
10
+ "https://github.com/shuding/better-all",
11
+ "https://github.com/isaacs/node-lru-cache",
12
+ "https://vercel.com/blog/how-we-optimized-package-imports-in-next-js",
13
+ "https://vercel.com/blog/how-we-made-the-vercel-dashboard-twice-as-fast"
14
+ ]
15
+ }
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: Store Event Handlers in Refs
3
+ impact: LOW
4
+ impactDescription: stable subscriptions
5
+ tags: advanced, hooks, refs, event-handlers, optimization
6
+ ---
7
+
8
+ ## Store Event Handlers in Refs
9
+
10
+ Store callbacks in refs when used in effects that shouldn't re-subscribe on callback changes.
11
+
12
+ **Incorrect (re-subscribes on every render):**
13
+
14
+ ```tsx
15
+ function useWindowEvent(event: string, handler: (e) => void) {
16
+ useEffect(() => {
17
+ window.addEventListener(event, handler);
18
+ return () => window.removeEventListener(event, handler);
19
+ }, [event, handler]);
20
+ }
21
+ ```
22
+
23
+ **Correct (stable subscription):**
24
+
25
+ ```tsx
26
+ function useWindowEvent(event: string, handler: (e) => void) {
27
+ const handlerRef = useRef(handler);
28
+ useEffect(() => {
29
+ handlerRef.current = handler;
30
+ }, [handler]);
31
+
32
+ useEffect(() => {
33
+ const listener = (e) => handlerRef.current(e);
34
+ window.addEventListener(event, listener);
35
+ return () => window.removeEventListener(event, listener);
36
+ }, [event]);
37
+ }
38
+ ```
39
+
40
+ **Alternative: use `useEffectEvent` if you're on latest React:**
41
+
42
+ ```tsx
43
+ import { useEffectEvent } from "react";
44
+
45
+ function useWindowEvent(event: string, handler: (e) => void) {
46
+ const onEvent = useEffectEvent(handler);
47
+
48
+ useEffect(() => {
49
+ window.addEventListener(event, onEvent);
50
+ return () => window.removeEventListener(event, onEvent);
51
+ }, [event]);
52
+ }
53
+ ```
54
+
55
+ `useEffectEvent` provides a cleaner API for the same pattern: it creates a stable function reference that always calls the latest version of the handler.
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: Initialize App Once, Not Per Mount
3
+ impact: LOW-MEDIUM
4
+ impactDescription: avoids duplicate init in development
5
+ tags: initialization, useEffect, app-startup, side-effects
6
+ ---
7
+
8
+ ## Initialize App Once, Not Per Mount
9
+
10
+ Do not put app-wide initialization that must run once per app load inside `useEffect([])` of a component. Components can remount and effects will re-run. Use a module-level guard or top-level init in the entry module instead.
11
+
12
+ **Incorrect (runs twice in dev, re-runs on remount):**
13
+
14
+ ```tsx
15
+ function Comp() {
16
+ useEffect(() => {
17
+ loadFromStorage();
18
+ checkAuthToken();
19
+ }, []);
20
+
21
+ // ...
22
+ }
23
+ ```
24
+
25
+ **Correct (once per app load):**
26
+
27
+ ```tsx
28
+ let didInit = false;
29
+
30
+ function Comp() {
31
+ useEffect(() => {
32
+ if (didInit) return;
33
+ didInit = true;
34
+ loadFromStorage();
35
+ checkAuthToken();
36
+ }, []);
37
+
38
+ // ...
39
+ }
40
+ ```
41
+
42
+ Reference: [Initializing the application](https://react.dev/learn/you-might-not-need-an-effect#initializing-the-application)
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: useEffectEvent for Stable Callback Refs
3
+ impact: LOW
4
+ impactDescription: prevents effect re-runs
5
+ tags: advanced, hooks, useEffectEvent, refs, optimization
6
+ ---
7
+
8
+ ## useEffectEvent for Stable Callback Refs
9
+
10
+ Access latest values in callbacks without adding them to dependency arrays. Prevents effect re-runs while avoiding stale closures.
11
+
12
+ **Incorrect (effect re-runs on every callback change):**
13
+
14
+ ```tsx
15
+ function SearchInput({ onSearch }: { onSearch: (q: string) => void }) {
16
+ const [query, setQuery] = useState("");
17
+
18
+ useEffect(() => {
19
+ const timeout = setTimeout(() => onSearch(query), 300);
20
+ return () => clearTimeout(timeout);
21
+ }, [query, onSearch]);
22
+ }
23
+ ```
24
+
25
+ **Correct (using React's useEffectEvent):**
26
+
27
+ ```tsx
28
+ import { useEffectEvent } from "react";
29
+
30
+ function SearchInput({ onSearch }: { onSearch: (q: string) => void }) {
31
+ const [query, setQuery] = useState("");
32
+ const onSearchEvent = useEffectEvent(onSearch);
33
+
34
+ useEffect(() => {
35
+ const timeout = setTimeout(() => onSearchEvent(query), 300);
36
+ return () => clearTimeout(timeout);
37
+ }, [query]);
38
+ }
39
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: Prevent Waterfall Chains in API Routes
3
+ impact: CRITICAL
4
+ impactDescription: 2-10× improvement
5
+ tags: api-routes, server-actions, waterfalls, parallelization
6
+ ---
7
+
8
+ ## Prevent Waterfall Chains in API Routes
9
+
10
+ In API routes and Server Actions, start independent operations immediately, even if you don't await them yet.
11
+
12
+ **Incorrect (config waits for auth, data waits for both):**
13
+
14
+ ```typescript
15
+ export async function GET(request: Request) {
16
+ const session = await auth();
17
+ const config = await fetchConfig();
18
+ const data = await fetchData(session.user.id);
19
+ return Response.json({ data, config });
20
+ }
21
+ ```
22
+
23
+ **Correct (auth and config start immediately):**
24
+
25
+ ```typescript
26
+ export async function GET(request: Request) {
27
+ const sessionPromise = auth();
28
+ const configPromise = fetchConfig();
29
+ const session = await sessionPromise;
30
+ const [config, data] = await Promise.all([
31
+ configPromise,
32
+ fetchData(session.user.id),
33
+ ]);
34
+ return Response.json({ data, config });
35
+ }
36
+ ```
37
+
38
+ For operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).
@@ -0,0 +1,80 @@
1
+ ---
2
+ title: Defer Await Until Needed
3
+ impact: HIGH
4
+ impactDescription: avoids blocking unused code paths
5
+ tags: async, await, conditional, optimization
6
+ ---
7
+
8
+ ## Defer Await Until Needed
9
+
10
+ Move `await` operations into the branches where they're actually used to avoid blocking code paths that don't need them.
11
+
12
+ **Incorrect (blocks both branches):**
13
+
14
+ ```typescript
15
+ async function handleRequest(userId: string, skipProcessing: boolean) {
16
+ const userData = await fetchUserData(userId);
17
+
18
+ if (skipProcessing) {
19
+ // Returns immediately but still waited for userData
20
+ return { skipped: true };
21
+ }
22
+
23
+ // Only this branch uses userData
24
+ return processUserData(userData);
25
+ }
26
+ ```
27
+
28
+ **Correct (only blocks when needed):**
29
+
30
+ ```typescript
31
+ async function handleRequest(userId: string, skipProcessing: boolean) {
32
+ if (skipProcessing) {
33
+ // Returns immediately without waiting
34
+ return { skipped: true };
35
+ }
36
+
37
+ // Fetch only when needed
38
+ const userData = await fetchUserData(userId);
39
+ return processUserData(userData);
40
+ }
41
+ ```
42
+
43
+ **Another example (early return optimization):**
44
+
45
+ ```typescript
46
+ // Incorrect: always fetches permissions
47
+ async function updateResource(resourceId: string, userId: string) {
48
+ const permissions = await fetchPermissions(userId);
49
+ const resource = await getResource(resourceId);
50
+
51
+ if (!resource) {
52
+ return { error: "Not found" };
53
+ }
54
+
55
+ if (!permissions.canEdit) {
56
+ return { error: "Forbidden" };
57
+ }
58
+
59
+ return await updateResourceData(resource, permissions);
60
+ }
61
+
62
+ // Correct: fetches only when needed
63
+ async function updateResource(resourceId: string, userId: string) {
64
+ const resource = await getResource(resourceId);
65
+
66
+ if (!resource) {
67
+ return { error: "Not found" };
68
+ }
69
+
70
+ const permissions = await fetchPermissions(userId);
71
+
72
+ if (!permissions.canEdit) {
73
+ return { error: "Forbidden" };
74
+ }
75
+
76
+ return await updateResourceData(resource, permissions);
77
+ }
78
+ ```
79
+
80
+ This optimization is especially valuable when the skipped branch is frequently taken, or when the deferred operation is expensive.
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: Dependency-Based Parallelization
3
+ impact: CRITICAL
4
+ impactDescription: 2-10× improvement
5
+ tags: async, parallelization, dependencies, better-all
6
+ ---
7
+
8
+ ## Dependency-Based Parallelization
9
+
10
+ For operations with partial dependencies, use `better-all` to maximize parallelism. It automatically starts each task at the earliest possible moment.
11
+
12
+ **Incorrect (profile waits for config unnecessarily):**
13
+
14
+ ```typescript
15
+ const [user, config] = await Promise.all([fetchUser(), fetchConfig()]);
16
+ const profile = await fetchProfile(user.id);
17
+ ```
18
+
19
+ **Correct (config and profile run in parallel):**
20
+
21
+ ```typescript
22
+ import { all } from "better-all";
23
+
24
+ const { user, config, profile } = await all({
25
+ async user() {
26
+ return fetchUser();
27
+ },
28
+ async config() {
29
+ return fetchConfig();
30
+ },
31
+ async profile() {
32
+ return fetchProfile((await this.$.user).id);
33
+ },
34
+ });
35
+ ```
36
+
37
+ **Alternative without extra dependencies:**
38
+
39
+ We can also create all the promises first, and do `Promise.all()` at the end.
40
+
41
+ ```typescript
42
+ const userPromise = fetchUser();
43
+ const profilePromise = userPromise.then((user) => fetchProfile(user.id));
44
+
45
+ const [user, config, profile] = await Promise.all([
46
+ userPromise,
47
+ fetchConfig(),
48
+ profilePromise,
49
+ ]);
50
+ ```
51
+
52
+ Reference: [https://github.com/shuding/better-all](https://github.com/shuding/better-all)
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: Promise.all() for Independent Operations
3
+ impact: CRITICAL
4
+ impactDescription: 2-10× improvement
5
+ tags: async, parallelization, promises, waterfalls
6
+ ---
7
+
8
+ ## Promise.all() for Independent Operations
9
+
10
+ When async operations have no interdependencies, execute them concurrently using `Promise.all()`.
11
+
12
+ **Incorrect (sequential execution, 3 round trips):**
13
+
14
+ ```typescript
15
+ const user = await fetchUser();
16
+ const posts = await fetchPosts();
17
+ const comments = await fetchComments();
18
+ ```
19
+
20
+ **Correct (parallel execution, 1 round trip):**
21
+
22
+ ```typescript
23
+ const [user, posts, comments] = await Promise.all([
24
+ fetchUser(),
25
+ fetchPosts(),
26
+ fetchComments(),
27
+ ]);
28
+ ```