@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,377 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sources": [
4
+ {
5
+ "id": "google-review",
6
+ "publisher": "Google",
7
+ "title": "Code review standard",
8
+ "url": "https://google.github.io/eng-practices/review/reviewer/standard.html",
9
+ "section": "Engineering principles and code health",
10
+ "checkedAt": "2026-11-08",
11
+ "versionScope": "Living public guidance; revision unknown",
12
+ "licenseStatus": "unknown",
13
+ "adoption": "adopt",
14
+ "limits": "Use evidence and project standards; personal preference alone is not a blocker."
15
+ },
16
+ {
17
+ "id": "ms-playbook",
18
+ "publisher": "Microsoft ISE",
19
+ "title": "Test planning",
20
+ "url": "https://microsoft.github.io/code-with-engineering-playbook/automated-testing/test-planning/",
21
+ "section": "Risk, test scope and responsibilities",
22
+ "checkedAt": "2026-11-08",
23
+ "versionScope": "Living ISE playbook; revision unknown",
24
+ "licenseStatus": "unknown",
25
+ "adoption": "adopt",
26
+ "limits": "Team practice, not a company-wide mandate; retain existing tools."
27
+ },
28
+ {
29
+ "id": "ms-faults",
30
+ "publisher": "Microsoft ISE",
31
+ "title": "Fault injection testing",
32
+ "url": "https://microsoft.github.io/code-with-engineering-playbook/automated-testing/fault-injection-testing/",
33
+ "section": "Controlled failure and observations",
34
+ "checkedAt": "2026-11-08",
35
+ "versionScope": "Living ISE playbook; revision unknown",
36
+ "licenseStatus": "unknown",
37
+ "adoption": "adopt",
38
+ "limits": "Run scoped, controlled failures; do not infer production reliability from a small example."
39
+ },
40
+ {
41
+ "id": "google-ts",
42
+ "publisher": "Google",
43
+ "title": "TS/JS style guide",
44
+ "url": "https://google.github.io/styleguide/tsguide.html",
45
+ "section": "Environment caveat; types and exceptions",
46
+ "checkedAt": "2026-11-08",
47
+ "versionScope": "Public guide; revision unknown",
48
+ "licenseStatus": "unknown",
49
+ "adoption": "conditional",
50
+ "limits": "Google explicitly notes internal constraints differ; no blanket ban overriding a justified project convention."
51
+ },
52
+ {
53
+ "id": "typescript-publishing",
54
+ "publisher": "TypeScript",
55
+ "title": "Publishing declaration files",
56
+ "url": "https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html",
57
+ "section": "Types and declaration dependencies",
58
+ "checkedAt": "2026-11-08",
59
+ "versionScope": "Living handbook; check installed compiler/module resolution",
60
+ "licenseStatus": "unknown",
61
+ "adoption": "adopt",
62
+ "limits": "Validate the actual packed consumer; do not upgrade compiler or module mode on this basis."
63
+ },
64
+ {
65
+ "id": "rust-api",
66
+ "publisher": "Rust library team",
67
+ "title": "Rust API Guidelines",
68
+ "url": "https://rust-lang.github.io/api-guidelines/",
69
+ "section": "Type safety, dependability and future proofing",
70
+ "checkedAt": "2026-11-08",
71
+ "versionScope": "Living recommendations; revision unknown",
72
+ "licenseStatus": "unknown",
73
+ "adoption": "adopt",
74
+ "limits": "Guidance rather than language law; preserve edition and MSRV."
75
+ },
76
+ {
77
+ "id": "tokio-join",
78
+ "publisher": "Tokio project",
79
+ "title": "JoinHandle",
80
+ "url": "https://docs.rs/tokio/latest/tokio/task/struct.JoinHandle.html",
81
+ "section": "Drop, abort and completion",
82
+ "checkedAt": "2026-11-08",
83
+ "versionScope": "Page observed 1.54.1; project runtime/version determines applicability",
84
+ "licenseStatus": "unknown",
85
+ "adoption": "conditional",
86
+ "limits": "Tokio-specific mechanics only when Tokio is already used; no new runtime dependency."
87
+ },
88
+ {
89
+ "id": "uber-go",
90
+ "publisher": "Uber",
91
+ "title": "Go Style Guide",
92
+ "url": "https://github.com/uber-go/guide/blob/master/style.md",
93
+ "section": "Errors, interfaces and goroutine lifetime",
94
+ "checkedAt": "2026-11-08",
95
+ "versionScope": "Living master; revision unknown",
96
+ "licenseStatus": "unknown",
97
+ "adoption": "adopt",
98
+ "limits": "Do not import Uber dependencies or turn buffer-size style into a correctness theorem."
99
+ },
100
+ {
101
+ "id": "go-context",
102
+ "publisher": "Go project",
103
+ "title": "context package",
104
+ "url": "https://pkg.go.dev/context",
105
+ "section": "Cancellation propagation and ownership",
106
+ "checkedAt": "2026-11-08",
107
+ "versionScope": "Standard library; check owning go.mod/toolchain",
108
+ "licenseStatus": "unknown",
109
+ "adoption": "adopt",
110
+ "limits": "A cancellation signal alone does not confirm worker exit."
111
+ },
112
+ {
113
+ "id": "google-java",
114
+ "publisher": "Google",
115
+ "title": "Java Style Guide",
116
+ "url": "https://google.github.io/styleguide/javaguide.html",
117
+ "section": "Source structure and exception handling",
118
+ "checkedAt": "2026-11-08",
119
+ "versionScope": "Living public style; revision unknown",
120
+ "licenseStatus": "unknown",
121
+ "adoption": "conditional",
122
+ "limits": "Naming/layout follows local standard; style is distinct from runtime correctness."
123
+ },
124
+ {
125
+ "id": "oracle-resources",
126
+ "publisher": "Oracle",
127
+ "title": "Try-with-resources",
128
+ "url": "https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html",
129
+ "section": "Closing resources and suppressed exceptions",
130
+ "checkedAt": "2026-11-08",
131
+ "versionScope": "JDK8 tutorial; not a source for newer runtime features",
132
+ "licenseStatus": "unknown",
133
+ "adoption": "adopt",
134
+ "limits": "Preserve primary cause and borrowed-resource ownership; check actual API contract."
135
+ },
136
+ {
137
+ "id": "java-executor",
138
+ "publisher": "Oracle",
139
+ "title": "ExecutorService",
140
+ "url": "https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/ExecutorService.html",
141
+ "section": "Shutdown, termination and awaitTermination",
142
+ "checkedAt": "2026-11-08",
143
+ "versionScope": "Java SE17 documentation",
144
+ "licenseStatus": "unknown",
145
+ "adoption": "conditional",
146
+ "limits": "Check target JDK; no automatic virtual-thread or JDK migration."
147
+ },
148
+ {
149
+ "id": "google-python",
150
+ "publisher": "Google",
151
+ "title": "Python Style Guide",
152
+ "url": "https://google.github.io/styleguide/pyguide.html",
153
+ "section": "Imports, exceptions and mutable state",
154
+ "checkedAt": "2026-11-08",
155
+ "versionScope": "Living public guide; revision unknown",
156
+ "licenseStatus": "unknown",
157
+ "adoption": "conditional",
158
+ "limits": "Keep current formatter/type checker and library responsibilities."
159
+ },
160
+ {
161
+ "id": "python-asyncio",
162
+ "publisher": "Python project",
163
+ "title": "Coroutines and tasks",
164
+ "url": "https://docs.python.org/3/library/asyncio-task.html",
165
+ "section": "Cancellation and task ownership",
166
+ "checkedAt": "2026-11-08",
167
+ "versionScope": "Page observed 3.15.2; feature availability follows project Python",
168
+ "licenseStatus": "unknown",
169
+ "adoption": "conditional",
170
+ "limits": "Newer TaskGroup/timeout features require a supported project version; no upgrade implied."
171
+ },
172
+ {
173
+ "id": "cert-c",
174
+ "publisher": "CMU SEI",
175
+ "title": "MEM00-C allocation and release",
176
+ "url": "https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/recommendations/memory-management-mem/mem00-c/",
177
+ "section": "MEM00-C memory responsibility",
178
+ "checkedAt": "2026-11-08",
179
+ "versionScope": "2016-edition standard family; MEM00-C is a recommendation",
180
+ "licenseStatus": "unknown",
181
+ "adoption": "adopt",
182
+ "limits": "Do not label recommendations as mandatory CERT rules or apply C++ ownership machinery to pure C."
183
+ },
184
+ {
185
+ "id": "cpp-core",
186
+ "publisher": "C++ Core Guidelines editors",
187
+ "title": "C++ Core Guidelines",
188
+ "url": "https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines",
189
+ "section": "Resource and lifetime interfaces",
190
+ "checkedAt": "2026-11-08",
191
+ "versionScope": "Page dated 2026-06-14, living release0.8",
192
+ "licenseStatus": "unknown",
193
+ "adoption": "adopt",
194
+ "limits": "Adapt to existing exception policy and compiler; borrowing does not imply ownership."
195
+ },
196
+ {
197
+ "id": "google-cpp",
198
+ "publisher": "Google",
199
+ "title": "C++ Style Guide",
200
+ "url": "https://google.github.io/styleguide/cppguide.html",
201
+ "section": "Exceptions and project consistency",
202
+ "checkedAt": "2026-11-08",
203
+ "versionScope": "Living public guide; revision unknown",
204
+ "licenseStatus": "unknown",
205
+ "adoption": "conditional",
206
+ "limits": "Its exception/standard policy is not universal; preserve the owning project policy and C ABI."
207
+ },
208
+ {
209
+ "id": "ms-sal",
210
+ "publisher": "Microsoft",
211
+ "title": "Understanding SAL",
212
+ "url": "https://learn.microsoft.com/en-us/cpp/code-quality/understanding-sal?view=msvc-170",
213
+ "section": "Parameter preconditions and output guarantees",
214
+ "checkedAt": "2026-11-08",
215
+ "versionScope": "MSVC170 documentation view",
216
+ "licenseStatus": "unknown",
217
+ "adoption": "conditional",
218
+ "limits": "SAL is an optional toolchain-specific expression, not a portable mandatory annotation."
219
+ },
220
+ {
221
+ "id": "aws-retry",
222
+ "publisher": "AWS",
223
+ "title": "Timeouts, retries and backoff with jitter",
224
+ "url": "https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/",
225
+ "section": "Timeouts, bounded retries and retry amplification",
226
+ "checkedAt": "2026-11-08",
227
+ "versionScope": "Article dated 2019-12-05; official Builder Center redirect",
228
+ "licenseStatus": "unknown",
229
+ "adoption": "adopt",
230
+ "limits": "Retry only semantically safe operations within a total budget; failure classes alone do not grant write replay."
231
+ },
232
+ {
233
+ "id": "aws-idempotency",
234
+ "publisher": "AWS",
235
+ "title": "Making retries safe with idempotent APIs",
236
+ "url": "https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/",
237
+ "section": "Caller intent, duplicate requests and atomic recording",
238
+ "checkedAt": "2026-11-08",
239
+ "versionScope": "Builders Library; revision unknown",
240
+ "licenseStatus": "unknown",
241
+ "adoption": "adopt",
242
+ "limits": "A process-local example does not establish database/multi-process exactly-once."
243
+ },
244
+ {
245
+ "id": "react-effects",
246
+ "publisher": "React project",
247
+ "title": "useEffect",
248
+ "url": "https://react.dev/reference/react/useEffect",
249
+ "section": "Cleanup and fetching race conditions",
250
+ "checkedAt": "2026-11-08",
251
+ "versionScope": "Page observed React19.3; use installed project API",
252
+ "licenseStatus": "unknown",
253
+ "adoption": "adopt",
254
+ "limits": "Abort and stale-result checks complement each other; no React upgrade implied."
255
+ },
256
+ {
257
+ "id": "react-act",
258
+ "publisher": "React project",
259
+ "title": "act",
260
+ "url": "https://react.dev/reference/react/act",
261
+ "section": "Applying updates before assertions",
262
+ "checkedAt": "2026-11-08",
263
+ "versionScope": "Page observed React19.3; verify sample versions",
264
+ "licenseStatus": "unknown",
265
+ "adoption": "adopt",
266
+ "limits": "DOM simulation is not browser E2E or native desktop execution."
267
+ },
268
+ {
269
+ "id": "vue-watchers",
270
+ "publisher": "Vue project",
271
+ "title": "Watchers",
272
+ "url": "https://vuejs.org/guide/essentials/watchers.html",
273
+ "section": "Side-effect cleanup",
274
+ "checkedAt": "2026-11-08",
275
+ "versionScope": "Vue3; onWatcherCleanup requires3.5+ and synchronous registration",
276
+ "licenseStatus": "unknown",
277
+ "adoption": "conditional",
278
+ "limits": "Use supported callback cleanup on older Vue3; no framework migration."
279
+ },
280
+ {
281
+ "id": "tauri-permissions",
282
+ "publisher": "Tauri project",
283
+ "title": "Permissions",
284
+ "url": "https://v2.tauri.app/security/permissions/",
285
+ "section": "Command allow/deny and capability scope",
286
+ "checkedAt": "2026-11-08",
287
+ "versionScope": "Tauri2 docs; check installed version/configuration",
288
+ "licenseStatus": "unknown",
289
+ "adoption": "conditional",
290
+ "limits": "Rust command-unit tests do not activate webview permissions or prove packaged GUI security."
291
+ },
292
+ {
293
+ "id": "electron-security",
294
+ "publisher": "Electron project",
295
+ "title": "Security",
296
+ "url": "https://www.electronjs.org/docs/latest/tutorial/security",
297
+ "section": "IPC sender checks and renderer trust",
298
+ "checkedAt": "2026-11-08",
299
+ "versionScope": "Living docs; match installed Electron",
300
+ "licenseStatus": "unknown",
301
+ "adoption": "conditional",
302
+ "limits": "Handler tests do not prove sandbox/context isolation is active in a packaged app."
303
+ },
304
+ {
305
+ "id": "spring-tests",
306
+ "publisher": "Spring project",
307
+ "title": "Testing Spring Boot applications",
308
+ "url": "https://docs.spring.io/spring-boot/3.5/reference/testing/spring-boot-applications.html",
309
+ "section": "Test slices and application tests",
310
+ "checkedAt": "2026-11-08",
311
+ "versionScope": "Boot3.5 docs observed3.5.16; preserve sample/project versions",
312
+ "licenseStatus": "unknown",
313
+ "adoption": "conditional",
314
+ "limits": "Test scope matters; MVC tests do not establish live DB/transaction or deployment behavior."
315
+ },
316
+ {
317
+ "id": "fastapi-lifespan",
318
+ "publisher": "FastAPI project",
319
+ "title": "Lifespan events",
320
+ "url": "https://fastapi.tiangolo.com/advanced/events/",
321
+ "section": "Acquire and release application resources",
322
+ "checkedAt": "2026-11-08",
323
+ "versionScope": "Living FastAPI documentation; match pinned dependencies",
324
+ "licenseStatus": "unknown",
325
+ "adoption": "conditional",
326
+ "limits": "Use actual lifespan execution in tests; import does not own a live connection."
327
+ },
328
+ {
329
+ "id": "gin-binding",
330
+ "publisher": "Gin project",
331
+ "title": "Binding",
332
+ "url": "https://gin-gonic.com/en/docs/binding/",
333
+ "section": "Binding errors and validation",
334
+ "checkedAt": "2026-11-08",
335
+ "versionScope": "Living Gin documentation; match pinned module",
336
+ "licenseStatus": "unknown",
337
+ "adoption": "conditional",
338
+ "limits": "Writing/aborting a response does not replace explicit control-flow return in the current handler."
339
+ },
340
+ {
341
+ "id": "axum-extractors",
342
+ "publisher": "Axum project",
343
+ "title": "Extractors",
344
+ "url": "https://docs.rs/axum/latest/axum/extract/",
345
+ "section": "Extractor order and rejections",
346
+ "checkedAt": "2026-11-08",
347
+ "versionScope": "Latest route observed0.8.9; fixed0.8.9 route unavailable via browser tool",
348
+ "licenseStatus": "unknown",
349
+ "adoption": "conditional",
350
+ "limits": "Pinned existing example is authoritative for compilation; do not assume source signatures across releases."
351
+ },
352
+ {
353
+ "id": "drogon-filters",
354
+ "publisher": "Drogon project",
355
+ "title": "Middleware and Filter",
356
+ "url": "https://github.com/drogonframework/drogon/wiki/ENG-05-Middleware-and-Filter",
357
+ "section": "Filter callbacks and continuation",
358
+ "checkedAt": "2026-11-08",
359
+ "versionScope": "Living wiki; match compiled example version",
360
+ "licenseStatus": "unknown",
361
+ "adoption": "conditional",
362
+ "limits": "Synthetic role headers are not authentication; callback lifetime must follow actual ownership."
363
+ },
364
+ {
365
+ "id": "node-typescript",
366
+ "publisher": "Node.js project",
367
+ "title": "Modules: TypeScript",
368
+ "url": "https://nodejs.org/api/typescript.html",
369
+ "section": "Type-stripping history, enabling, and separate type checking",
370
+ "checkedAt": "2026-11-08",
371
+ "versionScope": "Page observed26.13.0; sample>=22.18, actual24.14.1 tested; product Node>=22 unchanged",
372
+ "licenseStatus": "unknown",
373
+ "adoption": "conditional",
374
+ "limits": "Native stripping is not type checking and ignores tsconfig. Missing sample capability is MISSING, not a product runtime upgrade."
375
+ }
376
+ ]
377
+ }
@@ -0,0 +1,106 @@
1
+ ---
2
+ practiceCards:
3
+ - id: "cc-rust-project-standard:ownership-api"
4
+ level: "required"
5
+ sourceIds: ["rust-api","cpp-core"]
6
+ caseIds: ["EP-RS-01"]
7
+ evidence: "review-only"
8
+ - id: "cc-rust-project-standard:result-boundaries"
9
+ level: "required"
10
+ sourceIds: ["rust-api"]
11
+ caseIds: ["EP-RS-01"]
12
+ evidence: "case"
13
+ - id: "cc-rust-project-standard:unsafe-ffi"
14
+ level: "conditional"
15
+ sourceIds: ["rust-api","cert-c"]
16
+ caseIds: ["EP-RS-01","EP-C-01"]
17
+ evidence: "review-only"
18
+ ---
19
+
20
+ # 本入口工程决策
21
+
22
+ 先定位项目角色、工具链及已有约定,再按需读取[公共原则](common/engineering-practices.md)。下列条件仅约束当前语言/场景;结构检查不证明全部语义或实际运行。
23
+
24
+ <a id="cc-rust-project-standard:ownership-api"></a>
25
+ ## 先明确借用,再考虑共享拥有
26
+
27
+ 级别: required
28
+
29
+ ### 风险
30
+ 复制拥有关系可能掩盖资源超出调用方寿命。
31
+
32
+ ### 适用
33
+ 适用于crate公共API、原生库和桌面核心,无需服务分层。
34
+
35
+ ### 决策
36
+ 明确句柄拥有方、借用期限及转移;调用方保留所有权时使用借用,Arc必须有真实共享寿命需求。
37
+
38
+ ### 例外
39
+ 有意隔离时可克隆已拥有数据,这是成本/契约选择,不是全面禁克隆;保留edition/MSRV。
40
+
41
+ ### 正反示意
42
+ 正例:借用输入,拥有新获取lease。反例:以Arc替代关闭协调。
43
+
44
+ ### 验证
45
+ 评审公共签名及转移/借用示意;本地Drop测试不能证明所有别名或异步交互。
46
+
47
+ ### 来源
48
+ rust-api, cpp-core — [来源与适用限制](common/engineering-practices.sources.json).
49
+
50
+ 证据标识: EP-RS-01; review-only. 执行状态及覆盖范围见实际记录;关联ID不证明该卡全部语义。
51
+
52
+ <a id="cc-rust-project-standard:result-boundaries"></a>
53
+ ## Result保留原因及清理
54
+
55
+ 级别: required
56
+
57
+ ### 风险
58
+ 抹去原因或Err时遗忘资源会隐藏操作失败。
59
+
60
+ ### 适用
61
+ 适用于可失败库/API;已记录不可能不变量可使用项目允许的断言。
62
+
63
+ ### 决策
64
+ 返回项目Result分类,保留Error::source,以RAII覆盖提前返回;错误在应用边缘转换,不在crate内部打印秘密。
65
+
66
+ ### 例外
67
+ 受控测试中的unwrap与不可信运行时输入有别,不必替换所有测试断言。
68
+
69
+ ### 正反示意
70
+ 正例:Err保留I/O原因并释放lease。反例:失败路径mem::forget或返回空成功。
71
+
72
+ ### 验证
73
+ 以缺陷开关1/0运行相同两个cargo测试,检查cause与Drop次数;offline/locked准备单独进行。
74
+
75
+ ### 来源
76
+ rust-api — [来源与适用限制](common/engineering-practices.sources.json).
77
+
78
+ 证据标识: EP-RS-01; case. [本入口可运行案例](../examples/engineering/README.md)。 执行状态及覆盖范围见实际记录;关联ID不证明该卡全部语义。
79
+
80
+ <a id="cc-rust-project-standard:unsafe-ffi"></a>
81
+ ## unsafe与FFI需明确有效性契约
82
+
83
+ 级别: conditional
84
+
85
+ ### 风险
86
+ Rust类型不能证明外部指针长度、寿命及分配器。
87
+
88
+ ### 适用
89
+ 仅实际unsafe/FFI/原生边界适用,安全Rust无需新增unsafe包装。
90
+
91
+ ### 决策
92
+ 记录指针有效性、对齐、长度、所有权及panic政策,将unsafe缩小在已检查接口后;分配器及释放方配对。
93
+
94
+ ### 例外
95
+ 没有当前edition/工具链事实,不采用新unsafe属性或ABI假设;捕获边界应尊重unwind/abort政策。
96
+
97
+ ### 正反示意
98
+ 正例:校验外部借用缓冲区,由原拥有者释放。反例:把任意非空指针转为拥有关系。
99
+
100
+ ### 验证
101
+ 用实际原生工具评审安全前提及失败/销毁测试;安全Rust样例不验证unsafe健全性。
102
+
103
+ ### 来源
104
+ rust-api, cert-c — [来源与适用限制](common/engineering-practices.sources.json).
105
+
106
+ 证据标识: EP-RS-01, EP-C-01; review-only. 执行状态及覆盖范围见实际记录;关联ID不证明该卡全部语义。
@@ -0,0 +1,37 @@
1
+ # Rust 工程规范
2
+
3
+ ## 关键检查
4
+
5
+ 1. 先读 Cargo.toml、workspace 成员、edition、MSRV 与现有 alias;在所属 crate 内改动,不顺手升级整个工作区。
6
+
7
+ 2. 在接口边界明确所有权;调用方持有生命周期时优先借用,共享所有权必须有真实共享生命周期需求。
8
+
9
+ 3. 遵循仓库错误分类与 Result 传播,保留原因链,在应用边界映射,不在公共诊断中暴露敏感信息。
10
+
11
+ 4. 隔离领域逻辑、持久化与传输,检查锁守卫生命周期,避免持有阻塞锁跨越挂起点。
12
+
13
+ 5. 同时测试畸形输入、部分持久化、回滚和所有权转移;使用临时资源与确定性失败注入。
14
+
15
+ 6. 使用现有锁与工具链运行可用的 fmt 检查、clippy 和定向 Cargo 测试;缺少工具链必须记为未验证。
16
+
17
+ <a id="scope"></a>
18
+ ## 边界与案例
19
+
20
+ 适用场景:
21
+ - 规划现有 Cargo workspace 的 crate 边界
22
+ - 审查 Rust 公共接口所有权和 Result 边界
23
+ - 保持现有 edition 增加存储模块
24
+ - 为 Rust 库选择工程质量检查
25
+
26
+ 应用角色按实际证据区分;本语言模块可用于库、CLI、桌面或服务,框架问题另选专项。
27
+
28
+ ## 交付要求
29
+
30
+ - 已读取的工程/契约证据及变更作用域。
31
+ - 选用方案、关键不变量、资源/错误或失败边界。
32
+ - 实际运行的命令与结果,未运行项及不能证明的结论。
33
+ - 兼容、恢复/回滚或后续处理限制;评审结论须给可核实位置。
34
+
35
+ ## 权威资料
36
+
37
+ [相关官方/项目资料](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html)(核验日期:2026-11-06)。实际使用时再匹配项目声明版本,不把参考页的最新版本当作升级授权。
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: cc-tauri-project-standard
3
+ description: 用于 Tauri 应用的 Rust command、WebView IPC 契约、capabilities 与 permissions、托管状态、桌面生命周期和平台构建发布;没有 Tauri 的普通 Rust 库不属于本专项。
4
+ ---
5
+
6
+ # Tauri 应用工程
7
+
8
+ 定位拥有任务的 Web 应用及 `src-tauri` crate。UI 与 Rust 核心是应用角色,不受提供本能力的前后端产品名称限制。
9
+
10
+ 1. 读取实际 Tauri/API/plugin 版本、两端锁文件、配置及支持平台。区分 v1/v2 权限模型,保持既有工具链。
11
+ 2. 将每次 invoke 对应到 Rust command、校验后的输入、公共结果/错误及资源所有者。文件和进程权限留在核心,只开放狭窄操作。
12
+ 3. 联合检查注册命令、应用命令权限生成、capabilities、窗口/WebView label 及远程来源;权限配置不能代替业务输入校验。
13
+ 4. 明确托管状态生命周期、阻塞工作的界限、取消及退出;检查跨 await 的锁和事件监听清理。
14
+ 5. 使用[实践清单](references/practice.md)及[最小应用](examples/minimal/README.md),本包包含独立完成专项所需的本地契约参考。
15
+ 6. 遵循[验证边界](references/verification.md):先验证拒绝输入时无越界结果,再单独测试真实 WebView/权限激活、目标平台产物和签名。
16
+
17
+ 交付 UI/core 子工程范围、invoke 契约、权限决定、实际命令结果及未验证平台。源码检查或核心单测不能证明桌面发布成功。
18
+
19
+ ## 工程实践
20
+
21
+ 按当前任务读取[本入口工程细则](references/engineering-practices.md),再按链接选择公共原则。规则级别与例外以实际项目契约为准;不因产品前后端标签限制语言或职责。
@@ -0,0 +1,9 @@
1
+ # 最小 Tauri 文档应用
2
+
3
+ 本目录独立包含纯 Rust 的 core、Tauri 2 command、应用命令权限生成、main capability 和实际调用它的 UI,不依赖相邻 Skill。
4
+
5
+ 按[验证说明](../../references/verification.md)运行 core 测试。显式启用 defective 时选择缺陷函数,同一断言应失败;应用不得启用此特性。
6
+
7
+ 现有 Tauri 2 依赖及平台前置条件准备好后,在此目录执行 cargo run --manifest-path src-tauri/Cargo.toml --offline。应用在自身数据目录创建 documents/hello.txt,按钮通过受保护核心读取;renderer 不提供可信根。
8
+
9
+ 框架依赖应由所属项目的正常流程解析并锁定后再主张可复现构建;core 的独立锁不覆盖 GUI 依赖图。核心测试只证明读取边界,权限激活、拒绝窗口和 GUI 发布须通过真实环境验证。
@@ -0,0 +1,5 @@
1
+ version = 4
2
+
3
+ [[package]]
4
+ name = "document-core"
5
+ version = "0.1.0"
@@ -0,0 +1,9 @@
1
+ [package]
2
+ name = "document-core"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ publish = false
6
+
7
+ [features]
8
+ # 显式缺陷教学模式,应用不得启用。
9
+ defective = []
@@ -0,0 +1,46 @@
1
+ use std::{fs, io::Read, path::{Component, Path}};
2
+
3
+ /// Deliberately flawed baseline: the caller can leave the allowed directory.
4
+ pub fn read_document_defective(root: &Path, name: &str) -> Result<String, String> {
5
+ fs::read_to_string(root.join(name)).map_err(|_| "read failed".into())
6
+ }
7
+
8
+ pub fn read_document(root: &Path, name: &str) -> Result<String, String> {
9
+ if name.is_empty() || Path::new(name).components().any(|part| !matches!(part, Component::Normal(_))) {
10
+ return Err("invalid document name".into());
11
+ }
12
+ let root=fs::canonicalize(root).map_err(|_| "document root unavailable")?;
13
+ let file=fs::canonicalize(root.join(name)).map_err(|_| "document unavailable")?;
14
+ if !file.starts_with(&root) || !file.is_file() { return Err("outside allowed directory".into()); }
15
+ let mut bytes=Vec::new();
16
+ fs::File::open(file).map_err(|_| "read failed")?.take(65_537).read_to_end(&mut bytes).map_err(|_| "read failed")?;
17
+ if bytes.len()>65_536 { return Err("document too large".into()); }
18
+ String::from_utf8(bytes).map_err(|_| "document is not UTF-8".into())
19
+ }
20
+
21
+ #[cfg(test)]
22
+ mod tests {
23
+ use super::*;
24
+ use std::{path::PathBuf, sync::atomic::{AtomicUsize, Ordering}};
25
+ static NEXT: AtomicUsize = AtomicUsize::new(0);
26
+ struct Fixture(PathBuf);
27
+ impl Fixture {
28
+ fn new() -> Self {
29
+ let base = std::env::temp_dir().join(format!("craft-command-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed)));
30
+ fs::create_dir_all(base.join("allowed")).unwrap();
31
+ fs::write(base.join("allowed/hello.txt"), "hello").unwrap();
32
+ fs::write(base.join("private.txt"), "outside").unwrap();
33
+ Self(base)
34
+ }
35
+ fn read(&self, name: &str) -> Result<String, String> {
36
+ let root=self.0.join("allowed");
37
+ if cfg!(feature="defective") { read_document_defective(&root,name) } else { read_document(&root,name) }
38
+ }
39
+ }
40
+ impl Drop for Fixture { fn drop(&mut self) { fs::remove_dir_all(&self.0).unwrap(); } }
41
+ #[test] fn reads_allowed_document() { let f=Fixture::new();assert_eq!(f.read("hello.txt").unwrap(),"hello"); }
42
+ #[test] fn rejects_traversal() { let f=Fixture::new();assert!(f.read("../private.txt").is_err(),"outside allowed directory must be rejected"); }
43
+ #[test] fn rejects_absolute_path() { let f=Fixture::new();assert!(f.read(f.0.join("private.txt").to_str().unwrap()).is_err()); }
44
+ #[cfg(unix)]
45
+ #[test] fn rejects_symlink_escape() { let f=Fixture::new();std::os::unix::fs::symlink(f.0.join("private.txt"),f.0.join("allowed/link.txt")).unwrap();assert!(f.read("link.txt").is_err()); }
46
+ }
@@ -0,0 +1,12 @@
1
+ [package]
2
+ name = "craft-document-example"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ publish = false
6
+
7
+ [build-dependencies]
8
+ tauri-build = { version = "2", features = [] }
9
+
10
+ [dependencies]
11
+ tauri = { version = "2", features = [] }
12
+ document-core = { path = "../core" }
@@ -0,0 +1,5 @@
1
+ fn main() {
2
+ tauri_build::try_build(tauri_build::Attributes::new().app_manifest(
3
+ tauri_build::AppManifest::new().commands(&["read_document"]),
4
+ )).expect("Tauri permission generation failed");
5
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "identifier": "main",
3
+ "description": "Local main window document access",
4
+ "windows": ["main"],
5
+ "permissions": ["allow-read-document"]
6
+ }
@@ -0,0 +1,4 @@
1
+ [[permission]]
2
+ identifier = "allow-read-document"
3
+ description = "通过已校验的 Rust command 读取有界文档"
4
+ commands.allow = ["read_document"]