@rotifer/playground 0.5.0-alpha.2 → 0.7.0

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 (316) hide show
  1. package/CHANGELOG.md +159 -15
  2. package/LICENSE +1 -1
  3. package/README.md +51 -23
  4. package/README.zh.md +54 -25
  5. package/dist/cloud/auth.d.ts +7 -1
  6. package/dist/cloud/auth.d.ts.map +1 -1
  7. package/dist/cloud/auth.js +65 -1
  8. package/dist/cloud/auth.js.map +1 -1
  9. package/dist/cloud/client.d.ts +4 -1
  10. package/dist/cloud/client.d.ts.map +1 -1
  11. package/dist/cloud/client.js +9 -2
  12. package/dist/cloud/client.js.map +1 -1
  13. package/dist/cloud/types.d.ts +3 -1
  14. package/dist/cloud/types.d.ts.map +1 -1
  15. package/dist/cloud/types.js.map +1 -1
  16. package/dist/commands/agent-create.d.ts.map +1 -1
  17. package/dist/commands/agent-create.js +66 -3
  18. package/dist/commands/agent-create.js.map +1 -1
  19. package/dist/commands/agent-run.d.ts.map +1 -1
  20. package/dist/commands/agent-run.js +296 -32
  21. package/dist/commands/agent-run.js.map +1 -1
  22. package/dist/commands/arena-submit.d.ts.map +1 -1
  23. package/dist/commands/arena-submit.js +45 -17
  24. package/dist/commands/arena-submit.js.map +1 -1
  25. package/dist/commands/compile.d.ts.map +1 -1
  26. package/dist/commands/compile.js +9 -3
  27. package/dist/commands/compile.js.map +1 -1
  28. package/dist/commands/init.d.ts.map +1 -1
  29. package/dist/commands/init.js +13 -3
  30. package/dist/commands/init.js.map +1 -1
  31. package/dist/commands/login.d.ts.map +1 -1
  32. package/dist/commands/login.js +23 -16
  33. package/dist/commands/login.js.map +1 -1
  34. package/dist/commands/network.js +4 -4
  35. package/dist/commands/network.js.map +1 -1
  36. package/dist/commands/publish.d.ts.map +1 -1
  37. package/dist/commands/publish.js +162 -44
  38. package/dist/commands/publish.js.map +1 -1
  39. package/dist/commands/test.d.ts.map +1 -1
  40. package/dist/commands/test.js +209 -23
  41. package/dist/commands/test.js.map +1 -1
  42. package/dist/commands/wrap.d.ts.map +1 -1
  43. package/dist/commands/wrap.js +17 -1
  44. package/dist/commands/wrap.js.map +1 -1
  45. package/dist/index.js +0 -0
  46. package/dist/runtime/network-gateway.d.ts +53 -0
  47. package/dist/runtime/network-gateway.d.ts.map +1 -0
  48. package/dist/runtime/network-gateway.js +147 -0
  49. package/dist/runtime/network-gateway.js.map +1 -0
  50. package/dist/utils/binding.d.ts +25 -0
  51. package/dist/utils/binding.d.ts.map +1 -1
  52. package/dist/utils/binding.js.map +1 -1
  53. package/dist/utils/open-browser.d.ts +10 -0
  54. package/dist/utils/open-browser.d.ts.map +1 -0
  55. package/dist/utils/open-browser.js +23 -0
  56. package/dist/utils/open-browser.js.map +1 -0
  57. package/genes/academic-writer/.cloud-manifest.json +6 -0
  58. package/genes/academic-writer/.gene-manifest.json +8 -0
  59. package/genes/academic-writer/SKILL.md +274 -0
  60. package/genes/academic-writer/phenotype.json +28 -0
  61. package/genes/ai-components/.cloud-manifest.json +6 -0
  62. package/genes/ai-components/.gene-manifest.json +8 -0
  63. package/genes/ai-components/SKILL.md +381 -0
  64. package/genes/ai-components/phenotype.json +28 -0
  65. package/genes/algorithmic-art/.cloud-manifest.json +6 -0
  66. package/genes/algorithmic-art/.gene-manifest.json +8 -0
  67. package/genes/algorithmic-art/SKILL.md +405 -0
  68. package/genes/algorithmic-art/phenotype.json +28 -0
  69. package/genes/answer-synthesizer/.cloud-manifest.json +6 -0
  70. package/genes/answer-synthesizer/index.ts +194 -0
  71. package/genes/answer-synthesizer/phenotype.json +61 -0
  72. package/genes/api-designer/.cloud-manifest.json +6 -0
  73. package/genes/api-designer/.gene-manifest.json +8 -0
  74. package/genes/api-designer/SKILL.md +456 -0
  75. package/genes/api-designer/phenotype.json +28 -0
  76. package/genes/auto-coder/.cloud-manifest.json +6 -0
  77. package/genes/auto-coder/.gene-manifest.json +8 -0
  78. package/genes/auto-coder/SKILL.md +400 -0
  79. package/genes/auto-coder/phenotype.json +28 -0
  80. package/genes/auto-writer/.cloud-manifest.json +6 -0
  81. package/genes/auto-writer/.gene-manifest.json +8 -0
  82. package/genes/auto-writer/SKILL.md +361 -0
  83. package/genes/auto-writer/phenotype.json +28 -0
  84. package/genes/brand-personality/.cloud-manifest.json +6 -0
  85. package/genes/brand-personality/.gene-manifest.json +8 -0
  86. package/genes/brand-personality/SKILL.md +549 -0
  87. package/genes/brand-personality/phenotype.json +28 -0
  88. package/genes/business-writer/.cloud-manifest.json +6 -0
  89. package/genes/business-writer/.gene-manifest.json +8 -0
  90. package/genes/business-writer/SKILL.md +448 -0
  91. package/genes/business-writer/phenotype.json +28 -0
  92. package/genes/citation-manager/.cloud-manifest.json +6 -0
  93. package/genes/citation-manager/.gene-manifest.json +8 -0
  94. package/genes/citation-manager/SKILL.md +279 -0
  95. package/genes/citation-manager/index.ts +162 -0
  96. package/genes/citation-manager/package.json +1 -0
  97. package/genes/citation-manager/phenotype.json +50 -0
  98. package/genes/code-complexity/.cloud-manifest.json +6 -0
  99. package/genes/code-complexity/README.md +35 -0
  100. package/genes/code-complexity/index.ts +101 -0
  101. package/genes/code-complexity/phenotype.json +34 -0
  102. package/genes/copywriter/.cloud-manifest.json +6 -0
  103. package/genes/copywriter/.gene-manifest.json +8 -0
  104. package/genes/copywriter/SKILL.md +329 -0
  105. package/genes/copywriter/phenotype.json +28 -0
  106. package/genes/creative-writer/.cloud-manifest.json +6 -0
  107. package/genes/creative-writer/.gene-manifest.json +8 -0
  108. package/genes/creative-writer/SKILL.md +356 -0
  109. package/genes/creative-writer/phenotype.json +28 -0
  110. package/genes/data-modeler/.cloud-manifest.json +6 -0
  111. package/genes/data-modeler/.gene-manifest.json +8 -0
  112. package/genes/data-modeler/SKILL.md +486 -0
  113. package/genes/data-modeler/phenotype.json +28 -0
  114. package/genes/debugger/.cloud-manifest.json +6 -0
  115. package/genes/debugger/.gene-manifest.json +8 -0
  116. package/genes/debugger/SKILL.md +416 -0
  117. package/genes/debugger/phenotype.json +28 -0
  118. package/genes/design-tokens/.cloud-manifest.json +6 -0
  119. package/genes/design-tokens/.gene-manifest.json +8 -0
  120. package/genes/design-tokens/SKILL.md +222 -0
  121. package/genes/design-tokens/index.ts +128 -0
  122. package/genes/design-tokens/package.json +1 -0
  123. package/genes/design-tokens/phenotype.json +1 -0
  124. package/genes/devops-automator/.cloud-manifest.json +6 -0
  125. package/genes/devops-automator/.gene-manifest.json +8 -0
  126. package/genes/devops-automator/SKILL.md +490 -0
  127. package/genes/devops-automator/phenotype.json +28 -0
  128. package/genes/doc-coauthoring/.cloud-manifest.json +6 -0
  129. package/genes/doc-coauthoring/.gene-manifest.json +8 -0
  130. package/genes/doc-coauthoring/SKILL.md +375 -0
  131. package/genes/doc-coauthoring/phenotype.json +28 -0
  132. package/genes/doc-retrieval/.cloud-manifest.json +6 -0
  133. package/genes/doc-retrieval/index.ts +134 -0
  134. package/genes/doc-retrieval/phenotype.json +54 -0
  135. package/genes/docs-writer/.cloud-manifest.json +6 -0
  136. package/genes/docs-writer/.gene-manifest.json +8 -0
  137. package/genes/docs-writer/SKILL.md +492 -0
  138. package/genes/docs-writer/phenotype.json +28 -0
  139. package/genes/evolve-life/.cloud-manifest.json +6 -0
  140. package/genes/evolve-life/.compile-result.json +12 -0
  141. package/genes/evolve-life/README.md +52 -0
  142. package/genes/evolve-life/gene.ir.wasm +0 -0
  143. package/genes/evolve-life/gene.wasm +0 -0
  144. package/genes/evolve-life/index.ts +255 -0
  145. package/genes/evolve-life/phenotype.json +129 -0
  146. package/genes/evolve-life-bitwise/.cloud-manifest.json +6 -0
  147. package/genes/evolve-life-bitwise/.compile-result.json +12 -0
  148. package/genes/evolve-life-bitwise/gene.ir.wasm +0 -0
  149. package/genes/evolve-life-bitwise/gene.wasm +0 -0
  150. package/genes/evolve-life-bitwise/index.ts +273 -0
  151. package/genes/evolve-life-bitwise/phenotype.json +129 -0
  152. package/genes/evolve-life-sparse/.cloud-manifest.json +6 -0
  153. package/genes/evolve-life-sparse/.compile-result.json +12 -0
  154. package/genes/evolve-life-sparse/gene.ir.wasm +0 -0
  155. package/genes/evolve-life-sparse/gene.wasm +0 -0
  156. package/genes/evolve-life-sparse/index.ts +236 -0
  157. package/genes/evolve-life-sparse/phenotype.json +129 -0
  158. package/genes/fact-checker/.cloud-manifest.json +6 -0
  159. package/genes/fact-checker/.gene-manifest.json +8 -0
  160. package/genes/fact-checker/SKILL.md +373 -0
  161. package/genes/fact-checker/phenotype.json +28 -0
  162. package/genes/genesis-code-format/.cloud-manifest.json +6 -0
  163. package/genes/genesis-code-format/package.json +1 -0
  164. package/genes/genesis-code-format/phenotype.json +1 -0
  165. package/genes/genesis-file-read/.cloud-manifest.json +6 -0
  166. package/genes/genesis-file-read/index.ts +11 -1
  167. package/genes/genesis-file-read/package.json +1 -0
  168. package/genes/genesis-file-read/phenotype.json +1 -0
  169. package/genes/genesis-l0-constraint/.cloud-manifest.json +6 -0
  170. package/genes/genesis-l0-constraint/package.json +1 -0
  171. package/genes/genesis-l0-constraint/phenotype.json +1 -0
  172. package/genes/genesis-web-search/.cloud-manifest.json +2 -2
  173. package/genes/genesis-web-search/package.json +1 -0
  174. package/genes/genesis-web-search/phenotype.json +1 -0
  175. package/genes/genesis-web-search-lite/.cloud-manifest.json +6 -0
  176. package/genes/genesis-web-search-lite/package.json +1 -0
  177. package/genes/genesis-web-search-lite/phenotype.json +1 -0
  178. package/genes/git-workflow/.cloud-manifest.json +6 -0
  179. package/genes/git-workflow/.gene-manifest.json +8 -0
  180. package/genes/git-workflow/SKILL.md +407 -0
  181. package/genes/git-workflow/phenotype.json +28 -0
  182. package/genes/grammar-checker/.cloud-manifest.json +6 -0
  183. package/genes/grammar-checker/.gene-manifest.json +8 -0
  184. package/genes/grammar-checker/SKILL.md +194 -0
  185. package/genes/grammar-checker/index.ts +168 -0
  186. package/genes/grammar-checker/package.json +1 -0
  187. package/genes/grammar-checker/phenotype.json +52 -0
  188. package/genes/json-validator/.cloud-manifest.json +6 -0
  189. package/genes/json-validator/README.md +42 -0
  190. package/genes/json-validator/index.ts +112 -0
  191. package/genes/json-validator/phenotype.json +42 -0
  192. package/genes/license-advisor/.cloud-manifest.json +6 -0
  193. package/genes/license-advisor/.gene-manifest.json +8 -0
  194. package/genes/license-advisor/SKILL.md +117 -0
  195. package/genes/license-advisor/phenotype.json +28 -0
  196. package/genes/logic-architect/.cloud-manifest.json +6 -0
  197. package/genes/logic-architect/.gene-manifest.json +8 -0
  198. package/genes/logic-architect/SKILL.md +451 -0
  199. package/genes/logic-architect/phenotype.json +28 -0
  200. package/genes/markdown-formatter/.cloud-manifest.json +6 -0
  201. package/genes/markdown-formatter/README.md +34 -0
  202. package/genes/markdown-formatter/index.ts +86 -0
  203. package/genes/markdown-formatter/phenotype.json +32 -0
  204. package/genes/orch/.cloud-manifest.json +6 -0
  205. package/genes/orch/.gene-manifest.json +8 -0
  206. package/genes/orch/SKILL.md +504 -0
  207. package/genes/orch/phenotype.json +28 -0
  208. package/genes/particle-barneshut/.cloud-manifest.json +6 -0
  209. package/genes/particle-barneshut/.compile-result.json +12 -0
  210. package/genes/particle-barneshut/README.md +55 -0
  211. package/genes/particle-barneshut/gene.ir.wasm +0 -0
  212. package/genes/particle-barneshut/gene.wasm +0 -0
  213. package/genes/particle-barneshut/index.ts +486 -0
  214. package/genes/particle-barneshut/phenotype.json +137 -0
  215. package/genes/particle-brute/.cloud-manifest.json +6 -0
  216. package/genes/particle-brute/.compile-result.json +12 -0
  217. package/genes/particle-brute/README.md +55 -0
  218. package/genes/particle-brute/gene.ir.wasm +0 -0
  219. package/genes/particle-brute/gene.wasm +0 -0
  220. package/genes/particle-brute/index.ts +277 -0
  221. package/genes/particle-brute/phenotype.json +137 -0
  222. package/genes/particle-spatial/.cloud-manifest.json +6 -0
  223. package/genes/particle-spatial/.compile-result.json +12 -0
  224. package/genes/particle-spatial/README.md +53 -0
  225. package/genes/particle-spatial/gene.ir.wasm +0 -0
  226. package/genes/particle-spatial/gene.wasm +0 -0
  227. package/genes/particle-spatial/index.ts +352 -0
  228. package/genes/particle-spatial/phenotype.json +137 -0
  229. package/genes/performance-optimizer/.cloud-manifest.json +6 -0
  230. package/genes/performance-optimizer/.gene-manifest.json +8 -0
  231. package/genes/performance-optimizer/SKILL.md +480 -0
  232. package/genes/performance-optimizer/phenotype.json +28 -0
  233. package/genes/plagiarism-checker/.cloud-manifest.json +6 -0
  234. package/genes/plagiarism-checker/.gene-manifest.json +8 -0
  235. package/genes/plagiarism-checker/SKILL.md +342 -0
  236. package/genes/plagiarism-checker/phenotype.json +28 -0
  237. package/genes/product-manager/.cloud-manifest.json +6 -0
  238. package/genes/product-manager/.gene-manifest.json +8 -0
  239. package/genes/product-manager/SKILL.md +249 -0
  240. package/genes/product-manager/phenotype.json +28 -0
  241. package/genes/project-reviewer/.cloud-manifest.json +6 -0
  242. package/genes/project-reviewer/.gene-manifest.json +8 -0
  243. package/genes/project-reviewer/SKILL.md +312 -0
  244. package/genes/project-reviewer/phenotype.json +28 -0
  245. package/genes/prompt-engineer/.cloud-manifest.json +6 -0
  246. package/genes/prompt-engineer/.gene-manifest.json +8 -0
  247. package/genes/prompt-engineer/SKILL.md +411 -0
  248. package/genes/prompt-engineer/phenotype.json +28 -0
  249. package/genes/readability-analyzer/.cloud-manifest.json +6 -0
  250. package/genes/readability-analyzer/.gene-manifest.json +8 -0
  251. package/genes/readability-analyzer/SKILL.md +357 -0
  252. package/genes/readability-analyzer/index.ts +123 -0
  253. package/genes/readability-analyzer/package.json +1 -0
  254. package/genes/readability-analyzer/phenotype.json +35 -0
  255. package/genes/rotifer-protocol/SKILL.md +121 -0
  256. package/genes/security-auditor/.cloud-manifest.json +6 -0
  257. package/genes/security-auditor/.gene-manifest.json +8 -0
  258. package/genes/security-auditor/SKILL.md +494 -0
  259. package/genes/security-auditor/phenotype.json +28 -0
  260. package/genes/seo-optimizer/.cloud-manifest.json +6 -0
  261. package/genes/seo-optimizer/.gene-manifest.json +8 -0
  262. package/genes/seo-optimizer/SKILL.md +327 -0
  263. package/genes/seo-optimizer/index.ts +206 -0
  264. package/genes/seo-optimizer/package.json +1 -0
  265. package/genes/seo-optimizer/phenotype.json +1 -0
  266. package/genes/source-linker/.cloud-manifest.json +6 -0
  267. package/genes/source-linker/index.ts +88 -0
  268. package/genes/source-linker/phenotype.json +45 -0
  269. package/genes/style-optimizer/.cloud-manifest.json +6 -0
  270. package/genes/style-optimizer/.gene-manifest.json +8 -0
  271. package/genes/style-optimizer/SKILL.md +285 -0
  272. package/genes/style-optimizer/phenotype.json +28 -0
  273. package/genes/tech-lead/.cloud-manifest.json +6 -0
  274. package/genes/tech-lead/.gene-manifest.json +8 -0
  275. package/genes/tech-lead/SKILL.md +451 -0
  276. package/genes/tech-lead/phenotype.json +28 -0
  277. package/genes/test-wrap/.cloud-manifest.json +6 -0
  278. package/genes/test-wrap/.gene-manifest.json +8 -0
  279. package/genes/test-wrap/phenotype.json +28 -0
  280. package/genes/testing-strategist/.cloud-manifest.json +6 -0
  281. package/genes/testing-strategist/.gene-manifest.json +8 -0
  282. package/genes/testing-strategist/SKILL.md +500 -0
  283. package/genes/testing-strategist/phenotype.json +28 -0
  284. package/genes/text-summarizer/.cloud-manifest.json +6 -0
  285. package/genes/text-summarizer/README.md +34 -0
  286. package/genes/text-summarizer/index.ts +122 -0
  287. package/genes/text-summarizer/phenotype.json +32 -0
  288. package/genes/tone-analyzer/.cloud-manifest.json +6 -0
  289. package/genes/tone-analyzer/.gene-manifest.json +8 -0
  290. package/genes/tone-analyzer/SKILL.md +410 -0
  291. package/genes/tone-analyzer/phenotype.json +28 -0
  292. package/genes/translator/.cloud-manifest.json +6 -0
  293. package/genes/translator/.gene-manifest.json +8 -0
  294. package/genes/translator/SKILL.md +355 -0
  295. package/genes/translator/phenotype.json +28 -0
  296. package/genes/ui-components/.cloud-manifest.json +6 -0
  297. package/genes/ui-components/.gene-manifest.json +8 -0
  298. package/genes/ui-components/SKILL.md +467 -0
  299. package/genes/ui-components/phenotype.json +28 -0
  300. package/genes/uiux-designer/.cloud-manifest.json +6 -0
  301. package/genes/uiux-designer/.gene-manifest.json +8 -0
  302. package/genes/uiux-designer/SKILL.md +353 -0
  303. package/genes/uiux-designer/phenotype.json +28 -0
  304. package/genes/url-extractor/.cloud-manifest.json +6 -0
  305. package/genes/url-extractor/README.md +37 -0
  306. package/genes/url-extractor/index.ts +86 -0
  307. package/genes/url-extractor/phenotype.json +48 -0
  308. package/genes/ux-patterns/.cloud-manifest.json +6 -0
  309. package/genes/ux-patterns/.gene-manifest.json +8 -0
  310. package/genes/ux-patterns/SKILL.md +872 -0
  311. package/genes/ux-patterns/phenotype.json +28 -0
  312. package/genes/web3-components/.cloud-manifest.json +6 -0
  313. package/genes/web3-components/.gene-manifest.json +8 -0
  314. package/genes/web3-components/SKILL.md +390 -0
  315. package/genes/web3-components/phenotype.json +28 -0
  316. package/package.json +6 -5
@@ -0,0 +1,467 @@
1
+ ---
2
+ name: ui-components
3
+ description: 参数化UI组件库,根据风格参数动态生成按钮、输入框、卡片等组件样式。当用户提到"按钮""输入框""卡片""表格""弹窗""导航"等组件时使用。
4
+ ---
5
+
6
+ # UI Components (参数化组件库)
7
+
8
+ **定位**: 根据风格参数动态生成组件样式,而非从固定变体中选择。
9
+
10
+ **依赖**:
11
+ - [brand-personality](../brand-personality/SKILL.md) - 提供风格维度参数
12
+ - [design-tokens](../design-tokens/SKILL.md) - 提供CSS变量
13
+ - [ux-patterns](../ux-patterns/SKILL.md) - 提供文案和动效参数
14
+
15
+ ---
16
+
17
+ ## 参数化组件生成
18
+
19
+ ### 核心思路
20
+
21
+ ```
22
+ 输入: 风格参数 (borderRadius, motionIntensity, contrast, colors...)
23
+
24
+ 处理: 参数映射函数
25
+
26
+ 输出: 组件CSS类/样式
27
+ ```
28
+
29
+ ### 参数到样式的映射
30
+
31
+ ```typescript
32
+ interface StyleParams {
33
+ borderRadius: number; // 0-100 → 圆角
34
+ motionIntensity: number; // 0-100 → 动效
35
+ contrast: number; // 0-100 → 阴影/边框强度
36
+ density: number; // 0-100 → 间距
37
+ colors: {
38
+ primary: string;
39
+ secondary?: string;
40
+ };
41
+ }
42
+
43
+ function generateButtonStyles(params: StyleParams) {
44
+ const radius = Math.round(params.borderRadius * 0.32); // 0-32px
45
+ const duration = 80 + params.motionIntensity * 4.2;
46
+ const shadowOpacity = 0.05 + params.contrast * 0.002;
47
+ const padding = params.density > 50 ? 'px-6 py-3' : 'px-4 py-2.5';
48
+
49
+ return {
50
+ base: `
51
+ ${padding}
52
+ bg-[${params.colors.primary}] text-white
53
+ text-sm font-medium
54
+ rounded-[${radius}px]
55
+ transition-all duration-[${Math.round(duration)}ms]
56
+ `,
57
+ hover: params.contrast > 50
58
+ ? `hover:shadow-lg hover:-translate-y-0.5`
59
+ : `hover:brightness-110`,
60
+ active: params.motionIntensity > 60
61
+ ? `active:scale-95`
62
+ : `active:brightness-95`
63
+ };
64
+ }
65
+ ```
66
+
67
+ ---
68
+
69
+ ## 按钮 (Button)
70
+
71
+ ### 参数化生成
72
+
73
+ ```typescript
74
+ function Button({ params, children }: { params: StyleParams; children: React.ReactNode }) {
75
+ const radius = Math.round(params.borderRadius * 0.32);
76
+ const duration = 80 + params.motionIntensity * 4.2;
77
+
78
+ // 根据参数决定样式特性
79
+ const useGradient = params.contrast > 70;
80
+ const useShadow = params.contrast > 40;
81
+ const useScale = params.motionIntensity > 50;
82
+
83
+ return (
84
+ <button
85
+ className={`
86
+ px-${params.density > 50 ? 6 : 4} py-${params.density > 50 ? 3 : 2.5}
87
+ text-sm font-medium text-white
88
+ rounded-[${radius}px]
89
+ transition-all duration-[${Math.round(duration)}ms]
90
+ ${useGradient
91
+ ? 'bg-gradient-to-r from-[var(--color-primary)] to-[var(--color-secondary)]'
92
+ : 'bg-[var(--color-primary)]'}
93
+ ${useShadow ? 'shadow-md hover:shadow-lg' : ''}
94
+ ${useScale ? 'hover:scale-[1.02] active:scale-95' : 'hover:brightness-110'}
95
+ `}
96
+ >
97
+ {children}
98
+ </button>
99
+ );
100
+ }
101
+ ```
102
+
103
+ ### 参数效果对照
104
+
105
+ | 参数组合 | 效果 |
106
+ |---------|------|
107
+ | borderRadius: 15, motionIntensity: 15 | 小圆角,快速过渡,无缩放 |
108
+ | borderRadius: 70, motionIntensity: 55 | 大圆角,中等过渡,轻微缩放 |
109
+ | borderRadius: 85, motionIntensity: 80, contrast: 80 | 药丸形,弹性动效,渐变+阴影 |
110
+
111
+ ### 示例输出
112
+
113
+ ```html
114
+ <!-- borderRadius: 20, motionIntensity: 30, contrast: 40 -->
115
+ <button class="px-4 py-2.5 bg-[var(--color-primary)] text-white text-sm font-medium
116
+ rounded-[6px] transition-all duration-[206ms]
117
+ hover:brightness-110">
118
+ 提交
119
+ </button>
120
+
121
+ <!-- borderRadius: 70, motionIntensity: 60, contrast: 60 -->
122
+ <button class="px-6 py-3 bg-[var(--color-primary)] text-white text-sm font-medium
123
+ rounded-[22px] shadow-md transition-all duration-[332ms]
124
+ hover:shadow-lg hover:scale-[1.02] active:scale-95">
125
+ 开始使用
126
+ </button>
127
+
128
+ <!-- borderRadius: 90, motionIntensity: 85, contrast: 80 -->
129
+ <button class="px-6 py-3 text-white text-sm font-semibold
130
+ rounded-full shadow-lg
131
+ bg-gradient-to-r from-[var(--color-primary)] to-[var(--color-secondary)]
132
+ transition-all duration-[437ms]
133
+ hover:shadow-xl hover:scale-105 active:scale-95">
134
+ Let's Go!
135
+ </button>
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 卡片 (Card)
141
+
142
+ ### 参数化生成
143
+
144
+ ```typescript
145
+ function generateCardStyles(params: StyleParams) {
146
+ const radius = Math.round(params.borderRadius * 0.32) + 4; // 卡片圆角稍大
147
+ const padding = 16 + params.density * 0.16; // 16-32px
148
+ const duration = 80 + params.motionIntensity * 4.2;
149
+
150
+ // 边框 vs 阴影
151
+ const useShadow = params.contrast > 50;
152
+ const borderStyle = useShadow
153
+ ? 'border-transparent shadow-md'
154
+ : 'border border-gray-100';
155
+
156
+ // 悬停效果
157
+ const hoverEffect = params.motionIntensity > 40
158
+ ? 'hover:shadow-lg hover:-translate-y-1'
159
+ : 'hover:border-gray-200';
160
+
161
+ return {
162
+ container: `
163
+ bg-white rounded-[${radius}px] p-[${Math.round(padding)}px]
164
+ ${borderStyle}
165
+ transition-all duration-[${Math.round(duration)}ms]
166
+ ${hoverEffect}
167
+ `,
168
+ title: `text-lg font-semibold text-gray-900 mb-2`,
169
+ description: `text-sm text-gray-500 leading-relaxed`
170
+ };
171
+ }
172
+ ```
173
+
174
+ ### 示例输出
175
+
176
+ ```html
177
+ <!-- 低参数: borderRadius: 25, contrast: 35 -->
178
+ <div class="bg-white rounded-[12px] p-5 border border-gray-100
179
+ transition-all duration-[185ms]
180
+ hover:border-gray-200">
181
+ <h3 class="text-lg font-semibold text-gray-900 mb-2">标题</h3>
182
+ <p class="text-sm text-gray-500">描述内容</p>
183
+ </div>
184
+
185
+ <!-- 高参数: borderRadius: 75, contrast: 65, motionIntensity: 60 -->
186
+ <div class="bg-white rounded-[28px] p-7 shadow-md
187
+ transition-all duration-[332ms]
188
+ hover:shadow-lg hover:-translate-y-1">
189
+ <h3 class="text-lg font-semibold text-gray-900 mb-2">温暖标题</h3>
190
+ <p class="text-sm text-gray-500 leading-relaxed">温暖的描述文字</p>
191
+ </div>
192
+ ```
193
+
194
+ ---
195
+
196
+ ## 输入框 (Input)
197
+
198
+ ### 参数化生成
199
+
200
+ ```typescript
201
+ function generateInputStyles(params: StyleParams) {
202
+ const radius = Math.round(params.borderRadius * 0.28); // 输入框圆角稍小
203
+ const duration = 80 + params.motionIntensity * 4.2;
204
+
205
+ // 背景样式
206
+ const bgStyle = params.contrast < 40
207
+ ? 'bg-transparent border-b border-gray-300' // 下划线风格
208
+ : 'bg-gray-50 border border-gray-200'; // 常规风格
209
+
210
+ return `
211
+ w-full px-4 py-2.5 text-sm text-gray-900
212
+ ${bgStyle}
213
+ rounded-[${radius}px]
214
+ placeholder-gray-400
215
+ transition-all duration-[${Math.round(duration)}ms]
216
+ focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]/20
217
+ focus:border-[var(--color-primary)]
218
+ `;
219
+ }
220
+ ```
221
+
222
+ ### 示例输出
223
+
224
+ ```html
225
+ <!-- 低对比度/极简: borderRadius: 10, contrast: 25 -->
226
+ <input class="w-full px-4 py-2.5 text-sm text-gray-900
227
+ bg-transparent border-b border-gray-300
228
+ rounded-[3px] placeholder-gray-400
229
+ transition-all duration-[122ms]
230
+ focus:outline-none focus:border-[var(--color-primary)]"
231
+ placeholder="请输入...">
232
+
233
+ <!-- 高参数: borderRadius: 65, contrast: 55 -->
234
+ <input class="w-full px-4 py-2.5 text-sm text-gray-900
235
+ bg-gray-50 border border-gray-200
236
+ rounded-[18px] placeholder-gray-400
237
+ transition-all duration-[311ms]
238
+ focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]/20
239
+ focus:border-[var(--color-primary)]"
240
+ placeholder="请输入...">
241
+ ```
242
+
243
+ ---
244
+
245
+ ## 弹窗 (Modal)
246
+
247
+ ### 参数化生成
248
+
249
+ ```typescript
250
+ function generateModalStyles(params: StyleParams) {
251
+ const radius = Math.round(params.borderRadius * 0.32) + 8; // 弹窗圆角更大
252
+ const duration = 80 + params.motionIntensity * 4.2;
253
+ const padding = 20 + params.density * 0.12;
254
+
255
+ // 入场动画
256
+ const animation = params.motionIntensity > 60
257
+ ? 'animate-pop-in' // 弹性缩放
258
+ : 'animate-fade-in'; // 简单淡入
259
+
260
+ return {
261
+ overlay: `fixed inset-0 bg-black/30 backdrop-blur-sm z-40`,
262
+ container: `
263
+ fixed inset-0 flex items-center justify-center z-50 p-4
264
+ `,
265
+ content: `
266
+ bg-white rounded-[${radius}px] shadow-xl w-full max-w-md
267
+ ${animation}
268
+ `,
269
+ header: `px-${Math.round(padding / 4)} py-4 border-b border-gray-100`,
270
+ body: `px-${Math.round(padding / 4)} py-4`,
271
+ footer: `px-${Math.round(padding / 4)} py-4 bg-gray-50 flex justify-end gap-3
272
+ rounded-b-[${radius}px]`
273
+ };
274
+ }
275
+ ```
276
+
277
+ ---
278
+
279
+ ## 导航 (Navigation)
280
+
281
+ ### 侧边栏参数化
282
+
283
+ ```typescript
284
+ function generateSidebarStyles(params: StyleParams) {
285
+ const itemRadius = Math.round(params.borderRadius * 0.24);
286
+ const duration = 80 + params.motionIntensity * 4.2;
287
+
288
+ return {
289
+ container: `w-64 h-screen bg-white border-r border-gray-100 p-4`,
290
+ navItem: `
291
+ flex items-center gap-3 px-3 py-2.5
292
+ text-gray-600 text-sm
293
+ rounded-[${itemRadius}px]
294
+ transition-colors duration-[${Math.round(duration)}ms]
295
+ hover:bg-gray-50
296
+ `,
297
+ navItemActive: `
298
+ flex items-center gap-3 px-3 py-2.5
299
+ text-[var(--color-primary)] font-medium text-sm
300
+ rounded-[${itemRadius}px]
301
+ bg-[var(--color-primary)]/5
302
+ `
303
+ };
304
+ }
305
+ ```
306
+
307
+ ---
308
+
309
+ ## 表格 (Table)
310
+
311
+ ### 参数化生成
312
+
313
+ ```typescript
314
+ function generateTableStyles(params: StyleParams) {
315
+ const containerRadius = Math.round(params.borderRadius * 0.32);
316
+ const duration = 80 + params.motionIntensity * 4.2;
317
+
318
+ return {
319
+ container: `bg-white rounded-[${containerRadius}px] border border-gray-100 overflow-hidden`,
320
+ header: `bg-gray-50 border-b border-gray-100`,
321
+ headerCell: `px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider`,
322
+ body: `divide-y divide-gray-50`,
323
+ row: `hover:bg-gray-50 transition-colors duration-[${Math.round(duration * 0.5)}ms]`,
324
+ cell: `px-6 py-4 text-sm text-gray-900`
325
+ };
326
+ }
327
+ ```
328
+
329
+ ---
330
+
331
+ ## 反馈组件
332
+
333
+ ### Toast 参数化
334
+
335
+ ```typescript
336
+ function generateToastStyles(params: StyleParams) {
337
+ const radius = Math.round(params.borderRadius * 0.28);
338
+ const duration = 80 + params.motionIntensity * 4.2;
339
+
340
+ // 入场动画
341
+ const animation = params.motionIntensity > 50
342
+ ? 'animate-slide-up'
343
+ : 'animate-fade-in';
344
+
345
+ return `
346
+ flex items-center gap-3 px-4 py-3
347
+ bg-white border border-gray-100
348
+ rounded-[${radius}px] shadow-lg
349
+ ${animation}
350
+ `;
351
+ }
352
+ ```
353
+
354
+ ### 空状态参数化
355
+
356
+ ```typescript
357
+ function generateEmptyStateStyles(params: StyleParams, emotionalTone: number) {
358
+ // 根据 emotionalTone 决定是否使用 emoji/插画
359
+ const useEmoji = emotionalTone >= 60;
360
+ const iconSize = emotionalTone > 70 ? 'text-6xl' : 'text-4xl';
361
+
362
+ return {
363
+ container: `py-16 text-center`,
364
+ icon: useEmoji ? iconSize : 'w-16 h-16 text-gray-300',
365
+ title: `text-lg font-medium text-gray-900 mb-2`,
366
+ description: `text-sm text-gray-500 mb-6`,
367
+ action: `px-4 py-2 bg-[var(--color-primary)] text-white rounded-[var(--radius-md)]`
368
+ };
369
+ }
370
+ ```
371
+
372
+ ---
373
+
374
+ ## 预设快捷入口
375
+
376
+ 预设只是预定义的参数组合:
377
+
378
+ ```typescript
379
+ const COMPONENT_PRESETS = {
380
+ minimal: {
381
+ borderRadius: 15, motionIntensity: 15, contrast: 35, density: 40
382
+ },
383
+ warm: {
384
+ borderRadius: 70, motionIntensity: 55, contrast: 45, density: 65
385
+ },
386
+ playful: {
387
+ borderRadius: 85, motionIntensity: 80, contrast: 70, density: 55
388
+ },
389
+ professional: {
390
+ borderRadius: 25, motionIntensity: 35, contrast: 55, density: 45
391
+ },
392
+ bold: {
393
+ borderRadius: 50, motionIntensity: 90, contrast: 95, density: 50
394
+ }
395
+ };
396
+
397
+ // 使用预设
398
+ const warmButton = generateButtonStyles({
399
+ ...COMPONENT_PRESETS.warm,
400
+ colors: { primary: '#E07A5F' }
401
+ });
402
+ ```
403
+
404
+ ---
405
+
406
+ ## 人性化细节
407
+
408
+ ### 有机形状(高 borderRadius + 微调)
409
+
410
+ ```css
411
+ /* 当 borderRadius > 70 时,可选择性使用不对称圆角 */
412
+ .organic-card {
413
+ border-radius: 24px 20px 28px 22px;
414
+ }
415
+
416
+ /* 或微妙倾斜 */
417
+ .playful-tilt {
418
+ transform: rotate(-0.5deg);
419
+ }
420
+ .playful-tilt:hover {
421
+ transform: rotate(0.5deg);
422
+ }
423
+ ```
424
+
425
+ ### 渐变与光效(高 contrast)
426
+
427
+ ```html
428
+ <!-- contrast > 70 时可使用 -->
429
+ <div class="relative overflow-hidden">
430
+ <div class="absolute -top-40 -right-40 w-80 h-80
431
+ bg-[var(--color-primary)]/10 rounded-full blur-3xl"></div>
432
+ <!-- 内容 -->
433
+ </div>
434
+ ```
435
+
436
+ ---
437
+
438
+ ## 使用工作流
439
+
440
+ ```typescript
441
+ // 1. 获取风格参数
442
+ const params = getStyleParams(); // 从 brand-personality 获取
443
+
444
+ // 2. 生成组件样式
445
+ const buttonStyles = generateButtonStyles(params);
446
+ const cardStyles = generateCardStyles(params);
447
+ const inputStyles = generateInputStyles(params);
448
+
449
+ // 3. 应用到组件
450
+ <button className={buttonStyles.base + buttonStyles.hover}>
451
+ 提交
452
+ </button>
453
+
454
+ <div className={cardStyles.container}>
455
+ <h3 className={cardStyles.title}>标题</h3>
456
+ <p className={cardStyles.description}>描述</p>
457
+ </div>
458
+ ```
459
+
460
+ ---
461
+
462
+ ## 相关技能
463
+
464
+ - **brand-personality**: 提供风格维度参数
465
+ - **design-tokens**: 提供CSS变量(圆角、颜色、动效)
466
+ - **ux-patterns**: 提供文案和动效参数
467
+ - **uiux-designer**: 统一调度入口
@@ -0,0 +1,28 @@
1
+ {
2
+ "domain": "ui.components",
3
+ "description": "Parameterized UI component library. Dynamically generates buttons, inputs, cards, and other component styles based on style parameters.",
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": 1771939271216,
25
+ "fidelity": "Wrapped",
26
+ "transparency": "Open",
27
+ "source": "skill"
28
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "cloud_id": "0bd85932-8e6f-4046-b635-d85dbaf2f99c",
3
+ "owner": "Rotifer Protocol",
4
+ "version": "0.1.0",
5
+ "published_at": "2026-03-17T14:13:57.223Z"
6
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "geneId": "d6813c93b50fe48ae1b43f6aa731c61cf604f79906c1a521b070938383893b61",
3
+ "name": "uiux-designer",
4
+ "domain": "ui.design",
5
+ "fidelity": "Wrapped",
6
+ "wrappedAt": "2026-02-24T13:23:04.427Z",
7
+ "fromSkill": "../.cursor/skills/uiux-designer/SKILL.md"
8
+ }