@runweave/server-linux-x64 0.1.7 → 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 (352) hide show
  1. package/manifest.json +1487 -156
  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 +2416 -1684
  9. package/payload/backend/ios-simulators/pool.py +3 -3
  10. package/payload/backend/scheduled-tasks-sqlite-worker.cjs +224 -171
  11. package/payload/frontend/dist/assets/{_baseUniq-i1Ki3twP.js → _baseUniq-qHFga5V8.js} +1 -1
  12. package/payload/frontend/dist/assets/{access-DK9V0f3W.js → access-DgHvmn15.js} +1 -1
  13. package/payload/frontend/dist/assets/{advanced-B13lWv1d.js → advanced-C1Fh14vw.js} +1 -1
  14. package/payload/frontend/dist/assets/{appearance-DumRYmkD.js → appearance-Bs7cSXqO.js} +1 -1
  15. package/payload/frontend/dist/assets/{arc-HKn3_xyV.js → arc-E3iYHQG_.js} +1 -1
  16. package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-C09x7b94.js → architectureDiagram-Q4EWVU46-DgpYpTb9.js} +1 -1
  17. package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-CFLFTR6d.js → blockDiagram-DXYQGD6D-CfFOEKZ7.js} +1 -1
  18. package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-8P8Q-xqC.js → c4Diagram-AHTNJAMY-BxlHBUj3.js} +1 -1
  19. package/payload/frontend/dist/assets/channel-amxyNKnk.js +1 -0
  20. package/payload/frontend/dist/assets/{chunk-4BX2VUAB-B1KEkTal.js → chunk-4BX2VUAB-xWocgDo8.js} +1 -1
  21. package/payload/frontend/dist/assets/{chunk-4TB4RGXK-Bu_Z47kJ.js → chunk-4TB4RGXK-Bl1cNICf.js} +1 -1
  22. package/payload/frontend/dist/assets/{chunk-55IACEB6-xzHVCHyi.js → chunk-55IACEB6-DVtE836u.js} +1 -1
  23. package/payload/frontend/dist/assets/{chunk-EDXVE4YY-h3HAW06h.js → chunk-EDXVE4YY-Dbd3tDCr.js} +1 -1
  24. package/payload/frontend/dist/assets/{chunk-FMBD7UC4-CQ4faPSh.js → chunk-FMBD7UC4-MPJaTsyN.js} +1 -1
  25. package/payload/frontend/dist/assets/{chunk-OYMX7WX6-CubmLoGT.js → chunk-OYMX7WX6-D3LuudlW.js} +1 -1
  26. package/payload/frontend/dist/assets/{chunk-QZHKN3VN-xk0zKNja.js → chunk-QZHKN3VN-Dn1aF6iQ.js} +1 -1
  27. package/payload/frontend/dist/assets/{chunk-YZCP3GAM-CHpTv8sd.js → chunk-YZCP3GAM-jZYbHnCw.js} +1 -1
  28. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-B8cTijjT.js +1 -0
  29. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-B8cTijjT.js +1 -0
  30. package/payload/frontend/dist/assets/clone-xzI2eGRI.js +1 -0
  31. package/payload/frontend/dist/assets/connection-V2iI-6rM.js +12 -0
  32. package/payload/frontend/dist/assets/{connections-A7InZw2T.js → connections-G_Q7342g.js} +1 -1
  33. package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-CQn27vi_.js → cose-bilkent-S5V4N54A-75FLD3RS.js} +1 -1
  34. package/payload/frontend/dist/assets/{dagre-KV5264BT-CClOwB9v.js → dagre-KV5264BT-DEm-DpJL.js} +1 -1
  35. package/payload/frontend/dist/assets/{desktop-BgryfXXM.js → desktop-g5JC-CQd.js} +1 -1
  36. package/payload/frontend/dist/assets/{diagram-5BDNPKRD-DcUJOAmV.js → diagram-5BDNPKRD-BV6P2UTy.js} +1 -1
  37. package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-DdabmTwk.js → diagram-G4DWMVQ6-DuCK-MM2.js} +1 -1
  38. package/payload/frontend/dist/assets/{diagram-MMDJMWI5-DmcxjBIk.js → diagram-MMDJMWI5-D5_GlPgO.js} +1 -1
  39. package/payload/frontend/dist/assets/{diagram-TYMM5635-BUSpXaiN.js → diagram-TYMM5635-QRbOYR1P.js} +1 -1
  40. package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-vkAXcv5_.js → erDiagram-SMLLAGMA-DefCheAw.js} +1 -1
  41. package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-BHDU7BUJ.js → flowDiagram-DWJPFMVM-DVzyWIso.js} +1 -1
  42. package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-C3lAG7_6.js → ganttDiagram-T4ZO3ILL-BJaClUEF.js} +1 -1
  43. package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-DHLyYJf7.js → gitGraphDiagram-UUTBAWPF-BLfbApNz.js} +1 -1
  44. package/payload/frontend/dist/assets/{graph-Bp5bIzXM.js → graph-C-YqFh68.js} +1 -1
  45. package/payload/frontend/dist/assets/{image-DkcKNLTV.js → image-CZo_2Awc.js} +1 -1
  46. package/payload/frontend/dist/assets/{index-BUS7FSlk.js → index-6q2aeqkt.js} +95 -105
  47. package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-CVp9zvmA.js → infoDiagram-42DDH7IO-BakVOutT.js} +1 -1
  48. package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-D07QPX3O.js → ishikawaDiagram-UXIWVN3A-D_1Oa5Dc.js} +1 -1
  49. package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-D-iZPDHM.js → journeyDiagram-VCZTEJTY-Y8TVFv6B.js} +1 -1
  50. package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-BR4eWb08.js → kanban-definition-6JOO6SKY-DxeNhTIB.js} +1 -1
  51. package/payload/frontend/dist/assets/{layout-Cyv0DyJm.js → layout-5cMeOTAp.js} +1 -1
  52. package/payload/frontend/dist/assets/{linear-D5M7Pvj1.js → linear-Bnc3ev5g.js} +1 -1
  53. package/payload/frontend/dist/assets/main-3TPtEl66.js +706 -0
  54. package/payload/frontend/dist/assets/main-D4_uoZQa.css +33 -0
  55. package/payload/frontend/dist/assets/{min-BFlloFGg.js → min-BRXKkrS8.js} +1 -1
  56. package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-AKUF178o.js → mindmap-definition-QFDTVHPH-RYZO_BEr.js} +1 -1
  57. package/payload/frontend/dist/assets/{monitoring-B2okceCB.js → monitoring-Fv7kZ4s6.js} +1 -1
  58. package/payload/frontend/dist/assets/{notifications-0lql4_qJ.js → notifications-BzrYqyMH.js} +1 -1
  59. package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-CRiHmwn7.js → pieDiagram-DEJITSTG-Bzw0dhjz.js} +1 -1
  60. package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-CzXrq7IJ.js → quadrantDiagram-34T5L4WZ-CQJY_msa.js} +1 -1
  61. package/payload/frontend/dist/assets/{record-content-DTCQKbEj.js → record-content-B7-6olQt.js} +1 -1
  62. package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-Bbn5ulLV.js → requirementDiagram-MS252O5E-DuP8hAV8.js} +1 -1
  63. package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-D9ZZ46pQ.js → sankeyDiagram-XADWPNL6-D-fQnCZZ.js} +1 -1
  64. package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-DxOP2gDa.js → sequenceDiagram-FGHM5R23-DaZNEccV.js} +1 -1
  65. package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-NF_Qq5Cq.js → stateDiagram-FHFEXIEX-CkOLt5R1.js} +1 -1
  66. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-atg1K4nB.js +1 -0
  67. package/payload/frontend/dist/assets/{status-2U71YpVe.js → status-CIIPajZp.js} +1 -1
  68. package/payload/frontend/dist/assets/suiji-C453W-Sg.js +1 -0
  69. package/payload/frontend/dist/assets/{svg-DpI3GSCw.js → svg-BUqAWGtg.js} +1 -1
  70. package/payload/frontend/dist/assets/{tabs-CYKuiiHg.js → tabs-Cwlp1Meu.js} +1 -1
  71. package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-ChEZSNF_.js → timeline-definition-GMOUNBTQ-BOKDMwHS.js} +1 -1
  72. package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-Ch26SNbB.js → vennDiagram-DHZGUBPP-fSZjDS41.js} +1 -1
  73. package/payload/frontend/dist/assets/{wardley-RL74JXVD-D0ap5vv0.js → wardley-RL74JXVD-D1KIsvoD.js} +1 -1
  74. package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-btdjsmHO.js → wardleyDiagram-NUSXRM2D-FMe67dwE.js} +1 -1
  75. package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-CklPtFGT.js → xychartDiagram-5P7HB3ND-B9AM9_9w.js} +1 -1
  76. package/payload/frontend/dist/build-info.json +4 -4
  77. package/payload/frontend/dist/companion.html +1 -1
  78. package/payload/frontend/dist/index.html +3 -3
  79. package/payload/packages/agent-bridge/src/install-pi.mjs +81 -0
  80. package/payload/plugins/pi/dist/SKILL.md +22 -0
  81. package/payload/plugins/pi/dist/bridge/app-server-client.cjs +82 -0
  82. package/payload/plugins/pi/dist/bridge/feishu_stop_notify.sh +169 -0
  83. package/payload/plugins/pi/dist/bridge/runweave-hook-bridge.cjs +583 -0
  84. package/payload/plugins/pi/dist/bridge/runweave-hook-completion.cjs +42 -0
  85. package/payload/plugins/pi/dist/bridge/runweave-hook-payload.cjs +578 -0
  86. package/payload/plugins/pi/dist/bridge/runweave-task-supervision.cjs +167 -0
  87. package/payload/plugins/pi/dist/runweave.js +316 -0
  88. package/payload/plugins/toolkit/.codex-plugin/plugin.json +31 -0
  89. package/payload/plugins/toolkit/README.md +185 -0
  90. package/payload/plugins/toolkit/hooks/AGENTS.md +6 -0
  91. package/payload/plugins/toolkit/hooks/app-server-client.cjs +82 -0
  92. package/payload/plugins/toolkit/hooks/feishu_stop_notify.sh +169 -0
  93. package/payload/plugins/toolkit/hooks/runweave-hook-bridge.cjs +583 -0
  94. package/payload/plugins/toolkit/hooks/runweave-hook-completion.cjs +42 -0
  95. package/payload/plugins/toolkit/hooks/runweave-hook-dispatch.cjs +123 -0
  96. package/payload/plugins/toolkit/hooks/runweave-hook-payload.cjs +578 -0
  97. package/payload/plugins/toolkit/hooks/runweave-task-supervision.cjs +167 -0
  98. package/payload/plugins/toolkit/hooks.json +108 -0
  99. package/payload/plugins/toolkit/skills/acceptance/SKILL.md +70 -0
  100. package/payload/plugins/toolkit/skills/acceptance/agents/openai.yaml +4 -0
  101. package/payload/plugins/toolkit/skills/acceptance/references/capture.md +38 -0
  102. package/payload/plugins/toolkit/skills/acceptance/references/delivery.md +54 -0
  103. package/payload/plugins/toolkit/skills/acceptance/references/gallery-contract.md +84 -0
  104. package/payload/plugins/toolkit/skills/acceptance/references/gallery-copy.md +34 -0
  105. package/payload/plugins/toolkit/skills/acceptance/references/video.md +52 -0
  106. package/payload/plugins/toolkit/skills/acceptance/scripts/capture.py +137 -0
  107. package/payload/plugins/toolkit/skills/acceptance/scripts/common.py +63 -0
  108. package/payload/plugins/toolkit/skills/acceptance/scripts/gallery.py +353 -0
  109. package/payload/plugins/toolkit/skills/acceptance/scripts/preview.py +109 -0
  110. package/payload/plugins/toolkit/skills/acceptance/scripts/video.py +283 -0
  111. package/payload/plugins/toolkit/skills/acceptance/templates/reader.css +576 -0
  112. package/payload/plugins/toolkit/skills/acceptance/templates/reader.html +63 -0
  113. package/payload/plugins/toolkit/skills/acceptance/templates/reader.js +326 -0
  114. package/payload/plugins/toolkit/skills/acceptance/templates/viewer.css +55 -0
  115. package/payload/plugins/toolkit/skills/acceptance-gallery/SKILL.md +8 -0
  116. package/payload/plugins/toolkit/skills/acceptance-gallery/agents/openai.yaml +6 -0
  117. package/payload/plugins/toolkit/skills/acceptance-gallery/references/capture-and-copy.md +3 -0
  118. package/payload/plugins/toolkit/skills/acceptance-gallery/references/content-contract.md +3 -0
  119. package/payload/plugins/toolkit/skills/acceptance-gallery/scripts/gallery.py +9 -0
  120. package/payload/plugins/toolkit/skills/acceptance-video/SKILL.md +8 -0
  121. package/payload/plugins/toolkit/skills/acceptance-video/agents/openai.yaml +6 -0
  122. package/payload/plugins/toolkit/skills/acceptance-video/references/input-and-capture.md +3 -0
  123. package/payload/plugins/toolkit/skills/acceptance-video/references/mobile-review.md +3 -0
  124. package/payload/plugins/toolkit/skills/acceptance-video/scripts/capture.py +9 -0
  125. package/payload/plugins/toolkit/skills/acceptance-video/scripts/video.py +9 -0
  126. package/payload/plugins/toolkit/skills/agent-device/SKILL.md +86 -0
  127. package/payload/plugins/toolkit/skills/agent-device/agents/openai.yaml +4 -0
  128. package/payload/plugins/toolkit/skills/agent-device/references/ios-setup.md +36 -0
  129. package/payload/plugins/toolkit/skills/agent-device/scripts/device.py +398 -0
  130. package/payload/plugins/toolkit/skills/agent-device/scripts/resources.py +248 -0
  131. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/SKILL.md +128 -0
  132. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/agents/openai.yaml +4 -0
  133. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-checklist.md +59 -0
  134. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-guide.md +135 -0
  135. package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-handoff-template.md +57 -0
  136. package/payload/plugins/toolkit/skills/ask-first/SKILL.md +81 -0
  137. package/payload/plugins/toolkit/skills/brainstorming/SKILL.md +41 -0
  138. package/payload/plugins/toolkit/skills/browse-record/SKILL.md +35 -0
  139. package/payload/plugins/toolkit/skills/browse-record/references/app-usage.md +19 -0
  140. package/payload/plugins/toolkit/skills/browse-record/references/daily-reporting.md +115 -0
  141. package/payload/plugins/toolkit/skills/browse-record/references/zhihu.md +33 -0
  142. package/payload/plugins/toolkit/skills/browse-record/scripts/app_usage.py +110 -0
  143. package/payload/plugins/toolkit/skills/browse-record/scripts/browse_job.py +385 -0
  144. package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu-read.js +126 -0
  145. package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu_http.py +273 -0
  146. package/payload/plugins/toolkit/skills/clear-technical-explanations/LICENSE +21 -0
  147. package/payload/plugins/toolkit/skills/clear-technical-explanations/SKILL.md +103 -0
  148. package/payload/plugins/toolkit/skills/code-grounded-requirements/SKILL.md +54 -0
  149. package/payload/plugins/toolkit/skills/daily-doc-maintenance/SKILL.md +151 -0
  150. package/payload/plugins/toolkit/skills/daily-record/SKILL.md +63 -0
  151. package/payload/plugins/toolkit/skills/daily-record/agents/openai.yaml +4 -0
  152. package/payload/plugins/toolkit/skills/daily-record/references/browser-history.md +6 -0
  153. package/payload/plugins/toolkit/skills/daily-record/references/feishu.md +90 -0
  154. package/payload/plugins/toolkit/skills/daily-record/references/scheduled-reporting.md +144 -0
  155. package/payload/plugins/toolkit/skills/daily-record/references/scheduled-task.template.json +15 -0
  156. package/payload/plugins/toolkit/skills/daily-record/references/suiji-work-records.md +57 -0
  157. package/payload/plugins/toolkit/skills/daily-record/scripts/feishu.py +280 -0
  158. package/payload/plugins/toolkit/skills/daily-record/scripts/job.py +416 -0
  159. package/payload/plugins/toolkit/skills/daily-record/scripts/job_browser.py +77 -0
  160. package/payload/plugins/toolkit/skills/daily-record/scripts/job_facts.py +132 -0
  161. package/payload/plugins/toolkit/skills/daily-record/scripts/job_isolation.py +69 -0
  162. package/payload/plugins/toolkit/skills/daily-record/scripts/job_materials.py +154 -0
  163. package/payload/plugins/toolkit/skills/daily-record/scripts/job_screen.py +77 -0
  164. package/payload/plugins/toolkit/skills/daily-record/scripts/job_state.py +309 -0
  165. package/payload/plugins/toolkit/skills/daily-refactor/SKILL.md +101 -0
  166. package/payload/plugins/toolkit/skills/daily-refactor/scripts/compare-architecture-reports.mjs +168 -0
  167. package/payload/plugins/toolkit/skills/debugging-strategies/SKILL.md +38 -0
  168. package/payload/plugins/toolkit/skills/debugging-strategies/resources/implementation-playbook.md +520 -0
  169. package/payload/plugins/toolkit/skills/diagnostic-log-debugging/SKILL.md +79 -0
  170. package/payload/plugins/toolkit/skills/doc-coauthoring/SKILL.md +64 -0
  171. package/payload/plugins/toolkit/skills/eli5/LICENSE +21 -0
  172. package/payload/plugins/toolkit/skills/eli5/SKILL.md +18 -0
  173. package/payload/plugins/toolkit/skills/experience/SKILL.md +71 -0
  174. package/payload/plugins/toolkit/skills/experience/package.json +13 -0
  175. package/payload/plugins/toolkit/skills/git-advanced-workflows/SKILL.md +457 -0
  176. package/payload/plugins/toolkit/skills/github-pr/SKILL.md +109 -0
  177. package/payload/plugins/toolkit/skills/github-pr/scripts/github-access.mjs +292 -0
  178. package/payload/plugins/toolkit/skills/github-pr/scripts/preflight.mjs +191 -0
  179. package/payload/plugins/toolkit/skills/github-pr/scripts/source-worktree.mjs +354 -0
  180. package/payload/plugins/toolkit/skills/grill-with-docs/SKILL.md +66 -0
  181. package/payload/plugins/toolkit/skills/grill-with-docs/agents/openai.yaml +6 -0
  182. package/payload/plugins/toolkit/skills/grilling/SKILL.md +14 -0
  183. package/payload/plugins/toolkit/skills/handoff/SKILL.md +98 -0
  184. package/payload/plugins/toolkit/skills/karpathy-guidelines/SKILL.md +73 -0
  185. package/payload/plugins/toolkit/skills/playwright-cli/SKILL.md +562 -0
  186. package/payload/plugins/toolkit/skills/playwright-cli/references/element-attributes.md +23 -0
  187. package/payload/plugins/toolkit/skills/playwright-cli/references/playwright-tests.md +39 -0
  188. package/payload/plugins/toolkit/skills/playwright-cli/references/request-mocking.md +87 -0
  189. package/payload/plugins/toolkit/skills/playwright-cli/references/running-code.md +240 -0
  190. package/payload/plugins/toolkit/skills/playwright-cli/references/session-management.md +226 -0
  191. package/payload/plugins/toolkit/skills/playwright-cli/references/spec-driven-testing.md +312 -0
  192. package/payload/plugins/toolkit/skills/playwright-cli/references/storage-state.md +275 -0
  193. package/payload/plugins/toolkit/skills/playwright-cli/references/test-generation.md +138 -0
  194. package/payload/plugins/toolkit/skills/playwright-cli/references/tracing.md +142 -0
  195. package/payload/plugins/toolkit/skills/playwright-cli/references/video-recording.md +157 -0
  196. package/payload/plugins/toolkit/skills/playwright-cli/templates/standalone.config.json +7 -0
  197. package/payload/plugins/toolkit/skills/product-exploration/SKILL.md +64 -0
  198. package/payload/plugins/toolkit/skills/product-exploration/agents/openai.yaml +5 -0
  199. package/payload/plugins/toolkit/skills/prototype-first-development/SKILL.md +134 -0
  200. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/README.md +88 -0
  201. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/app.js +145 -0
  202. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/index.html +229 -0
  203. package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/mock-state.json +60 -0
  204. package/payload/plugins/toolkit/skills/prototype-first-development/references/implementation-plan-handoff-template.md +61 -0
  205. package/payload/plugins/toolkit/skills/prototype-first-development/references/prototype-workflow-checklist.md +64 -0
  206. package/payload/plugins/toolkit/skills/publish-runweave-server/SKILL.md +64 -0
  207. package/payload/plugins/toolkit/skills/publish-runweave-server/agents/openai.yaml +4 -0
  208. package/payload/plugins/toolkit/skills/react-best-practices/AGENTS.md +3227 -0
  209. package/payload/plugins/toolkit/skills/react-best-practices/README.md +127 -0
  210. package/payload/plugins/toolkit/skills/react-best-practices/SKILL.md +143 -0
  211. package/payload/plugins/toolkit/skills/react-best-practices/metadata.json +15 -0
  212. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/event-handler-refs.md +55 -0
  213. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/init-once.md +42 -0
  214. package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/use-latest.md +39 -0
  215. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/api-routes.md +38 -0
  216. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/defer-await.md +80 -0
  217. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/dependencies.md +52 -0
  218. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/parallel.md +28 -0
  219. package/payload/plugins/toolkit/skills/react-best-practices/rules/async/suspense-boundaries.md +99 -0
  220. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/barrel-imports.md +59 -0
  221. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/conditional.md +37 -0
  222. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/defer-third-party.md +49 -0
  223. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/dynamic-imports.md +35 -0
  224. package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/preload.md +46 -0
  225. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/event-listeners.md +78 -0
  226. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/localstorage-schema.md +77 -0
  227. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/passive-event-listeners.md +48 -0
  228. package/payload/plugins/toolkit/skills/react-best-practices/rules/client/swr-dedup.md +56 -0
  229. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/batch-dom-css.md +110 -0
  230. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-function-results.md +80 -0
  231. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-property-access.md +28 -0
  232. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-storage.md +70 -0
  233. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/combine-iterations.md +32 -0
  234. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/early-exit.md +50 -0
  235. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/flatmap-filter.md +55 -0
  236. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/hoist-regexp.md +45 -0
  237. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/index-maps.md +37 -0
  238. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/length-check-first.md +50 -0
  239. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/min-max-loop.md +82 -0
  240. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/set-map-lookups.md +24 -0
  241. package/payload/plugins/toolkit/skills/react-best-practices/rules/js/tosorted-immutable.md +57 -0
  242. package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/sections.md +46 -0
  243. package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/template.md +28 -0
  244. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/activity.md +26 -0
  245. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/animate-svg-wrapper.md +38 -0
  246. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/conditional-render.md +32 -0
  247. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/content-visibility.md +38 -0
  248. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hoist-jsx.md +36 -0
  249. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-no-flicker.md +72 -0
  250. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-suppress-warning.md +26 -0
  251. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/resource-hints.md +89 -0
  252. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/script-defer-async.md +71 -0
  253. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/svg-precision.md +28 -0
  254. package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/usetransition-loading.md +75 -0
  255. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/defer-reads.md +39 -0
  256. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/dependencies.md +45 -0
  257. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state-no-effect.md +40 -0
  258. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state.md +29 -0
  259. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/functional-setstate.md +77 -0
  260. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/lazy-state-init.md +58 -0
  261. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo-with-default-value.md +36 -0
  262. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo.md +44 -0
  263. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/move-effect-to-event.md +45 -0
  264. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/no-inline-components.md +83 -0
  265. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/simple-expression-in-memo.md +35 -0
  266. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/transitions.md +40 -0
  267. package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/use-ref-transient-values.md +73 -0
  268. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/after-nonblocking.md +74 -0
  269. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/auth-actions.md +96 -0
  270. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-lru.md +41 -0
  271. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-react.md +76 -0
  272. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/dedup-props.md +65 -0
  273. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/hoist-static-io.md +139 -0
  274. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/parallel-fetching.md +83 -0
  275. package/payload/plugins/toolkit/skills/react-best-practices/rules/server/serialization.md +38 -0
  276. package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/SKILL.md +8 -0
  277. package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/agents/openai.yaml +6 -0
  278. package/payload/plugins/toolkit/skills/reproduce-before-fix/SKILL.md +93 -0
  279. package/payload/plugins/toolkit/skills/reproduce-before-fix/agents/openai.yaml +7 -0
  280. package/payload/plugins/toolkit/skills/review-only/SKILL.md +72 -0
  281. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/SKILL.md +134 -0
  282. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/agents/openai.yaml +7 -0
  283. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/references/contracts.md +114 -0
  284. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/classify-runtime-verdict.mjs +140 -0
  285. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/run-static-review.mjs +389 -0
  286. package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/static-review-contract.mjs +243 -0
  287. package/payload/plugins/toolkit/skills/run-test-cases/SKILL.md +63 -0
  288. package/payload/plugins/toolkit/skills/runweave-change-validation/SKILL.md +196 -0
  289. package/payload/plugins/toolkit/skills/runweave-change-validation/agents/openai.yaml +7 -0
  290. package/payload/plugins/toolkit/skills/runweave-change-validation/scripts/assert-dev-session-status.mjs +181 -0
  291. package/payload/plugins/toolkit/skills/runweave-dev-session/SKILL.md +126 -0
  292. package/payload/plugins/toolkit/skills/runweave-dev-session/agents/openai.yaml +7 -0
  293. package/payload/plugins/toolkit/skills/runweave-management/SKILL.md +47 -0
  294. package/payload/plugins/toolkit/skills/scheduled-task/SKILL.md +35 -0
  295. package/payload/plugins/toolkit/skills/shadcn/SKILL.md +245 -0
  296. package/payload/plugins/toolkit/skills/shadcn/agents/openai.yml +5 -0
  297. package/payload/plugins/toolkit/skills/shadcn/assets/shadcn-small.png +0 -0
  298. package/payload/plugins/toolkit/skills/shadcn/assets/shadcn.png +0 -0
  299. package/payload/plugins/toolkit/skills/shadcn/cli.md +276 -0
  300. package/payload/plugins/toolkit/skills/shadcn/customization.md +209 -0
  301. package/payload/plugins/toolkit/skills/shadcn/evals/evals.json +47 -0
  302. package/payload/plugins/toolkit/skills/shadcn/mcp.md +94 -0
  303. package/payload/plugins/toolkit/skills/shadcn/rules/base-vs-radix.md +310 -0
  304. package/payload/plugins/toolkit/skills/shadcn/rules/composition.md +197 -0
  305. package/payload/plugins/toolkit/skills/shadcn/rules/forms.md +198 -0
  306. package/payload/plugins/toolkit/skills/shadcn/rules/icons.md +101 -0
  307. package/payload/plugins/toolkit/skills/shadcn/rules/styling.md +163 -0
  308. package/payload/plugins/toolkit/skills/suiji/SKILL.md +54 -0
  309. package/payload/plugins/toolkit/skills/suiji/references/api.md +72 -0
  310. package/payload/plugins/toolkit/skills/suiji/references/source-adapter.md +40 -0
  311. package/payload/plugins/toolkit/skills/suiji/references/work-records.md +36 -0
  312. package/payload/plugins/toolkit/skills/suiji/scripts/source_adapter.py +46 -0
  313. package/payload/plugins/toolkit/skills/suiji/scripts/suiji.py +358 -0
  314. package/payload/plugins/toolkit/skills/suiji/scripts/work_records.py +328 -0
  315. package/payload/plugins/toolkit/skills/suiji/scripts/work_reports.py +75 -0
  316. package/payload/plugins/toolkit/skills/sync-branch-hard-reset/SKILL.md +59 -0
  317. package/payload/plugins/toolkit/skills/update-runweave-backend/SKILL.md +90 -0
  318. package/payload/plugins/toolkit/skills/update-runweave-backend/agents/openai.yaml +4 -0
  319. package/payload/plugins/toolkit/skills/update-runweave-backend/references/npm-update.md +68 -0
  320. package/payload/plugins/toolkit/skills/update-runweave-backend/references/systemd.md +34 -0
  321. package/payload/plugins/toolkit/skills/update-runweave-desktop/SKILL.md +102 -0
  322. package/payload/plugins/toolkit/skills/update-runweave-ios/SKILL.md +16 -0
  323. package/payload/plugins/toolkit/skills/update-runweave-ios/references/ios-wireless-recovery.md +54 -0
  324. package/payload/plugins/toolkit/skills/using-rw/SKILL.md +265 -0
  325. package/payload/plugins/toolkit/skills/write-plan/SKILL.md +72 -0
  326. package/payload/plugins/toolkit/skills/write-test-cases/SKILL.md +100 -0
  327. package/payload/plugins/toolkit/skills/write-test-cases/assets/test-plan-template.yaml +15 -0
  328. package/payload/plugins/toolkit/skills/write-test-cases/references/coverage-checklist.md +75 -0
  329. package/payload/plugins/toolkit/skills/write-test-cases/references/design-techniques.md +91 -0
  330. package/payload/plugins/toolkit/skills/youtube-reading/SKILL.md +35 -0
  331. package/payload/plugins/toolkit/skills/youtube-reading/agents/openai.yaml +4 -0
  332. package/payload/plugins/toolkit/skills/youtube-reading/assets/runtime-lock.json +92 -0
  333. package/payload/plugins/toolkit/skills/youtube-reading/references/content-contract.md +52 -0
  334. package/payload/plugins/toolkit/skills/youtube-reading/references/setup.md +70 -0
  335. package/payload/plugins/toolkit/skills/youtube-reading/requirements.lock +9 -0
  336. package/payload/plugins/toolkit/skills/youtube-reading/scripts/artifacts.py +206 -0
  337. package/payload/plugins/toolkit/skills/youtube-reading/scripts/runtime.py +424 -0
  338. package/payload/plugins/toolkit/skills/youtube-reading/scripts/youtube_reading.py +314 -0
  339. package/payload/plugins/toolkit-release.json +1 -0
  340. package/payload/scripts/toolkit/codex-state.mjs +75 -0
  341. package/payload/scripts/toolkit/release.mjs +210 -0
  342. package/payload/scripts/toolkit/sync-runtime.mjs +108 -0
  343. package/payload/scripts/toolkit/sync.mjs +585 -0
  344. package/payload/frontend/dist/assets/channel-CuSisha8.js +0 -1
  345. package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-ClJkT7PY.js +0 -1
  346. package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-ClJkT7PY.js +0 -1
  347. package/payload/frontend/dist/assets/clone-CPcyXi9g.js +0 -1
  348. package/payload/frontend/dist/assets/connection-BhcgnOMb.js +0 -12
  349. package/payload/frontend/dist/assets/main-BDBhLSX2.js +0 -696
  350. package/payload/frontend/dist/assets/main-Cg6Oo1xK.css +0 -33
  351. package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-DhdOfEAv.js +0 -1
  352. package/payload/frontend/dist/assets/suiji-DXtfgwxj.js +0 -1
@@ -0,0 +1,80 @@
1
+ ---
2
+ title: Cache Repeated Function Calls
3
+ impact: MEDIUM
4
+ impactDescription: avoid redundant computation
5
+ tags: javascript, cache, memoization, performance
6
+ ---
7
+
8
+ ## Cache Repeated Function Calls
9
+
10
+ Use a module-level Map to cache function results when the same function is called repeatedly with the same inputs during render.
11
+
12
+ **Incorrect (redundant computation):**
13
+
14
+ ```typescript
15
+ function ProjectList({ projects }: { projects: Project[] }) {
16
+ return (
17
+ <div>
18
+ {projects.map(project => {
19
+ // slugify() called 100+ times for same project names
20
+ const slug = slugify(project.name)
21
+
22
+ return <ProjectCard key={project.id} slug={slug} />
23
+ })}
24
+ </div>
25
+ )
26
+ }
27
+ ```
28
+
29
+ **Correct (cached results):**
30
+
31
+ ```typescript
32
+ // Module-level cache
33
+ const slugifyCache = new Map<string, string>()
34
+
35
+ function cachedSlugify(text: string): string {
36
+ if (slugifyCache.has(text)) {
37
+ return slugifyCache.get(text)!
38
+ }
39
+ const result = slugify(text)
40
+ slugifyCache.set(text, result)
41
+ return result
42
+ }
43
+
44
+ function ProjectList({ projects }: { projects: Project[] }) {
45
+ return (
46
+ <div>
47
+ {projects.map(project => {
48
+ // Computed only once per unique project name
49
+ const slug = cachedSlugify(project.name)
50
+
51
+ return <ProjectCard key={project.id} slug={slug} />
52
+ })}
53
+ </div>
54
+ )
55
+ }
56
+ ```
57
+
58
+ **Simpler pattern for single-value functions:**
59
+
60
+ ```typescript
61
+ let isLoggedInCache: boolean | null = null;
62
+
63
+ function isLoggedIn(): boolean {
64
+ if (isLoggedInCache !== null) {
65
+ return isLoggedInCache;
66
+ }
67
+
68
+ isLoggedInCache = document.cookie.includes("auth=");
69
+ return isLoggedInCache;
70
+ }
71
+
72
+ // Clear cache when auth changes
73
+ function onAuthChange() {
74
+ isLoggedInCache = null;
75
+ }
76
+ ```
77
+
78
+ Use a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.
79
+
80
+ Reference: [How we made the Vercel Dashboard twice as fast](https://vercel.com/blog/how-we-made-the-vercel-dashboard-twice-as-fast)
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: Cache Property Access in Loops
3
+ impact: LOW-MEDIUM
4
+ impactDescription: reduces lookups
5
+ tags: javascript, loops, optimization, caching
6
+ ---
7
+
8
+ ## Cache Property Access in Loops
9
+
10
+ Cache object property lookups in hot paths.
11
+
12
+ **Incorrect (3 lookups × N iterations):**
13
+
14
+ ```typescript
15
+ for (let i = 0; i < arr.length; i++) {
16
+ process(obj.config.settings.value);
17
+ }
18
+ ```
19
+
20
+ **Correct (1 lookup total):**
21
+
22
+ ```typescript
23
+ const value = obj.config.settings.value;
24
+ const len = arr.length;
25
+ for (let i = 0; i < len; i++) {
26
+ process(value);
27
+ }
28
+ ```
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: Cache Storage API Calls
3
+ impact: LOW-MEDIUM
4
+ impactDescription: reduces expensive I/O
5
+ tags: javascript, localStorage, storage, caching, performance
6
+ ---
7
+
8
+ ## Cache Storage API Calls
9
+
10
+ `localStorage`, `sessionStorage`, and `document.cookie` are synchronous and expensive. Cache reads in memory.
11
+
12
+ **Incorrect (reads storage on every call):**
13
+
14
+ ```typescript
15
+ function getTheme() {
16
+ return localStorage.getItem("theme") ?? "light";
17
+ }
18
+ // Called 10 times = 10 storage reads
19
+ ```
20
+
21
+ **Correct (Map cache):**
22
+
23
+ ```typescript
24
+ const storageCache = new Map<string, string | null>();
25
+
26
+ function getLocalStorage(key: string) {
27
+ if (!storageCache.has(key)) {
28
+ storageCache.set(key, localStorage.getItem(key));
29
+ }
30
+ return storageCache.get(key);
31
+ }
32
+
33
+ function setLocalStorage(key: string, value: string) {
34
+ localStorage.setItem(key, value);
35
+ storageCache.set(key, value); // keep cache in sync
36
+ }
37
+ ```
38
+
39
+ Use a Map (not a hook) so it works everywhere: utilities, event handlers, not just React components.
40
+
41
+ **Cookie caching:**
42
+
43
+ ```typescript
44
+ let cookieCache: Record<string, string> | null = null;
45
+
46
+ function getCookie(name: string) {
47
+ if (!cookieCache) {
48
+ cookieCache = Object.fromEntries(
49
+ document.cookie.split("; ").map((c) => c.split("=")),
50
+ );
51
+ }
52
+ return cookieCache[name];
53
+ }
54
+ ```
55
+
56
+ **Important (invalidate on external changes):**
57
+
58
+ If storage can change externally (another tab, server-set cookies), invalidate cache:
59
+
60
+ ```typescript
61
+ window.addEventListener("storage", (e) => {
62
+ if (e.key) storageCache.delete(e.key);
63
+ });
64
+
65
+ document.addEventListener("visibilitychange", () => {
66
+ if (document.visibilityState === "visible") {
67
+ storageCache.clear();
68
+ }
69
+ });
70
+ ```
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: Combine Multiple Array Iterations
3
+ impact: LOW-MEDIUM
4
+ impactDescription: reduces iterations
5
+ tags: javascript, arrays, loops, performance
6
+ ---
7
+
8
+ ## Combine Multiple Array Iterations
9
+
10
+ Multiple `.filter()` or `.map()` calls iterate the array multiple times. Combine into one loop.
11
+
12
+ **Incorrect (3 iterations):**
13
+
14
+ ```typescript
15
+ const admins = users.filter((u) => u.isAdmin);
16
+ const testers = users.filter((u) => u.isTester);
17
+ const inactive = users.filter((u) => !u.isActive);
18
+ ```
19
+
20
+ **Correct (1 iteration):**
21
+
22
+ ```typescript
23
+ const admins: User[] = [];
24
+ const testers: User[] = [];
25
+ const inactive: User[] = [];
26
+
27
+ for (const user of users) {
28
+ if (user.isAdmin) admins.push(user);
29
+ if (user.isTester) testers.push(user);
30
+ if (!user.isActive) inactive.push(user);
31
+ }
32
+ ```
@@ -0,0 +1,50 @@
1
+ ---
2
+ title: Early Return from Functions
3
+ impact: LOW-MEDIUM
4
+ impactDescription: avoids unnecessary computation
5
+ tags: javascript, functions, optimization, early-return
6
+ ---
7
+
8
+ ## Early Return from Functions
9
+
10
+ Return early when result is determined to skip unnecessary processing.
11
+
12
+ **Incorrect (processes all items even after finding answer):**
13
+
14
+ ```typescript
15
+ function validateUsers(users: User[]) {
16
+ let hasError = false;
17
+ let errorMessage = "";
18
+
19
+ for (const user of users) {
20
+ if (!user.email) {
21
+ hasError = true;
22
+ errorMessage = "Email required";
23
+ }
24
+ if (!user.name) {
25
+ hasError = true;
26
+ errorMessage = "Name required";
27
+ }
28
+ // Continues checking all users even after error found
29
+ }
30
+
31
+ return hasError ? { valid: false, error: errorMessage } : { valid: true };
32
+ }
33
+ ```
34
+
35
+ **Correct (returns immediately on first error):**
36
+
37
+ ```typescript
38
+ function validateUsers(users: User[]) {
39
+ for (const user of users) {
40
+ if (!user.email) {
41
+ return { valid: false, error: "Email required" };
42
+ }
43
+ if (!user.name) {
44
+ return { valid: false, error: "Name required" };
45
+ }
46
+ }
47
+
48
+ return { valid: true };
49
+ }
50
+ ```
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: Use flatMap to Map and Filter in One Pass
3
+ impact: LOW-MEDIUM
4
+ impactDescription: eliminates intermediate array
5
+ tags: javascript, arrays, flatMap, filter, performance
6
+ ---
7
+
8
+ ## Use flatMap to Map and Filter in One Pass
9
+
10
+ **Impact: LOW-MEDIUM (eliminates intermediate array)**
11
+
12
+ Chaining `.map().filter(Boolean)` creates an intermediate array and iterates twice. Use `.flatMap()` to transform and filter in a single pass.
13
+
14
+ **Incorrect (2 iterations, intermediate array):**
15
+
16
+ ```typescript
17
+ const userNames = users
18
+ .map((user) => (user.isActive ? user.name : null))
19
+ .filter(Boolean);
20
+ ```
21
+
22
+ **Correct (1 iteration, no intermediate array):**
23
+
24
+ ```typescript
25
+ const userNames = users.flatMap((user) => (user.isActive ? [user.name] : []));
26
+ ```
27
+
28
+ **More examples:**
29
+
30
+ ```typescript
31
+ // Extract valid emails from responses
32
+ // Before
33
+ const emails = responses
34
+ .map((r) => (r.success ? r.data.email : null))
35
+ .filter(Boolean);
36
+
37
+ // After
38
+ const emails = responses.flatMap((r) => (r.success ? [r.data.email] : []));
39
+
40
+ // Parse and filter valid numbers
41
+ // Before
42
+ const numbers = strings.map((s) => parseInt(s, 10)).filter((n) => !isNaN(n));
43
+
44
+ // After
45
+ const numbers = strings.flatMap((s) => {
46
+ const n = parseInt(s, 10);
47
+ return isNaN(n) ? [] : [n];
48
+ });
49
+ ```
50
+
51
+ **When to use:**
52
+
53
+ - Transforming items while filtering some out
54
+ - Conditional mapping where some inputs produce no output
55
+ - Parsing/validating where invalid inputs should be skipped
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: Hoist RegExp Creation
3
+ impact: LOW-MEDIUM
4
+ impactDescription: avoids recreation
5
+ tags: javascript, regexp, optimization, memoization
6
+ ---
7
+
8
+ ## Hoist RegExp Creation
9
+
10
+ Don't create RegExp inside render. Hoist to module scope or memoize with `useMemo()`.
11
+
12
+ **Incorrect (new RegExp every render):**
13
+
14
+ ```tsx
15
+ function Highlighter({ text, query }: Props) {
16
+ const regex = new RegExp(`(${query})`, 'gi')
17
+ const parts = text.split(regex)
18
+ return <>{parts.map((part, i) => ...)}</>
19
+ }
20
+ ```
21
+
22
+ **Correct (memoize or hoist):**
23
+
24
+ ```tsx
25
+ const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
26
+
27
+ function Highlighter({ text, query }: Props) {
28
+ const regex = useMemo(
29
+ () => new RegExp(`(${escapeRegex(query)})`, 'gi'),
30
+ [query]
31
+ )
32
+ const parts = text.split(regex)
33
+ return <>{parts.map((part, i) => ...)}</>
34
+ }
35
+ ```
36
+
37
+ **Warning (global regex has mutable state):**
38
+
39
+ Global regex (`/g`) has mutable `lastIndex` state:
40
+
41
+ ```typescript
42
+ const regex = /foo/g;
43
+ regex.test("foo"); // true, lastIndex = 3
44
+ regex.test("foo"); // false, lastIndex = 0
45
+ ```
@@ -0,0 +1,37 @@
1
+ ---
2
+ title: Build Index Maps for Repeated Lookups
3
+ impact: LOW-MEDIUM
4
+ impactDescription: 1M ops to 2K ops
5
+ tags: javascript, map, indexing, optimization, performance
6
+ ---
7
+
8
+ ## Build Index Maps for Repeated Lookups
9
+
10
+ Multiple `.find()` calls by the same key should use a Map.
11
+
12
+ **Incorrect (O(n) per lookup):**
13
+
14
+ ```typescript
15
+ function processOrders(orders: Order[], users: User[]) {
16
+ return orders.map((order) => ({
17
+ ...order,
18
+ user: users.find((u) => u.id === order.userId),
19
+ }));
20
+ }
21
+ ```
22
+
23
+ **Correct (O(1) per lookup):**
24
+
25
+ ```typescript
26
+ function processOrders(orders: Order[], users: User[]) {
27
+ const userById = new Map(users.map((u) => [u.id, u]));
28
+
29
+ return orders.map((order) => ({
30
+ ...order,
31
+ user: userById.get(order.userId),
32
+ }));
33
+ }
34
+ ```
35
+
36
+ Build map once (O(n)), then all lookups are O(1).
37
+ For 1000 orders × 1000 users: 1M ops → 2K ops.
@@ -0,0 +1,50 @@
1
+ ---
2
+ title: Early Length Check for Array Comparisons
3
+ impact: MEDIUM-HIGH
4
+ impactDescription: avoids expensive operations when lengths differ
5
+ tags: javascript, arrays, performance, optimization, comparison
6
+ ---
7
+
8
+ ## Early Length Check for Array Comparisons
9
+
10
+ When comparing arrays with expensive operations (sorting, deep equality, serialization), check lengths first. If lengths differ, the arrays cannot be equal.
11
+
12
+ In real-world applications, this optimization is especially valuable when the comparison runs in hot paths (event handlers, render loops).
13
+
14
+ **Incorrect (always runs expensive comparison):**
15
+
16
+ ```typescript
17
+ function hasChanges(current: string[], original: string[]) {
18
+ // Always sorts and joins, even when lengths differ
19
+ return current.sort().join() !== original.sort().join();
20
+ }
21
+ ```
22
+
23
+ Two O(n log n) sorts run even when `current.length` is 5 and `original.length` is 100. There is also overhead of joining the arrays and comparing the strings.
24
+
25
+ **Correct (O(1) length check first):**
26
+
27
+ ```typescript
28
+ function hasChanges(current: string[], original: string[]) {
29
+ // Early return if lengths differ
30
+ if (current.length !== original.length) {
31
+ return true;
32
+ }
33
+ // Only sort when lengths match
34
+ const currentSorted = current.toSorted();
35
+ const originalSorted = original.toSorted();
36
+ for (let i = 0; i < currentSorted.length; i++) {
37
+ if (currentSorted[i] !== originalSorted[i]) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
43
+ ```
44
+
45
+ This new approach is more efficient because:
46
+
47
+ - It avoids the overhead of sorting and joining the arrays when lengths differ
48
+ - It avoids consuming memory for the joined strings (especially important for large arrays)
49
+ - It avoids mutating the original arrays
50
+ - It returns early when a difference is found
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: Use Loop for Min/Max Instead of Sort
3
+ impact: LOW
4
+ impactDescription: O(n) instead of O(n log n)
5
+ tags: javascript, arrays, performance, sorting, algorithms
6
+ ---
7
+
8
+ ## Use Loop for Min/Max Instead of Sort
9
+
10
+ Finding the smallest or largest element only requires a single pass through the array. Sorting is wasteful and slower.
11
+
12
+ **Incorrect (O(n log n) - sort to find latest):**
13
+
14
+ ```typescript
15
+ interface Project {
16
+ id: string;
17
+ name: string;
18
+ updatedAt: number;
19
+ }
20
+
21
+ function getLatestProject(projects: Project[]) {
22
+ const sorted = [...projects].sort((a, b) => b.updatedAt - a.updatedAt);
23
+ return sorted[0];
24
+ }
25
+ ```
26
+
27
+ Sorts the entire array just to find the maximum value.
28
+
29
+ **Incorrect (O(n log n) - sort for oldest and newest):**
30
+
31
+ ```typescript
32
+ function getOldestAndNewest(projects: Project[]) {
33
+ const sorted = [...projects].sort((a, b) => a.updatedAt - b.updatedAt);
34
+ return { oldest: sorted[0], newest: sorted[sorted.length - 1] };
35
+ }
36
+ ```
37
+
38
+ Still sorts unnecessarily when only min/max are needed.
39
+
40
+ **Correct (O(n) - single loop):**
41
+
42
+ ```typescript
43
+ function getLatestProject(projects: Project[]) {
44
+ if (projects.length === 0) return null;
45
+
46
+ let latest = projects[0];
47
+
48
+ for (let i = 1; i < projects.length; i++) {
49
+ if (projects[i].updatedAt > latest.updatedAt) {
50
+ latest = projects[i];
51
+ }
52
+ }
53
+
54
+ return latest;
55
+ }
56
+
57
+ function getOldestAndNewest(projects: Project[]) {
58
+ if (projects.length === 0) return { oldest: null, newest: null };
59
+
60
+ let oldest = projects[0];
61
+ let newest = projects[0];
62
+
63
+ for (let i = 1; i < projects.length; i++) {
64
+ if (projects[i].updatedAt < oldest.updatedAt) oldest = projects[i];
65
+ if (projects[i].updatedAt > newest.updatedAt) newest = projects[i];
66
+ }
67
+
68
+ return { oldest, newest };
69
+ }
70
+ ```
71
+
72
+ Single pass through the array, no copying, no sorting.
73
+
74
+ **Alternative (Math.min/Math.max for small arrays):**
75
+
76
+ ```typescript
77
+ const numbers = [5, 2, 8, 1, 9];
78
+ const min = Math.min(...numbers);
79
+ const max = Math.max(...numbers);
80
+ ```
81
+
82
+ This works for small arrays, but can be slower or just throw an error for very large arrays due to spread operator limitations. Maximal array length is approximately 124000 in Chrome 143 and 638000 in Safari 18; exact numbers may vary - see [the fiddle](https://jsfiddle.net/qw1jabsx/4/). Use the loop approach for reliability.
@@ -0,0 +1,24 @@
1
+ ---
2
+ title: Use Set/Map for O(1) Lookups
3
+ impact: LOW-MEDIUM
4
+ impactDescription: O(n) to O(1)
5
+ tags: javascript, set, map, data-structures, performance
6
+ ---
7
+
8
+ ## Use Set/Map for O(1) Lookups
9
+
10
+ Convert arrays to Set/Map for repeated membership checks.
11
+
12
+ **Incorrect (O(n) per check):**
13
+
14
+ ```typescript
15
+ const allowedIds = ['a', 'b', 'c', ...]
16
+ items.filter(item => allowedIds.includes(item.id))
17
+ ```
18
+
19
+ **Correct (O(1) per check):**
20
+
21
+ ```typescript
22
+ const allowedIds = new Set(['a', 'b', 'c', ...])
23
+ items.filter(item => allowedIds.has(item.id))
24
+ ```
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: Use toSorted() Instead of sort() for Immutability
3
+ impact: MEDIUM-HIGH
4
+ impactDescription: prevents mutation bugs in React state
5
+ tags: javascript, arrays, immutability, react, state, mutation
6
+ ---
7
+
8
+ ## Use toSorted() Instead of sort() for Immutability
9
+
10
+ `.sort()` mutates the array in place, which can cause bugs with React state and props. Use `.toSorted()` to create a new sorted array without mutation.
11
+
12
+ **Incorrect (mutates original array):**
13
+
14
+ ```typescript
15
+ function UserList({ users }: { users: User[] }) {
16
+ // Mutates the users prop array!
17
+ const sorted = useMemo(
18
+ () => users.sort((a, b) => a.name.localeCompare(b.name)),
19
+ [users]
20
+ )
21
+ return <div>{sorted.map(renderUser)}</div>
22
+ }
23
+ ```
24
+
25
+ **Correct (creates new array):**
26
+
27
+ ```typescript
28
+ function UserList({ users }: { users: User[] }) {
29
+ // Creates new sorted array, original unchanged
30
+ const sorted = useMemo(
31
+ () => users.toSorted((a, b) => a.name.localeCompare(b.name)),
32
+ [users]
33
+ )
34
+ return <div>{sorted.map(renderUser)}</div>
35
+ }
36
+ ```
37
+
38
+ **Why this matters in React:**
39
+
40
+ 1. Props/state mutations break React's immutability model - React expects props and state to be treated as read-only
41
+ 2. Causes stale closure bugs - Mutating arrays inside closures (callbacks, effects) can lead to unexpected behavior
42
+
43
+ **Browser support (fallback for older browsers):**
44
+
45
+ `.toSorted()` is available in all modern browsers (Chrome 110+, Safari 16+, Firefox 115+, Node.js 20+). For older environments, use spread operator:
46
+
47
+ ```typescript
48
+ // Fallback for older browsers
49
+ const sorted = [...items].sort((a, b) => a.value - b.value);
50
+ ```
51
+
52
+ **Other immutable array methods:**
53
+
54
+ - `.toSorted()` - immutable sort
55
+ - `.toReversed()` - immutable reverse
56
+ - `.toSpliced()` - immutable splice
57
+ - `.with()` - immutable element replacement
@@ -0,0 +1,46 @@
1
+ # Sections
2
+
3
+ This file defines all sections, their ordering, impact levels, and descriptions.
4
+ The section ID (in parentheses) is the filename prefix used to group rules.
5
+
6
+ ---
7
+
8
+ ## 1. Eliminating Waterfalls (async)
9
+
10
+ **Impact:** CRITICAL
11
+ **Description:** Waterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.
12
+
13
+ ## 2. Bundle Size Optimization (bundle)
14
+
15
+ **Impact:** CRITICAL
16
+ **Description:** Reducing initial bundle size improves Time to Interactive and Largest Contentful Paint.
17
+
18
+ ## 3. Server-Side Performance (server)
19
+
20
+ **Impact:** HIGH
21
+ **Description:** Optimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times.
22
+
23
+ ## 4. Client-Side Data Fetching (client)
24
+
25
+ **Impact:** MEDIUM-HIGH
26
+ **Description:** Automatic deduplication and efficient data fetching patterns reduce redundant network requests.
27
+
28
+ ## 5. Re-render Optimization (rerender)
29
+
30
+ **Impact:** MEDIUM
31
+ **Description:** Reducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness.
32
+
33
+ ## 6. Rendering Performance (rendering)
34
+
35
+ **Impact:** MEDIUM
36
+ **Description:** Optimizing the rendering process reduces the work the browser needs to do.
37
+
38
+ ## 7. JavaScript Performance (js)
39
+
40
+ **Impact:** LOW-MEDIUM
41
+ **Description:** Micro-optimizations for hot paths can add up to meaningful improvements.
42
+
43
+ ## 8. Advanced Patterns (advanced)
44
+
45
+ **Impact:** LOW
46
+ **Description:** Advanced patterns for specific cases that require careful implementation.
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: Rule Title Here
3
+ impact: MEDIUM
4
+ impactDescription: Optional description of impact (e.g., "20-50% improvement")
5
+ tags: tag1, tag2
6
+ ---
7
+
8
+ ## Rule Title Here
9
+
10
+ **Impact: MEDIUM (optional impact description)**
11
+
12
+ Brief explanation of the rule and why it matters. This should be clear and concise, explaining the performance implications.
13
+
14
+ **Incorrect (description of what's wrong):**
15
+
16
+ ```typescript
17
+ // Bad code example here
18
+ const bad = example();
19
+ ```
20
+
21
+ **Correct (description of what's right):**
22
+
23
+ ```typescript
24
+ // Good code example here
25
+ const good = example();
26
+ ```
27
+
28
+ Reference: [Link to documentation or resource](https://example.com)