@bovinphang/craft-common 1.0.1 → 2.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 (323) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/CHANGELOG.zh-CN.md +39 -0
  3. package/README.md +17 -3
  4. package/dist/content/applicability.d.ts +17 -0
  5. package/dist/content/catalog.d.ts +1 -1
  6. package/dist/content/snapshot.d.ts +32 -0
  7. package/dist/index.d.ts +18 -0
  8. package/dist/index.js +10873 -208
  9. package/dist/install/file-transition.d.ts +10 -0
  10. package/dist/install/product/lifecycle.d.ts +17 -0
  11. package/dist/install/product/locks.d.ts +2 -0
  12. package/dist/install/product/ownership.d.ts +3 -0
  13. package/dist/install/product/paths.d.ts +17 -0
  14. package/dist/install/product/runtime-descriptors.d.ts +109 -0
  15. package/dist/install/product/session.d.ts +31 -0
  16. package/dist/install/product/shared-config/hash.d.ts +9 -0
  17. package/dist/install/product/shared-config/index.d.ts +16 -0
  18. package/dist/install/product/shared-config/json.d.ts +11 -0
  19. package/dist/install/product/shared-config/text.d.ts +5 -0
  20. package/dist/install/product/shared-config/toml.d.ts +7 -0
  21. package/dist/install/product/shared-config/types.d.ts +21 -0
  22. package/dist/install/product/transaction.d.ts +10 -0
  23. package/dist/install/product/types.d.ts +65 -0
  24. package/dist/project/discover.d.ts +2 -0
  25. package/dist/project/evidence.d.ts +37 -0
  26. package/dist/project/frameworks.d.ts +5 -0
  27. package/dist/project/recommend.d.ts +17 -0
  28. package/dist/project/types.d.ts +42 -0
  29. package/docs/consuming-common.md +65 -6
  30. package/docs/releases/2.0.0.md +58 -0
  31. package/localized/zh-CN/methods/engineering-practices.md +237 -0
  32. package/localized/zh-CN/methods/engineering-practices.rules.json +121 -0
  33. package/localized/zh-CN/methods/engineering-practices.sources.json +377 -0
  34. package/localized/zh-CN/skills/cc-c-project-standard/SKILL.md +25 -0
  35. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
  36. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
  37. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
  38. package/localized/zh-CN/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
  39. package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
  40. package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
  41. package/localized/zh-CN/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
  42. package/localized/zh-CN/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
  43. package/localized/zh-CN/skills/cc-c-project-standard/references/practice.md +37 -0
  44. package/localized/zh-CN/skills/cc-cpp-project-standard/SKILL.md +25 -0
  45. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
  46. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
  47. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
  48. package/localized/zh-CN/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
  49. package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
  50. package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
  51. package/localized/zh-CN/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
  52. package/localized/zh-CN/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
  53. package/localized/zh-CN/skills/cc-cpp-project-standard/references/practice.md +37 -0
  54. package/localized/zh-CN/skills/cc-electron-project-standard/SKILL.md +21 -0
  55. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
  56. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
  57. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
  58. package/localized/zh-CN/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
  59. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
  60. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
  61. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
  62. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
  63. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
  64. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
  65. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
  66. package/localized/zh-CN/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
  67. package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
  68. package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
  69. package/localized/zh-CN/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
  70. package/localized/zh-CN/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
  71. package/localized/zh-CN/skills/cc-electron-project-standard/references/practice.md +19 -0
  72. package/localized/zh-CN/skills/cc-electron-project-standard/references/verification.md +17 -0
  73. package/localized/zh-CN/skills/cc-go-concurrency/SKILL.md +25 -0
  74. package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
  75. package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
  76. package/localized/zh-CN/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
  77. package/localized/zh-CN/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
  78. package/localized/zh-CN/skills/cc-go-concurrency/references/practice.md +37 -0
  79. package/localized/zh-CN/skills/cc-go-project-standard/SKILL.md +25 -0
  80. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
  81. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
  82. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
  83. package/localized/zh-CN/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
  84. package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
  85. package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
  86. package/localized/zh-CN/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
  87. package/localized/zh-CN/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
  88. package/localized/zh-CN/skills/cc-go-project-standard/references/practice.md +37 -0
  89. package/localized/zh-CN/skills/cc-java-project-standard/SKILL.md +25 -0
  90. package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/README.md +5 -0
  91. package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
  92. package/localized/zh-CN/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
  93. package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
  94. package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
  95. package/localized/zh-CN/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
  96. package/localized/zh-CN/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
  97. package/localized/zh-CN/skills/cc-java-project-standard/references/practice.md +37 -0
  98. package/localized/zh-CN/skills/cc-java-runtime/SKILL.md +25 -0
  99. package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
  100. package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
  101. package/localized/zh-CN/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
  102. package/localized/zh-CN/skills/cc-java-runtime/references/engineering-practices.md +73 -0
  103. package/localized/zh-CN/skills/cc-java-runtime/references/practice.md +37 -0
  104. package/localized/zh-CN/skills/cc-native-memory-safety/SKILL.md +25 -0
  105. package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
  106. package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
  107. package/localized/zh-CN/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
  108. package/localized/zh-CN/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
  109. package/localized/zh-CN/skills/cc-native-memory-safety/references/practice.md +37 -0
  110. package/localized/zh-CN/skills/cc-python-async/SKILL.md +25 -0
  111. package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.md +237 -0
  112. package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
  113. package/localized/zh-CN/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
  114. package/localized/zh-CN/skills/cc-python-async/references/engineering-practices.md +73 -0
  115. package/localized/zh-CN/skills/cc-python-async/references/practice.md +37 -0
  116. package/localized/zh-CN/skills/cc-python-project-standard/SKILL.md +25 -0
  117. package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
  118. package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
  119. package/localized/zh-CN/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
  120. package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
  121. package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
  122. package/localized/zh-CN/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
  123. package/localized/zh-CN/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
  124. package/localized/zh-CN/skills/cc-python-project-standard/references/practice.md +37 -0
  125. package/localized/zh-CN/skills/cc-rust-async/SKILL.md +25 -0
  126. package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
  127. package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
  128. package/localized/zh-CN/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
  129. package/localized/zh-CN/skills/cc-rust-async/references/engineering-practices.md +73 -0
  130. package/localized/zh-CN/skills/cc-rust-async/references/practice.md +37 -0
  131. package/localized/zh-CN/skills/cc-rust-project-standard/SKILL.md +25 -0
  132. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
  133. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
  134. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
  135. package/localized/zh-CN/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
  136. package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
  137. package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
  138. package/localized/zh-CN/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
  139. package/localized/zh-CN/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
  140. package/localized/zh-CN/skills/cc-rust-project-standard/references/practice.md +37 -0
  141. package/localized/zh-CN/skills/cc-tauri-project-standard/SKILL.md +21 -0
  142. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
  143. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
  144. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
  145. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
  146. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
  147. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
  148. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
  149. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
  150. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
  151. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
  152. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
  153. package/localized/zh-CN/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
  154. package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
  155. package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
  156. package/localized/zh-CN/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
  157. package/localized/zh-CN/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
  158. package/localized/zh-CN/skills/cc-tauri-project-standard/references/practice.md +20 -0
  159. package/localized/zh-CN/skills/cc-tauri-project-standard/references/verification.md +18 -0
  160. package/localized/zh-CN/skills/cc-typescript-project-standard/SKILL.md +60 -0
  161. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/README.md +7 -0
  162. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
  163. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
  164. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
  165. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
  166. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
  167. package/localized/zh-CN/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
  168. package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
  169. package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
  170. package/localized/zh-CN/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
  171. package/localized/zh-CN/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
  172. package/localized/zh-CN/skills/cc-typescript-project-standard/references/type-safety-patterns.md +73 -0
  173. package/localized/zh-CN/skills/cc-typescript-project-standard/references/type-safety.md +154 -0
  174. package/localized/zh-CN/skills/eval_queries.json +336 -0
  175. package/localized/zh-CN/skills/metadata.json +545 -7
  176. package/localized/zh-CN/skills/relations.json +143 -0
  177. package/methods/engineering-practices.md +237 -0
  178. package/methods/engineering-practices.rules.json +121 -0
  179. package/methods/engineering-practices.sources.json +377 -0
  180. package/package.json +10 -2
  181. package/skills/cc-c-project-standard/SKILL.md +25 -0
  182. package/skills/cc-c-project-standard/examples/engineering/README.md +7 -0
  183. package/skills/cc-c-project-standard/examples/engineering/boundary.c +26 -0
  184. package/skills/cc-c-project-standard/examples/engineering/boundary.h +15 -0
  185. package/skills/cc-c-project-standard/examples/engineering/boundary_test.c +73 -0
  186. package/skills/cc-c-project-standard/references/common/engineering-practices.md +237 -0
  187. package/skills/cc-c-project-standard/references/common/engineering-practices.rules.json +121 -0
  188. package/skills/cc-c-project-standard/references/common/engineering-practices.sources.json +377 -0
  189. package/skills/cc-c-project-standard/references/engineering-practices.md +106 -0
  190. package/skills/cc-c-project-standard/references/practice.md +37 -0
  191. package/skills/cc-cpp-project-standard/SKILL.md +25 -0
  192. package/skills/cc-cpp-project-standard/examples/engineering/README.md +7 -0
  193. package/skills/cc-cpp-project-standard/examples/engineering/boundary.cpp +26 -0
  194. package/skills/cc-cpp-project-standard/examples/engineering/boundary.hpp +12 -0
  195. package/skills/cc-cpp-project-standard/examples/engineering/boundary_test.cpp +38 -0
  196. package/skills/cc-cpp-project-standard/references/common/engineering-practices.md +237 -0
  197. package/skills/cc-cpp-project-standard/references/common/engineering-practices.rules.json +121 -0
  198. package/skills/cc-cpp-project-standard/references/common/engineering-practices.sources.json +377 -0
  199. package/skills/cc-cpp-project-standard/references/engineering-practices.md +106 -0
  200. package/skills/cc-cpp-project-standard/references/practice.md +37 -0
  201. package/skills/cc-electron-project-standard/SKILL.md +21 -0
  202. package/skills/cc-electron-project-standard/examples/engineering/README.md +7 -0
  203. package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.cjs +44 -0
  204. package/skills/cc-electron-project-standard/examples/engineering/ipc-lifecycle.test.cjs +44 -0
  205. package/skills/cc-electron-project-standard/examples/engineering/package.json +8 -0
  206. package/skills/cc-electron-project-standard/examples/minimal/README.md +9 -0
  207. package/skills/cc-electron-project-standard/examples/minimal/boundary.cjs +19 -0
  208. package/skills/cc-electron-project-standard/examples/minimal/boundary.test.cjs +7 -0
  209. package/skills/cc-electron-project-standard/examples/minimal/index.html +1 -0
  210. package/skills/cc-electron-project-standard/examples/minimal/main.cjs +20 -0
  211. package/skills/cc-electron-project-standard/examples/minimal/package.json +9 -0
  212. package/skills/cc-electron-project-standard/examples/minimal/preload.cjs +2 -0
  213. package/skills/cc-electron-project-standard/examples/minimal/renderer.js +4 -0
  214. package/skills/cc-electron-project-standard/references/common/engineering-practices.md +237 -0
  215. package/skills/cc-electron-project-standard/references/common/engineering-practices.rules.json +121 -0
  216. package/skills/cc-electron-project-standard/references/common/engineering-practices.sources.json +377 -0
  217. package/skills/cc-electron-project-standard/references/engineering-practices.md +73 -0
  218. package/skills/cc-electron-project-standard/references/practice.md +19 -0
  219. package/skills/cc-electron-project-standard/references/verification.md +17 -0
  220. package/skills/cc-go-concurrency/SKILL.md +25 -0
  221. package/skills/cc-go-concurrency/references/common/engineering-practices.md +237 -0
  222. package/skills/cc-go-concurrency/references/common/engineering-practices.rules.json +121 -0
  223. package/skills/cc-go-concurrency/references/common/engineering-practices.sources.json +377 -0
  224. package/skills/cc-go-concurrency/references/engineering-practices.md +73 -0
  225. package/skills/cc-go-concurrency/references/practice.md +37 -0
  226. package/skills/cc-go-project-standard/SKILL.md +25 -0
  227. package/skills/cc-go-project-standard/examples/engineering/README.md +7 -0
  228. package/skills/cc-go-project-standard/examples/engineering/go.mod +3 -0
  229. package/skills/cc-go-project-standard/examples/engineering/lifecycle.go +71 -0
  230. package/skills/cc-go-project-standard/examples/engineering/lifecycle_test.go +22 -0
  231. package/skills/cc-go-project-standard/references/common/engineering-practices.md +237 -0
  232. package/skills/cc-go-project-standard/references/common/engineering-practices.rules.json +121 -0
  233. package/skills/cc-go-project-standard/references/common/engineering-practices.sources.json +377 -0
  234. package/skills/cc-go-project-standard/references/engineering-practices.md +106 -0
  235. package/skills/cc-go-project-standard/references/practice.md +37 -0
  236. package/skills/cc-java-project-standard/SKILL.md +25 -0
  237. package/skills/cc-java-project-standard/examples/engineering/README.md +7 -0
  238. package/skills/cc-java-project-standard/examples/engineering/ResourceBoundary.java +26 -0
  239. package/skills/cc-java-project-standard/examples/engineering/ResourceBoundaryTest.java +41 -0
  240. package/skills/cc-java-project-standard/references/common/engineering-practices.md +237 -0
  241. package/skills/cc-java-project-standard/references/common/engineering-practices.rules.json +121 -0
  242. package/skills/cc-java-project-standard/references/common/engineering-practices.sources.json +377 -0
  243. package/skills/cc-java-project-standard/references/engineering-practices.md +106 -0
  244. package/skills/cc-java-project-standard/references/practice.md +35 -0
  245. package/skills/cc-java-runtime/SKILL.md +25 -0
  246. package/skills/cc-java-runtime/references/common/engineering-practices.md +237 -0
  247. package/skills/cc-java-runtime/references/common/engineering-practices.rules.json +121 -0
  248. package/skills/cc-java-runtime/references/common/engineering-practices.sources.json +377 -0
  249. package/skills/cc-java-runtime/references/engineering-practices.md +73 -0
  250. package/skills/cc-java-runtime/references/practice.md +37 -0
  251. package/skills/cc-native-memory-safety/SKILL.md +25 -0
  252. package/skills/cc-native-memory-safety/references/common/engineering-practices.md +237 -0
  253. package/skills/cc-native-memory-safety/references/common/engineering-practices.rules.json +121 -0
  254. package/skills/cc-native-memory-safety/references/common/engineering-practices.sources.json +377 -0
  255. package/skills/cc-native-memory-safety/references/engineering-practices.md +73 -0
  256. package/skills/cc-native-memory-safety/references/practice.md +37 -0
  257. package/skills/cc-python-async/SKILL.md +25 -0
  258. package/skills/cc-python-async/references/common/engineering-practices.md +237 -0
  259. package/skills/cc-python-async/references/common/engineering-practices.rules.json +121 -0
  260. package/skills/cc-python-async/references/common/engineering-practices.sources.json +377 -0
  261. package/skills/cc-python-async/references/engineering-practices.md +73 -0
  262. package/skills/cc-python-async/references/practice.md +37 -0
  263. package/skills/cc-python-project-standard/SKILL.md +25 -0
  264. package/skills/cc-python-project-standard/examples/engineering/README.md +7 -0
  265. package/skills/cc-python-project-standard/examples/engineering/resource_boundary.py +37 -0
  266. package/skills/cc-python-project-standard/examples/engineering/test_resource_boundary.py +49 -0
  267. package/skills/cc-python-project-standard/references/common/engineering-practices.md +237 -0
  268. package/skills/cc-python-project-standard/references/common/engineering-practices.rules.json +121 -0
  269. package/skills/cc-python-project-standard/references/common/engineering-practices.sources.json +377 -0
  270. package/skills/cc-python-project-standard/references/engineering-practices.md +106 -0
  271. package/skills/cc-python-project-standard/references/practice.md +37 -0
  272. package/skills/cc-rust-async/SKILL.md +25 -0
  273. package/skills/cc-rust-async/references/common/engineering-practices.md +237 -0
  274. package/skills/cc-rust-async/references/common/engineering-practices.rules.json +121 -0
  275. package/skills/cc-rust-async/references/common/engineering-practices.sources.json +377 -0
  276. package/skills/cc-rust-async/references/engineering-practices.md +73 -0
  277. package/skills/cc-rust-async/references/practice.md +37 -0
  278. package/skills/cc-rust-project-standard/SKILL.md +25 -0
  279. package/skills/cc-rust-project-standard/examples/engineering/Cargo.lock +7 -0
  280. package/skills/cc-rust-project-standard/examples/engineering/Cargo.toml +8 -0
  281. package/skills/cc-rust-project-standard/examples/engineering/README.md +5 -0
  282. package/skills/cc-rust-project-standard/examples/engineering/src/lib.rs +43 -0
  283. package/skills/cc-rust-project-standard/references/common/engineering-practices.md +237 -0
  284. package/skills/cc-rust-project-standard/references/common/engineering-practices.rules.json +121 -0
  285. package/skills/cc-rust-project-standard/references/common/engineering-practices.sources.json +377 -0
  286. package/skills/cc-rust-project-standard/references/engineering-practices.md +106 -0
  287. package/skills/cc-rust-project-standard/references/practice.md +37 -0
  288. package/skills/cc-tauri-project-standard/SKILL.md +21 -0
  289. package/skills/cc-tauri-project-standard/examples/minimal/README.md +9 -0
  290. package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.lock +5 -0
  291. package/skills/cc-tauri-project-standard/examples/minimal/core/Cargo.toml +9 -0
  292. package/skills/cc-tauri-project-standard/examples/minimal/core/src/lib.rs +46 -0
  293. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/Cargo.toml +12 -0
  294. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/build.rs +5 -0
  295. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/capabilities/main.json +6 -0
  296. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/permissions/documents.toml +4 -0
  297. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/src/main.rs +22 -0
  298. package/skills/cc-tauri-project-standard/examples/minimal/src-tauri/tauri.conf.json +13 -0
  299. package/skills/cc-tauri-project-standard/examples/minimal/ui/app.js +5 -0
  300. package/skills/cc-tauri-project-standard/examples/minimal/ui/index.html +1 -0
  301. package/skills/cc-tauri-project-standard/references/common/engineering-practices.md +237 -0
  302. package/skills/cc-tauri-project-standard/references/common/engineering-practices.rules.json +121 -0
  303. package/skills/cc-tauri-project-standard/references/common/engineering-practices.sources.json +377 -0
  304. package/skills/cc-tauri-project-standard/references/engineering-practices.md +73 -0
  305. package/skills/cc-tauri-project-standard/references/practice.md +20 -0
  306. package/skills/cc-tauri-project-standard/references/verification.md +18 -0
  307. package/skills/cc-typescript-project-standard/SKILL.md +60 -0
  308. package/skills/cc-typescript-project-standard/examples/engineering/README.md +9 -0
  309. package/skills/cc-typescript-project-standard/examples/engineering/boundary.test.ts +16 -0
  310. package/skills/cc-typescript-project-standard/examples/engineering/input.ts +12 -0
  311. package/skills/cc-typescript-project-standard/examples/engineering/package.json +12 -0
  312. package/skills/cc-typescript-project-standard/examples/engineering/pnpm-lock.yaml +39 -0
  313. package/skills/cc-typescript-project-standard/examples/engineering/pnpm-workspace.yaml +1 -0
  314. package/skills/cc-typescript-project-standard/examples/engineering/tsconfig.json +8 -0
  315. package/skills/cc-typescript-project-standard/references/common/engineering-practices.md +237 -0
  316. package/skills/cc-typescript-project-standard/references/common/engineering-practices.rules.json +121 -0
  317. package/skills/cc-typescript-project-standard/references/common/engineering-practices.sources.json +377 -0
  318. package/skills/cc-typescript-project-standard/references/engineering-practices.md +106 -0
  319. package/skills/cc-typescript-project-standard/references/type-safety-patterns.md +73 -0
  320. package/skills/cc-typescript-project-standard/references/type-safety.md +154 -0
  321. package/skills/eval_queries.json +336 -0
  322. package/skills/metadata.json +545 -7
  323. package/skills/relations.json +143 -0
@@ -0,0 +1,10 @@
1
+ interface Entry {
2
+ path: string;
3
+ before: string | null;
4
+ after: string | null;
5
+ }
6
+ /** A deleted file may now be the directory created for its journaled child files. */
7
+ export declare function transactionEntryHash(entry: Entry, entries: readonly Entry[]): string | null;
8
+ /** Remove only empty directories that could not exist below the original file. */
9
+ export declare function prepareTransitionRestore(entry: Entry, entries: readonly Entry[]): void;
10
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { SharedRequest, FileMutation } from "../types.js";
2
+ import type { ProductAction, ProductDefinition, ProductContext, ManifestCodec, RuntimeProductAdapter, ProductInstallResult } from "./types.js";
3
+ export interface ProductLifecycleInput {
4
+ action: ProductAction;
5
+ definition: ProductDefinition;
6
+ context: ProductContext;
7
+ codec: ManifestCodec;
8
+ adapter: RuntimeProductAdapter;
9
+ common?: SharedRequest;
10
+ forceOwnedRemoval?: boolean;
11
+ seed?: ProductInstallationSeed;
12
+ }
13
+ export interface ProductInstallationSeed {
14
+ manifest: import("./types.js").ProductManifestState;
15
+ mutations: FileMutation[];
16
+ }
17
+ export declare function runProductLifecycle(input: ProductLifecycleInput): Promise<ProductInstallResult>;
@@ -0,0 +1,2 @@
1
+ export declare function acquireFileLease(file: string): () => void;
2
+ export declare function withProductConfigurationLocks<T>(files: readonly string[], operation: () => Promise<T>): Promise<T>;
@@ -0,0 +1,3 @@
1
+ import type { ProductDefinition } from "./types.js";
2
+ export declare function assertProductOwnership(file: string, owner: ProductDefinition, roots?: readonly string[]): void;
3
+ export declare function assertProductDefinition(owner: ProductDefinition): void;
@@ -0,0 +1,17 @@
1
+ export interface RuntimeTargetInput {
2
+ runtime: string;
3
+ cwd: string;
4
+ home: string;
5
+ scope: "local" | "global";
6
+ env: NodeJS.ProcessEnv;
7
+ compatibility: "frontend" | "backend";
8
+ baseDir?: string;
9
+ }
10
+ export interface RuntimeTargets {
11
+ baseDir: string;
12
+ skillsDir?: string;
13
+ resourceRoots: string[];
14
+ }
15
+ export declare function resolveRuntimeTargets(input: RuntimeTargetInput): RuntimeTargets;
16
+ export declare function productPathKey(file: string): string;
17
+ export declare function safeProductPath(file: string, roots: readonly string[]): string;
@@ -0,0 +1,109 @@
1
+ export declare const RUNTIME_DESCRIPTORS: Readonly<{
2
+ claude: {
3
+ localDirectory: string;
4
+ skills: boolean;
5
+ };
6
+ codex: {
7
+ localDirectory: string;
8
+ skills: boolean;
9
+ };
10
+ cursor: {
11
+ localDirectory: string;
12
+ skills: boolean;
13
+ };
14
+ windsurf: {
15
+ localDirectory: string;
16
+ skills: boolean;
17
+ };
18
+ opencode: {
19
+ localDirectory: string;
20
+ skills: boolean;
21
+ };
22
+ kilo: {
23
+ localDirectory: string;
24
+ skills: boolean;
25
+ };
26
+ gemini: {
27
+ localDirectory: string;
28
+ skills: boolean;
29
+ };
30
+ copilot: {
31
+ localDirectory: string;
32
+ skills: boolean;
33
+ };
34
+ antigravity: {
35
+ localDirectory: string;
36
+ skills: boolean;
37
+ };
38
+ augment: {
39
+ localDirectory: string;
40
+ skills: boolean;
41
+ };
42
+ trae: {
43
+ localDirectory: string;
44
+ skills: boolean;
45
+ };
46
+ codebuddy: {
47
+ localDirectory: string;
48
+ skills: boolean;
49
+ };
50
+ cline: {
51
+ localDirectory: string;
52
+ skills: boolean;
53
+ };
54
+ openclaw: {
55
+ localDirectory: string;
56
+ skills: boolean;
57
+ };
58
+ qoder: {
59
+ localDirectory: string;
60
+ skills: boolean;
61
+ };
62
+ }>;
63
+ export type RuntimeId = keyof typeof RUNTIME_DESCRIPTORS;
64
+ export declare function runtimeDescriptor(id: string): {
65
+ localDirectory: string;
66
+ skills: boolean;
67
+ } | {
68
+ localDirectory: string;
69
+ skills: boolean;
70
+ } | {
71
+ localDirectory: string;
72
+ skills: boolean;
73
+ } | {
74
+ localDirectory: string;
75
+ skills: boolean;
76
+ } | {
77
+ localDirectory: string;
78
+ skills: boolean;
79
+ } | {
80
+ localDirectory: string;
81
+ skills: boolean;
82
+ } | {
83
+ localDirectory: string;
84
+ skills: boolean;
85
+ } | {
86
+ localDirectory: string;
87
+ skills: boolean;
88
+ } | {
89
+ localDirectory: string;
90
+ skills: boolean;
91
+ } | {
92
+ localDirectory: string;
93
+ skills: boolean;
94
+ } | {
95
+ localDirectory: string;
96
+ skills: boolean;
97
+ } | {
98
+ localDirectory: string;
99
+ skills: boolean;
100
+ } | {
101
+ localDirectory: string;
102
+ skills: boolean;
103
+ } | {
104
+ localDirectory: string;
105
+ skills: boolean;
106
+ } | {
107
+ localDirectory: string;
108
+ skills: boolean;
109
+ };
@@ -0,0 +1,31 @@
1
+ import type { FileMutation } from "../types.js";
2
+ import type { ProductDefinition, ProductContext, ProductManifestState, ProductAction, CommonPointer } from "./types.js";
3
+ import type { OwnedEntry } from "./shared-config/types.js";
4
+ export interface InstallSessionOptions {
5
+ definition: ProductDefinition;
6
+ context: ProductContext;
7
+ previous?: ProductManifestState;
8
+ action: ProductAction;
9
+ common?: CommonPointer;
10
+ forceOwnedRemoval?: boolean;
11
+ initialMutations?: readonly FileMutation[];
12
+ }
13
+ export interface FileInstallSession {
14
+ read(file: string): Buffer;
15
+ exists(file: string): boolean;
16
+ stage(file: string, after: Buffer | null): void;
17
+ writeManaged(file: string, after: Buffer): void;
18
+ retireTree(root: string, options?: {
19
+ rejectUnknown?: boolean;
20
+ }): void;
21
+ finish(): {
22
+ mutations: FileMutation[];
23
+ manifest: ProductManifestState;
24
+ preserved: string[];
25
+ conflicts: string[];
26
+ };
27
+ }
28
+ export interface InstallSession extends FileInstallSession {
29
+ editShared(file: string, entry: OwnedEntry): void;
30
+ }
31
+ export declare function createInstallSession(options: InstallSessionOptions): InstallSession;
@@ -0,0 +1,9 @@
1
+ import type { ProductDefinition } from "../types.js";
2
+ import type { OwnedEntry } from "./types.js";
3
+ export declare const hashBytes: (bytes: Buffer) => string;
4
+ export declare function stable(value: unknown): string;
5
+ export declare function entryHash(entry: {
6
+ kind: OwnedEntry["kind"];
7
+ value: unknown;
8
+ id?: string;
9
+ }, owner?: ProductDefinition): string;
@@ -0,0 +1,16 @@
1
+ import type { ProductDefinition } from "../types.js";
2
+ import type { OwnedEntry } from "./types.js";
3
+ export { entryHash, stable, hashBytes } from "./hash.js";
4
+ export type ConfigEntryStatus = "healthy" | "missing" | "modified";
5
+ export declare function validateConfigEntry(entry: OwnedEntry, owner: ProductDefinition): void;
6
+ export declare function configEntryStatus(before: Buffer | null, owner: ProductDefinition, entry: OwnedEntry): ConfigEntryStatus;
7
+ export declare function planConfigEntry(input: {
8
+ before: Buffer | null;
9
+ owner: ProductDefinition;
10
+ entry: OwnedEntry;
11
+ previous?: OwnedEntry;
12
+ action: "upsert" | "remove";
13
+ }): {
14
+ after: Buffer | null;
15
+ status: "changed" | "unchanged" | "preserved";
16
+ };
@@ -0,0 +1,11 @@
1
+ import type { OwnedEntry } from "./types.js";
2
+ type JsonEntry = Extract<OwnedEntry, {
3
+ kind: "json-hook";
4
+ }> | Extract<OwnedEntry, {
5
+ kind: "json-path" | "toml-key";
6
+ }>;
7
+ export declare function safeKeys(keys: string[]): void;
8
+ export declare function getPath(root: Record<string, unknown>, keys: string[]): unknown;
9
+ export declare function readJson(body: string): Record<string, unknown>;
10
+ export declare function editJson(body: string, entry: JsonEntry, action: "upsert" | "remove", previous?: OwnedEntry): string | null | undefined;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { OwnedEntry } from "./types.js";
2
+ export declare function textFragment(value: string, markerId: string): string;
3
+ export declare function editText(body: string, entry: Extract<OwnedEntry, {
4
+ kind: "text-marker";
5
+ }>, action: "upsert" | "remove", previous?: OwnedEntry, markerId?: string): string | null | undefined;
@@ -0,0 +1,7 @@
1
+ import type { OwnedEntry } from "./types.js";
2
+ type TomlEntry = Extract<OwnedEntry, {
3
+ kind: "json-path" | "toml-key";
4
+ }>;
5
+ export declare function fragment(entry: TomlEntry): string;
6
+ export declare function editToml(body: string, entry: TomlEntry, action: "upsert" | "remove", previous?: OwnedEntry): string | null | undefined;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ export type OwnedEntry = {
2
+ kind: "text-marker";
3
+ id: string;
4
+ value: string;
5
+ hash: string;
6
+ createdFile: boolean;
7
+ } | {
8
+ kind: "json-path" | "toml-key";
9
+ id: string;
10
+ path: string[];
11
+ value: unknown;
12
+ hash: string;
13
+ createdFile: boolean;
14
+ } | {
15
+ kind: "json-hook";
16
+ id: string;
17
+ event: string;
18
+ value: Record<string, unknown>;
19
+ hash: string;
20
+ createdFile: boolean;
21
+ };
@@ -0,0 +1,10 @@
1
+ import type { FileMutation } from "../types.js";
2
+ import type { ProductContext, ProductDefinition } from "./types.js";
3
+ export interface ProductTransactionInput {
4
+ definition: ProductDefinition;
5
+ context: ProductContext;
6
+ }
7
+ export declare function recoverProductTransaction(input: ProductTransactionInput): Promise<"clean" | "recovered">;
8
+ export declare function executeProductPlan(input: ProductTransactionInput, mutations: FileMutation[], options?: {
9
+ dryRun?: boolean;
10
+ }): Promise<void>;
@@ -0,0 +1,65 @@
1
+ import type { InstallLanguage } from "../../content/types.js";
2
+ import type { OwnedEntry } from "./shared-config/types.js";
3
+ import type { InstallSession } from "./session.js";
4
+ export type ProductAction = "install" | "update" | "uninstall";
5
+ export interface ProductDefinition {
6
+ packageName: string;
7
+ consumerProduct: string;
8
+ resourcePrefix: string;
9
+ manifestName: string;
10
+ stateDirectoryName: string;
11
+ markerId: string;
12
+ retainUnrequestedFiles?: boolean;
13
+ nativeMetadata?: boolean;
14
+ resourceEntries?: Readonly<Record<string, readonly string[]>>;
15
+ }
16
+ export interface ProductContext {
17
+ packageVersion: string;
18
+ runtime: string;
19
+ scope: "local" | "global";
20
+ language: InstallLanguage;
21
+ cwd: string;
22
+ home: string;
23
+ baseDir: string;
24
+ allowedRoots: string[];
25
+ dryRun: boolean;
26
+ }
27
+ export interface CommonPointer {
28
+ target: string;
29
+ ledgerDir: string;
30
+ packageVersion: string;
31
+ language: InstallLanguage;
32
+ digest: string;
33
+ }
34
+ export interface ProductManifestState {
35
+ product: string;
36
+ packageVersion: string;
37
+ runtime: string;
38
+ scope: "local" | "global";
39
+ language: InstallLanguage;
40
+ installedAt: string;
41
+ files: Array<{
42
+ path: string;
43
+ hash: string;
44
+ }>;
45
+ sharedEntries: Array<{
46
+ path: string;
47
+ entry: OwnedEntry;
48
+ }>;
49
+ common?: CommonPointer;
50
+ }
51
+ export interface ManifestCodec {
52
+ decode(bytes: Buffer, ctx: ProductContext): ProductManifestState;
53
+ encode(state: ProductManifestState, ctx: ProductContext): Buffer;
54
+ }
55
+ export interface ProductInstallResult {
56
+ changed: string[];
57
+ preserved: string[];
58
+ conflicts: string[];
59
+ common: "shared" | "none" | "retained";
60
+ status: "complete" | "partial" | "planned";
61
+ }
62
+ export interface RuntimeProductAdapter {
63
+ configurationFiles(ctx: ProductContext): string[];
64
+ plan(ctx: ProductContext, session: InstallSession): Promise<void>;
65
+ }
@@ -0,0 +1,2 @@
1
+ import type { ProjectInspection, WorkspaceInspectionOptions } from "./types.js";
2
+ export declare function inspectWorkspace(options: WorkspaceInspectionOptions): ProjectInspection;
@@ -0,0 +1,37 @@
1
+ export declare const BUILD_MARKERS: Readonly<Record<string, readonly string[]>>;
2
+ export declare const SOURCE_EXTENSIONS: Readonly<Record<string, string>>;
3
+ export declare const IGNORED_DIRS: Set<string>;
4
+ export declare const sensitiveFile: (name: string) => boolean;
5
+ export declare const sourceLanguage: (file: string) => string | undefined;
6
+ export declare function declaredNativeLanguages(body: string): string[];
7
+ export declare function record(value: unknown): Record<string, unknown>;
8
+ export declare function jsonManifest(body: string): Record<string, unknown>;
9
+ export declare function tomlManifest(body: string): Record<string, unknown>;
10
+ export declare function yamlManifest(body: string): Record<string, unknown>;
11
+ /** Preserve a declared constraint, never URLs, credentials or an invented resolved version. */
12
+ export declare function versionConstraint(value: unknown): string | undefined;
13
+ export interface ManifestDependency {
14
+ name: string;
15
+ version?: string;
16
+ }
17
+ export declare function npmDependencies(body: string): ManifestDependency[];
18
+ export declare function cargoDependencies(body: string): ManifestDependency[];
19
+ export declare function pythonDependencies(body: string): ManifestDependency[];
20
+ export declare function goDependencies(body: string): ManifestDependency[];
21
+ export interface MavenCoordinate {
22
+ group: string;
23
+ artifact: string;
24
+ version?: string;
25
+ }
26
+ export declare function mavenCoordinates(body: string): MavenCoordinate[];
27
+ export declare function gradleCoordinates(body: string): MavenCoordinate[];
28
+ export declare function gradlePlugins(body: string): ManifestDependency[];
29
+ /** Lex only top-level command calls; never execute CMake or inspect commands inside string arguments. */
30
+ export declare function cmakeCommands(body: string): Array<{
31
+ name: string;
32
+ args: string;
33
+ }>;
34
+ export declare function cmakePackageVersion(body: string, name: string): {
35
+ present: boolean;
36
+ version?: string;
37
+ };
@@ -0,0 +1,5 @@
1
+ import type { ProjectRole } from "../content/applicability.js";
2
+ import type { FrameworkDetector } from "./types.js";
3
+ export declare function npmFrameworkDetector(id: string, packages: readonly string[], roles: readonly ProjectRole[]): FrameworkDetector;
4
+ export declare function cargoFrameworkDetector(id: string, crate: string, roles: readonly ProjectRole[]): FrameworkDetector;
5
+ export declare const DESKTOP_FRAMEWORK_DETECTORS: readonly FrameworkDetector[];
@@ -0,0 +1,17 @@
1
+ import { type CapabilityCandidate, type TaskKind } from "../content/applicability.js";
2
+ import type { ProjectInspection } from "./types.js";
3
+ export interface CapabilityRecommendation {
4
+ id: string;
5
+ sourcePackage: string;
6
+ projectRoots: string[];
7
+ reasons: string[];
8
+ }
9
+ /** Match delivered catalog entries only. Conditions are OR within a dimension, AND across dimensions. */
10
+ export declare function recommendCapabilities(input: {
11
+ inspection: ProjectInspection;
12
+ catalog: readonly CapabilityCandidate[];
13
+ task?: {
14
+ path?: string;
15
+ kind?: TaskKind;
16
+ };
17
+ }): CapabilityRecommendation[];
@@ -0,0 +1,42 @@
1
+ import type { ProjectRole } from "../content/applicability.js";
2
+ export interface FrameworkEvidence {
3
+ id: string;
4
+ version?: string;
5
+ paths: string[];
6
+ }
7
+ export interface ProjectUnit {
8
+ root: string;
9
+ languages: string[];
10
+ frameworks: FrameworkEvidence[];
11
+ roles: ProjectRole[];
12
+ evidence: string[];
13
+ buildFiles: string[];
14
+ relatedRoots: string[];
15
+ ambiguous: boolean;
16
+ }
17
+ export interface ProjectInspection {
18
+ schemaVersion: 1;
19
+ workspace: string;
20
+ units: ProjectUnit[];
21
+ warnings: string[];
22
+ truncated: boolean;
23
+ }
24
+ export interface FrameworkDetector {
25
+ id: string;
26
+ detect(input: {
27
+ root: string;
28
+ files: readonly string[];
29
+ readManifest: (relative: string) => string | undefined;
30
+ }): {
31
+ evidence: FrameworkEvidence;
32
+ roles: ProjectRole[];
33
+ relatedRoots: string[];
34
+ } | undefined;
35
+ }
36
+ export interface WorkspaceInspectionOptions {
37
+ workspace: string;
38
+ taskPath?: string;
39
+ maxDepth?: number;
40
+ maxEntries?: number;
41
+ detectors?: readonly FrameworkDetector[];
42
+ }
@@ -1,19 +1,27 @@
1
1
  # 消费 craft-common
2
2
 
3
- 公共包当前修复版为 `@bovinphang/craft-common@1.0.1`(首版 1.0.0),要求 Node >=22、ESM。1.0.1 修复较大事务日志恢复的正则栈溢出及 Windows 等价大小写路径的遍历挂起,并固定分发文本换行。消费者精确固定版本,公共内容在本仓库维护,产品只维护自动生成的分发副本。公共源码不依赖 frontend-craft。
3
+ 统一底座正式版本号为 `@bovinphang/craft-common@2.0.0`,当前待发布,要求 Node >=22、ESM。保留 1.0.1 的事务恢复、Windows 等价路径和固定换行修复。两产品精确使用同一精确版本;公共内容在本仓库维护,产品只维护生成的分发副本。公共源码不依赖任何产品。
4
4
 
5
5
  ## 内容与分发
6
6
 
7
- `readContentCatalog(packageRoot, language)` 显式接收包根,返回 `en` 或 `zh-CN` 的七个入口、完整文件哈希、来源版本和摘要;不要依赖 bundle 后的 import.meta.url 定位内容。
7
+ `readContentCatalog(packageRoot, language)` 显式接收包根,返回 `en` 或 `zh-CN` 的 21 个入口、完整文件哈希、来源版本和摘要;不要依赖 bundle 后的 import.meta.url 定位内容。
8
8
 
9
- `readMethodResource(packageRoot, method, language)` 提供源码核验、文档同步、诊断、重构、TDD 的通用方法字节。领域 Skill 将方法内嵌为本地 references,独立发布时不依赖相邻 Skill。修改 methods 后运行 `pnpm run sync:methods` 更新公共入口引用;评估样例独立维护。
9
+ `readMethodResource(packageRoot, method, language)` 提供源码核验、文档同步、诊断、重构、TDD、工程实践六类通用方法字节。领域 Skill 将方法内嵌为本地 references,独立发布时不依赖相邻 Skill。修改 methods 后运行 `pnpm run sync:methods` 更新公共入口引用;评估样例独立维护。
10
10
 
11
- frontend-craft / backend-craft 的 `pnpm run sync:common` 生成中英文公共快照、领域方法副本和来源锁;`pnpm run check:common` 只读比对。Git 原生插件也携带这些生成快照,不要求用户执行构建。禁止手工修改生成文件。公共独立包用 1.0.1,领域独立包跟随其产品版本。两个消费者需使用相同版本、语言及精确内容摘要;升级前先通过旧产品卸载退出旧公共引用并处理保留的用户修改。
11
+ frontend-craft / backend-craft 的 `pnpm run sync:common` 生成中英文公共快照、领域方法副本和来源锁;`pnpm run check:common` 只读比对。Git 原生插件也携带这些生成快照,不要求用户执行构建。禁止手工修改生成文件。公共独立包用 2.0.0,领域独立包跟随其产品版本。两个消费者需使用相同版本、语言及精确内容摘要;升级前先通过旧产品卸载退出旧公共引用并处理保留的用户修改。
12
12
 
13
13
  检查覆盖完整公共文件集合;同步仅清理旧锁认领且哈希未变的过期文件。额外未知文件和手工修改会阻断同步并保留原文件。组合索引中的产品自有条目仍在产品维护,公共条目来自本包。
14
14
 
15
15
  ## 安装契约
16
16
 
17
+ `runProductLifecycle({ action, definition, context, codec, adapter, common? })` 是两产品统一入口。`definition` 声明产品身份和资源策略;`codec` 兼容本产品历史清单;`adapter.plan(context, session)` 用显式会话生成计划,不直接写磁盘。无标准 Skill 的宿主仍使用同一产品事务,提供 `common` 时再协调公共资源与消费者账本。
18
+
19
+ `resolveRuntimeTargets` 统一十五宿主的配置目录、实际 Skill 目标和允许根;显式 `compatibility` 保留历史环境变量解释差异。`createInstallSession` 支持读己之写、未知/修改文件保护、精确共享配置条目及部分卸载。会话没有全局草稿;结束后不能继续写入。
20
+
21
+ 配置路径锁跨产品、跨 Skill 目标协调同一配置;恢复及重新读盘均在锁内完成。dry-run 运行真实规划但不创建锁、不恢复残留事务、不写文件。历史目录搬迁用 `seed` 规划复制,保留原所有权哈希;Cline 文件变目录也在事务中保留原文及备份。
22
+
23
+ `syncProductSnapshot({ productRoot, commonRoot, check, domainMethods, extraResources, retiredIds })` 统一构建快照同步。产品声明资源映射,common 预检完整双语资源、旧锁哈希、未知输出和混合索引;任何预检失败均不开始写入。
24
+
17
25
  `resolveSharedIdentity(skillsDir)` 规范化真实目标及现存祖先路径,将状态放在父目录 `craft-manifests/<目标路径摘要>/` 中。配置目录不同但真实 Skill 目录相同时复用;同一父目录的不同目标互相隔离。
18
26
 
19
27
  `planSharedDeployment(request)` 只读生成变更和冲突。消费者由产品名、真实产品清单路径和作用域标识。初版要求版本、语言和内容摘要精确一致,拒绝未知同名文件及用户修改。不要让产品清单再次认领 cc 文件。
@@ -24,10 +32,61 @@ frontend-craft / backend-craft 的 `pnpm run sync:common` 生成中英文公共
24
32
 
25
33
  允许产品声明的根目录本身是 junction;根内部的符号链接仍拒绝。事务写入、日志及恢复使用规范化真实路径。协议保证本地主机并发和进程中断恢复,不保证断电级持久性或多主机共享文件系统协调。
26
34
 
27
- 消费者测试使用 frontend/backend 夹具验证,不代表 backend-craft 产品已经实现。原生插件双产品发现和去重需要 Runtime 专项验证,不能用 CLI 测试替代。
35
+ 公共包单元测试使用 frontend/backend 消费者夹具验证协议;backend-craft 现已接入公共事务,产品级共存证据见 backend-craft 的 `docs/verification/coexistence.md`,安装约定见其 `docs/coexistence.md`。原生插件双产品发现和去重需要 Runtime 专项验证,不能用 CLI 测试替代。
28
36
 
29
37
  ## 开发与发布边界
30
38
 
31
- 未公开发布时,通过 `pnpm pack` 产物和 `scripts/local-registry.ts` 临时本地服务联调;只给当前 pnpm 进程指定临时 npmrc,不修改用户全局 registry。同一个开发版本的 tarball 变化后重新安装并更新真实完整性摘要。
39
+ 未公开发布时,通过 `pnpm exec npm pack` 产物和 `scripts/local-registry.ts` 临时本地服务联调;pnpm 12 使用临时项目级 scoped registry,不修改用户全局 registry,联调后移除该临时配置。已消费候选的tarball不可用不同字节覆盖;每次变化使用新的精确候选版本,保留旧归档,并以新真实归档重新安装、更新SRI。
32
40
 
33
41
  先发布公共包,再发布依赖它的产品;发布属于独立操作。本次不实际发布。发布前必须将产品锁中的开发服务地址清理为标准来源,并在公共包真实可下载后重新做公开 registry 的 frozen 安装校验。不能把本地缓存成功当作公开可下载。
42
+
43
+ ## 工程结构与维护入口
44
+
45
+ craft-common 2.0.0 是 TypeScript / ESM 公共库,不提供独立终端 CLI。运行要求 Node.js >=22,包管理器固定为 pnpm 12.4.1;构建使用 esbuild 和 TypeScript 声明生成,测试使用 Node.js `node:test`。
46
+
47
+ ```text
48
+ craft-common/
49
+ ├── src/
50
+ │ ├── index.ts # 公共导出
51
+ │ ├── content/ # 内容目录、方法读取、递归资源与摘要
52
+ │ └── install/ # 共享身份、只读规划、事务、恢复及协议类型
53
+ ├── skills/ # 21 个 cc-* 公共入口与完整运行资源
54
+ ├── methods/ # 源码核验、文档同步、诊断、重构、TDD、工程实践方法源
55
+ ├── localized/zh-CN/ # 公共入口与方法的中文镜像
56
+ ├── scripts/ # 构建、方法同步、测试、独立包、本地 registry
57
+ ├── tests/ # 内容、资源闭合、共享安装及中断恢复测试
58
+ ├── docs/consuming-common.md # 消费 API、共享协议及发布约定
59
+ └── .github/workflows/ci.yml # Windows/Linux、Node 22 校验
60
+ ```
61
+
62
+ 既有七个方法与图表入口为 `cc-drawio-studio`、`cc-technical-diagrams`、`cc-source-driven-development`、`cc-doc-sync-core`、`cc-debug-methodology`、`cc-refactoring-core`、`cc-tdd-methodology`。`src/index.ts` 导出内容读取、资源收集、共享身份解析、规划、执行和恢复 API;调用者显式传入包根目录,不依赖打包后的源码位置猜测资源路径。
63
+
64
+ 先维护 `methods/` 及对应中文内容,运行 `pnpm run sync:methods` 更新公共 Skill 内的方法副本。`pnpm lint`、`pnpm typecheck`、`pnpm test`、`pnpm build` 用于开发校验。`pnpm run pack:skills` 生成 21 个双语独立 Skill 包,`pnpm exec npm pack` 构建并打包库;`dist/` 和打包输出不手工修改。
65
+
66
+ frontend-craft 3.0.0 和 backend-craft 1.0.0 均精确依赖 2.0.0。产品中的公共 Skill、领域方法副本和来源锁由各产品的 `pnpm run sync:common` 更新,再用 `pnpm run check:common` 比对。产品共同使用同一个真实 Skill 目标时,版本、语言与内容摘要必须一致。
67
+
68
+ 发布顺序为公共包在前、消费者在后。源码版本、历史验收和本地缓存成功不证明公共 registry 已提供对应版本,发布前需单独验证公开源安装。仓库中的 `docs/implementation-report.md` 保留原阶段证据,不作为当前测试数量或发布状态的依据。
69
+
70
+ ## 工程事实与任务推荐
71
+
72
+ `inspectWorkspace({workspace,taskPath?,maxDepth?,maxEntries?,detectors?})` 只读扫描,返回完整 `units`、语言、框架版本约束、角色、证据路径、明确工作区/应用关联和截断警告。默认深度 12、条目 10000、清单 256 KiB;忽略链接、敏感文件和依赖产物,不执行构建脚本。语言不推断服务角色;框架必须有实际依赖证据,版本不明保留警告。
73
+
74
+ `recommendCapabilities({inspection,catalog,task?:{path?,kind?}})` 只从已交付 catalog 推荐;最近子工程限定任务范围,IPC 仅扩展有同一桌面框架证据关联的 UI/core。条件同维度 OR、跨维度 AND;任务未提供时只返回工程级候选。旧 metadata 无 applicability 仍有效,但不自动猜适用范围。候选不是自动执行或自动安装指令。
75
+
76
+ 当前新增入口、迁移、实际验证边界见 [跨领域能力验收](verification/cross-domain-capabilities.md)。
77
+
78
+ <!-- engineering-practices-20261108 -->
79
+
80
+ ## 工程实践源与证据
81
+
82
+ 工程实践为第六类方法,不增加独立Skill、用户CLI或规则引擎。methods/engineering-practices.md及.sources.json/.rules.json是八项原则和来源的唯一手工源;核心JSON只保存core规则,不持有其他入口锚点。每个增强入口另维护自身references/engineering-practices.md;产品通过现有domainMethods/extraResources从已安装的精确common包生成三份公共资源。
83
+
84
+ sync:methods现在预检双语、增量保留完整21入口、自定义字段和适用范围;检查模式不写入,重复同步应零变化。不要恢复旧七项整表重建,也不要手工修改产品副本。示例依赖与产品工具链隔离;普通检查/安装不自动准备示例环境。
85
+
86
+ 本轮common八个真实案例、前端React DOM及后端HTTP各一例按各仓verify:engineering维护,输入hash、工具、具名计数和原始RED/GREEN日志分别记录。缺编译器、GUI/签名/外部DB等未执行边界不能被结构计数或模型回答覆盖。仓库docs/verification/engineering-practices保存本轮覆盖、模型与交付报告,未随公共库分发的维护报告不作为运行时依赖。
87
+
88
+ 协调升级顺序保持:用旧产品CLI退出全部旧公共消费者并处理用户编辑;安装两个匹配版本的产品;再分别同步/检查。无Skill宿主继续交付私有参考,不产生公共消费者。公共2.0.0当前待发布,公开源frozen安装需发布后另验;本地临时registry/版本例外最终恢复原策略,保留真实SRI。
89
+
90
+ 当前pnpm12.4.1的pack会排除嵌套pnpm-lock.yaml,即使files显式列出也无效;本轮最小夹具和实际归档已复现。因此公共发行归档使用现有npm打包器:先构建,再执行pnpm exec npm pack(产品pack:all也使用npm打包),保留样例独立锁。不得用缺锁的pnpm pack归档联调或发布;实际归档闭合检查是门禁,源码目录存在不能代替。包管理器与依赖安装仍保持pnpm12.4.1。
91
+
92
+ 当前2.0.0变更见[变更日志](../CHANGELOG.zh-CN.md),实际归档与授权后发布顺序见[发布步骤](releases/2.0.0.md)。frontend3.0.0和backend1.0.0仍未发布;本轮不提升其版本号。
@@ -0,0 +1,58 @@
1
+ # craft-common 2.0.0 发布准备
2
+
3
+ 正式版本号为`2.0.0`,当前状态是**待发布**。frontend-craft继续使用未发布的`3.0.0`,backend-craft继续使用未发布的`1.0.0`;两者只更新精确公共依赖及生成内容。本步骤不创建Git提交/标签,不推送或执行npm发布。
4
+
5
+ 变更说明见[英文](../../CHANGELOG.md)与[简体中文](../../CHANGELOG.zh-CN.md)。公共入口21个,前端74个,后端42个;版本号形式不表示公开源已经可用。
6
+
7
+ ## 本地生成与核验
8
+
9
+ 在common源码仓执行既有命令:
10
+
11
+ ```sh
12
+ pnpm run sync:methods
13
+ pnpm run sync:methods -- --check
14
+ pnpm lint
15
+ pnpm typecheck
16
+ pnpm test
17
+ pnpm build
18
+ pnpm run pack:skills
19
+ ```
20
+
21
+ 先创建空的产物目录`npm-packages/releases/2.0.0`,再执行:
22
+
23
+ ```sh
24
+ pnpm exec npm pack --pack-destination npm-packages/releases/2.0.0
25
+ ```
26
+
27
+ 使用该npm归档,不改用pnpm 12.4.1的pack:后者排除嵌套pnpm-lock.yaml。实际解包检查21个双语入口、方法、声明、许可证、两份changelog、此发布说明和示例锁;示例不含node_modules、编译或运行缓存。对实际tgz记录字节数、SHA512/SRI,保存在本地独立发布清单中,避免把自身摘要嵌入被摘要的包。
28
+
29
+ 可对同一归档执行只读发布预演,预演成功不代表已上传或公开可下载:
30
+
31
+ ```sh
32
+ npm publish npm-packages/releases/2.0.0/bovinphang-craft-common-2.0.0.tgz --dry-run --access public --json
33
+ ```
34
+
35
+ 两产品须消费这一份实际归档,更新精确`2.0.0`依赖与真实SRI,再运行`sync:common`/`check:common`、类型/构建及相关内容、安装和分发检查。公共独立Skill包版本同为2.0.0;前后端领域包仍跟随各自3.0.0/1.0.0。临时本地源和精确版本例外只用于联调,结束后恢复原策略并移除开发服务地址,不修改全局registry或关闭供应链核验。
36
+
37
+ 正式版本归档一经作为本轮发布产物交付,就以清单中的字节为准;后续源码改动须重新准备并协调消费者SRI,不能默默替换已验证产物,更不能覆盖已发布版本。
38
+
39
+ ## 获得发布授权后的操作
40
+
41
+ 以下命令仅供维护者在获得独立发布授权后执行,本次不执行:
42
+
43
+ ```sh
44
+ npm publish npm-packages/releases/2.0.0/bovinphang-craft-common-2.0.0.tgz --access public
45
+ npm view @bovinphang/craft-common@2.0.0 dist.integrity
46
+ ```
47
+
48
+ 1. 发布前重新确认2.0.0未被占用、账号/组织权限及npm认证要求;不要打印凭据。
49
+ 2. 将公开`dist.integrity`与本地发布清单、两产品锁中的SRI比对,必须完全一致。
50
+ 3. 保持原供应链策略,在干净环境使用公开源分别验证两产品的`pnpm install --frozen-lockfile`及已有门禁。等待策略窗口时如实记录,不将本地缓存或临时源成功当公开安装成功。
51
+ 4. 只有公共包发布及公开消费验证完成后,才考虑另行发布两产品。当前不提升两产品版本号,也不因common就绪自动发布它们。
52
+ 5. 实际发布后再将changelog的“未发布”标记替换为真实发布日期,并记录Git标签/远端发布结果;本次准备不伪造这些状态。
53
+
54
+ ## 迁移与验证边界
55
+
56
+ 版本、语言或内容摘要不同的公共消费者不能混装。先备份编辑,用旧产品CLI退出全部旧公共引用,处理保留文件,再安装两份匹配产品;不自动升级另一产品或强制接管未知文件。同一宿主的CLI与原生渠道继续互斥,双原生产品去重不属于本次承诺。
57
+
58
+ 已有开发版验收记录保留其原版本、摘要和执行日期;本次正式版清单单独记录版本/SRI、实际命令及未运行项。GUI/签名、真实数据库/生产鉴权、浏览器E2E、全部最低工具版本及公开发布不因版本提升而自动获得验证。