@bovinphang/frontend-craft 2.7.0 → 2.8.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 (380) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +34 -0
  4. package/CHANGELOG.zh-CN.md +34 -0
  5. package/README.md +1 -1
  6. package/README.openclaw.md +99 -43
  7. package/README.openclaw.zh-CN.md +99 -43
  8. package/README.zh-CN.md +1 -1
  9. package/agents/fec-architect.md +70 -70
  10. package/agents/fec-code-reviewer.md +82 -82
  11. package/agents/fec-debugger.md +20 -20
  12. package/agents/fec-design-token-mapper.md +36 -36
  13. package/agents/fec-doc-updater.md +13 -13
  14. package/agents/fec-e2e-runner.md +45 -45
  15. package/agents/fec-figma-implementer.md +59 -59
  16. package/agents/fec-performance-optimizer.md +128 -128
  17. package/agents/fec-refactor-cleaner.md +14 -14
  18. package/agents/fec-security-reviewer.md +66 -67
  19. package/agents/fec-test-planner.md +27 -27
  20. package/agents/fec-typescript-reviewer.md +87 -87
  21. package/agents/fec-ui-checker.md +74 -74
  22. package/commands/fec-debug.md +19 -19
  23. package/commands/fec-doc-sync.md +11 -11
  24. package/commands/fec-init.md +37 -38
  25. package/commands/fec-plan.md +58 -58
  26. package/commands/fec-refactor-clean.md +11 -11
  27. package/commands/fec-review.md +41 -41
  28. package/commands/fec-scaffold.md +41 -41
  29. package/commands/fec-tdd.md +13 -13
  30. package/dist/bin/frontend-craft.js +29 -27
  31. package/docs/example-prompts.md +3 -0
  32. package/docs/ja-JP/README.md +1 -1
  33. package/docs/ko-KR/README.md +1 -1
  34. package/docs/project-structure.md +13 -5
  35. package/docs/zh-CN/example-prompts.md +3 -0
  36. package/docs/zh-CN/project-structure.md +6 -1
  37. package/docs/zh-TW/README.md +1 -1
  38. package/localized/zh-CN/agents/fec-architect.md +125 -0
  39. package/localized/zh-CN/agents/fec-code-reviewer.md +152 -0
  40. package/localized/zh-CN/agents/fec-debugger.md +44 -0
  41. package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
  42. package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
  43. package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
  44. package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
  45. package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
  46. package/localized/zh-CN/agents/fec-refactor-cleaner.md +32 -0
  47. package/localized/zh-CN/agents/fec-security-reviewer.md +116 -0
  48. package/localized/zh-CN/agents/fec-test-planner.md +50 -0
  49. package/localized/zh-CN/agents/fec-typescript-reviewer.md +142 -0
  50. package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
  51. package/localized/zh-CN/commands/fec-debug.md +30 -0
  52. package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
  53. package/localized/zh-CN/commands/fec-init.md +70 -0
  54. package/localized/zh-CN/commands/fec-plan.md +94 -0
  55. package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
  56. package/localized/zh-CN/commands/fec-review.md +66 -0
  57. package/localized/zh-CN/commands/fec-scaffold.md +205 -0
  58. package/localized/zh-CN/commands/fec-tdd.md +21 -0
  59. package/localized/zh-CN/skills/TEMPLATE.md +155 -0
  60. package/localized/zh-CN/skills/eval_queries.json +1013 -0
  61. package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
  62. package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
  63. package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  64. package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
  65. package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
  66. package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
  67. package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
  68. package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
  69. package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
  70. package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
  71. package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
  72. package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  73. package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
  74. package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  75. package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
  76. package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  77. package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  78. package/localized/zh-CN/skills/fec-code-review/SKILL.md +143 -0
  79. package/localized/zh-CN/skills/fec-code-review/references/report-template.md +29 -0
  80. package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
  81. package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
  82. package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
  83. package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
  84. package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
  85. package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
  86. package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  87. package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
  88. package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
  89. package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  90. package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  91. package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  92. package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
  93. package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
  94. package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  95. package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
  96. package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  97. package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
  98. package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  99. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
  100. package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  101. package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  102. package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  103. package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  104. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  105. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  106. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  107. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  108. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  109. package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  110. package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
  111. package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  112. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  113. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  114. package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  115. package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
  116. package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
  117. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  118. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  119. package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  120. package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  121. package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
  122. package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
  123. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +80 -0
  124. package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  125. package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
  126. package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +74 -0
  127. package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  128. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
  129. package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  130. package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  131. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
  132. package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  133. package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
  134. package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  135. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
  136. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  137. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  138. package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  139. package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
  140. package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  141. package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
  142. package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
  143. package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  144. package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
  145. package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  146. package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
  147. package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  148. package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
  149. package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  150. package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
  151. package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
  152. package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  153. package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  154. package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
  155. package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  156. package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  157. package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  158. package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  159. package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +51 -0
  160. package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
  161. package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
  162. package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
  163. package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
  164. package/localized/zh-CN/skills/fec-security-review/SKILL.md +38 -0
  165. package/localized/zh-CN/skills/fec-security-review/references/report-template.md +27 -0
  166. package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
  167. package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
  168. package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
  169. package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
  170. package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
  171. package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  172. package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
  173. package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
  174. package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
  175. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +52 -0
  176. package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
  177. package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
  178. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
  179. package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
  180. package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
  181. package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
  182. package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
  183. package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
  184. package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
  185. package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
  186. package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  187. package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
  188. package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
  189. package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
  190. package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
  191. package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
  192. package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
  193. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
  194. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  195. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
  196. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  197. package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
  198. package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  199. package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  200. package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  201. package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  202. package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  203. package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  204. package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
  205. package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
  206. package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
  207. package/localized/zh-CN/skills/metadata.json +1646 -0
  208. package/localized/zh-CN/skills/relations.json +755 -0
  209. package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
  210. package/localized/zh-CN/templates/claude/settings.json +62 -0
  211. package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
  212. package/localized/zh-CN/templates/codex/config.toml +32 -0
  213. package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
  214. package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  215. package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +54 -0
  216. package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
  217. package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
  218. package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
  219. package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
  220. package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
  221. package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
  222. package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
  223. package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
  224. package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
  225. package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
  226. package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
  227. package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
  228. package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
  229. package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
  230. package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
  231. package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
  232. package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
  233. package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
  234. package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
  235. package/openclaw.plugin.json +1 -1
  236. package/package.json +3 -2
  237. package/skills/TEMPLATE.md +74 -74
  238. package/skills/eval_queries.json +678 -678
  239. package/skills/fec-accessibility-check/SKILL.md +21 -21
  240. package/skills/fec-accessibility-check/references/report-template.md +12 -12
  241. package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
  242. package/skills/fec-alchemy/SKILL.md +50 -50
  243. package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
  244. package/skills/fec-alchemy/assets/intake-template.md +55 -55
  245. package/skills/fec-alchemy/assets/review-checklist.md +23 -23
  246. package/skills/fec-alchemy/references/methodology.md +66 -66
  247. package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
  248. package/skills/fec-api-integration/SKILL.md +61 -61
  249. package/skills/fec-api-integration/references/integration-patterns.md +30 -30
  250. package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
  251. package/skills/fec-browser-storage/SKILL.md +16 -16
  252. package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
  253. package/skills/fec-canvas-threejs/SKILL.md +21 -21
  254. package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
  255. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
  256. package/skills/fec-code-review/SKILL.md +94 -94
  257. package/skills/fec-code-review/references/report-template.md +13 -13
  258. package/skills/fec-component-testing/SKILL.md +39 -39
  259. package/skills/fec-data-fetching/SKILL.md +16 -16
  260. package/skills/fec-data-fetching/references/query-patterns.md +27 -27
  261. package/skills/fec-debug-framework/SKILL.md +95 -95
  262. package/skills/fec-debug-framework/references/report-template.md +34 -34
  263. package/skills/fec-dependency-upgrade/SKILL.md +17 -17
  264. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
  265. package/skills/fec-doc-sync/SKILL.md +23 -23
  266. package/skills/fec-drawio-studio/SKILL.md +42 -38
  267. package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
  268. package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
  269. package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
  270. package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
  271. package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
  272. package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
  273. package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
  274. package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
  275. package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
  276. package/skills/fec-e2e-testing/SKILL.md +24 -24
  277. package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
  278. package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
  279. package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
  280. package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
  281. package/skills/fec-form-handling/SKILL.md +21 -21
  282. package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
  283. package/skills/fec-image-generation/SKILL.md +54 -29
  284. package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
  285. package/skills/fec-image-generation/references/diagram-workflows.md +33 -2
  286. package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
  287. package/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
  288. package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
  289. package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
  290. package/skills/fec-implement-from-design/SKILL.md +81 -81
  291. package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
  292. package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
  293. package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
  294. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
  295. package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
  296. package/skills/fec-legacy-web-standard/SKILL.md +17 -17
  297. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
  298. package/skills/fec-list-virtualization/SKILL.md +16 -16
  299. package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
  300. package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
  301. package/skills/fec-motion-interaction/SKILL.md +51 -51
  302. package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
  303. package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
  304. package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
  305. package/skills/fec-performance-optimization/SKILL.md +54 -54
  306. package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
  307. package/skills/fec-performance-optimization/references/report-template.md +31 -31
  308. package/skills/fec-pwa-implementation/SKILL.md +17 -17
  309. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
  310. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
  311. package/skills/fec-react-project-standard/SKILL.md +72 -72
  312. package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
  313. package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
  314. package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
  315. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
  316. package/skills/fec-refactor-clean/SKILL.md +30 -30
  317. package/skills/fec-refactor-clean/references/report-template.md +23 -23
  318. package/skills/fec-responsive-layout/SKILL.md +17 -17
  319. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
  320. package/skills/fec-route-protection/SKILL.md +26 -26
  321. package/skills/fec-security-review/SKILL.md +20 -20
  322. package/skills/fec-security-review/references/report-template.md +12 -12
  323. package/skills/fec-security-review/references/security-checklist.md +27 -27
  324. package/skills/fec-source-driven-development/SKILL.md +59 -59
  325. package/skills/fec-state-management/SKILL.md +34 -34
  326. package/skills/fec-state-management/references/state-patterns.md +19 -19
  327. package/skills/fec-storybook-component-doc/SKILL.md +19 -19
  328. package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
  329. package/skills/fec-svg-animation/SKILL.md +32 -32
  330. package/skills/fec-tailwind-design-system/SKILL.md +17 -17
  331. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
  332. package/skills/fec-tdd-workflow/SKILL.md +28 -28
  333. package/skills/fec-testing-strategy/SKILL.md +29 -29
  334. package/skills/fec-typescript-project-standard/SKILL.md +38 -38
  335. package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
  336. package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
  337. package/skills/fec-ui-design/SKILL.md +90 -90
  338. package/skills/fec-ui-design/references/design-intelligence.md +61 -61
  339. package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
  340. package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
  341. package/skills/fec-validation-fix/SKILL.md +26 -26
  342. package/skills/fec-validation-fix/references/report-template.md +25 -25
  343. package/skills/fec-vite-project-standard/SKILL.md +39 -39
  344. package/skills/fec-vue3-project-standard/SKILL.md +38 -38
  345. package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
  346. package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
  347. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
  348. package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
  349. package/skills/fec-web-video-presentation/SKILL.md +33 -33
  350. package/skills/fec-web-workers/SKILL.md +16 -16
  351. package/skills/fec-web-workers/references/advanced-workers.md +13 -13
  352. package/skills/fec-web-workers/references/basic-worker.md +8 -8
  353. package/skills/metadata.json +121 -115
  354. package/skills/relations.json +4 -0
  355. package/templates/claude/CLAUDE.md +60 -60
  356. package/templates/codex/AGENTS.md +76 -76
  357. package/templates/codex/config.toml +4 -4
  358. package/templates/openclaw/AGENTS.md +68 -68
  359. package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
  360. package/templates/shared/rules/fec-agent-workflow.md +40 -40
  361. package/templates/shared/rules/fec-api-layer.md +52 -52
  362. package/templates/shared/rules/fec-ci-cd.md +29 -29
  363. package/templates/shared/rules/fec-code-comments.md +22 -22
  364. package/templates/shared/rules/fec-design-system.md +53 -53
  365. package/templates/shared/rules/fec-error-handling.md +40 -40
  366. package/templates/shared/rules/fec-git-conventions.md +42 -42
  367. package/templates/shared/rules/fec-i18n.md +48 -48
  368. package/templates/shared/rules/fec-naming-conventions.md +91 -91
  369. package/templates/shared/rules/fec-performance.md +78 -78
  370. package/templates/shared/rules/fec-react.md +58 -58
  371. package/templates/shared/rules/fec-refactoring.md +34 -34
  372. package/templates/shared/rules/fec-rendering-patterns.md +36 -36
  373. package/templates/shared/rules/fec-responsive-design.md +37 -37
  374. package/templates/shared/rules/fec-source-driven-development.md +22 -22
  375. package/templates/shared/rules/fec-state-management.md +56 -56
  376. package/templates/shared/rules/fec-testing.md +64 -64
  377. package/templates/shared/rules/fec-typescript.md +75 -75
  378. package/templates/shared/rules/fec-vue.md +42 -42
  379. package/templates/shared/rules/fec-working-modes.md +34 -34
  380. package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
@@ -6,8 +6,10 @@ Use these conventions when a user asks for a named technical diagram.
6
6
 
7
7
  - Group nodes by tier: client, edge, service, data, external.
8
8
  - Use swimlanes or grouped containers when boundaries matter.
9
+ - For layered block architecture, prefer horizontal tiers with left-side tier labels, content-driven containers, and optional cross-cutting sidebars for security, monitoring or governance.
9
10
  - Put bus or event-stream nodes near the center of publisher/subscriber rows.
10
11
  - Use cylinders for databases, rounded rectangles for services, dashed outlines for external systems.
12
+ - Use arrows only when data flow or dependency direction matters; use spatial grouping for pure capability stacks.
11
13
 
12
14
  ## ERD
13
15
 
@@ -15,18 +17,21 @@ Use these conventions when a user asks for a named technical diagram.
15
17
  - Mark primary keys and foreign keys in labels.
16
18
  - Use dashed relationship edges when cardinality is not fully known.
17
19
  - Prefer top-to-bottom layout for schemas with multiple relation clusters.
20
+ - Use stable table widths and row heights so long column names wrap instead of resizing neighboring tables.
18
21
 
19
22
  ## UML Class
20
23
 
21
24
  - Use a class box split into name, fields and methods.
22
25
  - Use hollow triangle arrows for inheritance, dashed hollow triangle for interface implementation.
23
26
  - Keep interfaces or abstract bases above concrete classes.
27
+ - Keep associations orthogonal and label multiplicity near the edge segment it describes.
24
28
 
25
29
  ## Sequence
26
30
 
27
31
  - Lay participants left-to-right and time top-to-bottom.
28
32
  - Keep request, response and async message styles visually distinct.
29
33
  - Add activation boxes only when they clarify nested work.
34
+ - Leave enough horizontal spacing for message labels; if labels collide, wrap text or split the interaction into phases.
30
35
 
31
36
  ## ML / Deep Learning
32
37
 
@@ -39,3 +44,17 @@ Use these conventions when a user asks for a named technical diagram.
39
44
  - Use ovals for start/end, rectangles for process, diamonds for decisions.
40
45
  - Label decision branches.
41
46
  - Merge branches back to a central path when possible.
47
+ - Keep the primary path vertical. Route alternate or error branches sideways and back to the main path with orthogonal edges.
48
+ - For editable draw.io flowcharts, follow [flowchart-quality.md](flowchart-quality.md) before final delivery.
49
+
50
+ ## Mindmap
51
+
52
+ - Put the central concept in the middle and distribute first-level branches across quadrants.
53
+ - Use curved edges without arrowheads and keep each branch color consistent from parent to leaves.
54
+ - Fan leaves away from the center; do not let branches cross through the central label.
55
+
56
+ ## Network Topology
57
+
58
+ - Use hierarchical rows such as internet, edge, switching/routing and devices.
59
+ - Distinguish wired and wireless links visually, usually solid for wired and dashed for wireless.
60
+ - Keep endpoint devices aligned in rows or columns so connection paths remain scannable.
@@ -0,0 +1,49 @@
1
+ # Flowchart Quality
2
+
3
+ Use this reference when a draw.io / diagrams.net deliverable is a process, workflow, approval path, release path, incident response path, onboarding flow or other flowchart that must remain readable after opening in diagrams.net.
4
+
5
+ ## Readability Contract
6
+
7
+ - Keep manually authored flowcharts narrow. Prefer `pageWidth` between 600 and 800; do not exceed 800 unless the diagram is intentionally a wide cross-functional table.
8
+ - Set `dx` and `dy` close to the page dimensions so diagrams.net does not initially zoom the drawing until labels become tiny.
9
+ - Put the primary path top-to-bottom. Use side branches only for alternatives, failures, retries and exceptions, then return them to the main path with orthogonal connectors.
10
+ - Split more than five dense stages into multiple diagrams or pages instead of making one oversized canvas.
11
+
12
+ ## Stage Grouping
13
+
14
+ - Use `swimlane` containers for real stages, actors, phases or bounded groups; avoid loose rectangles when a title and containment relationship matter.
15
+ - Keep stage containers on a 10px grid, normally with a 20px outer page margin and 30-40px vertical breathing room between stages.
16
+ - Give container headers a readable hierarchy: stage labels around 14-16px, bold, with a clear border color.
17
+ - Set stage containers to `connectable="0"` and `collapsible=0` so connectors target intentional nodes and the diagram does not gain collapse controls.
18
+ - Size containers to fit their children with 15px or more bottom padding. A container with large one-sided blank space usually needs a layout pass.
19
+
20
+ ## Labels
21
+
22
+ - Keep node text centered for process boxes unless a table-like artifact genuinely needs aligned rows.
23
+ - Use `whiteSpace=wrap;html=1` on process nodes, and keep normal body text at 12px or larger.
24
+ - Put the node title first, visually stronger than the body. Use concise labels and move long implementation detail into notes or metadata.
25
+ - Use the same language as the user's request, and escape XML attribute content before saving.
26
+
27
+ ## Connectors
28
+
29
+ - Use `edgeStyle=orthogonalEdgeStyle` for normal flowchart connectors.
30
+ - Make the main stage-to-stage path visually stronger than secondary edges, for example with a thicker stroke and a consistent accent color.
31
+ - Label decision branches and exception paths close to the edge segment they describe.
32
+ - For fan-out from one node to several peers, use explicit `entryX`, `entryY`, `exitX` and `exitY` anchors so branches do not cross.
33
+ - Route retry, rollback and loop connectors around the left or right margin with explicit waypoints instead of diagonal shortcuts through content.
34
+
35
+ ## Visual System
36
+
37
+ - Use a small palette with one color per stage type or actor group. Keep process node fills neutral and let borders or headers carry the stage color.
38
+ - Reserve warning, failure, pending and future states for exceptional nodes; do not use status colors as decoration.
39
+ - Keep container corners square when the stage boundary is structural; rounded corners are fine for ordinary process nodes.
40
+
41
+ ## Final Review
42
+
43
+ Before delivery, run:
44
+
45
+ ```bash
46
+ node skills/fec-drawio-studio/scripts/diagram-lint.mjs diagram.drawio --format markdown --strict
47
+ ```
48
+
49
+ Then manually check that the opened diagram has no crossed main-path connectors, no clipped labels, no collapsed-looking stages, and no unreadably small text at the default diagrams.net zoom.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Auto Layout
4
4
 
5
- Use `layout-graph.mjs` for dependency graphs, code structure maps and diagrams with more than about 15 nodes.
5
+ Use `layout-graph.mjs` for dependency graphs, code structure maps and diagrams with more than about 15 nodes. For smaller diagrams, manual XML is acceptable when the coordinates, containers and edge anchors can be reviewed directly.
6
6
 
7
7
  ```bash
8
8
  node skills/fec-drawio-studio/scripts/layout-graph.mjs graph.json --output diagram.drawio --manifest layout.json
@@ -25,21 +25,36 @@ Input graph:
25
25
 
26
26
  Graphviz `dot` is optional. If it is missing, hand-place the diagram or deliver XML plus a diagrams.net URL.
27
27
 
28
+ ## Manual Layout
29
+
30
+ - Align visible vertex `x` and `y` values to the 10px grid.
31
+ - Keep at least 60px outer page margin and enough space that connectors do not cross labels.
32
+ - Use equal sizes and equal gaps for sibling nodes in the same row or column unless content requires a different size.
33
+ - Encode explicit label breaks as `
`; do not put literal `\n` in draw.io `value` attributes.
34
+ - Include `whiteSpace=wrap;html=1` on labels and use `fontSize=14` by default, with 12 as the smallest readable exception.
35
+ - Size containers, sidebars and swimlanes to their content plus balanced padding. If a final row is incomplete, center it or split the group instead of leaving a large empty tail.
36
+
28
37
  ## Export
29
38
 
30
39
  Preview:
31
40
 
32
41
  ```bash
33
- drawio -x -f png --width 2000 -o diagram.png diagram.drawio
42
+ node skills/fec-drawio-studio/scripts/drawio-export.mjs diagram.drawio --format png --output diagram.png --width 2000
34
43
  ```
35
44
 
36
45
  Final editable PNG:
37
46
 
38
47
  ```bash
39
- drawio -x -f png -e -s 2 -o diagram.drawio.png diagram.drawio
48
+ node skills/fec-drawio-studio/scripts/drawio-export.mjs diagram.drawio --format png --output diagram.drawio.png --scale 2 --embed
40
49
  node skills/fec-drawio-studio/scripts/png-embed-fix.mjs diagram.drawio.png
41
50
  ```
42
51
 
52
+ Preview export can be checked without draw.io side effects:
53
+
54
+ ```bash
55
+ node skills/fec-drawio-studio/scripts/drawio-export.mjs diagram.drawio --format png --output diagram.png --scale 2 --width 2000 --dry-run --json
56
+ ```
57
+
43
58
  Fallback URL:
44
59
 
45
60
  ```bash
@@ -16,6 +16,9 @@ Use this reference to choose the lightest editable diagram source that still mee
16
16
  - Put child nodes inside their visual container by setting `parent` to the container id and using coordinates relative to that container.
17
17
  - Put edges that cross container boundaries at `parent="1"` so they are not clipped by a lane or group.
18
18
  - Every edge must contain `<mxGeometry relative="1" as="geometry"/>`; do not use self-closing edge cells.
19
+ - Use `&#xa;` for forced line breaks in `value` attributes. Literal `\n` renders as text in draw.io and should be treated as a quality issue.
20
+ - Keep manually placed vertices on a 10px grid, within `pageWidth` / `pageHeight`, and with stable dimensions so hover, labels and exports do not shift the layout.
21
+ - For manually authored flowcharts, keep `pageWidth` at or below 800 unless the diagram is deliberately a wide matrix or cross-functional table.
19
22
 
20
23
  ## Containers And Process Layout
21
24
 
@@ -35,6 +38,7 @@ Use this reference to choose the lightest editable diagram source that still mee
35
38
 
36
39
  - Match diagram label language to the user's language.
37
40
  - Add `html=1` whenever labels contain HTML markup or escaped `<br>` formatting.
41
+ - Include `whiteSpace=wrap;html=1` on normal shape labels so long text wraps consistently.
38
42
  - Escape XML attribute values: `&`, `<`, `>`, and `"` must be entities.
39
43
  - Prefer adaptive colors and simple palettes; specify dark-mode overrides only when automatic inversion makes labels or shapes unclear.
40
44
 
@@ -51,4 +55,4 @@ Use this reference to choose the lightest editable diagram source that still mee
51
55
  - Do not leave raw ampersands or angle brackets inside attribute values.
52
56
  - Do not use duplicate ids.
53
57
  - Do not leave edges pointing to missing source or target cells.
54
- - Run `diagram-lint.mjs` before final handoff.
58
+ - Run `diagram-lint.mjs` before final handoff. Use `--strict` when the exported artifact is a final deliverable so warnings such as overlaps, literal line breaks, missing wrapping styles, tiny fonts, grid drift and page overflow block the handoff.
@@ -8,6 +8,18 @@ export function lintDrawio(xml) {
8
8
  if (!/<mx(Cell|file|GraphModel)\b/.test(xml)) warnings.push("No draw.io graph markers found");
9
9
  if (/<mxCell\b[^>]*\bedge="1"[^>]*\/>/.test(xml)) errors.push("edge mxCell must not be self-closing; add mxGeometry relative=\"1\"");
10
10
 
11
+ const graphModel = attrsOf(xml.match(/<mxGraphModel\b([^>]*)>/)?.[1] ?? "");
12
+ const pageWidth = Number(graphModel.pageWidth);
13
+ const pageHeight = Number(graphModel.pageHeight);
14
+ const viewportWidth = Number(graphModel.dx);
15
+ const viewportHeight = Number(graphModel.dy);
16
+ if (Number.isFinite(pageWidth) && pageWidth > 800) warnings.push(`pageWidth ${pageWidth} is above the readable manual-flowchart maximum of 800`);
17
+ if (Number.isFinite(pageWidth) && Number.isFinite(viewportWidth) && viewportWidth < pageWidth * 0.75) {
18
+ warnings.push(`dx ${viewportWidth} is much smaller than pageWidth ${pageWidth}; diagrams.net may initially zoom labels too small`);
19
+ }
20
+ if (Number.isFinite(pageHeight) && Number.isFinite(viewportHeight) && viewportHeight < pageHeight * 0.5) {
21
+ warnings.push(`dy ${viewportHeight} is much smaller than pageHeight ${pageHeight}; diagrams.net may initially zoom labels too small`);
22
+ }
11
23
  const cellRe = /<mxCell\b([^>]*?)(?:\/>|>([\s\S]*?)<\/mxCell>)/g;
12
24
  const objectByCellIndex = objectsByCellIndex(xml);
13
25
  const cells = [];
@@ -28,6 +40,7 @@ export function lintDrawio(xml) {
28
40
  for (const [name, value] of rawAttrsOf(match[1])) {
29
41
  if (hasUnescapedAmpersand(value)) errors.push(`cell ${id} attribute ${name} contains an unescaped ampersand`);
30
42
  if (/[<>]/.test(value)) errors.push(`cell ${id} attribute ${name} contains an unescaped angle bracket`);
43
+ if (name === "value" && /\\n/.test(value)) warnings.push(`cell ${id} value contains literal \\n; use &#xa; for draw.io line breaks`);
31
44
  }
32
45
  const geom = body.match(/<mxGeometry\b([^>]*?)(?:\/>|>)/)?.[1];
33
46
  cells.push({ id, attrs, body, geom: geom ? attrsOf(geom) : null });
@@ -49,14 +62,33 @@ export function lintDrawio(xml) {
49
62
  }
50
63
  if (attrs.edge === "1" && !geom) errors.push(`edge ${id} is missing mxGeometry`);
51
64
  if (attrs.edge === "1" && (!attrs.source || !attrs.target)) warnings.push(`edge ${id} has no source or target`);
65
+ if (attrs.edge === "1" && attrs.style && !styleHas(attrs.style, "edgeStyle", "orthogonalEdgeStyle")) {
66
+ warnings.push(`edge ${id} should use orthogonalEdgeStyle for readable technical diagram routing`);
67
+ }
52
68
  if (attrs.vertex === "1") {
53
69
  if (looksLikeHtml(attrs.value) && !styleHas(attrs.style, "html", "1")) warnings.push(`cell ${id} label contains HTML but style does not include html=1`);
70
+ if (!styleHas(attrs.style, "whiteSpace", "wrap")) warnings.push(`cell ${id} style should include whiteSpace=wrap for label wrapping`);
71
+ if (!styleHas(attrs.style, "html", "1")) warnings.push(`cell ${id} style should include html=1 for predictable label rendering`);
72
+ const fontSize = styleNumber(attrs.style, "fontSize");
73
+ if (Number.isFinite(fontSize) && fontSize < 12) warnings.push(`cell ${id} fontSize ${fontSize} is below the readable minimum of 12`);
74
+ if (isSwimlane(attrs.style)) {
75
+ if (attrs.connectable !== "0") warnings.push(`swimlane ${id} should set connectable="0" so connectors target intentional nodes`);
76
+ if (styleValue(attrs.style, "collapsible") !== "0") warnings.push(`swimlane ${id} should set collapsible=0 to avoid collapse controls in deliverables`);
77
+ if (styleValue(attrs.style, "rounded") !== "0") warnings.push(`swimlane ${id} should use rounded=0 for clear structural stage boundaries`);
78
+ if (Number.isFinite(fontSize) && fontSize < 14) warnings.push(`swimlane ${id} title fontSize ${fontSize} is below the recommended flowchart stage range of 14-16`);
79
+ } else if (isLikelyProcessNode(attrs.style)) {
80
+ const align = styleValue(attrs.style, "align");
81
+ if (align && align !== "center") warnings.push(`process node ${id} should use align=center for flowchart readability`);
82
+ }
54
83
  if (!geom) errors.push(`vertex ${id} is missing mxGeometry`);
55
84
  else {
56
85
  const rect = rectOf(geom);
57
86
  if (!Number.isFinite(rect.w) || !Number.isFinite(rect.h)) errors.push(`vertex ${id} has invalid size`);
58
87
  else if (rect.w <= 0 || rect.h <= 0) warnings.push(`vertex ${id} has non-positive size`);
59
88
  if (rect.x < 0 || rect.y < 0) warnings.push(`vertex ${id} has negative position`);
89
+ if (!onGrid(rect.x) || !onGrid(rect.y)) warnings.push(`vertex ${id} position should align to the 10px grid`);
90
+ if (Number.isFinite(pageWidth) && rect.x + rect.w > pageWidth) warnings.push(`vertex ${id} extends beyond pageWidth ${pageWidth}`);
91
+ if (Number.isFinite(pageHeight) && rect.y + rect.h > pageHeight) warnings.push(`vertex ${id} extends beyond pageHeight ${pageHeight}`);
60
92
  }
61
93
  }
62
94
  }
@@ -119,6 +151,32 @@ function styleHas(style = "", key, expected) {
119
151
  });
120
152
  }
121
153
 
154
+ function styleNumber(style = "", key) {
155
+ for (const part of style.split(";")) {
156
+ const [partKey, value] = part.split("=", 2);
157
+ if (partKey === key) return Number(value);
158
+ }
159
+ return NaN;
160
+ }
161
+
162
+ function styleValue(style = "", key) {
163
+ for (const part of style.split(";")) {
164
+ const [partKey, value] = part.split("=", 2);
165
+ if (partKey === key) return value ?? "";
166
+ }
167
+ return undefined;
168
+ }
169
+
170
+ function isSwimlane(style = "") {
171
+ return style.split(";").some((part) => part === "swimlane" || part === "shape=swimlane");
172
+ }
173
+
174
+ function isLikelyProcessNode(style = "") {
175
+ const shape = styleValue(style, "shape");
176
+ if (shape) return ["process", "rectangle", "rhombus", "terminator"].includes(shape);
177
+ return style.includes("rounded=1") || style.includes("whiteSpace=wrap");
178
+ }
179
+
122
180
  function rectOf(geom) {
123
181
  return {
124
182
  x: Number(geom.x ?? 0),
@@ -128,6 +186,10 @@ function rectOf(geom) {
128
186
  };
129
187
  }
130
188
 
189
+ function onGrid(value, grid = 10) {
190
+ return Number.isFinite(value) && Math.abs(value / grid - Math.round(value / grid)) < 1e-9;
191
+ }
192
+
131
193
  function overlaps(a, b) {
132
194
  return a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
133
195
  }
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env node
2
+ import fs from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import { spawnSync } from "node:child_process";
6
+ import { formatResult, parseArgs } from "./studio-core.mjs";
7
+
8
+ const INSTALL_HINTS = [
9
+ "draw.io desktop CLI was not found.",
10
+ "Install draw.io desktop, then rerun the export.",
11
+ "Windows: winget install JGraph.Draw",
12
+ "macOS: brew install --cask drawio",
13
+ "Linux: install drawio from your package manager or snap install drawio",
14
+ "Manual download: https://github.com/jgraph/drawio-desktop/releases",
15
+ ];
16
+
17
+ export function buildExportPlan(input, args = {}, env = process.env, platform = process.platform) {
18
+ const drawio = findDrawio(args.drawio, env, platform);
19
+ if (!drawio) {
20
+ return {
21
+ ok: false,
22
+ title: "Draw.io Export",
23
+ errors: [INSTALL_HINTS.join("\n")],
24
+ command: null,
25
+ };
26
+ }
27
+
28
+ const format = String(args.format ?? "png");
29
+ const output = String(args.output ?? defaultOutput(input, format));
30
+ const commandArgs = ["-x", "-f", format];
31
+ if (args.embed) commandArgs.push("-e");
32
+ if (args.scale) commandArgs.push("-s", String(args.scale));
33
+ if (args.width) commandArgs.push("--width", String(args.width));
34
+ if (args.border) commandArgs.push("--border", String(args.border));
35
+ if (args.crop) commandArgs.push("--crop");
36
+ if (args.page !== undefined) commandArgs.push("-p", String(args.page));
37
+ commandArgs.push("-o", output, input);
38
+
39
+ return {
40
+ ok: true,
41
+ title: "Draw.io Export",
42
+ drawio,
43
+ command: [drawio, ...commandArgs],
44
+ output,
45
+ format,
46
+ dryRun: Boolean(args.dryRun),
47
+ errors: [],
48
+ };
49
+ }
50
+
51
+ export function findDrawio(explicitPath, env = process.env, platform = process.platform) {
52
+ if (explicitPath) return existingFile(explicitPath);
53
+
54
+ for (const command of ["drawio", "draw.io"]) {
55
+ const found = findOnPath(command, env, platform);
56
+ if (found) return found;
57
+ }
58
+
59
+ for (const candidate of defaultCandidates(env, platform)) {
60
+ const found = existingFile(candidate);
61
+ if (found) return found;
62
+ }
63
+
64
+ return null;
65
+ }
66
+
67
+ function findOnPath(command, env, platform) {
68
+ const pathValue = env.PATH ?? env.Path ?? "";
69
+ const dirs = pathValue.split(path.delimiter).filter(Boolean);
70
+ const extensions = platform === "win32" ? pathExtensions(env) : [""];
71
+ for (const dir of dirs) {
72
+ for (const ext of extensions) {
73
+ const candidate = path.join(dir, command.endsWith(ext) ? command : `${command}${ext}`);
74
+ const found = existingFile(candidate);
75
+ if (found) return found;
76
+ }
77
+ }
78
+ return null;
79
+ }
80
+
81
+ function pathExtensions(env) {
82
+ const configured = env.PATHEXT ? env.PATHEXT.split(";").filter(Boolean) : [".EXE", ".CMD", ".BAT", ""];
83
+ return [...new Set(["", ...configured, ...configured.map((item) => item.toLowerCase())])];
84
+ }
85
+
86
+ function defaultCandidates(env, platform) {
87
+ if (platform === "win32") {
88
+ return [
89
+ path.join(env.ProgramFiles ?? "C:\\Program Files", "draw.io", "draw.io.exe"),
90
+ path.join(env["ProgramFiles(x86)"] ?? "C:\\Program Files (x86)", "draw.io", "draw.io.exe"),
91
+ path.join(env.LOCALAPPDATA ?? path.join(os.homedir(), "AppData", "Local"), "Programs", "draw.io", "draw.io.exe"),
92
+ ];
93
+ }
94
+ if (platform === "darwin") {
95
+ return ["/Applications/draw.io.app/Contents/MacOS/draw.io"];
96
+ }
97
+ return ["/usr/bin/drawio", "/usr/local/bin/drawio", "/snap/bin/drawio"];
98
+ }
99
+
100
+ function existingFile(candidate) {
101
+ if (!candidate) return null;
102
+ const resolved = path.resolve(candidate);
103
+ return fs.existsSync(resolved) && fs.statSync(resolved).isFile() ? resolved : null;
104
+ }
105
+
106
+ function defaultOutput(input, format) {
107
+ return `${input.replace(/\.(drawio|xml)$/i, "")}.${format}`;
108
+ }
109
+
110
+ function printFailure(plan, args) {
111
+ const output = formatResult(plan, args.formatOutput ?? (args.json ? "json" : "markdown"));
112
+ process.stderr.write(output);
113
+ }
114
+
115
+ const args = parseArgs(process.argv.slice(2));
116
+ const input = args._[0];
117
+ if (!input) {
118
+ console.error("usage: node drawio-export.mjs <file.drawio> [--format png|svg|pdf] [--output file] [--scale 2] [--width 2000] [--border 20] [--dry-run] [--json]");
119
+ process.exit(2);
120
+ }
121
+
122
+ const plan = buildExportPlan(input, args);
123
+ if (!plan.ok) {
124
+ printFailure(plan, args);
125
+ process.exit(1);
126
+ }
127
+
128
+ if (args.dryRun) {
129
+ process.stdout.write(formatResult(plan, args.formatOutput ?? (args.json ? "json" : "markdown")));
130
+ process.exit(0);
131
+ }
132
+
133
+ const result = spawnSync(plan.command[0], plan.command.slice(1), { stdio: "inherit" });
134
+ process.exit(result.status ?? 1);
@@ -1,28 +1,44 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
- import zlib from "node:zlib";
5
4
  import { formatResult, parseArgs, skillDir } from "./studio-core.mjs";
6
5
 
7
- const INDEX = path.join(skillDir, "data", "shape-index.json.gz");
6
+ const INDEX = path.join(skillDir, "data", "shape-index.json");
8
7
  const ALIASES = new Map([
9
- ["亚马逊", "aws"], ["阿里云", "alibaba cloud"], ["微软云", "azure"], ["谷歌云", "gcp"],
10
- ["云", "cloud"], ["数据库", "database"], ["队列", "queue"], ["网关", "gateway"],
11
- ["服务", "service"], ["用户", "user"], ["角色", "actor"], ["流程", "flowchart"],
12
- ["容器", "container"], ["网络", "network"], ["交换机", "switch"], ["路由器", "router"],
13
- ["函数", "lambda"], ["对象存储", "storage"], ["消息", "message"],
8
+ ["亚马逊", "aws"],
9
+ ["阿里云", "alibaba cloud"],
10
+ ["微软云", "azure"],
11
+ ["谷歌云", "gcp"],
12
+ ["云", "cloud"],
13
+ ["数据库", "database"],
14
+ ["队列", "queue"],
15
+ ["网关", "gateway"],
16
+ ["服务", "service"],
17
+ ["用户", "user"],
18
+ ["角色", "actor"],
19
+ ["流程", "flowchart"],
20
+ ["容器", "container"],
21
+ ["网络", "network"],
22
+ ["交换机", "switch"],
23
+ ["路由器", "router"],
24
+ ["函数", "lambda"],
25
+ ["对象存储", "storage"],
26
+ ["消息", "message"],
14
27
  ]);
15
28
 
16
29
  export function loadShapes() {
17
- return JSON.parse(zlib.gunzipSync(fs.readFileSync(INDEX)).toString("utf8"));
30
+ return JSON.parse(fs.readFileSync(INDEX).toString("utf8"));
18
31
  }
19
32
 
20
33
  export function queryShapes(shapes, query, options = {}) {
21
34
  const terms = expandTerms(query);
22
- const category = options.category ? String(options.category).toLowerCase() : "";
35
+ const category = options.category
36
+ ? String(options.category).toLowerCase()
37
+ : "";
23
38
  const scored = [];
24
39
  for (const [index, shape] of shapes.entries()) {
25
- const haystack = `${shape.title ?? ""} ${shape.tags ?? ""} ${shape.style ?? ""}`.toLowerCase();
40
+ const haystack =
41
+ `${shape.title ?? ""} ${shape.tags ?? ""} ${shape.style ?? ""}`.toLowerCase();
26
42
  if (category && !haystack.includes(category)) continue;
27
43
  let score = 0;
28
44
  const title = String(shape.title ?? "").toLowerCase();
@@ -34,12 +50,30 @@ export function queryShapes(shapes, query, options = {}) {
34
50
  else if (tags.includes(term)) score += 12;
35
51
  if (fuzzyContains(haystack, term)) score += 4;
36
52
  }
37
- if (score > 0) scored.push({ index, score, titleHits: terms.filter((term) => title.includes(term)).length, shape });
53
+ if (score > 0)
54
+ scored.push({
55
+ index,
56
+ score,
57
+ titleHits: terms.filter((term) => title.includes(term)).length,
58
+ shape,
59
+ });
38
60
  }
39
61
  return scored
40
- .sort((a, b) => b.score - a.score || b.titleHits - a.titleHits || String(a.shape.title).localeCompare(String(b.shape.title)) || a.index - b.index)
62
+ .sort(
63
+ (a, b) =>
64
+ b.score - a.score ||
65
+ b.titleHits - a.titleHits ||
66
+ String(a.shape.title).localeCompare(String(b.shape.title)) ||
67
+ a.index - b.index,
68
+ )
41
69
  .slice(0, Number(options.limit ?? 10))
42
- .map(({ shape, score }) => ({ title: shape.title, w: shape.w, h: shape.h, style: shape.style, score }));
70
+ .map(({ shape, score }) => ({
71
+ title: shape.title,
72
+ w: shape.w,
73
+ h: shape.h,
74
+ style: shape.style,
75
+ score,
76
+ }));
43
77
  }
44
78
 
45
79
  function expandTerms(query) {
@@ -50,7 +84,11 @@ function expandTerms(query) {
50
84
  expanded.push(ALIASES.get(term) ?? term);
51
85
  if (term.includes("-")) expanded.push(...term.split("-"));
52
86
  }
53
- return [...new Set(expanded.join(" ").match(/[a-z0-9._-]+|[\u4e00-\u9fff]+/g) ?? [])].filter((term) => term.length >= 2);
87
+ return [
88
+ ...new Set(
89
+ expanded.join(" ").match(/[a-z0-9._-]+|[\u4e00-\u9fff]+/g) ?? [],
90
+ ),
91
+ ].filter((term) => term.length >= 2);
54
92
  }
55
93
 
56
94
  function fuzzyContains(text, term) {
@@ -66,7 +104,9 @@ function fuzzyContains(text, term) {
66
104
  const args = parseArgs(process.argv.slice(2));
67
105
  const query = args._.join(" ");
68
106
  if (!query) {
69
- console.error("usage: node shape-query.mjs <keywords> [--limit 10] [--category aws] [--format markdown|json]");
107
+ console.error(
108
+ "usage: node shape-query.mjs <keywords> [--limit 10] [--category aws] [--format markdown|json]",
109
+ );
70
110
  process.exit(2);
71
111
  }
72
112
  const results = queryShapes(loadShapes(), query, args);
@@ -1,42 +1,42 @@
1
1
  ---
2
2
  name: fec-e2e-testing
3
- description: Use when creating, maintaining, debugging, or reviewing real-browser end-to-end tests with Playwright or Cypress, including Page Object models, CI artifacts, traces, flaky tests, cross-page visual regression, and critical user journeys such as login, payment, permissions, or CRUD. For layer planning or tests close to UI components, choose the matching testing workflow first; Chinese triggers include E2E, 端到端测试, Playwright, Cypress.
3
+ description: Use when creating, maintaining, debugging, or reviewing real-browser end-to-end tests with Playwright or Cypress, including Page Object models, CI artifacts, traces, flaky tests, cross-page visual regression, and critical user journeys such as login, payment, permissions, or CRUD. For layer planning or tests close to UI components, choose the matching testing workflow first; Chinese triggers include E2E, end-to-end testing, Playwright, Cypress.
4
4
  ---
5
5
 
6
- # E2E 测试规范
6
+ # E2E Test Specification
7
7
 
8
8
  ## Purpose
9
9
 
10
- 用真实浏览器验证关键用户旅程,发现单元测试无法覆盖的集成风险。
10
+ Validate key user journeys with real browsers and uncover integration risks not covered by unit tests.
11
11
 
12
12
  ## Procedure
13
13
 
14
- 1. 明确关键旅程:登录、购买、创建、搜索、权限、支付等跨页面流程优先;若只是选择测试层级,先做测试分层规划。
15
- 2. 新项目优先 Playwright;已有 Cypress 项目沿用 Cypress,不为迁移而迁移。
16
- 3. 用 Page Object 或 fixtures 封装登录、页面定位器和共享数据,spec 中避免裸选择器。
17
- 4. 断言用户可见结果,依赖 Locator 自动等待、网络响应或可见状态,不使用固定 sleep。
18
- 5. CI 必须上传 HTML report、截图、trace 或视频;flaky 用例要隔离、复现、标注来源并关联 issue。
19
- 6. 调试失败时先读 trace、console、network 和截图,再改测试;不要把真实产品缺陷误判成 flaky。
20
- 7. 对关键浏览器能力、支付、权限、上传和实时通信流程,记录测试环境、种子数据和清理策略。
21
- 8. 测试数据必须可重复:优先使用 API seed、数据库 fixture、测试账号或 mock 服务;随机数据需带唯一前缀并在 teardown 清理。
14
+ 1. Clarify the key journeys: cross-page processes such as login, purchase, creation, search, permissions, payment, etc. are given priority; if you only choose the test level, do the test hierarchical planning first.
15
+ 2. New projects will be given priority by Playwright; existing Cypress projects will continue to use Cypress and will not be migrated for the sake of migration.
16
+ 3. Use Page Object or fixtures to encapsulate login, page locator and shared data, and avoid naked selectors in the spec.
17
+ 4. Assert that the user can see the results, relying on Locator automatic waiting, network response or visible status, without using fixed sleep.
18
+ 5. CI must upload HTML report, screenshots, trace or video; Flaky use cases must be isolated, reproduced, marked with sources and associated with issues.
19
+ 6. When debugging fails, read the trace, console, network and screenshots first, and then change the test; do not misjudge real product defects as flaky.
20
+ 7. Record the test environment, seed data and cleanup strategies for key browser capabilities, payment, permissions, uploads and real-time communication processes.
21
+ 8. Test data must be repeatable: API seeds, database fixtures, test accounts or mock services are preferred; random data must have a unique prefix and be cleaned in teardown.
22
22
 
23
- ## 详细参考
23
+ ## Detailed reference
24
24
 
25
- - 需要目录结构、Page Object、spec 组织、配置、flaky 调试和产物示例时,加载 [references/playwright-patterns.md](references/playwright-patterns.md)。
26
- - 需要 CI 示例和 Markdown 报告模板时,加载 [references/e2e-ci-reporting.md](references/e2e-ci-reporting.md)。
27
- - 需要 Web3/钱包流程或高风险金融流程时,加载 [references/e2e-special-scenarios.md](references/e2e-special-scenarios.md)。
28
- - 需要跨页面截图或视觉回归配置时,加载 [references/e2e-visual-regression.md](references/e2e-visual-regression.md)。
25
+ - Load [references/playwright-patterns.md](references/playwright-patterns.md) when you need directory structure, Page Object, spec organization, configuration, flaky debugging and production examples.
26
+ - Load [references/e2e-ci-reporting.md](references/e2e-ci-reporting.md) when you need CI examples and Markdown report templates.
27
+ - Load [references/e2e-special-scenarios.md](references/e2e-special-scenarios.md) when Web3/wallet flows or high-risk financial flows are required.
28
+ - When cross-page screenshots or visual regression configuration are required, load [references/e2e-visual-regression.md](references/e2e-visual-regression.md).
29
29
 
30
30
  ## Constraints
31
31
 
32
- - 禁止依赖 `sleep` / 固定 `setTimeout` 作为主要同步手段。
33
- - 不在生产环境跑真实 E2E。
34
- - 避免在 E2E 中断言组件内部像素级样式;跨页面截图/视觉回归仅覆盖用户旅程中的关键页面状态。
35
- - 失败必须能靠截图、trace 或视频定位。
36
- - 组件内部契约测试分流到组件测试 workflow。
37
- - 不把不稳定等待、随机数据或依赖测试顺序带入 CI。
38
- - 不把重试次数当作 flaky 治理;重试只能保留证据,根因仍需定位。
32
+ - Disable reliance on `sleep` / fixed `setTimeout` as primary synchronization means.
33
+ - Do not run real E2E in production environment.
34
+ - Avoid asserting component internal pixel-level styles in E2E; cross-page screenshots/visual regressions only cover key page states in the user journey.
35
+ - Failure must be able to be located by taking screenshots, traces or videos.
36
+ - Component internal contract testing is offloaded to component testing workflow.
37
+ - Do not bring unstable waits, random data, or dependent test order into CI.
38
+ - Do not treat the number of retries as flaky management; retries can only retain evidence, and the root cause still needs to be located.
39
39
 
40
40
  ## Expected Output
41
41
 
42
- 关键用户旅程有稳定 E2E 覆盖,失败产物可定位问题,CI 中报告和 trace 可下载;flaky 用例有复现命令、隔离策略和后续 issue。
42
+ Key user journeys have stable E2E coverage, failed products can locate problems, and reports and traces in CI can be downloaded; flaky use cases include recurrence commands, isolation strategies, and follow-up issues.