add-coder 0.3.27 → 0.3.29

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 (262) hide show
  1. package/README.md +252 -150
  2. package/package.json +2 -1
  3. package/templates/.add-coder-src-hash.json +126 -148
  4. package/templates/adapters/claude/hooks/doc-format-guard.ts +32 -0
  5. package/templates/adapters/claude/hooks/lib/claude-env.ts +7 -0
  6. package/templates/adapters/claude/hooks/notification.ts +24 -0
  7. package/templates/adapters/claude/hooks/permission-denied.ts +33 -0
  8. package/templates/adapters/claude/hooks/permission-gate.ts +12 -0
  9. package/templates/adapters/claude/hooks/post-tool-failure.ts +4 -0
  10. package/templates/adapters/claude/hooks/post-tool-use.ts +17 -0
  11. package/templates/adapters/claude/hooks/pre-compact.ts +10 -0
  12. package/templates/adapters/claude/hooks/pre-tool-use.ts +81 -0
  13. package/templates/adapters/claude/hooks/prompt-submit.ts +82 -0
  14. package/templates/adapters/claude/hooks/review-checklist.ts +4 -0
  15. package/templates/adapters/claude/hooks/session-end.ts +10 -0
  16. package/templates/adapters/claude/hooks/session-start.ts +24 -0
  17. package/templates/adapters/claude/hooks/stop-check.ts +15 -0
  18. package/templates/adapters/claude/hooks/stop-failure.ts +34 -0
  19. package/templates/adapters/claude/hooks/subagent-guard.ts +25 -0
  20. package/templates/adapters/claude/hooks/subagent-stop.ts +12 -0
  21. package/templates/adapters/claude/settings.json +13 -13
  22. package/templates/adapters/codex/hooks/doc-format-guard.ts +30 -0
  23. package/templates/adapters/codex/hooks/notification.ts +26 -0
  24. package/templates/adapters/codex/hooks/permission-gate.ts +15 -0
  25. package/templates/adapters/codex/hooks/post-tool-failure.ts +14 -0
  26. package/templates/adapters/codex/hooks/post-tool-use.ts +85 -0
  27. package/templates/adapters/codex/hooks/pre-compact.ts +20 -0
  28. package/templates/adapters/codex/hooks/pre-tool-use.ts +141 -0
  29. package/templates/adapters/codex/hooks/prompt-submit.ts +38 -0
  30. package/templates/adapters/codex/hooks/review-checklist.ts +5 -0
  31. package/templates/adapters/codex/hooks/session-end.ts +19 -0
  32. package/templates/adapters/codex/hooks/session-start.ts +45 -0
  33. package/templates/adapters/codex/hooks/stop-check.ts +59 -0
  34. package/templates/adapters/codex/hooks/subagent-guard.ts +22 -0
  35. package/templates/adapters/codex/hooks/subagent-stop.ts +20 -0
  36. package/templates/adapters/codex/hooks.json +5 -5
  37. package/templates/adapters/qoder/hooks/doc-format-guard.ts +34 -0
  38. package/templates/adapters/qoder/hooks/lib/context-inject.ts +61 -0
  39. package/templates/adapters/qoder/hooks/lib/qoder-env.ts +23 -0
  40. package/templates/adapters/qoder/hooks/lib/review-checklist.ts +5 -0
  41. package/templates/adapters/qoder/hooks/notification.ts +34 -0
  42. package/templates/adapters/qoder/hooks/permission-gate.ts +26 -0
  43. package/templates/adapters/qoder/hooks/post-tool-failure.ts +30 -0
  44. package/templates/adapters/qoder/hooks/post-tool-use.ts +32 -0
  45. package/templates/adapters/qoder/hooks/pre-compact.ts +16 -0
  46. package/templates/adapters/qoder/hooks/pre-tool-use.ts +112 -0
  47. package/templates/adapters/qoder/hooks/prompt-submit.ts +66 -0
  48. package/templates/adapters/qoder/hooks/review-checklist.ts +24 -0
  49. package/templates/adapters/qoder/hooks/session-end.ts +27 -0
  50. package/templates/adapters/qoder/hooks/session-start.ts +83 -0
  51. package/templates/adapters/qoder/hooks/stop-check.ts +69 -0
  52. package/templates/adapters/qoder/hooks/subagent-guard.ts +16 -0
  53. package/templates/adapters/qoder/hooks/subagent-stop.ts +33 -0
  54. package/templates/adapters/qoder/settings.json +13 -13
  55. package/templates/adapters/trae/hooks/doc-format-guard.ts +30 -0
  56. package/templates/adapters/trae/hooks/notification.ts +22 -0
  57. package/templates/adapters/trae/hooks/permission-gate.ts +15 -0
  58. package/templates/adapters/trae/hooks/post-tool-failure.ts +14 -0
  59. package/templates/adapters/trae/hooks/post-tool-use.ts +24 -0
  60. package/templates/adapters/trae/hooks/pre-compact.ts +15 -0
  61. package/templates/adapters/trae/hooks/pre-tool-use.ts +40 -0
  62. package/templates/adapters/trae/hooks/prompt-submit.ts +29 -0
  63. package/templates/adapters/trae/hooks/review-checklist.ts +5 -0
  64. package/templates/adapters/trae/hooks/session-end.ts +16 -0
  65. package/templates/adapters/trae/hooks/session-start.ts +15 -0
  66. package/templates/adapters/trae/hooks/stop-check.ts +20 -0
  67. package/templates/adapters/trae/hooks/subagent-guard.ts +22 -0
  68. package/templates/adapters/trae/hooks/subagent-stop.ts +15 -0
  69. package/templates/adapters/trae/hooks.json +1 -1
  70. package/templates/adapters/vscode/hooks/doc-format-guard.ts +27 -0
  71. package/templates/adapters/vscode/hooks/notification.ts +22 -0
  72. package/templates/adapters/vscode/hooks/permission-gate.ts +15 -0
  73. package/templates/adapters/vscode/hooks/post-tool-failure.ts +32 -0
  74. package/templates/adapters/vscode/hooks/post-tool-use.ts +25 -0
  75. package/templates/adapters/vscode/hooks/pre-compact.ts +15 -0
  76. package/templates/adapters/vscode/hooks/pre-tool-use.ts +78 -0
  77. package/templates/adapters/vscode/hooks/prompt-submit.ts +74 -0
  78. package/templates/adapters/vscode/hooks/review-checklist.ts +5 -0
  79. package/templates/adapters/vscode/hooks/session-end.ts +16 -0
  80. package/templates/adapters/vscode/hooks/session-start.ts +24 -0
  81. package/templates/adapters/vscode/hooks/stop-check.ts +21 -0
  82. package/templates/adapters/vscode/hooks/subagent-guard.ts +21 -0
  83. package/templates/adapters/vscode/hooks/subagent-stop.ts +15 -0
  84. package/templates/core/docs/ADD-governance-claude-code.md +3 -3
  85. package/templates/core/docs/ADD-governance-codex.md +5 -5
  86. package/templates/core/docs/ADD-governance-qoder-cn.md +4 -4
  87. package/templates/core/docs/ADD-governance-trae.md +2 -2
  88. package/templates/core/docs/ADD-governance-vscode-copilot.md +21 -22
  89. package/templates/core/governance/audit-bridge.ts +47 -0
  90. package/templates/core/governance/common.ts +299 -0
  91. package/templates/core/governance/context-inject.ts +53 -0
  92. package/templates/core/governance/doc-format-guard.ts +440 -0
  93. package/templates/core/governance/notification-router.ts +62 -0
  94. package/templates/core/governance/notify.ts +66 -0
  95. package/templates/core/governance/permission-gate-router.ts +42 -0
  96. package/templates/core/governance/post-tool-failure-router.ts +56 -0
  97. package/templates/core/governance/post-tool-router.ts +212 -0
  98. package/templates/core/governance/pre-compact-guard.ts +41 -0
  99. package/templates/core/governance/pre-tool-guard.ts +309 -0
  100. package/templates/core/governance/preload-templates.ts +241 -0
  101. package/templates/core/governance/prompt-router.ts +222 -0
  102. package/templates/core/governance/review-checklist-guard.ts +186 -0
  103. package/templates/core/governance/rules.ts +720 -0
  104. package/templates/core/governance/session-end.ts +88 -0
  105. package/templates/core/governance/session-start-guard.ts +99 -0
  106. package/templates/core/governance/state-detect.ts +6 -0
  107. package/templates/core/governance/stop-router.ts +140 -0
  108. package/templates/core/governance/subagent-guard-router.ts +35 -0
  109. package/templates/core/governance/subagent-stop-router.ts +93 -0
  110. package/templates/core/governance/subagent-stop.ts +75 -0
  111. package/templates/core/governance/vocabulary.ts +109 -0
  112. package/templates/core/hooks/doc-format-guard.ts +21 -0
  113. package/templates/core/hooks/notification.ts +11 -0
  114. package/templates/core/hooks/permission-gate.ts +7 -0
  115. package/templates/core/hooks/post-tool-failure.ts +7 -0
  116. package/templates/core/hooks/post-tool-use.ts +23 -0
  117. package/templates/core/hooks/pre-compact.ts +9 -0
  118. package/templates/core/hooks/pre-tool-use.ts +30 -0
  119. package/templates/core/hooks/prompt-submit.ts +11 -0
  120. package/templates/core/hooks/review-checklist.ts +4 -0
  121. package/templates/core/hooks/session-end.ts +10 -0
  122. package/templates/core/hooks/session-start.ts +9 -0
  123. package/templates/core/hooks/stop-check.ts +14 -0
  124. package/templates/core/hooks/subagent-guard.ts +8 -0
  125. package/templates/core/hooks/subagent-stop.ts +9 -0
  126. package/templates/core/scripts/mcp-server/tools/gateway/check_rahs.ts +12 -1
  127. package/templates/core/scripts/mcp-server/tools/plan.ts +12 -2
  128. package/templates/adapters/claude/hooks/doc-format-guard.sh +0 -283
  129. package/templates/adapters/claude/hooks/lib/common.sh +0 -220
  130. package/templates/adapters/claude/hooks/lib/context-inject.sh +0 -96
  131. package/templates/adapters/claude/hooks/lib/notify.sh +0 -36
  132. package/templates/adapters/claude/hooks/lib/preload-templates.sh +0 -212
  133. package/templates/adapters/claude/hooks/lib/session-end.sh +0 -76
  134. package/templates/adapters/claude/hooks/lib/state-detect.sh +0 -13
  135. package/templates/adapters/claude/hooks/lib/subagent-stop.sh +0 -90
  136. package/templates/adapters/claude/hooks/lib/vocabulary.sh +0 -62
  137. package/templates/adapters/claude/hooks/notification.sh +0 -45
  138. package/templates/adapters/claude/hooks/permission-denied.sh +0 -42
  139. package/templates/adapters/claude/hooks/permission-gate.sh +0 -18
  140. package/templates/adapters/claude/hooks/post-tool-failure.sh +0 -10
  141. package/templates/adapters/claude/hooks/post-tool-use.sh +0 -35
  142. package/templates/adapters/claude/hooks/pre-compact.sh +0 -37
  143. package/templates/adapters/claude/hooks/pre-tool-use.sh +0 -153
  144. package/templates/adapters/claude/hooks/prompt-submit.sh +0 -99
  145. package/templates/adapters/claude/hooks/review-checklist.sh +0 -10
  146. package/templates/adapters/claude/hooks/session-end.sh +0 -21
  147. package/templates/adapters/claude/hooks/session-start.sh +0 -36
  148. package/templates/adapters/claude/hooks/stop-check.sh +0 -54
  149. package/templates/adapters/claude/hooks/stop-failure.sh +0 -44
  150. package/templates/adapters/claude/hooks/subagent-guard.sh +0 -36
  151. package/templates/adapters/claude/hooks/subagent-stop.sh +0 -20
  152. package/templates/adapters/codex/hooks/doc-format-guard.sh +0 -343
  153. package/templates/adapters/codex/hooks/lib/common.sh +0 -209
  154. package/templates/adapters/codex/hooks/lib/context-inject.sh +0 -96
  155. package/templates/adapters/codex/hooks/lib/notify.sh +0 -36
  156. package/templates/adapters/codex/hooks/lib/preload-templates.sh +0 -208
  157. package/templates/adapters/codex/hooks/lib/session-end.sh +0 -76
  158. package/templates/adapters/codex/hooks/lib/state-detect.sh +0 -8
  159. package/templates/adapters/codex/hooks/lib/subagent-stop.sh +0 -90
  160. package/templates/adapters/codex/hooks/lib/vocabulary.sh +0 -51
  161. package/templates/adapters/codex/hooks/notification.sh +0 -30
  162. package/templates/adapters/codex/hooks/permission-gate.sh +0 -18
  163. package/templates/adapters/codex/hooks/post-tool-failure.sh +0 -10
  164. package/templates/adapters/codex/hooks/post-tool-use.sh +0 -43
  165. package/templates/adapters/codex/hooks/pre-compact.sh +0 -37
  166. package/templates/adapters/codex/hooks/pre-tool-use.sh +0 -130
  167. package/templates/adapters/codex/hooks/prompt-submit.sh +0 -92
  168. package/templates/adapters/codex/hooks/review-checklist.sh +0 -10
  169. package/templates/adapters/codex/hooks/session-end.sh +0 -38
  170. package/templates/adapters/codex/hooks/session-start.sh +0 -63
  171. package/templates/adapters/codex/hooks/stop-check.sh +0 -71
  172. package/templates/adapters/codex/hooks/subagent-guard.sh +0 -15
  173. package/templates/adapters/codex/hooks/subagent-stop.sh +0 -47
  174. package/templates/adapters/qoder/hooks/doc-format-guard.sh +0 -341
  175. package/templates/adapters/qoder/hooks/lib/common.sh +0 -223
  176. package/templates/adapters/qoder/hooks/lib/context-inject.sh +0 -96
  177. package/templates/adapters/qoder/hooks/lib/notify.sh +0 -36
  178. package/templates/adapters/qoder/hooks/lib/preload-templates.sh +0 -212
  179. package/templates/adapters/qoder/hooks/lib/session-end.sh +0 -76
  180. package/templates/adapters/qoder/hooks/lib/state-detect.sh +0 -13
  181. package/templates/adapters/qoder/hooks/lib/subagent-stop.sh +0 -90
  182. package/templates/adapters/qoder/hooks/lib/vocabulary.sh +0 -62
  183. package/templates/adapters/qoder/hooks/notification.sh +0 -25
  184. package/templates/adapters/qoder/hooks/permission-gate.sh +0 -8
  185. package/templates/adapters/qoder/hooks/post-tool-failure.sh +0 -8
  186. package/templates/adapters/qoder/hooks/post-tool-use.sh +0 -121
  187. package/templates/adapters/qoder/hooks/pre-compact.sh +0 -37
  188. package/templates/adapters/qoder/hooks/pre-tool-use.sh +0 -154
  189. package/templates/adapters/qoder/hooks/prompt-submit.sh +0 -96
  190. package/templates/adapters/qoder/hooks/review-checklist.sh +0 -157
  191. package/templates/adapters/qoder/hooks/session-end.sh +0 -24
  192. package/templates/adapters/qoder/hooks/session-start.sh +0 -45
  193. package/templates/adapters/qoder/hooks/stop-check.sh +0 -59
  194. package/templates/adapters/qoder/hooks/subagent-guard.sh +0 -27
  195. package/templates/adapters/qoder/hooks/subagent-stop.sh +0 -26
  196. package/templates/adapters/trae/hooks/doc-format-guard.sh +0 -343
  197. package/templates/adapters/trae/hooks/lib/common.sh +0 -220
  198. package/templates/adapters/trae/hooks/lib/context-inject.sh +0 -96
  199. package/templates/adapters/trae/hooks/lib/notify.sh +0 -36
  200. package/templates/adapters/trae/hooks/lib/preload-templates.sh +0 -212
  201. package/templates/adapters/trae/hooks/lib/session-end.sh +0 -76
  202. package/templates/adapters/trae/hooks/lib/state-detect.sh +0 -10
  203. package/templates/adapters/trae/hooks/lib/subagent-stop.sh +0 -90
  204. package/templates/adapters/trae/hooks/lib/vocabulary.sh +0 -62
  205. package/templates/adapters/trae/hooks/notification.sh +0 -45
  206. package/templates/adapters/trae/hooks/permission-gate.sh +0 -18
  207. package/templates/adapters/trae/hooks/post-tool-failure.sh +0 -10
  208. package/templates/adapters/trae/hooks/post-tool-use.sh +0 -138
  209. package/templates/adapters/trae/hooks/pre-compact.sh +0 -37
  210. package/templates/adapters/trae/hooks/pre-tool-use.sh +0 -223
  211. package/templates/adapters/trae/hooks/prompt-submit.sh +0 -87
  212. package/templates/adapters/trae/hooks/review-checklist.sh +0 -10
  213. package/templates/adapters/trae/hooks/session-end.sh +0 -38
  214. package/templates/adapters/trae/hooks/session-start.sh +0 -53
  215. package/templates/adapters/trae/hooks/stop-check.sh +0 -54
  216. package/templates/adapters/trae/hooks/subagent-guard.sh +0 -15
  217. package/templates/adapters/trae/hooks/subagent-stop.sh +0 -47
  218. package/templates/adapters/vscode/hooks/doc-format-guard.sh +0 -282
  219. package/templates/adapters/vscode/hooks/lib/common.sh +0 -220
  220. package/templates/adapters/vscode/hooks/lib/context-inject.sh +0 -96
  221. package/templates/adapters/vscode/hooks/lib/notify.sh +0 -36
  222. package/templates/adapters/vscode/hooks/lib/preload-templates.sh +0 -212
  223. package/templates/adapters/vscode/hooks/lib/session-end.sh +0 -76
  224. package/templates/adapters/vscode/hooks/lib/state-detect.sh +0 -13
  225. package/templates/adapters/vscode/hooks/lib/subagent-stop.sh +0 -90
  226. package/templates/adapters/vscode/hooks/lib/vocabulary.sh +0 -62
  227. package/templates/adapters/vscode/hooks/notification.sh +0 -43
  228. package/templates/adapters/vscode/hooks/permission-gate.sh +0 -18
  229. package/templates/adapters/vscode/hooks/post-tool-failure.sh +0 -28
  230. package/templates/adapters/vscode/hooks/post-tool-use.sh +0 -35
  231. package/templates/adapters/vscode/hooks/pre-compact.sh +0 -37
  232. package/templates/adapters/vscode/hooks/pre-tool-use.sh +0 -153
  233. package/templates/adapters/vscode/hooks/prompt-submit.sh +0 -99
  234. package/templates/adapters/vscode/hooks/review-checklist.sh +0 -10
  235. package/templates/adapters/vscode/hooks/session-end.sh +0 -13
  236. package/templates/adapters/vscode/hooks/session-start.sh +0 -35
  237. package/templates/adapters/vscode/hooks/stop-check.sh +0 -62
  238. package/templates/adapters/vscode/hooks/subagent-guard.sh +0 -37
  239. package/templates/adapters/vscode/hooks/subagent-stop.sh +0 -12
  240. package/templates/core/hooks/doc-format-guard.sh +0 -343
  241. package/templates/core/hooks/lib/common.sh +0 -220
  242. package/templates/core/hooks/lib/context-inject.sh +0 -96
  243. package/templates/core/hooks/lib/notify.sh +0 -36
  244. package/templates/core/hooks/lib/preload-templates.sh +0 -212
  245. package/templates/core/hooks/lib/session-end.sh +0 -76
  246. package/templates/core/hooks/lib/state-detect.sh +0 -10
  247. package/templates/core/hooks/lib/subagent-stop.sh +0 -90
  248. package/templates/core/hooks/lib/vocabulary.sh +0 -62
  249. package/templates/core/hooks/notification.sh +0 -45
  250. package/templates/core/hooks/permission-gate.sh +0 -18
  251. package/templates/core/hooks/post-tool-failure.sh +0 -10
  252. package/templates/core/hooks/post-tool-use.sh +0 -138
  253. package/templates/core/hooks/pre-compact.sh +0 -37
  254. package/templates/core/hooks/pre-tool-use.sh +0 -223
  255. package/templates/core/hooks/prompt-submit.sh +0 -87
  256. package/templates/core/hooks/review-checklist.sh +0 -10
  257. package/templates/core/hooks/session-end.sh +0 -38
  258. package/templates/core/hooks/session-start.sh +0 -53
  259. package/templates/core/hooks/stop-check.sh +0 -54
  260. package/templates/core/hooks/subagent-guard.sh +0 -15
  261. package/templates/core/hooks/subagent-stop.sh +0 -47
  262. package/templates/shared/hooks-lib/common.sh +0 -22
package/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # add-coder
2
2
 
3
- Make 0.75 into one.
4
-
3
+ Make 0.75 into one.——让治理派重新定义生产关系,迈向人类 1 级文明时代。
5
4
  > 🀄中文 | 🔤[English](#-english-readme)
6
-
7
5
  💡 [酷 = 标准符合度 × 熵值管控 —— 我把"酷"从形容词算成了可验证的工程属性](https://github.com/xiaomingming92/add-coder/blob/main/docs/what-makes-software-cool.md)(ADD 范式设计哲学,附 benchmark 实证)
8
6
 
9
7
  > [![NPM downloads](https://img.shields.io/npm/dt/add-coder)](https://www.npmjs.com/package/add-coder) [![NPM version](https://img.shields.io/npm/v/add-coder)](https://www.npmjs.com/package/add-coder) [![GitHub stars](https://img.shields.io/github/stars/xiaomingming92/add-coder)](https://github.com/xiaomingming92/add-coder) <br/>
@@ -11,82 +9,20 @@ Make 0.75 into one.
11
9
  > 👍 星星之火可以燎原,让我们一起点赞
12
10
  [add-coder](https://github.com/xiaomingming92/add-coder)吧!
13
11
 
14
- ```bash
15
- # 0.1.0 发布于2026-07-10 04:11 UTC(北京时间当天上午 12:11)至 2026-07-28 累计突破 5000 次下载,**首次过死亡谷耗时 19 天**。
16
- ~ $ curl -s https://api.npmjs.org/downloads/point/last-month/add-coder
17
- {
18
- "downloads": 5161,
19
- "start": "2026-06-29",
20
- "end": "2026-07-28",
21
- "package": "add-coder"
22
- }
23
-
24
- ~ $ npm info add-coder@0.1.0
25
-
26
- add-coder@0.1.0 | MIT | deps: 3 | versions: 35
27
- Initialize ADD paradigm workflow templates for
28
- Claude Code, Qoder, and VS Code.
29
-
30
- keywords:
31
- add, add-paradigm, claude, qoder, vscode, mcp,
32
- workflow, codein2027, 集中裁决层, caijuehub
33
-
34
- bin: add-coder
35
-
36
- dist
37
- .tarball: https://registry.npmjs.org/add-coder/-/add-coder-0.1.0.tgz
38
- .shasum: 3266ddb5304d303705694edec7c2f41efc24881d
39
- .integrity: sha512-MxFICLEoAgTVxnHaiIOli5eVyCXvB+xnSzpfmu0mrigEeM9NxzBOm2Auzjn1GKUTXSWelT0FecwwlYmsCf+TWQ==
40
- .unpackedSize: 704.9 kB
41
-
42
- dependencies:
43
- zod: ^3.24.0
44
- commander: ^13.1.0
45
- smol-toml: ^1.7.0
46
-
47
- maintainers:
48
- - wujixmm <wujixmm@gmail.com>
49
-
50
- dist-tags:
51
- latest: 0.3.5
52
- preview: 0.3.6-feature-hitl-enhance-v1.2
53
-
54
- published 2 weeks ago by wujixmm <wujixmm@gmail.com>
55
- ```
56
-
12
+ > 🎉 **里程碑**:0.1.0 发布后 **19 天累计突破 5000 次下载**(首次过死亡谷)。完整 npm 实况数据(下载曲线、依赖、版本矩阵)见文末 [📊 npm 实况数据](#-npm-实况数据)。<br/>
13
+ > 虽然人生不如意之事十之八九,但有了 add-coder 和各位的加入,定会留下你们的精彩!别只下载——[提 Issue](https://github.com/xiaomingming92/add-coder/issues) · [参与讨论](https://github.com/xiaomingming92/add-coder/discussions)
57
14
 
58
15
  ---
59
16
 
60
- > ## ⚠️ 数据共享知情清单(Data-Sharing Disclosure)
61
- >
62
- > add-coder 无意于搞各家厂商的对抗叙事。以下内容仅为**基于各家官方公开条款原文的事实摘录**,目的是让开发者在选择 AI 编程 IDE 前知情。条款可能随时变更,请以官方最新版本为准。
63
- >
64
- > | 产品 | 运营主体 | 官方条款要点(原文摘录) | 产品实测(用户反馈) | 出处 | 核实日期 |
65
- > |------|---------|------------------------|---------------------|------|----------|
66
- > | **Qoder** | BRIGHT ZENITH PTE. LTD.(新加坡) | 用户内容(含聊天、编程及智能体会话的输入/输出,即含代码)默认用于"研究、开发和改进我们的服务",保留期最长 5 年;条款文本称可关闭"共享与改进"(Share & Improve)退出,**但关闭前已为上述目的处理的数据仍保留和使用**;数据跨境存储于美国/新加坡/日本 | 实测为强制隐私共享模式,界面无有效切换入口 | [Qoder 隐私政策](https://qoder.com/zh/privacy-policy) | 2026-05-12 / 2026-08-04 |
67
- > | **Qoder CN** | 阿里云(通义灵码系列) | 官方 FAQ 称:仅在用户点赞/点踩后,针对聊天记录(不包含代码)脱敏去标识化处理,用于算法升级与迭代 | **实测(v1.10.0):强制隐私共享模式,无切换功能**;官方 CLI 配置(`~/.qoder-cn/settings.json`)中亦无共享/改进开关项 | [阿里云帮助中心 FAQ](https://help.aliyun.com/zh/lingma/qoder-cn/support/faq) | 2026-07-15 / 2026-08-04 |
68
- > | **Trae CN** | 北京引力弹弓科技有限公司(字节跳动) | 服务所收集的数据经加密、严格去标识化且无法重新识别个人后,**可能用于模型训练**以优化模型效果与产品体验;可通过隐私模式"限制"该数据使用;代码文件不提供给其他第三方 | — | [Trae 隐私协议](https://www.trae.cn/privacy-policy) | 现行版 / 2026-08-04 |
69
- >
70
- > **要点**:三家官方条款均为"**默认开启共享、需用户主动退出**"(opt-out)模式。**但产品实测层面**:Qoder / Qoder CN 的退出开关在实际产品中不可用(Qoder CN v1.10.0 无切换功能,CLI 配置亦无对应开关),条款上的退出承诺在 CN 产品中无落地入口,实际效果即强制共享。Qoder 明确将用户内容(含代码)用于改进服务并保留 5 年;Trae 明确将数据用于模型训练(可通过隐私模式限制);Qoder CN 官方条款范围最窄(仅反馈后的聊天记录、不含代码)。
17
+ > ## ⚠️ 数据共享知情
71
18
  >
72
- > **建议**:涉及商业机密或个人数据的项目,使用前请逐项核对官方条款,并主动检查产品设置:Qoder(国际版)尝试关闭"共享与改进";Qoder CN(v1.10.0 实测无开关)与 Trae CN 请结合隐私模式与最小化输入策略使用;必要时改用数据完全本地化的替代方案。
19
+ > 主流 AI 编程 IDE(Qoder / Qoder CN / Trae CN)多为「**默认开启共享、需用户主动退出**」模式,部分 CN 产品实测**无退出入口**。涉及商业机密的项目请逐项核对官方条款——[完整知情清单](#-数据共享知情清单完整版)。
73
20
 
74
21
  ---
75
- > ### 🔮 下一步:add-coder IDE 插件(实施中)
76
22
 
77
- > add-coder 当前是 **脚手架 + 治理层**:把 ADD 范式(裁决集中、审计即基础设施、门禁驱动)部署进你的项目。
78
- > 下一阶段会以 **IDE 插件** 形式落地,让治理能力直接嵌在编辑与 Agent 生命周期里。
79
- >
80
- > **为什么值得期待:**
81
- >
82
- > | 维度 | 说明 |
83
- > |------|------|
84
- > | **范式优势** | 不是「更好用的补全」,而是把规则、证据、审批、回溯做成一等公民。改规则不改代码,跨轮不靠聊天记忆。 |
85
- > | **与 LLM 低耦合** | 核心是结构与门禁,不是绑死某一家模型。换模型不换治理逻辑;模型只负责生成,裁决与审计由范式层承担。 |
86
- > | **与 IDE 低耦合** | 治理逻辑统一,适配层分离。今天支持 Claude Code / Qoder / VS Code / Trae / Codex,明天换宿主只需加适配,不必重写规则与审计链。 |
87
- > | **不收集用户隐私** | 不上传代码、对话与项目数据。审计与裁决默认留在本地 / 你自己的基础设施里,不做「默认共享、事后退出」。 |
23
+ > ### 🔮 下一步:add-coder IDE 插件(实施中)
88
24
  >
89
- > 目标不是再做一个「AI 编程 IDE」,而是让 **任意 IDE + 任意 LLM** 都能跑在同一套可审计、可收敛、且不拿你数据的 ADD 之上。
25
+ > 治理能力直接嵌入编辑与 Agent 生命周期:规则/证据/审批/回溯做成一等公民;不收集用户隐私,任意 IDE + 任意 LLM 同跑一套可审计、可收敛的 ADD——[完整预告](#-ide-插件预告完整版)。
90
26
 
91
27
  ---
92
28
 
@@ -121,15 +57,16 @@ npx add-coder init
121
57
  | 审计靠开发者自觉记录 | **MCP 审计工具链** 自动记录每次操作,系统闸门强制检查 |
122
58
  | 无关联性 | 审计事件天然关联 Plan → Spec → Task → Step → Tool Call,形成完整证据链 |
123
59
 
124
- ### ② Caijuehub 集中裁决层:从 sync 到三域覆盖
60
+ ### ② Caijuehub 集中裁决层:规则供应链工厂
125
61
 
126
- Caijuehub 是 add-coder 历史上第一个实现 **TOML 规则声明自动生成策略业务代码消费** 的裁决引擎。从最初 sync --patch 的单域实验,到今天覆盖 HITL 审批和 DPS 评分的三域体系,演进路径本身证明了集中裁决层的扩展性。详见 [docs/caijuehub.md](./docs/caijuehub.md)。
62
+ Caijuehub 是 add-coder 的集中裁决引擎:从 sync --patch 单域实验,到覆盖 HITL 审批和 DPS 评分的三域体系,再到**供应链工厂化**——整个 caijuehub 就是一条规则供应链:**TOML 原料加工车间(transcribe 工厂链:统一 reader 校验 factories generators)→ 出厂质检(幂等自动化)→ 审批放行 分销消费**。新规则在 caijue.toml 登记即自动进产线(15 条产线零接线代码),扩展规则域不再复制粘贴样板。详见 [docs/caijuehub.md](./docs/caijuehub.md)。
127
63
 
128
64
  | 裁决域 | 规则文件 | 消费者 | 说明 |
129
65
  |--------|---------|--------|------|
130
66
  | add-coder run sync --patch | `sync-rules.toml` | `sync.ts` | **npm 包史上首个集中裁决热更新案例**(eating my own dog food:add-coder 用 caijuehub 管理自己的模板同步) |
131
67
  | HITL 审批 | `hitl-interaction-rules.toml` | `hitl.ts` | 每 IDE 独立声明交互模式 |
132
68
  | DPS 评分 | `dps-scoring-rules.toml` | `gateway.ts` | 文档质量闸门:语义/熵/CPM/结构 四维权重+阈值,AI 调参不碰代码 |
69
+ | Hook 治理协议层 | `hook-{guard,doc-format,context,event,protocol}-rules.toml` ×5 | core governance | 拦截链/识别规则/象限文本/事件阈值/协议形态——五端共享单一真源,治理维护走控制面 |
133
70
 
134
71
  > 📊 [sync-magic benchmark](./docs/sync-magic-benchmark-report.md):caijuehub 改造实测——4 组对比,TS vs bash,熵值 vs 速度的场景价值分析。
135
72
  >
@@ -177,7 +114,7 @@ AI 对话的致命缺陷:上次讨论的架构决策、已修复的 Bug、达
177
114
  - **Plan 索引** — 所有 Plan 通过 `index.md` 集中索引,支持模糊匹配快速定位
178
115
  - **DevLog 时序记录** — 每一步操作写入 `{YYYY-MM}/{DD}/` 时间轴,可回溯任意历史状态
179
116
 
180
- ### ⑥ Policy-Update-Loop:治理自我进化(脚手架不包含此架构能力,接下来会给到DEMO仓库让大家更好理解Policy-Update-Loop和Report体系)
117
+ ### ⑥ Policy-Update-Loop:治理自我进化
181
118
 
182
119
  不是静态模板,而是**闭环自适应系统**:
183
120
 
@@ -185,21 +122,33 @@ AI 对话的致命缺陷:上次讨论的架构决策、已修复的 Bug、达
185
122
  执行 → 审计 → 边界报告 → 规则调整 → 下一轮执行
186
123
  ```
187
124
 
188
- 运行时产生的 Report 会反过来更新 governance rules,实现治理策略的持续进化。
125
+ **已落地的闭环环节**:
126
+
127
+ - **执行 → 审计(✓ 已接入)**:hook 拦截 / 文件写入事件 → jsonl → MCP 常驻消费 → DevOperation 落库(`HOOK_INTERCEPT`,幂等去重)——每个治理动作自动留痕,可回查可追溯
128
+ - **审计 → 规则调整(✓ 已接入)**:caijuehub 规则中心改规则不改代码——DPS 四维评分 **FFT 自适应权重**(随历史数据自动调权)、`check_doc_similarity` 量化复检(形似义异文档自动识别)——审计数据驱动治理规则演进
129
+ - **边界报告(Report 体系)**:Runtime 边界报告闭环待 DEMO 仓库演示——Policy-Update-Loop 与 Report 体系端到端实践
189
130
 
190
131
  ### ⑦ 多 IDE 的 Hook 即治理层
191
132
 
192
- hook 不是「通知推送」,而是 **ADD 范式在 IDE agent 生命周期中的 17 个确定性治理卡位**。每个 IDE(Claude Code / Qoder CN / VS Code Copilot / Trae / Codex)有各自的 hook 机制,但治理逻辑统一——架构一致,适配层不同。
133
+ hook 不是「通知推送」,而是 **ADD 范式在 IDE agent 生命周期中的 16 个确定性治理卡位**(14 通用 + 2 Claude 特有)。每个 IDE(Claude Code / Qoder CN / VS Code Copilot / Trae / Codex)有各自的 hook 机制,但治理逻辑统一——架构一致,适配层不同。
193
134
 
194
- | IDE | 治理文档 | 覆盖事件 | Hook 配置 |
135
+ **三层架构,能力可控可对齐可收敛**:
136
+
137
+ - **治理契约层**:16 个治理卡位的判定逻辑收敛为单一契约实现(生命周期裁决 / 本地治理隔离 / 命令精确判定 / 模板守卫 / 审计链路),六端共享,行为一致性由契约保证
138
+ - **Hook 独立实现**:各 IDE 事件机制差异(事件映射 / 输出形态 / 环境注入)由适配层隔离——IDE 能力演进只改适配层,治理语义零漂移,各端能力可随时对齐、可控收敛
139
+ - **控制面管理**:规则 / 阈值 / 提示文本由 caijuehub 规则中心声明式托管(hook-*.toml 真源 → 生成常量 → 产物内联)——改规则不改代码,治理维护走控制面,五端一致性由一致性矩阵持续验证
140
+
141
+ | IDE | 治理文档 | 注册事件 | Hook 配置(node 直调) |
195
142
  |---|---|---|---|
196
- | Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) | 14/17 | `.claude/hooks/*.sh` |
197
- | Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) | 10/17 | `.qoder/hooks/*.sh` |
198
- | VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/17 | `.github/hooks/*.json` `.vscode/hooks/*.sh` |
199
- | Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/17 | `hooks.json` → `.trae/hooks/*.sh` |
200
- | Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) | 0 (原生) / 14 (导入 Claude) | `.codex/hooks.json` |
143
+ | Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) | 11/16 | `.claude/hooks/*.mjs`(settings.json command) |
144
+ | Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) | 11/16 | `.qoder/hooks/*.mjs`(settings.json command) |
145
+ | VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/16 | `.vscode/hooks/*.mjs`(Agent Host 双通道) |
146
+ | Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/16 | `hooks.json` → `.trae/hooks/*.mjs` |
147
+ | Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) | 5/16 | `.codex/hooks.json` → `.codex/hooks/*.mjs` |
201
148
 
202
- > 实施 Plan: [add-coder-hook-full-alignment-plan-v1](./.qoder/plans/2026-07/17/add-coder-hook-full-alignment-plan-v1.md) | 触发源: [GitHub Issue #6](https://github.com/xiaomingming92/add-coder/issues/6)
149
+ > **16 卡位六端占位已齐**:86 hook 入口产物全量分发到六端(14/16/14/14/14/14),治理契约层(core 基类)共享。「注册事件」为 IDE 原生事件模型可注册数——事件模型不足的端(Codex 5 / Trae 6)产物已占位,IDE 事件扩展后零代码启用。
150
+
151
+ > 实施 Plan: [add-coder-hook-node-refactor-plan-v1](./.qoder/plans/2026-08/14/add-coder-hook-node-refactor-plan-v1.md)(协议层 v2,已闭环)| 前序: [add-coder-hook-full-alignment-plan-v1](./.qoder/plans/2026-07/17/add-coder-hook-full-alignment-plan-v1.md) | 触发源: [GitHub Issue #6](https://github.com/xiaomingming92/add-coder/issues/6)
203
152
 
204
153
  ### ⑧ HITL 人机审核:审批即基础设施
205
154
 
@@ -318,6 +267,8 @@ npx add-coder init
318
267
  | `init` | 初始化 ADD 模板,支持 `--adapter claude\|qoder\|vscode\|trae\|codex\|auto` |
319
268
  | `sync` | 增量同步缺失文件(`--patch` 含 Atlas 能力检测:就绪 / 自动安装 / 降级文档) |
320
269
  | `status` | 检查模板完整性 |
270
+ | `stack` | 技术栈约束 profile 管理(`list` 注册表 / `set <name>` 启用 / `show` 当前)——约束文件 `{magicDir}/rules/profiles/{stack}-profile.md`,AI 会话自动注入当前技术栈约束 |
271
+ | `model:download` | DPS 评分 embedding 模型预下载(`--force` 强制重下;`init` 自动预下载,`sync` 缓存缺失时提示) |
321
272
 
322
273
  ## Atlas 数据库同步能力
323
274
 
@@ -364,9 +315,31 @@ npx add-coder init
364
315
  |------|------|
365
316
  | `--adapter <type>` | 目标 IDE:claude / qoder / vscode / trae / codex / auto(自动检测,默认) |
366
317
  | `--config <path>` | 指定配置文件 |
367
- | `--yes` | 跳过交互,只创建新文件 |
368
318
  | `--force` | 覆盖已有文件 |
369
319
  | `--dry-run` | 预览模式,不写入 |
320
+ | `--stack <name>` | 技术栈约束 profile 名(如 machineserver,可选) |
321
+ | `--skip-model` | 跳过 embedding 模型预下载 |
322
+ | `--print-mcp-config` | Codex:stdout 输出 config.toml 片段(不写盘,不初始化项目) |
323
+ | `--write-user-config` | Codex:显式确认后写入 `~/.codex/config.toml`(先备份) |
324
+
325
+ ### sync 选项
326
+
327
+ | 选项 | 说明 |
328
+ |------|------|
329
+ | `--adapter <type>` | 目标 IDE:claude / qoder / vscode / trae / codex |
330
+ | `--patch` | 覆盖已有模板文件(不碰 plans/specs/reviews) |
331
+ | `-i, --interactive` | 交互式选择要同步的文件 |
332
+ | `--model` | 检测到缺失时下载 embedding 模型 |
333
+ | `--yes` | 全部确认跳过询问 |
334
+
335
+ ### stack 用法
336
+
337
+ ```
338
+ npx add-coder stack list # 内置注册表 + 自定义 + 当前标记
339
+ npx add-coder stack set <name> # 启用技术栈约束 profile
340
+ npx add-coder stack show # 当前 stack + profile 路径
341
+ npx add-coder stack --clear # 清除技术栈设置(中性)
342
+ ```
370
343
 
371
344
  ## 生成内容
372
345
 
@@ -395,20 +368,17 @@ Elicitation Server→Client ✅ 已实现 向用户请求 HITL
395
368
  Tasks (实验性) 双向 ✅ 已实现 长任务持久化 + 状态追踪
396
369
  ```
397
370
 
398
- **当前已实现的 18 个 Tools**:
371
+ **当前已实现的 33 个 Tools**(按域分组):
399
372
 
400
- | 工具 | 用途 | 触发场景 |
401
- |------|------|---------|
402
- | `record_dev_operation` | 记录开发操作审计(before/after/reason) | 每次文件变更、配置修改 |
403
- | `query_audit_logs` | planKeyword / targetId 查询审计记录 | 跨会话恢复上下文、验证迭代证据 |
404
- | `get_project_context` | 获取 ADD 工作流状态快照 | 空白对话开局 |
405
- | `get_db_schema` | 获取 Prisma schema 信息 | 数据库相关操作 |
406
- | `check_dps` | DPS 闸门(设计/实现/文档/审计 四维各 25%) | Step 0 末尾 |
407
- | `check_rahs` | RAHS 闸门(运行时架构健康度) | Step 4/8 |
408
- | `check_add_route_status` | add-route 文件存在性校验 | Step 3 |
409
- | `check_spec_sync` | Spec 文档勾选状态与代码一致性 | Spec 执行后 |
410
- | `find_related_docs` | 检索相关架构/规范文档 | 语境理解 |
411
- | `get_hook_events` | 查询 Hook 拦截事件(planKeyword/hook/时间过滤+分组) | 治理审计、阈值告警 |
373
+ | | 工具 |
374
+ |------|------|
375
+ | 审计闭环 | `record_dev_operation` `query_audit_logs` `generate_audit_logger` `get_audit_logger_pattern` `get_hook_events` |
376
+ | HITL 审批 | `create_hitl` `update_hitl` `status_hitl` `render_hitl_approval` |
377
+ | Plan 追踪 | `plan_track` `plan_status` `plan_sync` `plan_round_status` `plan_round_close` |
378
+ | Review 追踪 | `review_track` `review_status` `review_sync` |
379
+ | 质量闸门 | `check_dps` `check_rahs` `check_add_route_status` `check_add_route_completeness` `check_spec_sync` `check_doc_similarity` `check_phase_symmetry` `check_failure_path` `check_add_compliance` |
380
+ | 契约追踪 | `contract_track` `contract_status` |
381
+ | 上下文检索 | `get_project_context` `get_db_schema` `get_spec_context` `get_add_template` `find_related_docs` |
412
382
 
413
383
  > 完整六能力架构设计见 [MCP 重构 Plan](.qoder/plans/2026-07/23/add-coder-mcp-restructure-plan-v1.md)。
414
384
 
@@ -419,36 +389,42 @@ Tasks (实验性) 双向 ✅ 已实现 长任务持久化
419
389
  │ ADD 范式 │
420
390
  │ Step 0-9 │
421
391
  └──────┬──────┘
422
- 门禁驱动
392
+ 算法门禁驱动
423
393
  ┌────────────┼────────────┐
424
394
  ▼ ▼ ▼
425
395
  ┌──────────┐ ┌──────────┐ ┌──────────┐
426
- │ DPS 闸门 │ │ RAHS 闸门│ │合规检查
396
+ │ DPS 闸门 │ │ RAHS 闸门│ 合规检查
427
397
  └────┬─────┘ └────┬─────┘ └────┬─────┘
428
398
  │ │ │
429
399
  ▼ ▼ ▼
430
400
  ┌─────────────────────────────────────┐
431
401
  │ 审计基础设施层 │
432
- │ DevOperation / AuditLog 表
402
+ │ DevOperation / AuditLog 表
433
403
  │ MCP 审计工具链 │
434
404
  │ Handoff / DevLog 时序文档 │
435
- └─────────────────────────────────────┘
436
-
405
+ └──────────────────┬──────────────────┘
406
+ 规则驱动
407
+
408
+ ┌─────────────────────────────────────┐
409
+ │ Caijuehub 集中裁决层 │
410
+ │ 规则供应链工厂 │
411
+ │ TOML 原料 → 加工车间 → 出厂质检 │
412
+ │ → 审批放行 → 分销消费 │
413
+ └──────────────────┬──────────────────┘
414
+ │ 生成常量 → 产物内联
415
+
416
+ ┌─────────────────────────────────────┐
417
+ │ 治理契约层(core 基类) │
418
+ │ 16 卡位判定逻辑收敛,六端共享 │
419
+ └──────────────────┬──────────────────┘
420
+ │ 受控适配
437
421
  ┌──────────┬───────────┼────────┬─────┐
438
422
  ▼ ▼ ▼ ▼ ▼
439
423
  ┌──────┐ ┌──────┐ ┌──────────┐ ┌──────┐ ┌──────┐
440
424
  │Claude│ │Qoder │ │ VS Code │ │ Trae │ │Codex │
441
- │Hooks │ │Hooks │ │ Config │ │Hooks │ │Hooks │
442
- 14/17 │ │10/17 │ │ 10/17 │ │ 6/17 │ │ 6/17
425
+ │Hooks │ │Hooks │ │ Hooks │ │Hooks │ │Hooks │
426
+ 11/16 │ │11/16 │ │ 10/16 │ │ 6/16 │ │ 5/16
443
427
  └──────┘ └──────┘ └──────────┘ └──────┘ └──────┘
444
-
445
- |
446
-
447
- ┌─────────────────────────────────────┐
448
- │ Caijuehub 集中裁决层 │
449
- │ TOML 驱动的策略体系 │
450
- │ 检测/适配/Prisma/写入 全可配置 │
451
- └─────────────────────────────────────┘
452
428
  ```
453
429
 
454
430
  ## 前置条件
@@ -483,17 +459,102 @@ Tasks (实验性) 双向 ✅ 已实现 长任务持久化
483
459
  | ide插件 | 解耦ADD范式代码和被治理项目的代码 |在做了,大家拭目以待吧,让编程更有趣,我的目标其实不在于IDE,我的工作顺手的事情 |
484
460
  | 对话记忆增强 | 长期项目知识记忆和plan级别的稀疏记忆 |--|
485
461
 
462
+ ---
463
+
464
+ ## 📊 npm 实况数据
465
+
466
+ ```bash
467
+ # 0.1.0 发布于2026-07-10 04:11 UTC(北京时间当天上午 12:11)至 2026-07-28 累计突破 5000 次下载,**首次过死亡谷耗时 19 天**。
468
+ ~ $ curl -s https://api.npmjs.org/downloads/point/last-month/add-coder
469
+ {
470
+ "downloads": 5161,
471
+ "start": "2026-06-29",
472
+ "end": "2026-07-28",
473
+ "package": "add-coder"
474
+ }
475
+
476
+ ~ $ npm info add-coder@0.1.0
477
+
478
+ add-coder@0.1.0 | MIT | deps: 3 | versions: 35
479
+ Initialize ADD paradigm workflow templates for
480
+ Claude Code, Qoder, and VS Code.
481
+
482
+ keywords:
483
+ add, add-paradigm, claude, qoder, vscode, mcp,
484
+ workflow, codein2027, 集中裁决层, caijuehub
485
+
486
+ bin: add-coder
487
+
488
+ dist
489
+ .tarball: https://registry.npmjs.org/add-coder/-/add-coder-0.1.0.tgz
490
+ .shasum: 3266ddb5304d303705694edec7c2f41efc24881d
491
+ .integrity: sha512-MxFICLEoAgTVxnHaiIOli5eVyCXvB+xnSzpfmu0mrigEeM9NxzBOm2Auzjn1GKUTXSWelT0FecwwlYmsCf+TWQ==
492
+ .unpackedSize: 704.9 kB
493
+
494
+ dependencies:
495
+ zod: ^3.24.0
496
+ commander: ^13.1.0
497
+ smol-toml: ^1.7.0
498
+
499
+ maintainers:
500
+ - wujixmm <wujixmm@gmail.com>
501
+
502
+ dist-tags:
503
+ latest: 0.3.5
504
+ preview: 0.3.6-feature-hitl-enhance-v1.2
505
+
506
+ published 2 weeks ago by wujixmm <wujixmm@gmail.com>
507
+ ```
508
+
509
+ ---
510
+
511
+ ## ⚠️ 数据共享知情清单(完整版)
512
+
513
+ > add-coder 无意于搞各家厂商的对抗叙事。以下内容仅为**基于各家官方公开条款原文的事实摘录**,目的是让开发者在选择 AI 编程 IDE 前知情。条款可能随时变更,请以官方最新版本为准。
514
+
515
+ | 产品 | 运营主体 | 官方条款要点(原文摘录) | 产品实测(用户反馈) | 出处 | 核实日期 |
516
+ |------|---------|------------------------|---------------------|------|----------|
517
+ | **Qoder** | BRIGHT ZENITH PTE. LTD.(新加坡) | 用户内容(含聊天、编程及智能体会话的输入/输出,即含代码)默认用于"研究、开发和改进我们的服务",保留期最长 5 年;条款文本称可关闭"共享与改进"(Share & Improve)退出,**但关闭前已为上述目的处理的数据仍保留和使用**;数据跨境存储于美国/新加坡/日本 | 实测为强制隐私共享模式,界面无有效切换入口 | [Qoder 隐私政策](https://qoder.com/zh/privacy-policy) | 2026-05-12 / 2026-08-04 |
518
+ | **Qoder CN** | 阿里云(通义灵码系列) | 官方 FAQ 称:仅在用户点赞/点踩后,针对聊天记录(不包含代码)脱敏去标识化处理,用于算法升级与迭代 | **实测(v1.10.0):强制隐私共享模式,无切换功能**;官方 CLI 配置(`~/.qoder-cn/settings.json`)中亦无共享/改进开关项 | [阿里云帮助中心 FAQ](https://help.aliyun.com/zh/lingma/qoder-cn/support/faq) | 2026-07-15 / 2026-08-04 |
519
+ | **Trae CN** | 北京引力弹弓科技有限公司(字节跳动) | 服务所收集的数据经加密、严格去标识化且无法重新识别个人后,**可能用于模型训练**以优化模型效果与产品体验;可通过隐私模式"限制"该数据使用;代码文件不提供给其他第三方 | — | [Trae 隐私协议](https://www.trae.cn/privacy-policy) | 现行版 / 2026-08-04 |
520
+
521
+ **要点**:三家官方条款均为"**默认开启共享、需用户主动退出**"(opt-out)模式。**但产品实测层面**:Qoder / Qoder CN 的退出开关在实际产品中不可用(Qoder CN v1.10.0 无切换功能,CLI 配置亦无对应开关),条款上的退出承诺在 CN 产品中无落地入口,实际效果即强制共享。Qoder 明确将用户内容(含代码)用于改进服务并保留 5 年;Trae 明确将数据用于模型训练(可通过隐私模式限制);Qoder CN 官方条款范围最窄(仅反馈后的聊天记录、不含代码)。
522
+
523
+ **建议**:涉及商业机密或个人数据的项目,使用前请逐项核对官方条款,并主动检查产品设置:Qoder(国际版)尝试关闭"共享与改进";Qoder CN(v1.10.0 实测无开关)与 Trae CN 请结合隐私模式与最小化输入策略使用;必要时改用数据完全本地化的替代方案。
524
+
525
+ ---
526
+
527
+ ## 🔮 IDE 插件预告(完整版)
528
+
529
+ add-coder 当前是 **脚手架 + 治理层**:把 ADD 范式(裁决集中、审计即基础设施、门禁驱动)部署进你的项目。下一阶段会以 **IDE 插件** 形式落地,让治理能力直接嵌在编辑与 Agent 生命周期里。
530
+
531
+ **为什么值得期待:**
532
+
533
+ | 维度 | 说明 |
534
+ |------|------|
535
+ | **范式优势** | 不是「更好用的补全」,而是把规则、证据、审批、回溯做成一等公民。改规则不改代码,跨轮不靠聊天记忆。 |
536
+ | **与 LLM 低耦合** | 核心是结构与门禁,不是绑死某一家模型。换模型不换治理逻辑;模型只负责生成,裁决与审计由范式层承担。 |
537
+ | **与 IDE 低耦合** | 治理逻辑统一,适配层分离。今天支持 Claude Code / Qoder / VS Code / Trae / Codex,明天换宿主只需加适配,不必重写规则与审计链。 |
538
+ | **不收集用户隐私** | 不上传代码、对话与项目数据。审计与裁决默认留在本地 / 你自己的基础设施里,不做「默认共享、事后退出」。 |
539
+
540
+ 目标不是再做一个「AI 编程 IDE」,而是让 **任意 IDE + 任意 LLM** 都能跑在同一套可审计、可收敛、且不拿你数据的 ADD 之上。
541
+
542
+ ---
543
+
486
544
 
487
545
 
488
546
  ---
489
547
  ## 🔤 English README
490
548
 
491
- Make 0.75 into one.
549
+ Make 0.75 into one. — Let the governance faction redefine the relations of production, toward humanity's Level-1 civilization era.
492
550
 
493
551
  💡 [Cool = Standard Conformance × Entropy Control — I turned "cool" from an adjective into a verifiable engineering property](https://github.com/xiaomingming92/add-coder/blob/main/docs/what-makes-software-cool.md) (design philosophy of the ADD paradigm, with benchmark evidence)
494
552
  > [![NPM downloads](https://img.shields.io/npm/dt/add-coder)](https://www.npmjs.com/package/add-coder) [![NPM version](https://img.shields.io/npm/v/add-coder)](https://www.npmjs.com/package/add-coder) [![GitHub stars](https://img.shields.io/github/stars/xiaomingming92/add-coder)](https://github.com/xiaomingming92/add-coder) <br/>
495
553
  > [📈 trend](https://www.npmcharts.com/compare/add-coder?interval=30)<br/>
496
554
  > 👍 Please star it if you hope more people will know about [add-coder](https://github.com/xiaomingming92/add-coder)
555
+ >
556
+ > 🎉 **Milestone**: 5,000+ downloads within 19 days of the 0.1.0 release (first time crossing the death valley). Full npm live data at the bottom of the Chinese section [📊 npm 实况数据](#-npm-实况数据).<br/>
557
+ > Life is full of imperfections — but with add-coder and your participation, your brilliance will be remembered! Don't just download — [open an Issue](https://github.com/xiaomingming92/add-coder/issues) · [join the Discussion](https://github.com/xiaomingming92/add-coder/discussions)
497
558
 
498
559
  **AI Governance, Implemented** — The complete scaffolding from [codein2027](https://github.com/xiaomingming92/codein2027) for rapidly building the ADD programming paradigm. Built on the core principle of **Audit as Infrastructure**, it shatters the black-box programming process and cross-session amnesia, evolving the programming paradigm into an auditable, traceable, and convergent new era. [NPM](https://www.npmjs.com/package/add-coder) · [GitHub](https://github.com/xiaomingming92/add-coder)
499
560
 
@@ -523,15 +584,16 @@ Traditional AI development: Chat → Generate code → Dig through chat history
523
584
  | Auditing relies on developer discipline | The **MCP audit toolchain** automatically records every operation; system gateways enforce checks |
524
585
  | No traceability | Audit events are naturally linked: Plan → Spec → Task → Step → Tool Call, forming a complete evidence chain |
525
586
 
526
- ### ② Caijuehub — The Centralized Adjudication Layer: From Sync to Three Domains
587
+ ### ② Caijuehub — The Centralized Adjudication Layer: Rule Supply Chain Factory
527
588
 
528
- Caijuehub is add-coder's first implementation of **TOML declaration → auto-generated strategy → business code consumption**. From the initial sync --patch experiment to today's three-domain coverage spanning HITL and DPS, the evolution proves the extensibility of the centralized adjudication layer. Details: [docs/caijuehub.md](./docs/caijuehub.md).
589
+ Caijuehub is add-coder's centralized adjudication engine: from the sync --patch single-domain experiment, to three-domain coverage spanning HITL approval and DPS scoring, to **supply-chain industrialization** the whole caijuehub is a rule supply chain: **TOML raw material → fabrication plant (transcribe factory chain: unified reader validation → factories → generators) → factory QA (idempotent automation) → approval release → distribution & consumption**. New rules registered in caijue.toml automatically enter the production line (15 lines, zero wiring code) — extending rule domains no longer means copy-paste boilerplate. Details: [docs/caijuehub.md](./docs/caijuehub.md).
529
590
 
530
591
  | Domain | Rules File | Consumer | Description |
531
592
  |--------|---------|--------|------|
532
593
  | sync --patch | `sync-rules.toml` | `sync.ts` | **First centralized adjudication hot-update in npm history** (eating my own dog food: add-coder manages its own template sync via caijuehub) |
533
594
  | HITL Approval | `hitl-interaction-rules.toml` | `hitl.ts` | Per-IDE interaction mode declaration |
534
595
  | DPS Scoring | `dps-scoring-rules.toml` | `gateway.ts` | Doc quality gateway: semantic/entropy/CPM/structure 4D weights+thresholds, AI self-tuning without touching code |
596
+ | Hook Governance Protocol | `hook-{guard,doc-format,context,event,protocol}-rules.toml` ×5 | core governance | Interception chains / recognition rules / quadrant text / event thresholds / protocol forms — single source of truth shared by all five IDEs |
535
597
 
536
598
  > 📊 [sync-magic benchmark](./docs/sync-magic-benchmark-report.md): Caijuehub refactoring measured — 4-group comparison, TS vs bash, scenario-value analysis of entropy vs speed.
537
599
  >
@@ -579,7 +641,7 @@ The fatal flaw of AI conversations: architectural decisions from last session, b
579
641
  - **Plan Index** — All Plans are centrally indexed via `index.md`, supporting fuzzy-match quick lookup
580
642
  - **DevLog Timeline** — Every operation is written to the `{YYYY-MM}/{DD}/` timeline, enabling full historical state traceability
581
643
 
582
- ### ⑥ Policy-Update-Loop: Self-Evolving Governance (the scaffold itself does not include this architectural capability; a DEMO repo will be provided next to better illustrate the Policy-Update-Loop and Report system)
644
+ ### ⑥ Policy-Update-Loop: Self-Evolving Governance
583
645
 
584
646
  Not a static template, but a **closed-loop adaptive system**:
585
647
 
@@ -587,7 +649,11 @@ Not a static template, but a **closed-loop adaptive system**:
587
649
  Execute → Audit → Boundary Report → Rule Adjustment → Next Execution
588
650
  ```
589
651
 
590
- Runtime-generated Reports feed back into governance rules, enabling continuous evolution of governance strategies.
652
+ **Closed-loop segments already in place**:
653
+
654
+ - **Execute → Audit (✓ live)**: hook interception / file-write events → jsonl → MCP resident consumer → DevOperation persistence (`HOOK_INTERCEPT`, idempotent dedup) — every governance action leaves an audit trail, queryable and traceable
655
+ - **Audit → Rule Adjustment (✓ live)**: caijuehub rule center — edit rules, not code: DPS 4-dimensional scoring with **FFT adaptive weights** (auto re-weighting from historical data), `check_doc_similarity` quantitative re-check (look-alike documents auto-detected) — audit data drives governance rule evolution
656
+ - **Boundary Report (Report system)**: runtime boundary report loop pending DEMO repo — end-to-end Policy-Update-Loop and Report system practice
591
657
 
592
658
  ### ⑦ Multi-IDE Hooks as the Governance Layer
593
659
 
@@ -602,13 +668,21 @@ Hooks are not "notification push" — they are the **IDE runtime interception la
602
668
 
603
669
  Each IDE(Claude Code / Qoder CN / VS Code Copilot / Trae / Codex)has its own hook implementation, but the **governance logic is unified** — the architecture is consistent, only the adapter layer differs.
604
670
 
605
- | IDE | Governance Doc | Events Covered | Hook Config |
671
+ **Three-layer architecture capabilities stay controllable, alignable, convergent**:
672
+
673
+ - **Governance contract layer**: the adjudication logic of the 16 governance checkpoints (14 common + 2 Claude-specific) converges into a single contract implementation (lifecycle arbitration / local governance isolation / precise command judgment / template guarding / audit chain), shared by all six ends — behavior consistency guaranteed by contract
674
+ - **Independent hook implementations**: each IDE's event mechanism differences (event mapping / output form / env injection) are isolated in the adapter layer — IDE capability evolution only touches adapters, governance semantics zero-drift, capabilities alignable and controllable at any time
675
+ - **Control plane management**: rules / thresholds / prompt texts are declaratively managed by the caijuehub rule center (hook-*.toml source of truth → generated constants → inlined artifacts) — edit rules, not code; governance maintenance goes through the control plane; five-end consistency continuously verified by the consistency matrix
676
+
677
+ | IDE | Governance Doc | Registered Events | Hook Config (node direct) |
606
678
  |---|---|---|---|
607
- | Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) | 14/17 | `.claude/hooks/*.sh` |
608
- | Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) | 10/17 | `.qoder/hooks/*.sh` |
609
- | VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/17 | `.github/hooks/*.json` `.vscode/hooks/*.sh` |
610
- | Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/17 | `hooks.json` → `.trae/hooks/*.sh` |
611
- | Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) | 0 native / 14 (via Claude import) | `.codex/hooks.json` |
679
+ | Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) | 11/16 | `.claude/hooks/*.mjs` (settings.json command) |
680
+ | Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) | 11/16 | `.qoder/hooks/*.mjs` (settings.json command) |
681
+ | VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/16 | `.vscode/hooks/*.mjs` (Agent Host dual-channel) |
682
+ | Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/16 | `hooks.json` → `.trae/hooks/*.mjs` |
683
+ | Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) | 5/16 | `.codex/hooks.json` → `.codex/hooks/*.mjs` |
684
+
685
+ > **All 16 checkpoints pre-positioned across all six ends**: 86 hook entry artifacts fully distributed (14/16/14/14/14/14), sharing the governance contract layer (core base classes). "Registered Events" counts what each IDE's native event model can register — ends with fewer native events (Codex 5 / Trae 6) already have artifacts in place; zero-code activation once the IDE event model expands.
612
686
 
613
687
  ### ⑧ HITL Human-in-the-Loop: Approval as Infrastructure
614
688
 
@@ -701,6 +775,8 @@ npx add-coder init
701
775
  | `init` | Initialize ADD templates, supports `--adapter claude\|qoder\|vscode\|trae\|codex\|auto` |
702
776
  | `sync` | Incrementally sync missing files |
703
777
  | `status` | Check template integrity |
778
+ | `stack` | Tech-stack constraint profile management (`list` registry / `set <name>` activate / `show` current) — profile file `{magicDir}/rules/profiles/{stack}-profile.md`, auto-injected into AI sessions |
779
+ | `model:download` | Pre-download the DPS scoring embedding model (`--force` re-download; `init` auto-downloads, `sync` prompts on cache miss) |
704
780
 
705
781
  ### init Internal Flow
706
782
 
@@ -720,9 +796,31 @@ npx add-coder init
720
796
  |--------|-------------|
721
797
  | `--adapter <type>` | Target IDE: claude / qoder / vscode / trae / codex / auto (default) |
722
798
  | `--config <path>` | Specify config file |
723
- | `--yes` | Skip interactions, create new files only |
724
799
  | `--force` | Overwrite existing files |
725
800
  | `--dry-run` | Preview mode, no writes |
801
+ | `--stack <name>` | Tech-stack constraint profile name (optional, e.g. machineserver) |
802
+ | `--skip-model` | Skip embedding model pre-download |
803
+ | `--print-mcp-config` | Codex: print config.toml snippet to stdout (no writes, no init) |
804
+ | `--write-user-config` | Codex: write `~/.codex/config.toml` after explicit confirm (backup first) |
805
+
806
+ ### sync Options
807
+
808
+ | Option | Description |
809
+ |--------|-------------|
810
+ | `--adapter <type>` | Target IDE: claude / qoder / vscode / trae / codex |
811
+ | `--patch` | Overwrite existing template files (never touches plans/specs/reviews) |
812
+ | `-i, --interactive` | Interactively select files to sync |
813
+ | `--model` | Download embedding model when missing detected |
814
+ | `--yes` | Confirm all, skip prompts |
815
+
816
+ ### stack Usage
817
+
818
+ ```
819
+ npx add-coder stack list # builtin registry + custom + current marker
820
+ npx add-coder stack set <name> # activate a tech-stack constraint profile
821
+ npx add-coder stack show # current stack + profile path
822
+ npx add-coder stack --clear # clear tech-stack setting (neutral)
823
+ ```
726
824
 
727
825
  ## Generated Content
728
826
 
@@ -737,19 +835,17 @@ npx add-coder init
737
835
 
738
836
  ## MCP Audit Toolchain
739
837
 
740
- `init` automatically deploys the MCP server (`mcp-server.ts`) into the project, loaded by the IDE via `mcp.json`. The following audit and governance tools are provided:
838
+ `init` automatically deploys the MCP server (`mcp-server.ts`) into the project, loaded by the IDE via `mcp.json`. **33 tools** across 7 domains:
741
839
 
742
- | Tool | Purpose | Trigger Scenario |
743
- |------|---------|-----------------|
744
- | `record_dev_operation` | Record development operation audits (before/after/reason) | Every file change, config modification |
745
- | `query_audit_logs` | Query audit records by planKeyword / targetId | Cross-session context recovery, iteration evidence verification |
746
- | `get_project_context` | Get ADD workflow status snapshot | Fresh conversation start |
747
- | `get_db_schema` | Get Prisma schema info | Database-related operations |
748
- | `check_dps` | DPS gateway (Design/Implementation/Docs/Audit, each 25%) | End of Step 0 |
749
- | `check_rahs` | RAHS gateway (runtime architecture health) | Step 4/8 |
750
- | `check_add_route_status` | add-route file existence check | Before Step 3 |
751
- | `check_spec_sync` | Spec doc checkbox status vs. code consistency | After Spec execution |
752
- | `find_related_docs` | Search related architecture/spec documents | Context understanding |
840
+ | Domain | Tools |
841
+ |------|------|
842
+ | Audit Loop | `record_dev_operation` `query_audit_logs` `generate_audit_logger` `get_audit_logger_pattern` `get_hook_events` |
843
+ | HITL Approval | `create_hitl` `update_hitl` `status_hitl` `render_hitl_approval` |
844
+ | Plan Tracking | `plan_track` `plan_status` `plan_sync` `plan_round_status` `plan_round_close` |
845
+ | Review Tracking | `review_track` `review_status` `review_sync` |
846
+ | Quality Gateways | `check_dps` `check_rahs` `check_add_route_status` `check_add_route_completeness` `check_spec_sync` `check_doc_similarity` `check_phase_symmetry` `check_failure_path` `check_add_compliance` |
847
+ | Contract Tracking | `contract_track` `contract_status` |
848
+ | Context Retrieval | `get_project_context` `get_db_schema` `get_spec_context` `get_add_template` `find_related_docs` |
753
849
 
754
850
  > Full tool list: [MCP Toolchain Specification](https://github.com/xiaomingming92/codein2027/blob/main/docs/大田精准耕播智能决策系统/knowledge/02-规范/%E3%80%8A%E5%BC%80%E5%8F%91%E6%93%8D%E4%BD%9C%E5%AE%A1%E8%AE%A1%E5%AD%98%E6%A1%A3%E8%A7%84%E8%8C%83%E3%80%8B.md).
755
851
 
@@ -773,25 +869,31 @@ npx add-coder init
773
869
  │ DevOperation / AuditLog Tables │
774
870
  │ MCP Audit Toolchain │
775
871
  │ Handoff / DevLog Timeline Docs │
776
- └─────────────────────────────────────┘
777
-
872
+ └──────────────────┬──────────────────┘
873
+ Rule-driven
874
+
875
+ ┌─────────────────────────────────────┐
876
+ │ Caijuehub — Centralized │
877
+ │ Adjudication Layer │
878
+ │ Rule Supply Chain Factory │
879
+ │ TOML raw → plant → QA → release → │
880
+ │ distribution & consumption │
881
+ └──────────────────┬──────────────────┘
882
+ │ Generated constants → inlined artifacts
883
+
884
+ ┌─────────────────────────────────────┐
885
+ │ Governance Contract Layer │
886
+ │ (core base classes) │
887
+ │ 16 checkpoints, shared by 6 ends │
888
+ └──────────────────┬──────────────────┘
889
+ │ Controlled adaptation
778
890
  ┌──────────┬───────────┼───────────┬──────────┐
779
891
  ▼ ▼ ▼ ▼ ▼
780
892
  ┌──────┐ ┌──────┐ ┌──────────┐ ┌──────┐ ┌──────┐
781
893
  │Claude│ │Qoder │ │ VS Code │ │ Trae │ │Codex │
782
- │Hooks │ │Hooks │ │ Config │ │Hooks │ │Hooks │
783
- 14/17 │ │10/17 │ │ 10/17 │ │ 6/17 │ │ 6/17
894
+ │Hooks │ │Hooks │ │ Hooks │ │Hooks │ │Hooks │
895
+ 11/16 │ │11/16 │ │ 10/16 │ │ 6/16 │ │ 5/16
784
896
  └──────┘ └──────┘ └──────────┘ └──────┘ └──────┘
785
-
786
- ┌────────────┘
787
-
788
- ┌─────────────────────────────────────┐
789
- │ Caijuehub — Centralized │
790
- │ Adjudication Layer │
791
- │ TOML-Driven Policy System │
792
- │ Detect / Adapt / Prisma / Write — │
793
- │ Fully Configurable │
794
- └─────────────────────────────────────┘
795
897
  ```
796
898
 
797
899
  ## Prerequisites
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-coder",
3
- "version": "0.3.27",
3
+ "version": "0.3.29",
4
4
  "private": false,
5
5
  "description": "[codein2027](https://github.com/xiaomingming92/codein2027) - A complete scaffolding for building the ADD programming paradigm, the implementation layer for AI code governance. Core principle: Audit as Infrastructure. Breaks the black-box programming process and cross-session amnesia, evolving programming paradigms into an auditable, traceable, and convergent new era. npx-ready.\n\n[codein2027](https://github.com/xiaomingming92/codein2027) 快速构建 ADD 编程范式的完整脚手架——AI 代码治理的落地方案。以「审计即基础设施」为核心,彻底打破编程过程黑盒与跨轮失忆,让编程范式进化为可审计、可追溯、可收敛的新时代。npx 即用,人人可体验。",
6
6
  "repository": {
@@ -85,6 +85,7 @@
85
85
  "@eslint/js": "^9.39.4",
86
86
  "@types/node": "^22.20.1",
87
87
  "@types/pg": "^8.20.4",
88
+ "esbuild": "0.27.7",
88
89
  "eslint": "^9.39.4",
89
90
  "pg": "^8.22.0",
90
91
  "tsup": "^8.4.0",