@rotifer/playground 0.8.1 → 0.8.6

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 (453) hide show
  1. package/CHANGELOG.md +46 -11
  2. package/README.md +92 -58
  3. package/README.zh.md +90 -49
  4. package/dist/cloud/auth.d.ts +9 -3
  5. package/dist/cloud/auth.d.ts.map +1 -1
  6. package/dist/cloud/auth.js +28 -13
  7. package/dist/cloud/auth.js.map +1 -1
  8. package/dist/cloud/client.d.ts +4 -3
  9. package/dist/cloud/client.d.ts.map +1 -1
  10. package/dist/cloud/client.js +139 -68
  11. package/dist/cloud/client.js.map +1 -1
  12. package/dist/cloud/types.d.ts +3 -0
  13. package/dist/cloud/types.d.ts.map +1 -1
  14. package/dist/cloud/types.js.map +1 -1
  15. package/dist/commands/agent-create.d.ts +20 -0
  16. package/dist/commands/agent-create.d.ts.map +1 -1
  17. package/dist/commands/agent-create.js +91 -80
  18. package/dist/commands/agent-create.js.map +1 -1
  19. package/dist/commands/agent-list.d.ts.map +1 -1
  20. package/dist/commands/agent-list.js +27 -24
  21. package/dist/commands/agent-list.js.map +1 -1
  22. package/dist/commands/agent-run.d.ts +24 -0
  23. package/dist/commands/agent-run.d.ts.map +1 -1
  24. package/dist/commands/agent-run.js +166 -44
  25. package/dist/commands/agent-run.js.map +1 -1
  26. package/dist/commands/api-key.d.ts +3 -0
  27. package/dist/commands/api-key.d.ts.map +1 -0
  28. package/dist/commands/api-key.js +235 -0
  29. package/dist/commands/api-key.js.map +1 -0
  30. package/dist/commands/arena-list.d.ts.map +1 -1
  31. package/dist/commands/arena-list.js +113 -97
  32. package/dist/commands/arena-list.js.map +1 -1
  33. package/dist/commands/arena-submit.d.ts.map +1 -1
  34. package/dist/commands/arena-submit.js +114 -37
  35. package/dist/commands/arena-submit.js.map +1 -1
  36. package/dist/commands/arena-watch.d.ts.map +1 -1
  37. package/dist/commands/arena-watch.js +59 -87
  38. package/dist/commands/arena-watch.js.map +1 -1
  39. package/dist/commands/compare.d.ts.map +1 -1
  40. package/dist/commands/compare.js +40 -50
  41. package/dist/commands/compare.js.map +1 -1
  42. package/dist/commands/compile.d.ts.map +1 -1
  43. package/dist/commands/compile.js +80 -58
  44. package/dist/commands/compile.js.map +1 -1
  45. package/dist/commands/hello.d.ts +3 -0
  46. package/dist/commands/hello.d.ts.map +1 -0
  47. package/dist/commands/hello.js +575 -0
  48. package/dist/commands/hello.js.map +1 -0
  49. package/dist/commands/info.d.ts.map +1 -1
  50. package/dist/commands/info.js +130 -40
  51. package/dist/commands/info.js.map +1 -1
  52. package/dist/commands/init.d.ts.map +1 -1
  53. package/dist/commands/init.js +39 -60
  54. package/dist/commands/init.js.map +1 -1
  55. package/dist/commands/install.d.ts.map +1 -1
  56. package/dist/commands/install.js +35 -9
  57. package/dist/commands/install.js.map +1 -1
  58. package/dist/commands/list.d.ts.map +1 -1
  59. package/dist/commands/list.js +111 -58
  60. package/dist/commands/list.js.map +1 -1
  61. package/dist/commands/login.d.ts.map +1 -1
  62. package/dist/commands/login.js +23 -10
  63. package/dist/commands/login.js.map +1 -1
  64. package/dist/commands/network.d.ts.map +1 -1
  65. package/dist/commands/network.js +48 -67
  66. package/dist/commands/network.js.map +1 -1
  67. package/dist/commands/publish.d.ts.map +1 -1
  68. package/dist/commands/publish.js +152 -53
  69. package/dist/commands/publish.js.map +1 -1
  70. package/dist/commands/reputation.js +84 -85
  71. package/dist/commands/reputation.js.map +1 -1
  72. package/dist/commands/run.d.ts.map +1 -1
  73. package/dist/commands/run.js +32 -12
  74. package/dist/commands/run.js.map +1 -1
  75. package/dist/commands/scan.d.ts.map +1 -1
  76. package/dist/commands/scan.js +8 -9
  77. package/dist/commands/scan.js.map +1 -1
  78. package/dist/commands/search.d.ts.map +1 -1
  79. package/dist/commands/search.js +80 -54
  80. package/dist/commands/search.js.map +1 -1
  81. package/dist/commands/self-update.d.ts +7 -0
  82. package/dist/commands/self-update.d.ts.map +1 -0
  83. package/dist/commands/self-update.js +187 -0
  84. package/dist/commands/self-update.js.map +1 -0
  85. package/dist/commands/stats.d.ts.map +1 -1
  86. package/dist/commands/stats.js +20 -26
  87. package/dist/commands/stats.js.map +1 -1
  88. package/dist/commands/test.d.ts.map +1 -1
  89. package/dist/commands/test.js +104 -79
  90. package/dist/commands/test.js.map +1 -1
  91. package/dist/commands/user-config.d.ts +3 -0
  92. package/dist/commands/user-config.d.ts.map +1 -0
  93. package/dist/commands/user-config.js +82 -0
  94. package/dist/commands/user-config.js.map +1 -0
  95. package/dist/commands/versions.d.ts.map +1 -1
  96. package/dist/commands/versions.js +46 -33
  97. package/dist/commands/versions.js.map +1 -1
  98. package/dist/commands/vg.d.ts.map +1 -1
  99. package/dist/commands/vg.js +65 -63
  100. package/dist/commands/vg.js.map +1 -1
  101. package/dist/commands/whoami.d.ts.map +1 -1
  102. package/dist/commands/whoami.js +33 -23
  103. package/dist/commands/whoami.js.map +1 -1
  104. package/dist/commands/wrap.d.ts.map +1 -1
  105. package/dist/commands/wrap.js +57 -40
  106. package/dist/commands/wrap.js.map +1 -1
  107. package/dist/index.js +61 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/publish/pre-publish-check.d.ts +15 -0
  110. package/dist/publish/pre-publish-check.d.ts.map +1 -0
  111. package/dist/publish/pre-publish-check.js +228 -0
  112. package/dist/publish/pre-publish-check.js.map +1 -0
  113. package/dist/runtime/domain-failover.d.ts +1 -1
  114. package/dist/runtime/domain-failover.js +1 -1
  115. package/dist/runtime/network-gateway.d.ts +1 -1
  116. package/dist/runtime/network-gateway.d.ts.map +1 -1
  117. package/dist/runtime/network-gateway.js +10 -10
  118. package/dist/runtime/network-gateway.js.map +1 -1
  119. package/dist/scanner/scanner.js +3 -3
  120. package/dist/scanner/scanner.js.map +1 -1
  121. package/dist/utils/binding.d.ts +1 -0
  122. package/dist/utils/binding.d.ts.map +1 -1
  123. package/dist/utils/binding.js +37 -15
  124. package/dist/utils/binding.js.map +1 -1
  125. package/dist/utils/content-hash.d.ts +3 -0
  126. package/dist/utils/content-hash.d.ts.map +1 -0
  127. package/dist/utils/content-hash.js +25 -0
  128. package/dist/utils/content-hash.js.map +1 -0
  129. package/dist/utils/detect-source-language.d.ts +20 -0
  130. package/dist/utils/detect-source-language.d.ts.map +1 -0
  131. package/dist/utils/detect-source-language.js +83 -0
  132. package/dist/utils/detect-source-language.js.map +1 -0
  133. package/dist/utils/display.d.ts +44 -1
  134. package/dist/utils/display.d.ts.map +1 -1
  135. package/dist/utils/display.js +443 -14
  136. package/dist/utils/display.js.map +1 -1
  137. package/dist/utils/domain-suggest.d.ts.map +1 -1
  138. package/dist/utils/domain-suggest.js +3 -3
  139. package/dist/utils/domain-suggest.js.map +1 -1
  140. package/dist/utils/javy-compiler.d.ts.map +1 -1
  141. package/dist/utils/javy-compiler.js +10 -3
  142. package/dist/utils/javy-compiler.js.map +1 -1
  143. package/dist/utils/open-browser.d.ts +7 -3
  144. package/dist/utils/open-browser.d.ts.map +1 -1
  145. package/dist/utils/open-browser.js +15 -4
  146. package/dist/utils/open-browser.js.map +1 -1
  147. package/dist/utils/palette.d.ts +49 -0
  148. package/dist/utils/palette.d.ts.map +1 -0
  149. package/dist/utils/palette.js +80 -0
  150. package/dist/utils/palette.js.map +1 -0
  151. package/dist/utils/private-fs.d.ts +3 -0
  152. package/dist/utils/private-fs.d.ts.map +1 -0
  153. package/dist/utils/private-fs.js +25 -0
  154. package/dist/utils/private-fs.js.map +1 -0
  155. package/dist/utils/project-root.d.ts +2 -0
  156. package/dist/utils/project-root.d.ts.map +1 -0
  157. package/dist/utils/project-root.js +49 -0
  158. package/dist/utils/project-root.js.map +1 -0
  159. package/dist/utils/run-logger.d.ts +24 -0
  160. package/dist/utils/run-logger.d.ts.map +1 -0
  161. package/dist/utils/run-logger.js +70 -0
  162. package/dist/utils/run-logger.js.map +1 -0
  163. package/dist/utils/sandbox-defaults.d.ts +9 -0
  164. package/dist/utils/sandbox-defaults.d.ts.map +1 -0
  165. package/dist/utils/sandbox-defaults.js +12 -0
  166. package/dist/utils/sandbox-defaults.js.map +1 -0
  167. package/dist/utils/update-check.d.ts +20 -0
  168. package/dist/utils/update-check.d.ts.map +1 -0
  169. package/dist/utils/update-check.js +155 -0
  170. package/dist/utils/update-check.js.map +1 -0
  171. package/dist/utils/user-config.d.ts +10 -0
  172. package/dist/utils/user-config.d.ts.map +1 -0
  173. package/dist/utils/user-config.js +54 -0
  174. package/dist/utils/user-config.js.map +1 -0
  175. package/dist/utils/validate-gene-name.d.ts +7 -0
  176. package/dist/utils/validate-gene-name.d.ts.map +1 -0
  177. package/dist/utils/validate-gene-name.js +28 -0
  178. package/dist/utils/validate-gene-name.js.map +1 -0
  179. package/genes/genesis-code-format/phenotype.json +4 -3
  180. package/genes/genesis-file-read/phenotype.json +4 -3
  181. package/genes/genesis-l0-constraint/phenotype.json +4 -3
  182. package/genes/genesis-web-search/phenotype.json +5 -4
  183. package/genes/genesis-web-search-lite/phenotype.json +4 -3
  184. package/package.json +35 -8
  185. package/scripts/postinstall.js +38 -0
  186. package/dist/errors/formatter.d.ts +0 -25
  187. package/dist/errors/formatter.d.ts.map +0 -1
  188. package/dist/errors/formatter.js +0 -43
  189. package/dist/errors/formatter.js.map +0 -1
  190. package/genes/academic-writer/.cloud-manifest.json +0 -6
  191. package/genes/academic-writer/.gene-manifest.json +0 -8
  192. package/genes/academic-writer/SKILL.md +0 -274
  193. package/genes/academic-writer/phenotype.json +0 -28
  194. package/genes/ai-components/.cloud-manifest.json +0 -6
  195. package/genes/ai-components/.gene-manifest.json +0 -8
  196. package/genes/ai-components/SKILL.md +0 -381
  197. package/genes/ai-components/phenotype.json +0 -28
  198. package/genes/algorithmic-art/.cloud-manifest.json +0 -6
  199. package/genes/algorithmic-art/.gene-manifest.json +0 -8
  200. package/genes/algorithmic-art/SKILL.md +0 -405
  201. package/genes/algorithmic-art/phenotype.json +0 -28
  202. package/genes/answer-synthesizer/.cloud-manifest.json +0 -6
  203. package/genes/answer-synthesizer/index.ts +0 -194
  204. package/genes/answer-synthesizer/phenotype.json +0 -61
  205. package/genes/api-designer/.cloud-manifest.json +0 -6
  206. package/genes/api-designer/.gene-manifest.json +0 -8
  207. package/genes/api-designer/SKILL.md +0 -456
  208. package/genes/api-designer/phenotype.json +0 -28
  209. package/genes/auto-coder/.cloud-manifest.json +0 -6
  210. package/genes/auto-coder/.gene-manifest.json +0 -8
  211. package/genes/auto-coder/SKILL.md +0 -400
  212. package/genes/auto-coder/phenotype.json +0 -28
  213. package/genes/auto-writer/.cloud-manifest.json +0 -6
  214. package/genes/auto-writer/.gene-manifest.json +0 -8
  215. package/genes/auto-writer/SKILL.md +0 -361
  216. package/genes/auto-writer/phenotype.json +0 -28
  217. package/genes/brand-personality/.cloud-manifest.json +0 -6
  218. package/genes/brand-personality/.gene-manifest.json +0 -8
  219. package/genes/brand-personality/SKILL.md +0 -549
  220. package/genes/brand-personality/phenotype.json +0 -28
  221. package/genes/business-writer/.cloud-manifest.json +0 -6
  222. package/genes/business-writer/.gene-manifest.json +0 -8
  223. package/genes/business-writer/SKILL.md +0 -448
  224. package/genes/business-writer/phenotype.json +0 -28
  225. package/genes/citation-manager/.cloud-manifest.json +0 -6
  226. package/genes/citation-manager/.gene-manifest.json +0 -8
  227. package/genes/citation-manager/SKILL.md +0 -279
  228. package/genes/citation-manager/index.ts +0 -162
  229. package/genes/citation-manager/package.json +0 -1
  230. package/genes/citation-manager/phenotype.json +0 -50
  231. package/genes/code-complexity/.cloud-manifest.json +0 -6
  232. package/genes/code-complexity/README.md +0 -35
  233. package/genes/code-complexity/index.ts +0 -101
  234. package/genes/code-complexity/phenotype.json +0 -34
  235. package/genes/copywriter/.cloud-manifest.json +0 -6
  236. package/genes/copywriter/.gene-manifest.json +0 -8
  237. package/genes/copywriter/SKILL.md +0 -329
  238. package/genes/copywriter/phenotype.json +0 -28
  239. package/genes/creative-writer/.cloud-manifest.json +0 -6
  240. package/genes/creative-writer/.gene-manifest.json +0 -8
  241. package/genes/creative-writer/SKILL.md +0 -356
  242. package/genes/creative-writer/phenotype.json +0 -28
  243. package/genes/data-modeler/.cloud-manifest.json +0 -6
  244. package/genes/data-modeler/.gene-manifest.json +0 -8
  245. package/genes/data-modeler/SKILL.md +0 -486
  246. package/genes/data-modeler/phenotype.json +0 -28
  247. package/genes/debugger/.cloud-manifest.json +0 -6
  248. package/genes/debugger/.gene-manifest.json +0 -8
  249. package/genes/debugger/SKILL.md +0 -416
  250. package/genes/debugger/phenotype.json +0 -28
  251. package/genes/design-tokens/.cloud-manifest.json +0 -6
  252. package/genes/design-tokens/.gene-manifest.json +0 -8
  253. package/genes/design-tokens/SKILL.md +0 -222
  254. package/genes/design-tokens/index.ts +0 -128
  255. package/genes/design-tokens/package.json +0 -1
  256. package/genes/design-tokens/phenotype.json +0 -1
  257. package/genes/devops-automator/.cloud-manifest.json +0 -6
  258. package/genes/devops-automator/.gene-manifest.json +0 -8
  259. package/genes/devops-automator/SKILL.md +0 -490
  260. package/genes/devops-automator/phenotype.json +0 -28
  261. package/genes/doc-coauthoring/.cloud-manifest.json +0 -6
  262. package/genes/doc-coauthoring/.gene-manifest.json +0 -8
  263. package/genes/doc-coauthoring/SKILL.md +0 -375
  264. package/genes/doc-coauthoring/phenotype.json +0 -28
  265. package/genes/doc-retrieval/.cloud-manifest.json +0 -6
  266. package/genes/doc-retrieval/index.ts +0 -134
  267. package/genes/doc-retrieval/phenotype.json +0 -54
  268. package/genes/docs-writer/.cloud-manifest.json +0 -6
  269. package/genes/docs-writer/.gene-manifest.json +0 -8
  270. package/genes/docs-writer/SKILL.md +0 -492
  271. package/genes/docs-writer/phenotype.json +0 -28
  272. package/genes/evolve-life/.cloud-manifest.json +0 -6
  273. package/genes/evolve-life/.compile-result.json +0 -12
  274. package/genes/evolve-life/README.md +0 -52
  275. package/genes/evolve-life/gene.ir.wasm +0 -0
  276. package/genes/evolve-life/gene.wasm +0 -0
  277. package/genes/evolve-life/index.ts +0 -255
  278. package/genes/evolve-life/phenotype.json +0 -129
  279. package/genes/evolve-life-bitwise/.cloud-manifest.json +0 -6
  280. package/genes/evolve-life-bitwise/.compile-result.json +0 -12
  281. package/genes/evolve-life-bitwise/gene.ir.wasm +0 -0
  282. package/genes/evolve-life-bitwise/gene.wasm +0 -0
  283. package/genes/evolve-life-bitwise/index.ts +0 -273
  284. package/genes/evolve-life-bitwise/phenotype.json +0 -129
  285. package/genes/evolve-life-sparse/.cloud-manifest.json +0 -6
  286. package/genes/evolve-life-sparse/.compile-result.json +0 -12
  287. package/genes/evolve-life-sparse/gene.ir.wasm +0 -0
  288. package/genes/evolve-life-sparse/gene.wasm +0 -0
  289. package/genes/evolve-life-sparse/index.ts +0 -236
  290. package/genes/evolve-life-sparse/phenotype.json +0 -129
  291. package/genes/fact-checker/.cloud-manifest.json +0 -6
  292. package/genes/fact-checker/.gene-manifest.json +0 -8
  293. package/genes/fact-checker/SKILL.md +0 -373
  294. package/genes/fact-checker/phenotype.json +0 -28
  295. package/genes/git-workflow/.cloud-manifest.json +0 -6
  296. package/genes/git-workflow/.gene-manifest.json +0 -8
  297. package/genes/git-workflow/SKILL.md +0 -407
  298. package/genes/git-workflow/phenotype.json +0 -28
  299. package/genes/grammar-checker/.cloud-manifest.json +0 -6
  300. package/genes/grammar-checker/.gene-manifest.json +0 -8
  301. package/genes/grammar-checker/SKILL.md +0 -194
  302. package/genes/grammar-checker/index.ts +0 -168
  303. package/genes/grammar-checker/package.json +0 -1
  304. package/genes/grammar-checker/phenotype.json +0 -52
  305. package/genes/guard-balanced/.gene-manifest.json +0 -8
  306. package/genes/guard-balanced/phenotype.json +0 -105
  307. package/genes/guard-balanced/system-prompt.md +0 -23
  308. package/genes/guard-strict/.gene-manifest.json +0 -8
  309. package/genes/guard-strict/phenotype.json +0 -107
  310. package/genes/guard-strict/system-prompt.md +0 -18
  311. package/genes/json-validator/.cloud-manifest.json +0 -6
  312. package/genes/json-validator/README.md +0 -42
  313. package/genes/json-validator/index.ts +0 -112
  314. package/genes/json-validator/phenotype.json +0 -42
  315. package/genes/license-advisor/.cloud-manifest.json +0 -6
  316. package/genes/license-advisor/.gene-manifest.json +0 -8
  317. package/genes/license-advisor/SKILL.md +0 -117
  318. package/genes/license-advisor/phenotype.json +0 -28
  319. package/genes/logic-architect/.cloud-manifest.json +0 -6
  320. package/genes/logic-architect/.gene-manifest.json +0 -8
  321. package/genes/logic-architect/SKILL.md +0 -451
  322. package/genes/logic-architect/phenotype.json +0 -28
  323. package/genes/markdown-formatter/.cloud-manifest.json +0 -6
  324. package/genes/markdown-formatter/README.md +0 -34
  325. package/genes/markdown-formatter/index.ts +0 -86
  326. package/genes/markdown-formatter/phenotype.json +0 -32
  327. package/genes/orch/.cloud-manifest.json +0 -6
  328. package/genes/orch/.gene-manifest.json +0 -8
  329. package/genes/orch/SKILL.md +0 -504
  330. package/genes/orch/phenotype.json +0 -28
  331. package/genes/particle-barneshut/.cloud-manifest.json +0 -6
  332. package/genes/particle-barneshut/.compile-result.json +0 -12
  333. package/genes/particle-barneshut/README.md +0 -55
  334. package/genes/particle-barneshut/gene.ir.wasm +0 -0
  335. package/genes/particle-barneshut/gene.wasm +0 -0
  336. package/genes/particle-barneshut/index.ts +0 -486
  337. package/genes/particle-barneshut/phenotype.json +0 -137
  338. package/genes/particle-brute/.cloud-manifest.json +0 -6
  339. package/genes/particle-brute/.compile-result.json +0 -12
  340. package/genes/particle-brute/README.md +0 -55
  341. package/genes/particle-brute/gene.ir.wasm +0 -0
  342. package/genes/particle-brute/gene.wasm +0 -0
  343. package/genes/particle-brute/index.ts +0 -277
  344. package/genes/particle-brute/phenotype.json +0 -137
  345. package/genes/particle-spatial/.cloud-manifest.json +0 -6
  346. package/genes/particle-spatial/.compile-result.json +0 -12
  347. package/genes/particle-spatial/README.md +0 -53
  348. package/genes/particle-spatial/gene.ir.wasm +0 -0
  349. package/genes/particle-spatial/gene.wasm +0 -0
  350. package/genes/particle-spatial/index.ts +0 -352
  351. package/genes/particle-spatial/phenotype.json +0 -137
  352. package/genes/performance-optimizer/.cloud-manifest.json +0 -6
  353. package/genes/performance-optimizer/.gene-manifest.json +0 -8
  354. package/genes/performance-optimizer/SKILL.md +0 -480
  355. package/genes/performance-optimizer/phenotype.json +0 -28
  356. package/genes/plagiarism-checker/.cloud-manifest.json +0 -6
  357. package/genes/plagiarism-checker/.gene-manifest.json +0 -8
  358. package/genes/plagiarism-checker/SKILL.md +0 -342
  359. package/genes/plagiarism-checker/phenotype.json +0 -28
  360. package/genes/product-manager/.cloud-manifest.json +0 -6
  361. package/genes/product-manager/.gene-manifest.json +0 -8
  362. package/genes/product-manager/SKILL.md +0 -249
  363. package/genes/product-manager/phenotype.json +0 -28
  364. package/genes/project-reviewer/.cloud-manifest.json +0 -6
  365. package/genes/project-reviewer/.gene-manifest.json +0 -8
  366. package/genes/project-reviewer/SKILL.md +0 -312
  367. package/genes/project-reviewer/phenotype.json +0 -28
  368. package/genes/prompt-engineer/.cloud-manifest.json +0 -6
  369. package/genes/prompt-engineer/.gene-manifest.json +0 -8
  370. package/genes/prompt-engineer/SKILL.md +0 -411
  371. package/genes/prompt-engineer/phenotype.json +0 -28
  372. package/genes/prompt-review-perf/.gene-manifest.json +0 -8
  373. package/genes/prompt-review-perf/phenotype.json +0 -61
  374. package/genes/prompt-review-perf/system-prompt.md +0 -22
  375. package/genes/prompt-review-readability/.gene-manifest.json +0 -8
  376. package/genes/prompt-review-readability/phenotype.json +0 -60
  377. package/genes/prompt-review-readability/system-prompt.md +0 -21
  378. package/genes/prompt-review-security/.gene-manifest.json +0 -8
  379. package/genes/prompt-review-security/phenotype.json +0 -60
  380. package/genes/prompt-review-security/system-prompt.md +0 -21
  381. package/genes/readability-analyzer/.cloud-manifest.json +0 -6
  382. package/genes/readability-analyzer/.gene-manifest.json +0 -8
  383. package/genes/readability-analyzer/SKILL.md +0 -357
  384. package/genes/readability-analyzer/index.ts +0 -123
  385. package/genes/readability-analyzer/package.json +0 -1
  386. package/genes/readability-analyzer/phenotype.json +0 -35
  387. package/genes/rotifer-protocol/SKILL.md +0 -121
  388. package/genes/rule-router-frequency/.gene-manifest.json +0 -8
  389. package/genes/rule-router-frequency/phenotype.json +0 -76
  390. package/genes/rule-router-frequency/system-prompt.md +0 -26
  391. package/genes/rule-router-relevance/.gene-manifest.json +0 -8
  392. package/genes/rule-router-relevance/phenotype.json +0 -76
  393. package/genes/rule-router-relevance/system-prompt.md +0 -29
  394. package/genes/security-auditor/.cloud-manifest.json +0 -6
  395. package/genes/security-auditor/.gene-manifest.json +0 -8
  396. package/genes/security-auditor/SKILL.md +0 -494
  397. package/genes/security-auditor/phenotype.json +0 -28
  398. package/genes/seo-optimizer/.cloud-manifest.json +0 -6
  399. package/genes/seo-optimizer/.gene-manifest.json +0 -8
  400. package/genes/seo-optimizer/SKILL.md +0 -327
  401. package/genes/seo-optimizer/index.ts +0 -206
  402. package/genes/seo-optimizer/package.json +0 -1
  403. package/genes/seo-optimizer/phenotype.json +0 -1
  404. package/genes/source-linker/.cloud-manifest.json +0 -6
  405. package/genes/source-linker/index.ts +0 -88
  406. package/genes/source-linker/phenotype.json +0 -45
  407. package/genes/style-optimizer/.cloud-manifest.json +0 -6
  408. package/genes/style-optimizer/.gene-manifest.json +0 -8
  409. package/genes/style-optimizer/SKILL.md +0 -285
  410. package/genes/style-optimizer/phenotype.json +0 -28
  411. package/genes/tech-lead/.cloud-manifest.json +0 -6
  412. package/genes/tech-lead/.gene-manifest.json +0 -8
  413. package/genes/tech-lead/SKILL.md +0 -451
  414. package/genes/tech-lead/phenotype.json +0 -28
  415. package/genes/test-wrap/.cloud-manifest.json +0 -6
  416. package/genes/test-wrap/.gene-manifest.json +0 -8
  417. package/genes/test-wrap/phenotype.json +0 -28
  418. package/genes/testing-strategist/.cloud-manifest.json +0 -6
  419. package/genes/testing-strategist/.gene-manifest.json +0 -8
  420. package/genes/testing-strategist/SKILL.md +0 -500
  421. package/genes/testing-strategist/phenotype.json +0 -28
  422. package/genes/text-summarizer/.cloud-manifest.json +0 -6
  423. package/genes/text-summarizer/README.md +0 -34
  424. package/genes/text-summarizer/index.ts +0 -122
  425. package/genes/text-summarizer/phenotype.json +0 -32
  426. package/genes/tone-analyzer/.cloud-manifest.json +0 -6
  427. package/genes/tone-analyzer/.gene-manifest.json +0 -8
  428. package/genes/tone-analyzer/SKILL.md +0 -410
  429. package/genes/tone-analyzer/phenotype.json +0 -28
  430. package/genes/translator/.cloud-manifest.json +0 -6
  431. package/genes/translator/.gene-manifest.json +0 -8
  432. package/genes/translator/SKILL.md +0 -355
  433. package/genes/translator/phenotype.json +0 -28
  434. package/genes/ui-components/.cloud-manifest.json +0 -6
  435. package/genes/ui-components/.gene-manifest.json +0 -8
  436. package/genes/ui-components/SKILL.md +0 -467
  437. package/genes/ui-components/phenotype.json +0 -28
  438. package/genes/uiux-designer/.cloud-manifest.json +0 -6
  439. package/genes/uiux-designer/.gene-manifest.json +0 -8
  440. package/genes/uiux-designer/SKILL.md +0 -353
  441. package/genes/uiux-designer/phenotype.json +0 -28
  442. package/genes/url-extractor/.cloud-manifest.json +0 -6
  443. package/genes/url-extractor/README.md +0 -37
  444. package/genes/url-extractor/index.ts +0 -86
  445. package/genes/url-extractor/phenotype.json +0 -48
  446. package/genes/ux-patterns/.cloud-manifest.json +0 -6
  447. package/genes/ux-patterns/.gene-manifest.json +0 -8
  448. package/genes/ux-patterns/SKILL.md +0 -872
  449. package/genes/ux-patterns/phenotype.json +0 -28
  450. package/genes/web3-components/.cloud-manifest.json +0 -6
  451. package/genes/web3-components/.gene-manifest.json +0 -8
  452. package/genes/web3-components/SKILL.md +0 -390
  453. package/genes/web3-components/phenotype.json +0 -28
@@ -1,42 +0,0 @@
1
- {
2
- "domain": "data.validate",
3
- "description": "Validates JSON data against a JSON Schema definition, returning detailed validation errors with paths.",
4
- "inputSchema": {
5
- "type": "object",
6
- "properties": {
7
- "data": { "description": "The JSON data to validate (any type)" },
8
- "schema": { "type": "object", "description": "JSON Schema to validate against" },
9
- "strict": { "type": "boolean", "description": "Disallow additional properties not in schema", "default": false }
10
- },
11
- "required": ["data", "schema"]
12
- },
13
- "outputSchema": {
14
- "type": "object",
15
- "properties": {
16
- "valid": { "type": "boolean", "description": "Whether the data passes validation" },
17
- "errors": {
18
- "type": "array",
19
- "items": {
20
- "type": "object",
21
- "properties": {
22
- "path": { "type": "string", "description": "JSON path to the error (e.g. $.items[0].name)" },
23
- "message": { "type": "string", "description": "Human-readable error message" },
24
- "keyword": { "type": "string", "description": "The schema keyword that failed (e.g. type, required)" }
25
- }
26
- },
27
- "description": "List of validation errors (empty if valid)"
28
- },
29
- "errorCount": { "type": "number", "description": "Total number of validation errors" }
30
- }
31
- },
32
- "dependencies": [],
33
- "version": "0.1.0",
34
- "author": "rotifer-genesis",
35
- "fidelity": "Native",
36
- "transparency": "Open",
37
- "semantic_requirements": {
38
- "timeModel": "Sync",
39
- "concurrencyModel": "Stateless",
40
- "failureSemantics": "Fail"
41
- }
42
- }
@@ -1,6 +0,0 @@
1
- {
2
- "cloud_id": "ec039e24-9b85-4f49-8661-96edb5959d01",
3
- "owner": "Rotifer Protocol",
4
- "version": "0.1.0",
5
- "published_at": "2026-03-17T14:13:04.660Z"
6
- }
@@ -1,8 +0,0 @@
1
- {
2
- "geneId": "157314d0eb6da3529235d9ad6cf877b22a46a8aec461bafeba1825040ab1841a",
3
- "name": "license-advisor",
4
- "domain": "legal.licensing",
5
- "fidelity": "Wrapped",
6
- "wrappedAt": "2026-02-24T13:23:40.260Z",
7
- "fromSkill": "../.cursor/skills/license-advisor/SKILL.md"
8
- }
@@ -1,117 +0,0 @@
1
- ---
2
- name: license-advisor
3
- description: Analyze project requirements and recommend suitable open source licenses (MIT, Apache, GPL, AGPL, LGPL, MPL, BSL, SSPL, etc.). Use when the user asks about licensing, choosing a license, open source strategy, or mentions license names like MIT/GPL/Apache.
4
- ---
5
-
6
- # License Advisor
7
-
8
- Help users select the most appropriate open source license by analyzing their product requirements, business model, and goals.
9
-
10
- ## Analysis Process
11
-
12
- ### Step 1: Gather Project Context
13
-
14
- Ask the user about:
15
-
16
- 1. **Project type**: Library, framework, application, SaaS, developer tool?
17
- 2. **Business model**: Open core, SaaS, support/consulting, donations, fully open?
18
- 3. **Key concerns**: (rank by priority)
19
- - Monetization and commercial protection
20
- - Preventing cloud providers from competing
21
- - Maximizing adoption and contributions
22
- - Ensuring derivatives stay open
23
- - Patent protection
24
-
25
- ### Step 2: Apply Decision Matrix
26
-
27
- | Requirement | Recommended Licenses |
28
- |-------------|---------------------|
29
- | Maximum adoption, minimal restrictions | MIT, ISC, Unlicense |
30
- | Adoption + patent protection | Apache 2.0 |
31
- | Derivatives must stay open (weak copyleft) | LGPL, MPL 2.0 |
32
- | All derivatives must be open (strong copyleft) | GPL v3 |
33
- | Network/SaaS derivatives must be open | AGPL v3 |
34
- | Time-delayed open source | BSL 1.1 |
35
- | Prevent cloud competition | SSPL, Elastic License, FSL |
36
- | Dual licensing strategy | GPL + Commercial |
37
-
38
- ### Step 3: Provide Recommendation
39
-
40
- Format your recommendation as:
41
-
42
- ```markdown
43
- ## License Recommendation
44
-
45
- **Primary recommendation**: [License Name]
46
- **Alternative options**: [Other suitable licenses]
47
-
48
- ### Why this license fits your needs
49
-
50
- [2-3 bullet points explaining the match]
51
-
52
- ### Key considerations
53
-
54
- - [Important implication 1]
55
- - [Important implication 2]
56
-
57
- ### Compatibility notes
58
-
59
- [Dependencies, ecosystem considerations]
60
- ```
61
-
62
- ## Quick Reference
63
-
64
- ### Permissive Licenses (Business-friendly)
65
-
66
- | License | Patent Grant | Attribution | Key Use Case |
67
- |---------|-------------|-------------|--------------|
68
- | MIT | No | Yes | Maximum adoption |
69
- | Apache 2.0 | Yes | Yes | Corporate-friendly, patent protection |
70
- | BSD 3-Clause | No | Yes | Similar to MIT |
71
- | ISC | No | Yes | Simplified MIT |
72
-
73
- ### Copyleft Licenses (Community-focused)
74
-
75
- | License | Scope | Network Trigger | Key Use Case |
76
- |---------|-------|-----------------|--------------|
77
- | GPL v3 | Full | No | Ensure all derivatives open |
78
- | LGPL v3 | Library boundary | No | Open libraries, closed apps OK |
79
- | MPL 2.0 | File-level | No | Per-file copyleft |
80
- | AGPL v3 | Full | Yes | SaaS must share code |
81
-
82
- ### Source-Available Licenses (Commercial protection)
83
-
84
- | License | After Delay | Cloud Restriction | Key Use Case |
85
- |---------|-------------|-------------------|--------------|
86
- | BSL 1.1 | Configurable (typically 4yr) | Production use restricted | Delayed open source |
87
- | SSPL | Never (not OSI) | Must open entire stack | Anti-cloud provider |
88
- | Elastic 2.0 | No | SaaS restriction | Similar to SSPL, less strict |
89
- | FSL | 2 years → Apache/MIT | Production restricted | Functional Source |
90
-
91
- ## Common Scenarios
92
-
93
- ### "I want maximum adoption"
94
- → **MIT** or **Apache 2.0** (if patent protection needed)
95
-
96
- ### "I'm building a SaaS and competitors might use my code"
97
- → **AGPL v3** (if open source important) or **BSL/SSPL** (if commercial protection priority)
98
-
99
- ### "I want contributions back but allow commercial use"
100
- → **LGPL v3** (for libraries) or **MPL 2.0** (file-level copyleft)
101
-
102
- ### "I want to sell commercial licenses"
103
- → **GPL v3 + Commercial dual license** or **BSL 1.1**
104
-
105
- ### "I hate cloud providers using my work"
106
- → **SSPL**, **Elastic License 2.0**, or **FSL**
107
-
108
- ## Detailed Reference
109
-
110
- For comprehensive license details, compatibility matrices, and legal considerations, see [LICENSES.md](LICENSES.md).
111
-
112
- ## Important Caveats
113
-
114
- 1. **Not legal advice**: Always recommend consulting a lawyer for commercial decisions
115
- 2. **Dependency compatibility**: Check that chosen license is compatible with dependencies
116
- 3. **CLA considerations**: For contributions, consider if a CLA is needed
117
- 4. **Relicensing**: Changing licenses later requires all contributors' consent (or CLA)
@@ -1,28 +0,0 @@
1
- {
2
- "domain": "legal.licensing",
3
- "description": "Analyze project requirements and recommend suitable open source licenses (MIT, Apache, GPL, AGPL, LGPL, MPL, BSL, SSPL, etc.). Use when the user asks about licensing, choosing a license, open source strategy, or mentions license names like MIT/GPL/Apache.",
4
- "inputSchema": {
5
- "type": "object",
6
- "properties": {
7
- "prompt": {
8
- "type": "string"
9
- }
10
- },
11
- "required": []
12
- },
13
- "outputSchema": {
14
- "type": "object",
15
- "properties": {
16
- "result": {
17
- "type": "string"
18
- }
19
- }
20
- },
21
- "dependencies": [],
22
- "version": "0.1.0",
23
- "author": "rotifer-team",
24
- "createdAt": 1771939420260,
25
- "fidelity": "Wrapped",
26
- "transparency": "Open",
27
- "source": "skill"
28
- }
@@ -1,6 +0,0 @@
1
- {
2
- "cloud_id": "73fb7cc6-27ae-4ecc-8d82-aa0aef317827",
3
- "owner": "Rotifer Protocol",
4
- "version": "0.1.0",
5
- "published_at": "2026-03-17T14:13:06.466Z"
6
- }
@@ -1,8 +0,0 @@
1
- {
2
- "geneId": "571243178fd0054cf51dda771e71ba83ff0f48e336b485e64054983f9c6d60fc",
3
- "name": "logic-architect",
4
- "domain": "code.architecture",
5
- "fidelity": "Wrapped",
6
- "wrappedAt": "2026-02-24T13:23:27.334Z",
7
- "fromSkill": "../.cursor/skills/logic-architect/SKILL.md"
8
- }
@@ -1,451 +0,0 @@
1
- ---
2
- name: logic-architect
3
- description: Ensure code has sound business logic, data flow, and technical implementation for AI and Web3 projects. Focus on architecture, edge cases, state management, agent patterns, and wallet safety. Use when writing core logic, reviewing architecture, implementing APIs, or when the user mentions logic, architecture, data flow, or asks for code review ignoring UI.
4
- ---
5
-
6
- # The Logic Architect (逻辑与架构专家)
7
-
8
- **Goal**: 确保代码在商业逻辑、数据流转和技术实现上无懈可击。**忽略 UI 细节**。
9
-
10
- **专注领域**: AI 应用架构 + Web3 安全逻辑
11
-
12
- ---
13
-
14
- ## Pre-Code Checklist
15
-
16
- ```
17
- Logic Integrity Check:
18
- - [ ] Edge cases: 0 items? 10000 items? Timeout?
19
- - [ ] State flow: Start → Loading → Success/Error → Reset (闭环?)
20
- - [ ] Data privacy: No secrets/keys sent to wrong endpoints?
21
- - [ ] OPC efficiency: Is this the simplest maintainable solution?
22
- - [ ] AI: Token limits? Streaming? Fallback model?
23
- - [ ] Web3: Wallet states? Chain switching? Gas estimation?
24
- ```
25
-
26
- ---
27
-
28
- ## 1. Strategic Filters (战略过滤器)
29
-
30
- ### OPC Efficiency (一人公司原则)
31
-
32
- | Question | If No → Action |
33
- |----------|----------------|
34
- | 能自动化吗? | 寻找可自动化方案或接受手动成本 |
35
- | 维护成本低吗? | 简化设计,减少移动部件 |
36
- | 有现成方案吗? | 优先使用成熟库/服务 |
37
- | 未来我能看懂吗? | 添加注释,简化逻辑 |
38
-
39
- **拒绝清单**:
40
- - 过度抽象(不需要时不要搞 Factory Pattern)
41
- - 自建可外包的基础设施(Auth, Payment, Email)
42
- - 需要 24/7 监控的复杂架构
43
-
44
- ---
45
-
46
- ## 2. AI Architecture Patterns
47
-
48
- ### AI Response Type System
49
-
50
- ```typescript
51
- // 统一 AI 响应类型(兼容多 SDK)
52
- type AIResponse<T> =
53
- | { ok: true; data: T; usage?: TokenUsage }
54
- | { ok: false; error: AIError }
55
-
56
- type AIError =
57
- | { code: 'RATE_LIMITED'; retryAfter: number }
58
- | { code: 'TOKEN_LIMIT'; used: number; limit: number }
59
- | { code: 'CONTEXT_LENGTH'; maxTokens: number }
60
- | { code: 'INVALID_RESPONSE'; raw: unknown }
61
- | { code: 'TIMEOUT' }
62
- | { code: 'MODERATION_FLAGGED'; categories: string[] }
63
-
64
- type TokenUsage = {
65
- prompt: number
66
- completion: number
67
- total: number
68
- cost?: number // USD
69
- }
70
- ```
71
-
72
- ### Streaming Pattern
73
-
74
- ```typescript
75
- // 流式响应处理(Vercel AI SDK 风格)
76
- async function* streamChat(messages: Message[]): AsyncGenerator<string> {
77
- const response = await openai.chat.completions.create({
78
- model: 'gpt-4',
79
- messages,
80
- stream: true,
81
- })
82
-
83
- for await (const chunk of response) {
84
- const content = chunk.choices[0]?.delta?.content
85
- if (content) yield content
86
- }
87
- }
88
-
89
- // 使用 Vercel AI SDK 时
90
- import { streamText } from 'ai'
91
- const { textStream } = await streamText({
92
- model: openai('gpt-4'),
93
- messages,
94
- })
95
- ```
96
-
97
- ### Multi-Model Fallback
98
-
99
- ```typescript
100
- // 模型降级策略
101
- const MODEL_CHAIN = [
102
- { model: 'gpt-4o', maxTokens: 128000 },
103
- { model: 'gpt-4o-mini', maxTokens: 128000 },
104
- { model: 'claude-3-5-sonnet', maxTokens: 200000 },
105
- ] as const
106
-
107
- async function callWithFallback<T>(
108
- prompt: string,
109
- schema: ZodSchema<T>
110
- ): Promise<T> {
111
- for (const { model } of MODEL_CHAIN) {
112
- try {
113
- return await generateObject({ model, prompt, schema })
114
- } catch (e) {
115
- if (isLastModel(model)) throw e
116
- console.warn(`${model} failed, falling back...`)
117
- }
118
- }
119
- throw new Error('All models failed')
120
- }
121
- ```
122
-
123
- ### Context Management
124
-
125
- ```typescript
126
- // 长对话上下文管理
127
- function truncateContext(
128
- messages: Message[],
129
- maxTokens: number
130
- ): Message[] {
131
- // 保留: system prompt + 最近 N 条
132
- const system = messages.filter(m => m.role === 'system')
133
- const others = messages.filter(m => m.role !== 'system')
134
-
135
- let tokenCount = countTokens(system)
136
- const kept: Message[] = []
137
-
138
- // 从最新往前保留
139
- for (let i = others.length - 1; i >= 0; i--) {
140
- const msgTokens = countTokens([others[i]])
141
- if (tokenCount + msgTokens > maxTokens) break
142
- kept.unshift(others[i])
143
- tokenCount += msgTokens
144
- }
145
-
146
- return [...system, ...kept]
147
- }
148
- ```
149
-
150
- ### Agent / Tool Pattern
151
-
152
- ```typescript
153
- // Agent 工具调用模式
154
- interface Tool<TInput, TOutput> {
155
- name: string
156
- description: string
157
- schema: ZodSchema<TInput>
158
- execute: (input: TInput) => Promise<TOutput>
159
- }
160
-
161
- // 工具执行循环
162
- async function agentLoop(
163
- initialPrompt: string,
164
- tools: Tool[],
165
- maxIterations = 10
166
- ): Promise<string> {
167
- let messages = [{ role: 'user', content: initialPrompt }]
168
-
169
- for (let i = 0; i < maxIterations; i++) {
170
- const response = await llm.chat({ messages, tools })
171
-
172
- if (response.finishReason === 'stop') {
173
- return response.content
174
- }
175
-
176
- if (response.finishReason === 'tool_calls') {
177
- for (const call of response.toolCalls) {
178
- const tool = tools.find(t => t.name === call.name)
179
- const result = await tool.execute(call.args)
180
- messages.push({ role: 'tool', content: result, toolCallId: call.id })
181
- }
182
- }
183
- }
184
- throw new Error('Max iterations reached')
185
- }
186
- ```
187
-
188
- ### Cost Control
189
-
190
- ```typescript
191
- // 成本追踪
192
- const PRICING = {
193
- 'gpt-4o': { input: 2.5, output: 10 }, // per 1M tokens
194
- 'gpt-4o-mini': { input: 0.15, output: 0.6 },
195
- 'claude-3-5-sonnet': { input: 3, output: 15 },
196
- } as const
197
-
198
- function calculateCost(model: string, usage: TokenUsage): number {
199
- const price = PRICING[model]
200
- return (usage.prompt * price.input + usage.completion * price.output) / 1_000_000
201
- }
202
-
203
- // 预算控制
204
- async function withBudget<T>(
205
- fn: () => Promise<{ result: T; usage: TokenUsage }>,
206
- maxCostUSD: number
207
- ): Promise<T> {
208
- const { result, usage } = await fn()
209
- const cost = calculateCost(currentModel, usage)
210
- if (cost > maxCostUSD) {
211
- throw new Error(`Cost ${cost} exceeds budget ${maxCostUSD}`)
212
- }
213
- return result
214
- }
215
- ```
216
-
217
- ---
218
-
219
- ## 3. Web3 Architecture Patterns
220
-
221
- ### Wallet State Machine
222
-
223
- ```typescript
224
- // 完整钱包状态(wagmi + viem / ethers 通用)
225
- type WalletState =
226
- | { status: 'disconnected' }
227
- | { status: 'connecting' }
228
- | { status: 'connected'; address: Address; chainId: number }
229
- | { status: 'wrong_network'; expected: number; actual: number }
230
- | { status: 'signing'; message: string }
231
- | { status: 'tx_pending'; hash: Hash }
232
- | { status: 'tx_confirmed'; hash: Hash; receipt: TransactionReceipt }
233
- | { status: 'tx_failed'; hash?: Hash; error: Error }
234
-
235
- // 状态转换
236
- // disconnected → connecting → connected
237
- // → wrong_network → (switch) → connected
238
- // connected → signing → connected
239
- // connected → tx_pending → tx_confirmed
240
- // → tx_failed
241
- ```
242
-
243
- ### Transaction Pattern (wagmi + viem)
244
-
245
- ```typescript
246
- import { useWriteContract, useWaitForTransactionReceipt } from 'wagmi'
247
-
248
- function useContractWrite() {
249
- const { writeContract, data: hash, isPending, error } = useWriteContract()
250
- const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash })
251
-
252
- async function execute(args: ContractArgs) {
253
- // Pre-flight checks
254
- if (!address) throw new Error('Wallet not connected')
255
- if (chainId !== expectedChainId) throw new Error('Wrong network')
256
-
257
- // Gas estimation with buffer
258
- const gasEstimate = await publicClient.estimateContractGas(args)
259
- const gasLimit = gasEstimate * 120n / 100n // 20% buffer
260
-
261
- writeContract({ ...args, gas: gasLimit })
262
- }
263
-
264
- return { execute, hash, isPending, isConfirming, isSuccess, error }
265
- }
266
- ```
267
-
268
- ### Transaction Pattern (ethers.js)
269
-
270
- ```typescript
271
- import { ethers } from 'ethers'
272
-
273
- async function executeTransaction(
274
- contract: ethers.Contract,
275
- method: string,
276
- args: unknown[]
277
- ): Promise<TransactionReceipt> {
278
- // Gas estimation
279
- const gasEstimate = await contract[method].estimateGas(...args)
280
- const gasLimit = gasEstimate * 120n / 100n
281
-
282
- // Execute
283
- const tx = await contract[method](...args, { gasLimit })
284
-
285
- // Wait for confirmation
286
- const receipt = await tx.wait(1) // 1 confirmation
287
-
288
- if (receipt.status === 0) {
289
- throw new Error('Transaction reverted')
290
- }
291
-
292
- return receipt
293
- }
294
- ```
295
-
296
- ### BigInt Handling
297
-
298
- ```typescript
299
- // BigInt 格式化(禁止精度丢失)
300
- import { formatUnits, parseUnits } from 'viem'
301
-
302
- // ✅ 正确
303
- const amount = parseUnits('1.5', 18) // 1.5 ETH → bigint
304
- const display = formatUnits(balance, 18) // bigint → string
305
-
306
- // ❌ 禁止(精度丢失)
307
- const bad = Number(balance) // 大数会丢失精度
308
- const worse = balance / 10n ** 18n // 整除丢失小数
309
- ```
310
-
311
- ### Chain Configuration
312
-
313
- ```typescript
314
- // 多链配置
315
- const SUPPORTED_CHAINS = {
316
- 1: { name: 'Ethereum', rpc: process.env.ETH_RPC_URL },
317
- 137: { name: 'Polygon', rpc: process.env.POLYGON_RPC_URL },
318
- 42161: { name: 'Arbitrum', rpc: process.env.ARB_RPC_URL },
319
- } as const
320
-
321
- type SupportedChainId = keyof typeof SUPPORTED_CHAINS
322
-
323
- function getChainConfig(chainId: number): ChainConfig {
324
- const config = SUPPORTED_CHAINS[chainId as SupportedChainId]
325
- if (!config) throw new Error(`Unsupported chain: ${chainId}`)
326
- return config
327
- }
328
- ```
329
-
330
- ---
331
-
332
- ## 4. Logic Integrity Protocol
333
-
334
- ### Edge Cases Matrix
335
-
336
- | Scenario | Expected Behavior |
337
- |----------|------------------|
338
- | `items.length === 0` | ? |
339
- | `items.length === 1` | ? |
340
- | `items.length > 1000` | ? (分页/虚拟化?) |
341
- | `network timeout` | ? |
342
- | `AI token limit hit` | ? (truncate/split?) |
343
- | `wallet disconnected mid-tx` | ? |
344
- | `gas price spike` | ? |
345
-
346
- ### State Management Pattern
347
-
348
- ```typescript
349
- type AsyncState<T, E = Error> =
350
- | { status: 'idle' }
351
- | { status: 'loading' }
352
- | { status: 'success'; data: T }
353
- | { status: 'error'; error: E }
354
-
355
- // AI 特化版
356
- type AIStreamState<T> =
357
- | { status: 'idle' }
358
- | { status: 'streaming'; partial: string }
359
- | { status: 'success'; data: T; usage: TokenUsage }
360
- | { status: 'error'; error: AIError }
361
- ```
362
-
363
- ### Data Privacy Rules
364
-
365
- ```
366
- NEVER send to external endpoints:
367
- - Private keys / seed phrases / mnemonics
368
- - Wallet signatures without user consent
369
- - AI prompts containing user PII
370
- - API keys in client-side code
371
-
372
- ALWAYS:
373
- - Mask addresses in logs (0x1234...5678)
374
- - Use server-side for AI API calls
375
- - Validate transaction parameters before signing
376
- - Rate limit AI endpoints
377
- ```
378
-
379
- ---
380
-
381
- ## 5. Review Checklist
382
-
383
- ```markdown
384
- ## Logic Review
385
-
386
- ### Correctness
387
- - [ ] 所有边界条件都有处理
388
- - [ ] 状态流转形成闭环
389
- - [ ] 错误信息对调试有帮助
390
-
391
- ### AI Specific
392
- - [ ] Token 超限有降级策略
393
- - [ ] 流式响应正确处理
394
- - [ ] 幻觉有验证机制
395
- - [ ] 成本可追踪
396
-
397
- ### Web3 Specific
398
- - [ ] 钱包状态全覆盖
399
- - [ ] BigInt 正确处理
400
- - [ ] Gas 估算有 buffer
401
- - [ ] 链切换有处理
402
-
403
- ### Security
404
- - [ ] 无敏感数据泄露
405
- - [ ] 输入已验证/清洗
406
- - [ ] 权限检查到位
407
- ```
408
-
409
- ---
410
-
411
- ## Quick Reference
412
-
413
- ### Common Patterns
414
-
415
- ```typescript
416
- // Retry with backoff
417
- async function withRetry<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T>
418
-
419
- // Timeout wrapper
420
- function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T>
421
-
422
- // Debounce for inputs
423
- function debounce<T extends (...args: any[]) => any>(fn: T, ms: number)
424
- ```
425
-
426
- ### AI SDK Quick Reference
427
-
428
- ```typescript
429
- // Vercel AI SDK
430
- import { generateText, streamText, generateObject } from 'ai'
431
- import { openai } from '@ai-sdk/openai'
432
- import { anthropic } from '@ai-sdk/anthropic'
433
-
434
- // OpenAI SDK
435
- import OpenAI from 'openai'
436
- const client = new OpenAI()
437
-
438
- // LangChain
439
- import { ChatOpenAI } from '@langchain/openai'
440
- ```
441
-
442
- ### Web3 SDK Quick Reference
443
-
444
- ```typescript
445
- // wagmi + viem
446
- import { useAccount, useConnect, useWriteContract } from 'wagmi'
447
- import { parseUnits, formatUnits, Address } from 'viem'
448
-
449
- // ethers.js
450
- import { ethers, parseEther, formatEther } from 'ethers'
451
- ```
@@ -1,28 +0,0 @@
1
- {
2
- "domain": "code.architecture",
3
- "description": "Ensure code has sound business logic, data flow, and technical implementation for AI and Web3 projects. Focus on architecture, edge cases, state management, agent patterns, and wallet safety. Use when writing core logic, reviewing architecture, implementing APIs, or when the user mentions logic, architecture, data flow, or asks for code review ignoring UI.",
4
- "inputSchema": {
5
- "type": "object",
6
- "properties": {
7
- "prompt": {
8
- "type": "string"
9
- }
10
- },
11
- "required": []
12
- },
13
- "outputSchema": {
14
- "type": "object",
15
- "properties": {
16
- "result": {
17
- "type": "string"
18
- }
19
- }
20
- },
21
- "dependencies": [],
22
- "version": "0.1.0",
23
- "author": "rotifer-team",
24
- "createdAt": 1771939407333,
25
- "fidelity": "Wrapped",
26
- "transparency": "Open",
27
- "source": "skill"
28
- }