@bovinphang/frontend-craft 2.9.0 → 3.0.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 (579) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +403 -378
  4. package/CHANGELOG.zh-CN.md +402 -377
  5. package/CONTRIBUTING.md +381 -371
  6. package/CONTRIBUTING.zh-CN.md +383 -371
  7. package/README.md +605 -545
  8. package/README.openclaw.md +395 -359
  9. package/README.openclaw.zh-CN.md +395 -359
  10. package/README.zh-CN.md +605 -545
  11. package/agents/fec-typescript-reviewer.md +1 -1
  12. package/common-content.lock.json +3795 -0
  13. package/dist/bin/frontend-craft.js +353 -174
  14. package/docs/common-migration.md +61 -0
  15. package/docs/example-prompts.md +157 -157
  16. package/docs/ja-JP/README.md +588 -534
  17. package/docs/ko-KR/README.md +588 -534
  18. package/docs/project-structure.md +166 -151
  19. package/docs/review-and-diagram-workflows.md +5 -5
  20. package/docs/runtimes/antigravity.md +18 -18
  21. package/docs/runtimes/augment.md +18 -18
  22. package/docs/runtimes/claude.md +193 -191
  23. package/docs/runtimes/claude.zh-CN.md +191 -189
  24. package/docs/runtimes/cline.md +18 -18
  25. package/docs/runtimes/codebuddy.md +18 -18
  26. package/docs/runtimes/codex.md +18 -18
  27. package/docs/runtimes/compatibility.md +42 -27
  28. package/docs/runtimes/copilot.md +18 -18
  29. package/docs/runtimes/cursor.md +18 -18
  30. package/docs/runtimes/gemini.md +18 -18
  31. package/docs/runtimes/kilo.md +18 -18
  32. package/docs/runtimes/openclaw.md +18 -18
  33. package/docs/runtimes/opencode.md +18 -18
  34. package/docs/runtimes/qoder.md +18 -18
  35. package/docs/runtimes/trae.md +18 -18
  36. package/docs/runtimes/windsurf.md +18 -18
  37. package/docs/zh-CN/common-migration.md +57 -0
  38. package/docs/zh-CN/example-prompts.md +157 -157
  39. package/docs/zh-CN/project-structure.md +166 -148
  40. package/docs/zh-CN/review-and-diagram-workflows.md +5 -5
  41. package/docs/zh-TW/README.md +588 -534
  42. package/localized/zh-CN/agents/fec-typescript-reviewer.md +1 -1
  43. package/localized/zh-CN/skills/cc-c-project-standard/SKILL.md +25 -0
  44. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
  45. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
  46. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
  47. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
  48. package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
  49. package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
  50. package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
  51. package/localized/zh-CN/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
  52. package/localized/zh-CN/skills/cc-c-project-standard/references/practice.md +37 -0
  53. package/localized/zh-CN/skills/cc-cpp-project-standard/SKILL.md +25 -0
  54. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
  55. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
  56. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
  57. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
  58. package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
  59. package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
  60. package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
  61. package/localized/zh-CN/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
  62. package/localized/zh-CN/skills/cc-cpp-project-standard/references/practice.md +37 -0
  63. package/localized/zh-CN/skills/cc-debug-methodology/SKILL.md +8 -0
  64. package/localized/zh-CN/skills/cc-debug-methodology/references/method.md +13 -0
  65. package/localized/zh-CN/skills/cc-doc-sync-core/SKILL.md +8 -0
  66. package/localized/zh-CN/skills/cc-doc-sync-core/references/method.md +12 -0
  67. package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/SKILL.md +5 -5
  68. package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/flowchart-quality.md +1 -1
  69. package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/layout-and-export.md +9 -9
  70. package/localized/zh-CN/skills/cc-electron-project-standard/SKILL.md +21 -0
  71. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
  72. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
  73. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
  74. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
  75. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
  76. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
  77. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
  78. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
  79. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
  80. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
  81. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
  82. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
  83. package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
  84. package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
  85. package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
  86. package/localized/zh-CN/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
  87. package/localized/zh-CN/skills/cc-electron-project-standard/references/practice.md +19 -0
  88. package/localized/zh-CN/skills/cc-electron-project-standard/references/verification.md +17 -0
  89. package/localized/zh-CN/skills/cc-go-concurrency/SKILL.md +25 -0
  90. package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
  91. package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
  92. package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
  93. package/localized/zh-CN/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
  94. package/localized/zh-CN/skills/cc-go-concurrency/references/practice.md +37 -0
  95. package/localized/zh-CN/skills/cc-go-project-standard/SKILL.md +25 -0
  96. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
  97. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
  98. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
  99. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
  100. package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
  101. package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
  102. package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
  103. package/localized/zh-CN/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
  104. package/localized/zh-CN/skills/cc-go-project-standard/references/practice.md +37 -0
  105. package/localized/zh-CN/skills/cc-java-project-standard/SKILL.md +25 -0
  106. package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/README.md +5 -0
  107. package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
  108. package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
  109. package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
  110. package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
  111. package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
  112. package/localized/zh-CN/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
  113. package/localized/zh-CN/skills/cc-java-project-standard/references/practice.md +37 -0
  114. package/localized/zh-CN/skills/cc-java-runtime/SKILL.md +25 -0
  115. package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
  116. package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
  117. package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
  118. package/localized/zh-CN/skills/cc-java-runtime/references/engineering-practices.md +73 -0
  119. package/localized/zh-CN/skills/cc-java-runtime/references/practice.md +37 -0
  120. package/localized/zh-CN/skills/cc-native-memory-safety/SKILL.md +25 -0
  121. package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
  122. package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
  123. package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
  124. package/localized/zh-CN/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
  125. package/localized/zh-CN/skills/cc-native-memory-safety/references/practice.md +37 -0
  126. package/localized/zh-CN/skills/cc-python-async/SKILL.md +25 -0
  127. package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.md +237 -0
  128. package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
  129. package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
  130. package/localized/zh-CN/skills/cc-python-async/references/engineering-practices.md +73 -0
  131. package/localized/zh-CN/skills/cc-python-async/references/practice.md +37 -0
  132. package/localized/zh-CN/skills/cc-python-project-standard/SKILL.md +25 -0
  133. package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
  134. package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
  135. package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
  136. package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
  137. package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
  138. package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
  139. package/localized/zh-CN/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
  140. package/localized/zh-CN/skills/cc-python-project-standard/references/practice.md +37 -0
  141. package/localized/zh-CN/skills/cc-refactoring-core/SKILL.md +8 -0
  142. package/localized/zh-CN/skills/cc-refactoring-core/references/method.md +16 -0
  143. package/localized/zh-CN/skills/cc-rust-async/SKILL.md +25 -0
  144. package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
  145. package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
  146. package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
  147. package/localized/zh-CN/skills/cc-rust-async/references/engineering-practices.md +73 -0
  148. package/localized/zh-CN/skills/cc-rust-async/references/practice.md +37 -0
  149. package/localized/zh-CN/skills/cc-rust-project-standard/SKILL.md +25 -0
  150. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
  151. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
  152. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
  153. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
  154. package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
  155. package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
  156. package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
  157. package/localized/zh-CN/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
  158. package/localized/zh-CN/skills/cc-rust-project-standard/references/practice.md +37 -0
  159. package/localized/zh-CN/skills/cc-source-driven-development/SKILL.md +8 -0
  160. package/localized/zh-CN/skills/cc-source-driven-development/references/method.md +19 -0
  161. package/localized/zh-CN/skills/cc-tauri-project-standard/SKILL.md +21 -0
  162. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
  163. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
  164. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
  165. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
  166. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
  167. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
  168. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
  169. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
  170. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
  171. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
  172. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
  173. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
  174. package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
  175. package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
  176. package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
  177. package/localized/zh-CN/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
  178. package/localized/zh-CN/skills/cc-tauri-project-standard/references/practice.md +20 -0
  179. package/localized/zh-CN/skills/cc-tauri-project-standard/references/verification.md +18 -0
  180. package/localized/zh-CN/skills/cc-tdd-methodology/SKILL.md +8 -0
  181. package/localized/zh-CN/skills/cc-tdd-methodology/references/method.md +13 -0
  182. package/localized/zh-CN/skills/cc-technical-diagrams/SKILL.md +34 -0
  183. package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/interactive-diagram.html +371 -371
  184. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/README.md +14 -0
  185. package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.mmd +21 -21
  186. package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.mmd +7 -7
  187. package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/references/diagram-workflows.md +3 -3
  188. package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/references/html-technical-diagrams.md +7 -7
  189. package/localized/zh-CN/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
  190. package/{skills/fec-image-generation → localized/zh-CN/skills/cc-technical-diagrams}/scripts/diagram-browser.mjs +77 -14
  191. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
  192. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
  193. package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/SKILL.md +10 -4
  194. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/README.md +7 -0
  195. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
  196. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
  197. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
  198. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
  199. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
  200. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
  201. package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
  202. package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
  203. package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
  204. package/localized/zh-CN/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
  205. package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety-patterns.md +5 -34
  206. package/localized/zh-CN/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety.md +6 -0
  207. package/localized/zh-CN/skills/eval_queries.json +741 -319
  208. package/localized/zh-CN/skills/fec-api-integration/SKILL.md +5 -1
  209. package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.md +237 -0
  210. package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.rules.json +121 -0
  211. package/localized/zh-CN/skills/fec-api-integration/references/common/engineering-practices.sources.json +377 -0
  212. package/localized/zh-CN/skills/fec-api-integration/references/engineering-practices.md +73 -0
  213. package/localized/zh-CN/skills/fec-code-review/SKILL.md +4 -0
  214. package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.md +237 -0
  215. package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.rules.json +121 -0
  216. package/localized/zh-CN/skills/fec-code-review/references/common/engineering-practices.sources.json +377 -0
  217. package/localized/zh-CN/skills/fec-code-review/references/engineering-practices.md +73 -0
  218. package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +4 -0
  219. package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.md +237 -0
  220. package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.rules.json +121 -0
  221. package/localized/zh-CN/skills/fec-data-fetching/references/common/engineering-practices.sources.json +377 -0
  222. package/localized/zh-CN/skills/fec-data-fetching/references/engineering-practices.md +73 -0
  223. package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +1 -50
  224. package/localized/zh-CN/skills/fec-debug-framework/references/common/debug.md +13 -0
  225. package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +4 -0
  226. package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.md +237 -0
  227. package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.rules.json +121 -0
  228. package/localized/zh-CN/skills/fec-dependency-upgrade/references/common/engineering-practices.sources.json +377 -0
  229. package/localized/zh-CN/skills/fec-dependency-upgrade/references/engineering-practices.md +73 -0
  230. package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +7 -28
  231. package/localized/zh-CN/skills/fec-doc-sync/references/common/doc-sync.md +12 -0
  232. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +7 -101
  233. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +1 -1
  234. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +1 -1
  235. package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +6 -0
  236. package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/README.md +7 -0
  237. package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/package.json +15 -0
  238. package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/pnpm-lock.yaml +662 -0
  239. package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
  240. package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/request-view.mjs +24 -0
  241. package/localized/zh-CN/skills/fec-react-project-standard/examples/engineering/request-view.test.mjs +33 -0
  242. package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.md +237 -0
  243. package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.rules.json +121 -0
  244. package/localized/zh-CN/skills/fec-react-project-standard/references/common/engineering-practices.sources.json +377 -0
  245. package/localized/zh-CN/skills/fec-react-project-standard/references/engineering-practices.md +73 -0
  246. package/localized/zh-CN/skills/fec-react-project-standard/references/generic-component-types.md +37 -0
  247. package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +3 -3
  248. package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +1 -1
  249. package/localized/zh-CN/skills/fec-refactoring/SKILL.md +12 -70
  250. package/localized/zh-CN/skills/fec-refactoring/references/common/refactoring.md +16 -0
  251. package/localized/zh-CN/skills/fec-refactoring/references/principles.md +9 -39
  252. package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +4 -56
  253. package/localized/zh-CN/skills/fec-security-review/SKILL.md +4 -0
  254. package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.md +237 -0
  255. package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.rules.json +121 -0
  256. package/localized/zh-CN/skills/fec-security-review/references/common/engineering-practices.sources.json +377 -0
  257. package/localized/zh-CN/skills/fec-security-review/references/engineering-practices.md +73 -0
  258. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +12 -43
  259. package/localized/zh-CN/skills/fec-tdd-workflow/references/common/tdd.md +13 -0
  260. package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +4 -0
  261. package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.md +237 -0
  262. package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.rules.json +121 -0
  263. package/localized/zh-CN/skills/fec-testing-strategy/references/common/engineering-practices.sources.json +377 -0
  264. package/localized/zh-CN/skills/fec-testing-strategy/references/engineering-practices.md +73 -0
  265. package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +4 -0
  266. package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.md +237 -0
  267. package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.rules.json +121 -0
  268. package/localized/zh-CN/skills/fec-vue3-project-standard/references/common/engineering-practices.sources.json +377 -0
  269. package/localized/zh-CN/skills/fec-vue3-project-standard/references/engineering-practices.md +73 -0
  270. package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +2 -2
  271. package/localized/zh-CN/skills/metadata.json +2246 -1008
  272. package/localized/zh-CN/skills/relations.json +501 -372
  273. package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +3 -29
  274. package/localized/zh-CN/templates/shared/rules/fec-typescript.md +4 -4
  275. package/localized/zh-CN/templates/shared/rules/references/common/source-driven-development.md +19 -0
  276. package/openclaw.plugin.json +1 -1
  277. package/package.json +11 -4
  278. package/skills/cc-c-project-standard/SKILL.md +25 -0
  279. package/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
  280. package/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
  281. package/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
  282. package/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
  283. package/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
  284. package/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
  285. package/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
  286. package/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
  287. package/skills/cc-c-project-standard/references/practice.md +37 -0
  288. package/skills/cc-cpp-project-standard/SKILL.md +25 -0
  289. package/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
  290. package/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
  291. package/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
  292. package/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
  293. package/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
  294. package/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
  295. package/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
  296. package/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
  297. package/skills/cc-cpp-project-standard/references/practice.md +37 -0
  298. package/skills/cc-debug-methodology/SKILL.md +8 -0
  299. package/skills/cc-debug-methodology/references/method.md +13 -0
  300. package/skills/cc-doc-sync-core/SKILL.md +8 -0
  301. package/skills/cc-doc-sync-core/references/method.md +12 -0
  302. package/skills/{fec-drawio-studio → cc-drawio-studio}/SKILL.md +5 -5
  303. package/skills/{fec-drawio-studio → cc-drawio-studio}/references/flowchart-quality.md +1 -1
  304. package/skills/{fec-drawio-studio → cc-drawio-studio}/references/layout-and-export.md +9 -9
  305. package/skills/cc-electron-project-standard/SKILL.md +21 -0
  306. package/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
  307. package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
  308. package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
  309. package/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
  310. package/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
  311. package/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
  312. package/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
  313. package/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
  314. package/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
  315. package/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
  316. package/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
  317. package/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
  318. package/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
  319. package/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
  320. package/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
  321. package/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
  322. package/skills/cc-electron-project-standard/references/practice.md +19 -0
  323. package/skills/cc-electron-project-standard/references/verification.md +17 -0
  324. package/skills/cc-go-concurrency/SKILL.md +25 -0
  325. package/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
  326. package/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
  327. package/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
  328. package/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
  329. package/skills/cc-go-concurrency/references/practice.md +37 -0
  330. package/skills/cc-go-project-standard/SKILL.md +25 -0
  331. package/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
  332. package/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
  333. package/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
  334. package/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
  335. package/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
  336. package/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
  337. package/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
  338. package/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
  339. package/skills/cc-go-project-standard/references/practice.md +37 -0
  340. package/skills/cc-java-project-standard/SKILL.md +25 -0
  341. package/skills/cc-java-project-standard/examples/engineering/README.md +7 -0
  342. package/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
  343. package/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
  344. package/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
  345. package/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
  346. package/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
  347. package/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
  348. package/skills/cc-java-project-standard/references/practice.md +35 -0
  349. package/skills/cc-java-runtime/SKILL.md +25 -0
  350. package/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
  351. package/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
  352. package/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
  353. package/skills/cc-java-runtime/references/engineering-practices.md +73 -0
  354. package/skills/cc-java-runtime/references/practice.md +37 -0
  355. package/skills/cc-native-memory-safety/SKILL.md +25 -0
  356. package/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
  357. package/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
  358. package/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
  359. package/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
  360. package/skills/cc-native-memory-safety/references/practice.md +37 -0
  361. package/skills/cc-python-async/SKILL.md +25 -0
  362. package/skills/cc-python-async/references/common/engineering-practices.md +237 -0
  363. package/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
  364. package/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
  365. package/skills/cc-python-async/references/engineering-practices.md +73 -0
  366. package/skills/cc-python-async/references/practice.md +37 -0
  367. package/skills/cc-python-project-standard/SKILL.md +25 -0
  368. package/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
  369. package/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
  370. package/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
  371. package/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
  372. package/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
  373. package/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
  374. package/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
  375. package/skills/cc-python-project-standard/references/practice.md +37 -0
  376. package/skills/cc-refactoring-core/SKILL.md +8 -0
  377. package/skills/cc-refactoring-core/references/method.md +16 -0
  378. package/skills/cc-rust-async/SKILL.md +25 -0
  379. package/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
  380. package/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
  381. package/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
  382. package/skills/cc-rust-async/references/engineering-practices.md +73 -0
  383. package/skills/cc-rust-async/references/practice.md +37 -0
  384. package/skills/cc-rust-project-standard/SKILL.md +25 -0
  385. package/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
  386. package/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
  387. package/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
  388. package/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
  389. package/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
  390. package/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
  391. package/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
  392. package/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
  393. package/skills/cc-rust-project-standard/references/practice.md +37 -0
  394. package/skills/cc-source-driven-development/SKILL.md +8 -0
  395. package/skills/cc-source-driven-development/references/method.md +19 -0
  396. package/skills/cc-tauri-project-standard/SKILL.md +21 -0
  397. package/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
  398. package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
  399. package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
  400. package/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
  401. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
  402. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
  403. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
  404. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
  405. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
  406. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
  407. package/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
  408. package/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
  409. package/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
  410. package/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
  411. package/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
  412. package/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
  413. package/skills/cc-tauri-project-standard/references/practice.md +20 -0
  414. package/skills/cc-tauri-project-standard/references/verification.md +18 -0
  415. package/skills/cc-tdd-methodology/SKILL.md +8 -0
  416. package/skills/cc-tdd-methodology/references/method.md +13 -0
  417. package/skills/cc-technical-diagrams/SKILL.md +34 -0
  418. package/skills/{fec-image-generation → cc-technical-diagrams}/assets/interactive-diagram.html +371 -371
  419. package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/README.md +5 -5
  420. package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.mmd +21 -21
  421. package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.mmd +7 -7
  422. package/skills/{fec-image-generation → cc-technical-diagrams}/references/diagram-workflows.md +3 -3
  423. package/skills/{fec-image-generation → cc-technical-diagrams}/references/html-technical-diagrams.md +7 -7
  424. package/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
  425. package/{localized/zh-CN/skills/fec-image-generation → skills/cc-technical-diagrams}/scripts/diagram-browser.mjs +77 -14
  426. package/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
  427. package/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
  428. package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/SKILL.md +10 -4
  429. package/skills/cc-typescript-project-standard/examples/engineering/README.md +9 -0
  430. package/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
  431. package/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
  432. package/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
  433. package/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
  434. package/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
  435. package/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
  436. package/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
  437. package/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
  438. package/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
  439. package/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
  440. package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety-patterns.md +6 -35
  441. package/skills/{fec-typescript-project-standard → cc-typescript-project-standard}/references/type-safety.md +7 -1
  442. package/skills/eval_queries.json +741 -319
  443. package/skills/fec-api-integration/SKILL.md +5 -1
  444. package/skills/fec-api-integration/references/common/engineering-practices.md +237 -0
  445. package/skills/fec-api-integration/references/common/engineering-practices.rules.json +121 -0
  446. package/skills/fec-api-integration/references/common/engineering-practices.sources.json +377 -0
  447. package/skills/fec-api-integration/references/engineering-practices.md +73 -0
  448. package/skills/fec-code-review/SKILL.md +4 -0
  449. package/skills/fec-code-review/references/common/engineering-practices.md +237 -0
  450. package/skills/fec-code-review/references/common/engineering-practices.rules.json +121 -0
  451. package/skills/fec-code-review/references/common/engineering-practices.sources.json +377 -0
  452. package/skills/fec-code-review/references/engineering-practices.md +73 -0
  453. package/skills/fec-data-fetching/SKILL.md +4 -0
  454. package/skills/fec-data-fetching/references/common/engineering-practices.md +237 -0
  455. package/skills/fec-data-fetching/references/common/engineering-practices.rules.json +121 -0
  456. package/skills/fec-data-fetching/references/common/engineering-practices.sources.json +377 -0
  457. package/skills/fec-data-fetching/references/engineering-practices.md +73 -0
  458. package/skills/fec-debug-framework/SKILL.md +2 -51
  459. package/skills/fec-debug-framework/references/common/debug.md +13 -0
  460. package/skills/fec-dependency-upgrade/SKILL.md +4 -0
  461. package/skills/fec-dependency-upgrade/references/common/engineering-practices.md +237 -0
  462. package/skills/fec-dependency-upgrade/references/common/engineering-practices.rules.json +121 -0
  463. package/skills/fec-dependency-upgrade/references/common/engineering-practices.sources.json +377 -0
  464. package/skills/fec-dependency-upgrade/references/engineering-practices.md +73 -0
  465. package/skills/fec-doc-sync/SKILL.md +7 -28
  466. package/skills/fec-doc-sync/references/common/doc-sync.md +12 -0
  467. package/skills/fec-image-generation/SKILL.md +7 -102
  468. package/skills/fec-image-generation/references/png-qa-autofix.md +1 -1
  469. package/skills/fec-image-generation/scripts/png-qa.mjs +1 -1
  470. package/skills/fec-react-project-standard/SKILL.md +6 -0
  471. package/skills/fec-react-project-standard/examples/engineering/README.md +7 -0
  472. package/skills/fec-react-project-standard/examples/engineering/package.json +15 -0
  473. package/skills/fec-react-project-standard/examples/engineering/pnpm-lock.yaml +662 -0
  474. package/skills/fec-react-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
  475. package/skills/fec-react-project-standard/examples/engineering/request-view.mjs +24 -0
  476. package/skills/fec-react-project-standard/examples/engineering/request-view.test.mjs +33 -0
  477. package/skills/fec-react-project-standard/references/common/engineering-practices.md +237 -0
  478. package/skills/fec-react-project-standard/references/common/engineering-practices.rules.json +121 -0
  479. package/skills/fec-react-project-standard/references/common/engineering-practices.sources.json +377 -0
  480. package/skills/fec-react-project-standard/references/engineering-practices.md +73 -0
  481. package/skills/fec-react-project-standard/references/generic-component-types.md +37 -0
  482. package/skills/fec-react-project-standard/references/react-quality-patterns.md +3 -3
  483. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +1 -1
  484. package/skills/fec-refactoring/SKILL.md +12 -70
  485. package/skills/fec-refactoring/references/common/refactoring.md +16 -0
  486. package/skills/fec-refactoring/references/principles.md +9 -56
  487. package/skills/fec-refactoring/references/workflow.md +4 -87
  488. package/skills/fec-security-review/SKILL.md +4 -0
  489. package/skills/fec-security-review/references/common/engineering-practices.md +237 -0
  490. package/skills/fec-security-review/references/common/engineering-practices.rules.json +121 -0
  491. package/skills/fec-security-review/references/common/engineering-practices.sources.json +377 -0
  492. package/skills/fec-security-review/references/engineering-practices.md +73 -0
  493. package/skills/fec-tdd-workflow/SKILL.md +13 -45
  494. package/skills/fec-tdd-workflow/references/common/tdd.md +13 -0
  495. package/skills/fec-testing-strategy/SKILL.md +4 -0
  496. package/skills/fec-testing-strategy/references/common/engineering-practices.md +237 -0
  497. package/skills/fec-testing-strategy/references/common/engineering-practices.rules.json +121 -0
  498. package/skills/fec-testing-strategy/references/common/engineering-practices.sources.json +377 -0
  499. package/skills/fec-testing-strategy/references/engineering-practices.md +73 -0
  500. package/skills/fec-vue3-project-standard/SKILL.md +4 -0
  501. package/skills/fec-vue3-project-standard/references/common/engineering-practices.md +237 -0
  502. package/skills/fec-vue3-project-standard/references/common/engineering-practices.rules.json +121 -0
  503. package/skills/fec-vue3-project-standard/references/common/engineering-practices.sources.json +377 -0
  504. package/skills/fec-vue3-project-standard/references/engineering-practices.md +73 -0
  505. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +2 -2
  506. package/skills/metadata.json +2246 -1008
  507. package/skills/relations.json +501 -372
  508. package/templates/shared/rules/fec-source-driven-development.md +3 -29
  509. package/templates/shared/rules/fec-typescript.md +4 -4
  510. package/templates/shared/rules/references/common/source-driven-development.md +19 -0
  511. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +0 -14
  512. package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +0 -87
  513. package/skills/fec-source-driven-development/SKILL.md +0 -87
  514. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/THIRD_PARTY_NOTICES.md +0 -0
  515. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/brand-icons.json +0 -0
  516. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/data/shape-index.json +0 -0
  517. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/data-residency.md +0 -0
  518. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/diagram-patterns.md +0 -0
  519. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/troubleshooting.md +0 -0
  520. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/references/xml-and-mermaid.md +0 -0
  521. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/brand-symbols.mjs +0 -0
  522. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-lint.mjs +0 -0
  523. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-url.mjs +0 -0
  524. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/drawio-export.mjs +0 -0
  525. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/layout-graph.mjs +0 -0
  526. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/png-embed-fix.mjs +0 -0
  527. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-go-packages.mjs +0 -0
  528. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-js-modules.mjs +0 -0
  529. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-classes.mjs +0 -0
  530. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-modules.mjs +0 -0
  531. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-rust-modules.mjs +0 -0
  532. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-ts-modules.mjs +0 -0
  533. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/shape-query.mjs +0 -0
  534. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/studio-core.mjs +0 -0
  535. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/corporate.json +0 -0
  536. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/default.json +0 -0
  537. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/handdrawn.json +0 -0
  538. /package/localized/zh-CN/skills/{fec-drawio-studio → cc-drawio-studio}/styles/schema.json +0 -0
  539. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/architecture.json +0 -0
  540. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/invalid-explicit.json +0 -0
  541. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.json +0 -0
  542. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.json +0 -0
  543. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/export-diagram.mjs +0 -0
  544. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/interactive-diagram-server.mjs +0 -0
  545. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/mermaid-render.mjs +0 -0
  546. /package/localized/zh-CN/skills/{fec-image-generation → cc-technical-diagrams}/scripts/tech-diagram-render.mjs +0 -0
  547. /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/THIRD_PARTY_NOTICES.md +0 -0
  548. /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/brand-icons.json +0 -0
  549. /package/skills/{fec-drawio-studio → cc-drawio-studio}/data/shape-index.json +0 -0
  550. /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/data-residency.md +0 -0
  551. /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/diagram-patterns.md +0 -0
  552. /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/troubleshooting.md +0 -0
  553. /package/skills/{fec-drawio-studio → cc-drawio-studio}/references/xml-and-mermaid.md +0 -0
  554. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/brand-symbols.mjs +0 -0
  555. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-lint.mjs +0 -0
  556. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/diagram-url.mjs +0 -0
  557. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/drawio-export.mjs +0 -0
  558. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/layout-graph.mjs +0 -0
  559. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/png-embed-fix.mjs +0 -0
  560. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-go-packages.mjs +0 -0
  561. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-js-modules.mjs +0 -0
  562. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-classes.mjs +0 -0
  563. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-python-modules.mjs +0 -0
  564. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-rust-modules.mjs +0 -0
  565. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/scan-ts-modules.mjs +0 -0
  566. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/shape-query.mjs +0 -0
  567. /package/skills/{fec-drawio-studio → cc-drawio-studio}/scripts/studio-core.mjs +0 -0
  568. /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/corporate.json +0 -0
  569. /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/default.json +0 -0
  570. /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/built-in/handdrawn.json +0 -0
  571. /package/skills/{fec-drawio-studio → cc-drawio-studio}/styles/schema.json +0 -0
  572. /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/architecture.json +0 -0
  573. /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/invalid-explicit.json +0 -0
  574. /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/sequence.json +0 -0
  575. /package/skills/{fec-image-generation → cc-technical-diagrams}/assets/quality-examples/workflow.json +0 -0
  576. /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/export-diagram.mjs +0 -0
  577. /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/interactive-diagram-server.mjs +0 -0
  578. /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/mermaid-render.mjs +0 -0
  579. /package/skills/{fec-image-generation → cc-technical-diagrams}/scripts/tech-diagram-render.mjs +0 -0
@@ -0,0 +1,462 @@
1
+ #!/usr/bin/env node
2
+ // @ts-nocheck
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import zlib from "node:zlib";
6
+ import { segmentHits } from "./diagram-layout.mjs";
7
+ import { pathToFileURL } from "node:url";
8
+
9
+ if (process.argv[1] && pathToFileURL(path.resolve(process.argv[1])).href === import.meta.url) {
10
+ const args = parseArgs(process.argv.slice(2));
11
+
12
+ if (!args.png || args.help) {
13
+ printHelp();
14
+ process.exit(args.help ? 0 : 1);
15
+ }
16
+
17
+ try {
18
+ const image = readPng(args.png);
19
+ const manifest = args.manifest ? readManifest(args.manifest) : undefined;
20
+ const report = analyze(image, manifest, Boolean(args.strict));
21
+ if ((args.format ?? "markdown") === "json") {
22
+ console.log(JSON.stringify(report, null, 2));
23
+ } else {
24
+ console.log(renderMarkdown(report));
25
+ }
26
+ process.exit(report.ok ? 0 : 2);
27
+ } catch (error) {
28
+ console.error(error instanceof Error ? error.message : String(error));
29
+ process.exit(1);
30
+ }
31
+
32
+ }
33
+
34
+ function parseArgs(values) {
35
+ const parsed = { format: "markdown", strict: false, help: false };
36
+ for (let index = 0; index < values.length; index += 1) {
37
+ const value = values[index];
38
+ if (value === "--help" || value === "-h") parsed.help = true;
39
+ else if (value === "--strict") parsed.strict = true;
40
+ else if (value === "--png") parsed.png = values[++index];
41
+ else if (value === "--manifest") parsed.manifest = values[++index];
42
+ else if (value === "--format") parsed.format = values[++index];
43
+ else throw new Error(`Unknown argument: ${value}`);
44
+ }
45
+ if (parsed.format !== "json" && parsed.format !== "markdown") {
46
+ throw new Error("--format must be json or markdown");
47
+ }
48
+ return parsed;
49
+ }
50
+
51
+ function printHelp() {
52
+ console.log(`Usage: node skills/cc-technical-diagrams/scripts/png-qa.mjs --png <file> [--manifest <layout.json>] [--format json|markdown] [--strict]`);
53
+ }
54
+
55
+ function readManifest(filePath) {
56
+ const manifest = JSON.parse(fs.readFileSync(filePath, "utf8"));
57
+ return {
58
+ ...manifest,
59
+ canvas: manifest.canvas,
60
+ boxes: Array.isArray(manifest.boxes) ? manifest.boxes : [],
61
+ connectors: Array.isArray(manifest.connectors) ? manifest.connectors : [],
62
+ };
63
+ }
64
+
65
+ function readPng(filePath) {
66
+ const buffer = fs.readFileSync(filePath);
67
+ const signature = "89504e470d0a1a0a";
68
+ if (buffer.subarray(0, 8).toString("hex") !== signature) {
69
+ throw new Error(`Not a PNG file: ${filePath}`);
70
+ }
71
+
72
+ let offset = 8;
73
+ let ihdr;
74
+ const idat = [];
75
+ while (offset < buffer.length) {
76
+ const length = buffer.readUInt32BE(offset);
77
+ const type = buffer.subarray(offset + 4, offset + 8).toString("ascii");
78
+ const data = buffer.subarray(offset + 8, offset + 8 + length);
79
+ offset += 12 + length;
80
+ if (type === "IHDR") {
81
+ ihdr = {
82
+ width: data.readUInt32BE(0),
83
+ height: data.readUInt32BE(4),
84
+ bitDepth: data[8],
85
+ colorType: data[9],
86
+ compression: data[10],
87
+ filter: data[11],
88
+ interlace: data[12],
89
+ };
90
+ } else if (type === "IDAT") {
91
+ idat.push(data);
92
+ } else if (type === "IEND") {
93
+ break;
94
+ }
95
+ }
96
+
97
+ if (!ihdr) throw new Error("PNG is missing IHDR");
98
+ if (ihdr.bitDepth !== 8) throw new Error(`Unsupported PNG bit depth: ${ihdr.bitDepth}`);
99
+ if (ihdr.compression !== 0 || ihdr.filter !== 0 || ihdr.interlace !== 0) {
100
+ throw new Error("Unsupported PNG compression/filter/interlace settings");
101
+ }
102
+
103
+ const channels = channelsForColorType(ihdr.colorType);
104
+ const inflated = zlib.inflateSync(Buffer.concat(idat));
105
+ const pixels = unfilter(inflated, ihdr.width, ihdr.height, channels);
106
+ return {
107
+ path: path.resolve(filePath),
108
+ width: ihdr.width,
109
+ height: ihdr.height,
110
+ colorType: ihdr.colorType,
111
+ channels,
112
+ pixels,
113
+ };
114
+ }
115
+
116
+ function channelsForColorType(colorType) {
117
+ if (colorType === 0) return 1;
118
+ if (colorType === 2) return 3;
119
+ if (colorType === 4) return 2;
120
+ if (colorType === 6) return 4;
121
+ throw new Error(`Unsupported PNG color type: ${colorType}`);
122
+ }
123
+
124
+ function unfilter(data, width, height, channels) {
125
+ const stride = width * channels;
126
+ const output = Buffer.alloc(stride * height);
127
+ let sourceOffset = 0;
128
+
129
+ for (let y = 0; y < height; y += 1) {
130
+ const filterType = data[sourceOffset];
131
+ sourceOffset += 1;
132
+ const rowOffset = y * stride;
133
+ const previousRowOffset = (y - 1) * stride;
134
+
135
+ for (let x = 0; x < stride; x += 1) {
136
+ const raw = data[sourceOffset + x];
137
+ const left = x >= channels ? output[rowOffset + x - channels] : 0;
138
+ const up = y > 0 ? output[previousRowOffset + x] : 0;
139
+ const upLeft = y > 0 && x >= channels ? output[previousRowOffset + x - channels] : 0;
140
+ let value;
141
+ if (filterType === 0) value = raw;
142
+ else if (filterType === 1) value = raw + left;
143
+ else if (filterType === 2) value = raw + up;
144
+ else if (filterType === 3) value = raw + Math.floor((left + up) / 2);
145
+ else if (filterType === 4) value = raw + paeth(left, up, upLeft);
146
+ else throw new Error(`Unsupported PNG filter type: ${filterType}`);
147
+ output[rowOffset + x] = value & 0xff;
148
+ }
149
+ sourceOffset += stride;
150
+ }
151
+
152
+ return output;
153
+ }
154
+
155
+ function paeth(left, up, upLeft) {
156
+ const estimate = left + up - upLeft;
157
+ const leftDistance = Math.abs(estimate - left);
158
+ const upDistance = Math.abs(estimate - up);
159
+ const upLeftDistance = Math.abs(estimate - upLeft);
160
+ if (leftDistance <= upDistance && leftDistance <= upLeftDistance) return left;
161
+ if (upDistance <= upLeftDistance) return up;
162
+ return upLeft;
163
+ }
164
+
165
+ function analyze(image, manifest, strict) {
166
+ const issues = [];
167
+ const nextActions = new Set();
168
+ const ink = measureInk(image, strict ? 10 : 18);
169
+
170
+ if (image.width < 64 || image.height < 64) {
171
+ addIssue(issues, nextActions, "image-too-small", "PNG is too small for reliable visual QA.", "Export a larger PNG before review.");
172
+ }
173
+
174
+ if (ink.coverage < (strict ? 0.001 : 0.0002)) {
175
+ addIssue(issues, nextActions, "blank-image", "PNG appears blank or nearly blank.", "Check the renderer/export target and regenerate the image.");
176
+ }
177
+
178
+ if (ink.bounds) {
179
+ const pad = strict ? 6 : 3;
180
+ if (ink.bounds.minX <= pad || ink.bounds.minY <= pad || image.width - ink.bounds.maxX <= pad || image.height - ink.bounds.maxY <= pad) {
181
+ addIssue(issues, nextActions, "edge-clipping", "Visible content is very close to the PNG edge.", "Increase canvas/viewBox padding or reduce subject scale.");
182
+ }
183
+ }
184
+
185
+ if (manifest) analyzeManifest(image, manifest, issues, nextActions, strict);
186
+
187
+ return {
188
+ ok: issues.length === 0,
189
+ image: {
190
+ path: image.path,
191
+ width: image.width,
192
+ height: image.height,
193
+ colorType: image.colorType,
194
+ inkCoverage: Number(ink.coverage.toFixed(6)),
195
+ inkBounds: ink.bounds,
196
+ },
197
+ measurement: manifest?.measurement ?? "image-only",
198
+ verification: { image: "checked", geometry: manifest ? "checked" : "unavailable", text: manifest?.measurement === "browser" ? "browser-measured" : "estimated-or-unavailable", visual: "pending" },
199
+ issues,
200
+ nextActions: [...nextActions],
201
+ };
202
+ }
203
+
204
+ function measureInk(image, threshold) {
205
+ const first = samplePixel(image, 0, 0);
206
+ let inkPixels = 0;
207
+ let minX = image.width;
208
+ let minY = image.height;
209
+ let maxX = -1;
210
+ let maxY = -1;
211
+
212
+ for (let y = 0; y < image.height; y += 1) {
213
+ for (let x = 0; x < image.width; x += 1) {
214
+ const pixel = samplePixel(image, x, y);
215
+ const differs = colorDistance(pixel, first) > threshold && pixel.a > 8;
216
+ if (differs) {
217
+ inkPixels += 1;
218
+ minX = Math.min(minX, x);
219
+ minY = Math.min(minY, y);
220
+ maxX = Math.max(maxX, x);
221
+ maxY = Math.max(maxY, y);
222
+ }
223
+ }
224
+ }
225
+
226
+ return {
227
+ coverage: inkPixels / (image.width * image.height),
228
+ bounds: inkPixels > 0 ? { minX, minY, maxX, maxY } : null,
229
+ };
230
+ }
231
+
232
+ function samplePixel(image, x, y) {
233
+ const offset = (y * image.width + x) * image.channels;
234
+ if (image.channels === 1) {
235
+ const value = image.pixels[offset];
236
+ return { r: value, g: value, b: value, a: 255 };
237
+ }
238
+ if (image.channels === 2) {
239
+ const value = image.pixels[offset];
240
+ return { r: value, g: value, b: value, a: image.pixels[offset + 1] };
241
+ }
242
+ return {
243
+ r: image.pixels[offset],
244
+ g: image.pixels[offset + 1],
245
+ b: image.pixels[offset + 2],
246
+ a: image.channels === 4 ? image.pixels[offset + 3] : 255,
247
+ };
248
+ }
249
+
250
+ function colorDistance(left, right) {
251
+ return Math.abs(left.r - right.r) + Math.abs(left.g - right.g) + Math.abs(left.b - right.b) + Math.abs(left.a - right.a);
252
+ }
253
+
254
+ export function analyzeManifest(image, manifest, issues, nextActions, strict) {
255
+ if (manifest.canvas && (manifest.canvas.width !== image.width || manifest.canvas.height !== image.height)) {
256
+ addIssue(
257
+ issues,
258
+ nextActions,
259
+ "manifest-canvas-mismatch",
260
+ `Manifest canvas ${manifest.canvas.width}x${manifest.canvas.height} does not match PNG ${image.width}x${image.height}.`,
261
+ "Regenerate the manifest from the final export dimensions.",
262
+ );
263
+ }
264
+
265
+ for (const box of manifest.boxes) if (![box.x,box.y,box.width,box.height].every(Number.isFinite) || box.width <= 0 || box.height <= 0) addIssue(issues,nextActions,"invalid-box-geometry",`Invalid geometry for "${box.id}".`,"Correct source dimensions.");
266
+ const allBoxes = manifest.boxes.map(normalizeBox).filter(Boolean);
267
+ const boxes = allBoxes.filter((box) => box.kind !== "group");
268
+ for (const issue of manifest.issues ?? []) addIssue(issues, nextActions, issue.code, issue.message, "Fix the source layout and render again.");
269
+ const labels = manifest.labels ?? [];
270
+ for (const label of labels) {
271
+ const owner = allBoxes.find((box) => box.id === label.owner);
272
+ if (label.kind === "node" && !owner) addIssue(issues,nextActions,"label-owner-missing",`Label "${label.id}" has an unknown node owner.`,"Correct label ownership in the manifest.");
273
+ if (![label.x,label.y,label.width,label.height].every(Number.isFinite) || label.width < 0 || label.height < 0) addIssue(issues,nextActions,"invalid-label-geometry",`Label "${label.id}" has invalid bounds.`,"Measure source labels again.");
274
+ if (label.x < 0 || label.y < 0 || label.x + label.width > image.width || label.y + label.height > image.height) addIssue(issues, nextActions, "label-out-of-bounds", `Label "${label.id}" exceeds the canvas.`, "Expand the canvas or adjust the source label position.");
275
+ if (label.kind === "node" && owner && (label.x < owner.x || label.y < owner.y || label.x + label.width > owner.x + owner.width || label.y + label.height > owner.y + owner.height)) addIssue(issues, nextActions, "node-text-overflow", `Label "${label.id}" exceeds node "${owner.id}".`, "Expand the source node or adjust its text layout.");
276
+ if (Array.isArray(label.lines) && label.lines.join("").replace(/\r?\n/g, "") !== String(label.text ?? "").replace(/\r?\n/g, "")) addIssue(issues, nextActions, "label-content-loss", `Label "${label.id}" does not preserve source text.`, "Restore the complete source label.");
277
+ if (label.kind === "edge") for (const box of boxes) if (overlapArea(label, box) > 0) addIssue(issues, nextActions, "edge-label-collision", `Label "${label.id}" overlaps node "${box.id}".`, "Move the edge label to a clear route segment.");
278
+ }
279
+ for (let i = 0; i < labels.length; i++) for (let j = i + 1; j < labels.length; j++) if (overlapArea(labels[i], labels[j]) > 0) addIssue(issues, nextActions, "text-overlap", `Labels "${labels[i].id}" and "${labels[j].id}" overlap.`, "Increase label spacing in the source.");
280
+ for (const box of boxes) {
281
+ if (box.x < 0 || box.y < 0 || box.x + box.width > image.width || box.y + box.height > image.height) {
282
+ addIssue(issues, nextActions, "box-out-of-bounds", `Box "${box.id}" is outside the canvas.`, "Move out-of-bounds nodes inside the canvas or expand the canvas.");
283
+ }
284
+ if (!labels.length && box.label && estimateLabelOverflow(box, strict)) {
285
+ addIssue(issues, nextActions, "label-overflow", `Box "${box.id}" label is likely to overflow.`, "Wrap or shorten labels, widen boxes, or increase export scale.");
286
+ }
287
+ }
288
+
289
+ for (let i = 0; i < boxes.length; i += 1) {
290
+ for (let j = i + 1; j < boxes.length; j += 1) {
291
+ const overlap = overlapArea(boxes[i], boxes[j]);
292
+ if (overlap > 0) {
293
+ addIssue(issues, nextActions, "box-overlap", `Boxes "${boxes[i].id}" and "${boxes[j].id}" overlap by ${Math.round(overlap)}px^2.`, "Increase node spacing or split dense groups.");
294
+ }
295
+ }
296
+ }
297
+
298
+ const boxById = new Map(boxes.map((box) => [box.id, box]));
299
+ const segments = [];
300
+ for (const connector of manifest.connectors) {
301
+ const points = normalizePoints(connector.points);
302
+ if(points.some(point=>point.x<0||point.y<0||point.x>image.width||point.y>image.height)) addIssue(issues,nextActions,"connector-out-of-bounds",`Connector "${connector.id}" exceeds the canvas.`,"Correct explicit waypoints or expand the source canvas.");
303
+ if (points.length < 2 || points.every((point) => point.x === points[0].x && point.y === points[0].y)) addIssue(issues, nextActions, "degenerate-connector", `Connector "${connector.id ?? "unnamed"}" has no visible path.`, "Give self calls a loop and other connectors distinct endpoints.");
304
+ for (let index = 0; index < points.length - 1; index += 1) {
305
+ const segment = { connector, a: points[index], b: points[index + 1] };
306
+ segments.push(segment);
307
+ for (const label of labels) if (segmentHits([segment.a.x,segment.a.y],[segment.b.x,segment.b.y],label)) addIssue(issues,nextActions,"connector-through-text",`Connector "${connector.id}" crosses label "${label.id}".`,"Move the source label or route around its text.");
308
+ for (const box of boxes) {
309
+ if (box.id === connector.from || box.id === connector.to) continue;
310
+ if (segmentIntersectsBox(segment, box)) {
311
+ addIssue(issues, nextActions, "connector-through-label", `Connector "${connector.id ?? "unnamed"}" crosses box "${box.id}".`, "Add waypoints around labels or use orthogonal routing.");
312
+ }
313
+ }
314
+ }
315
+ if ((connector.from && !boxById.has(connector.from)) || (connector.to && !boxById.has(connector.to))) {
316
+ addIssue(issues, nextActions, "connector-endpoint-missing", `Connector "${connector.id ?? "unnamed"}" references a missing endpoint.`, "Update connector endpoints to match manifest box ids.");
317
+ }
318
+ }
319
+
320
+ for (let i = 0; i < segments.length; i += 1) {
321
+ for (let j = i + 1; j < segments.length; j += 1) {
322
+ if (segments[i].connector === segments[j].connector) continue;
323
+ if (segmentsStack(segments[i], segments[j], strict ? 4 : 2)) {
324
+ addIssue(issues, nextActions, "connector-stacking", "Two connector segments are stacked or nearly stacked.", "Offset parallel connectors or bundle them into a labeled shared route.");
325
+ }
326
+ }
327
+ }
328
+ }
329
+
330
+ function normalizeBox(box) {
331
+ if (!box || typeof box.id !== "string") return null;
332
+ const normalized = {
333
+ id: box.id,
334
+ kind: box.kind,
335
+ x: Number(box.x),
336
+ y: Number(box.y),
337
+ width: Number(box.width),
338
+ height: Number(box.height),
339
+ label: typeof box.label === "string" ? box.label : "",
340
+ };
341
+ if ([normalized.x, normalized.y, normalized.width, normalized.height].some((value) => !Number.isFinite(value))) return null;
342
+ return normalized;
343
+ }
344
+
345
+ function normalizePoints(points) {
346
+ if (!Array.isArray(points)) return [];
347
+ return points
348
+ .map((point) => {
349
+ if (Array.isArray(point)) return { x: Number(point[0]), y: Number(point[1]) };
350
+ return { x: Number(point?.x), y: Number(point?.y) };
351
+ })
352
+ .filter((point) => Number.isFinite(point.x) && Number.isFinite(point.y));
353
+ }
354
+
355
+ function estimateLabelOverflow(box, strict) {
356
+ const label = box.label.trim();
357
+ if (!label) return false;
358
+ const lines = label.split(/\r?\n/);
359
+ const maxLine = Math.max(...lines.map((line) => visualLength(line)));
360
+ const estimatedWidth = maxLine * (strict ? 7.5 : 7);
361
+ const estimatedHeight = lines.length * (strict ? 18 : 16);
362
+ return estimatedWidth > Math.max(0, box.width - 12) || estimatedHeight > Math.max(0, box.height - 8);
363
+ }
364
+
365
+ function visualLength(value) {
366
+ return [...value].reduce((total, char) => total + (/[\u4e00-\u9fff]/.test(char) ? 2 : 1), 0);
367
+ }
368
+
369
+ function overlapArea(left, right) {
370
+ const width = Math.max(0, Math.min(left.x + left.width, right.x + right.width) - Math.max(left.x, right.x));
371
+ const height = Math.max(0, Math.min(left.y + left.height, right.y + right.height) - Math.max(left.y, right.y));
372
+ return width * height;
373
+ }
374
+
375
+ function segmentIntersectsBox(segment, box) {
376
+ return segmentHits([segment.a.x,segment.a.y],[segment.b.x,segment.b.y],box);
377
+ }
378
+
379
+ function legacySegmentIntersectsBox(segment, box) {
380
+ if (pointInsideBox(segment.a, box) || pointInsideBox(segment.b, box)) return true;
381
+ const edges = [
382
+ [{ x: box.x, y: box.y }, { x: box.x + box.width, y: box.y }],
383
+ [{ x: box.x + box.width, y: box.y }, { x: box.x + box.width, y: box.y + box.height }],
384
+ [{ x: box.x + box.width, y: box.y + box.height }, { x: box.x, y: box.y + box.height }],
385
+ [{ x: box.x, y: box.y + box.height }, { x: box.x, y: box.y }],
386
+ ];
387
+ return edges.some(([a, b]) => segmentsIntersect(segment.a, segment.b, a, b));
388
+ }
389
+
390
+ function pointInsideBox(point, box) {
391
+ return point.x >= box.x && point.x <= box.x + box.width && point.y >= box.y && point.y <= box.y + box.height;
392
+ }
393
+
394
+ function segmentsIntersect(a, b, c, d) {
395
+ const o1 = orientation(a, b, c);
396
+ const o2 = orientation(a, b, d);
397
+ const o3 = orientation(c, d, a);
398
+ const o4 = orientation(c, d, b);
399
+ if (o1 !== o2 && o3 !== o4) return true;
400
+ return false;
401
+ }
402
+
403
+ function orientation(a, b, c) {
404
+ const value = (b.y - a.y) * (c.x - b.x) - (b.x - a.x) * (c.y - b.y);
405
+ if (Math.abs(value) < 0.0001) return 0;
406
+ return value > 0 ? 1 : 2;
407
+ }
408
+
409
+ function segmentsStack(left, right, tolerance) {
410
+ const leftHorizontal = Math.abs(left.a.y - left.b.y) <= tolerance;
411
+ const rightHorizontal = Math.abs(right.a.y - right.b.y) <= tolerance;
412
+ const leftVertical = Math.abs(left.a.x - left.b.x) <= tolerance;
413
+ const rightVertical = Math.abs(right.a.x - right.b.x) <= tolerance;
414
+
415
+ if (leftHorizontal && rightHorizontal && Math.abs(left.a.y - right.a.y) <= tolerance) {
416
+ return rangesOverlap([left.a.x, left.b.x], [right.a.x, right.b.x]) > tolerance;
417
+ }
418
+ if (leftVertical && rightVertical && Math.abs(left.a.x - right.a.x) <= tolerance) {
419
+ return rangesOverlap([left.a.y, left.b.y], [right.a.y, right.b.y]) > tolerance;
420
+ }
421
+ return false;
422
+ }
423
+
424
+ function rangesOverlap(left, right) {
425
+ const a = [Math.min(...left), Math.max(...left)];
426
+ const b = [Math.min(...right), Math.max(...right)];
427
+ return Math.max(0, Math.min(a[1], b[1]) - Math.max(a[0], b[0]));
428
+ }
429
+
430
+ function addIssue(issues, nextActions, code, message, action) {
431
+ issues.push({ code, message, action });
432
+ if (typeof nextActions.add === "function") nextActions.add(action);
433
+ else if (!nextActions.includes(action)) nextActions.push(action);
434
+ }
435
+
436
+ function renderMarkdown(report) {
437
+ const lines = [
438
+ "# PNG QA Report",
439
+ "",
440
+ `- Status: ${report.ok ? "ok" : "issues-found"}`,
441
+ `- Image: ${report.image.width}x${report.image.height}`,
442
+ `- Ink coverage: ${report.image.inkCoverage}`,
443
+ ];
444
+ if (report.image.inkBounds) {
445
+ lines.push(`- Ink bounds: ${JSON.stringify(report.image.inkBounds)}`);
446
+ }
447
+ lines.push("", "## Issues");
448
+ if (report.issues.length === 0) {
449
+ lines.push("- None");
450
+ } else {
451
+ for (const issue of report.issues) {
452
+ lines.push(`- ${issue.code}: ${issue.message}`);
453
+ }
454
+ }
455
+ lines.push("", "## Next Actions");
456
+ if (report.nextActions.length === 0) {
457
+ lines.push("- None");
458
+ } else {
459
+ for (const action of report.nextActions) lines.push(`- ${action}`);
460
+ }
461
+ return `${lines.join("\n")}\n`;
462
+ }
@@ -1,10 +1,12 @@
1
1
  ---
2
- name: fec-typescript-project-standard
3
- description: Use when creating, configuring, reviewing, or debugging TypeScript project standards across frontend apps, libraries, SDKs, CLIs, monorepo packages, tsconfig, strictness, module/moduleResolution, path aliases, project references, declaration files, package exports, public API types, DTOs, advanced generics, discriminated unions, type guards, type narrowing, or type-level regressions. Prefer framework project skills for React/Vue/Next/Nuxt component architecture; Chinese triggers include TypeScript project specification, TS project specification, TypeScript type safety, type modeling, generics, discriminative unions, type narrowing, tsconfig, declaration files.
2
+ name: cc-typescript-project-standard
3
+ description: Use when TypeScript configuration, module resolution, public API types, declarations, package exports, narrowing or generic contracts need design or review in applications, SDKs, CLI tools, desktop processes or libraries.
4
4
  ---
5
5
 
6
6
  # TypeScript project specifications
7
7
 
8
+ Apply to libraries, CLI tools, desktop cores and services. Determine the application role from the actual project; a frontend/backend product name does not constrain the language.
9
+
8
10
  ## Purpose
9
11
 
10
12
  Unify project configuration, type boundaries, and release product rules for the TypeScript layer. Works with front-end applications, component libraries, SDKs, CLIs, monorepo packages, and pure TypeScript tool libraries, but does not take over the framework architecture responsibilities of React, Vue, Next.js, Nuxt, or Vite.
@@ -19,7 +21,7 @@ Unify project configuration, type boundaries, and release product rules for the
19
21
  - The component architecture, routing organization, and state management of frameworks such as React, Vue, Next.js, and Nuxt belong to the corresponding framework skills; this process only deals with cross-framework TypeScript contracts and project boundaries.
20
22
 
21
23
  2. Convergence `tsconfig`
22
- - Turn on `strict` by default, do not turn off key constraints such as `noImplicitAny`, `strictNullChecks` or `exactOptionalPropertyTypes` for pass builds.
24
+ - Prefer `strict` for new code and preserve existing checks; do not disable `noImplicitAny` or `strictNullChecks` merely to hide a defect. `exactOptionalPropertyTypes` is a separate option; introduce stricter settings through a scoped, compatible migration when justified.
23
25
  - Select `target`, `lib`, `module` and `moduleResolution` according to the running environment; browser applications, Node scripts, and library packages should not share an ambiguous configuration.
24
26
  - Separate basic configuration, application configuration, test configuration and build declaration configuration to avoid testing global types from polluting production code.
25
27
  - Path aliases must be understood by TypeScript, bundler, test runner, and published products at the same time; library packages must not publish source code aliases that cannot be resolved.
@@ -43,7 +45,7 @@ Unify project configuration, type boundaries, and release product rules for the
43
45
 
44
46
  ## Constraints
45
47
 
46
- - Don't use `skipLibCheck`, `any`, unguarded non-null assertions or the wide `as` to mask real boundary issues.
48
+ - Do not use `any`, unguarded non-null assertions or broad `as` to conceal an unverified boundary. A justified `skipLibCheck` dependency policy is separate from checking your own public API; record its limits.
47
49
  - Do not rely on release package private deep paths in application code.
48
50
  - Do not put framework directory structure, component layering, routing organization or state management decisions into this process; these are left to the corresponding framework or dedicated process.
49
51
  - Don't pollute browser running code with generated, test, or Node-only types.
@@ -52,3 +54,7 @@ Unify project configuration, type boundaries, and release product rules for the
52
54
  ## Expected Output
53
55
 
54
56
  The output should include TypeScript context determinations, key `tsconfig`/package type entry suggestions, type boundary schemes, declaration file or public API risks, and verification commands. After completion, the project should be able to independently typecheck, public types can be parsed by consumers, and type safety issues should have clear narrowing or modeling solutions.
57
+
58
+ ## Engineering practices
59
+
60
+ Read the [local engineering decisions](references/engineering-practices.md) for this task and follow their links to relevant shared principles. Apply levels and exceptions against actual project contracts; product frontend/backend labels do not constrain language or role.
@@ -0,0 +1,9 @@
1
+ # External input boundary — EP-TS-01
2
+
3
+ Use a separate writable copy of this directory. This example targets Node >=22.18 for native type stripping, with explicitly declared TypeScript and Node types; it does not change the parent project's supported versions.
4
+
5
+ Prepare once: `pnpm install --ignore-scripts --frozen-lockfile`. Then `pnpm typecheck` and `pnpm test`. In PowerShell set `$env:CRAFT_ENGINEERING_DEFECTIVE='1'` and run the same test: the named invalid-input assertion must fail after successful preparation/type checking. Set it to `'0'` (or remove it) and rerun: both tests pass. POSIX: prefix the test command with `CRAFT_ENGINEERING_DEFECTIVE=1` or `=0`.
6
+
7
+ The callback records real effects before/after validation; the defective branch deliberately replaces validation with a cast. Default behavior is protected. This does not test a payment backend, browser, async state or declaration publishing; those require their own consumer checks. No test imports parent-repository source. Install/build output belongs only to the writable copy.
8
+
9
+ [Node.js type-stripping history and limitations](https://nodejs.org/api/typescript.html): runtime stripping is separate from the explicit TypeScript type check.
@@ -0,0 +1,16 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { acceptAmount } from "./input.ts";
4
+
5
+ test("EP-TS-01 rejects invalid input before any effect", () => {
6
+ const effects: number[] = [];
7
+ for (const input of [{ amount: "10" }, { amount: -1 }, { amount: Number.MAX_SAFE_INTEGER + 1 }, null]) {
8
+ assert.throws(() => acceptAmount(input, amount => effects.push(amount)), /invalid amount/);
9
+ assert.deepEqual(effects, []);
10
+ }
11
+ });
12
+ test("EP-TS-01 accepts a valid input exactly once", () => {
13
+ const effects: number[] = [];
14
+ acceptAmount({ amount: 10 }, amount => effects.push(amount));
15
+ assert.deepEqual(effects, [10]);
16
+ });
@@ -0,0 +1,12 @@
1
+ /** Test switch only; normal use always validates the external boundary. */
2
+ export function acceptAmount(value: unknown, effect: (amount: number) => void): void {
3
+ if (process.env.CRAFT_ENGINEERING_DEFECTIVE === "1") {
4
+ effect((value as { amount: number }).amount);
5
+ return;
6
+ }
7
+ if (typeof value !== "object" || value === null || !("amount" in value)
8
+ || typeof value.amount !== "number" || !Number.isSafeInteger(value.amount) || value.amount <= 0) {
9
+ throw new TypeError("invalid amount");
10
+ }
11
+ effect(value.amount);
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "engineering-typescript-boundary-example",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "engines": { "node": ">=22.18.0" },
7
+ "scripts": {
8
+ "typecheck": "tsc --noEmit",
9
+ "test": "node --experimental-strip-types --test --test-reporter=tap boundary.test.ts"
10
+ },
11
+ "devDependencies": { "typescript": "5.9.3", "@types/node": "22.20.5" }
12
+ }
@@ -0,0 +1,39 @@
1
+ lockfileVersion: '9.0'
2
+
3
+ settings:
4
+ autoInstallPeers: true
5
+ excludeLinksFromLockfile: false
6
+
7
+ importers:
8
+
9
+ .:
10
+ devDependencies:
11
+ '@types/node':
12
+ specifier: 22.20.5
13
+ version: 22.20.5
14
+ typescript:
15
+ specifier: 5.9.3
16
+ version: 5.9.3
17
+
18
+ packages:
19
+
20
+ '@types/node@22.20.5':
21
+ resolution: {integrity: sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==}
22
+
23
+ typescript@5.9.3:
24
+ resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
25
+ engines: {node: '>=14.17'}
26
+ hasBin: true
27
+
28
+ undici-types@6.21.0:
29
+ resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
30
+
31
+ snapshots:
32
+
33
+ '@types/node@22.20.5':
34
+ dependencies:
35
+ undici-types: 6.21.0
36
+
37
+ typescript@5.9.3: {}
38
+
39
+ undici-types@6.21.0: {}
@@ -0,0 +1,8 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext",
4
+ "strict": true, "noEmit": true, "allowImportingTsExtensions": true,
5
+ "types": ["node"]
6
+ },
7
+ "include": ["*.ts"]
8
+ }