add-coder 0.2.6 → 0.2.8

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.
package/README.en.md CHANGED
@@ -27,7 +27,26 @@ Traditional AI development: Chat → Generate code → Dig through chat history
27
27
  | Auditing relies on developer discipline | The **MCP audit toolchain** automatically records every operation; system gateways enforce checks |
28
28
  | No traceability | Audit events are naturally linked: Plan → Spec → Task → Step → Tool Call, forming a complete evidence chain |
29
29
 
30
- ### ② Gateway-Driven, Not Free-Form Conversation
30
+ ### ② Prompt Cache Native — ¥218/mo, 98% Savings
31
+
32
+ The ADD paradigm isn't just methodology — its structured Step workflow naturally aligns with DeepSeek's Prompt Cache prefix-matching mechanism, delivering extreme token cost efficiency. **Real-world billing validation**:
33
+
34
+ | Metric | Value |
35
+ |--------|-------|
36
+ | July actual DeepSeek bill | **¥218.35** |
37
+ | Theoretical cost without cache | ¥11,100 |
38
+ | Cache hit rate | **99.31%** |
39
+ | Cache hit vs miss price gap | **120x** (¥0.025/M vs ¥3/M) |
40
+ | Total cost savings | **98.1%** |
41
+
42
+ ```
43
+ Traditional IDE free chat: cache hit rate 85–91%, ~5,000 MISS tokens/req
44
+ ADD paradigm + Qoder: cache hit rate 99.31%, only 2,426 MISS tokens/req
45
+ ```
46
+
47
+ > 📊 [Full analysis report](./docs/ADD范式缓存命中分析报告.md) — 4 Mermaid diagrams, 17-day daily data, cross-IDE comparison, and cost modeling.
48
+
49
+ ### ③ Gateway-Driven, Not Free-Form Conversation
31
50
 
32
51
  Traditional AI coding is "you say, I do" — quality depends entirely on the LLM's state that day. add-coder embeds **dual quality gateways** into the architecture:
33
52
 
@@ -38,7 +57,7 @@ RAHS (Runtime Architecture Health Score) — Runtime architecture health, < 90%
38
57
 
39
58
  These are not "suggestions" — they are **architectural blocks**. A Step cannot advance without passing its gateway.
40
59
 
41
- ### Cross-Session Memory, Not Per-Session Amnesia
60
+ ### Cross-Session Memory, Not Per-Session Amnesia
42
61
 
43
62
  The fatal flaw of AI conversations: architectural decisions from last session, bugs fixed, agreements reached — all forgotten in the next conversation. add-coder solves this at the architecture level:
44
63
 
@@ -46,7 +65,7 @@ The fatal flaw of AI conversations: architectural decisions from last session, b
46
65
  - **Plan Index** — All Plans are centrally indexed via `index.md`, supporting fuzzy-match quick lookup
47
66
  - **DevLog Timeline** — Every operation is written to the `{YYYY-MM}/{DD}/` timeline, enabling full historical state traceability
48
67
 
49
- ### 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)
68
+ ### 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)
50
69
 
51
70
  Not a static template, but a **closed-loop adaptive system**:
52
71
 
@@ -56,7 +75,7 @@ Execute → Audit → Boundary Report → Rule Adjustment → Next Execution
56
75
 
57
76
  Runtime-generated Reports feed back into governance rules, enabling continuous evolution of governance strategies.
58
77
 
59
- ### Multi-IDE Hooks as the Governance Layer
78
+ ### Multi-IDE Hooks as the Governance Layer
60
79
 
61
80
  Hooks are not "notification push" — they are the **IDE runtime interception layer**:
62
81
 
package/README.md CHANGED
@@ -27,7 +27,26 @@ npx add-coder init
27
27
  | 审计靠开发者自觉记录 | **MCP 审计工具链** 自动记录每次操作,系统闸门强制检查 |
28
28
  | 无关联性 | 审计事件天然关联 Plan → Spec → Task → Step → Tool Call,形成完整证据链 |
29
29
 
30
- ### ② 门禁驱动,而非自由对话
30
+ ### ② Prompt Cache 原生友好 — 月费 ¥218,节省 98%
31
+
32
+ ADD 范式不仅是方法论——它的结构化 Step 流程天然适配 DeepSeek Prompt Cache 的前缀匹配机制,带来极致的 Token 成本效率。**实测数据验证**:
33
+
34
+ | 指标 | 数值 |
35
+ |------|------|
36
+ | DeepSeek 7月实际账单 | **¥218.35** |
37
+ | 若无 Prompt Cache 理论费用 | ¥11,100 |
38
+ | Cache 命中率 | **99.31%** |
39
+ | 缓存命中 vs 未命中价差 | **120 倍**(¥0.025/M vs ¥3/M) |
40
+ | 总费用节省 | **98.1%** |
41
+
42
+ ```
43
+ 传统 IDE 自由对话: cache 命中率 85-91%, 每次请求 MISS 5,000 tokens
44
+ ADD 范式 + Qoder: cache 命中率 99.31%, 每次请求 MISS 仅 2,426 tokens
45
+ ```
46
+
47
+ > 📊 [完整分析报告](./docs/ADD范式缓存命中分析报告.md) — 含 4 张 Mermaid 图表、17 天逐日数据、跨 IDE 对比与成本建模。
48
+
49
+ ### ③ 门禁驱动,而非自由对话
31
50
 
32
51
  传统 AI coding 是「你说我做」,质量完全依赖 LLM 当天状态。add-coder 在架构中嵌入了 **双质量闸门**:
33
52
 
@@ -38,7 +57,7 @@ RAHS (Runtime Architecture Health Score) — 运行时架构健康度,< 90% BL
38
57
 
39
58
  这不是「建议」,是**架构阻断** — 不通过闸门的 Step 无法推进到下一步。
40
59
 
41
- ### 跨轮记忆,而非每轮失忆
60
+ ### 跨轮记忆,而非每轮失忆
42
61
 
43
62
  AI 对话的致命缺陷:上次讨论的架构决策、已修复的 Bug、达成的约定,下轮对话全部遗忘。add-coder 在架构层面解决:
44
63
 
@@ -46,7 +65,7 @@ AI 对话的致命缺陷:上次讨论的架构决策、已修复的 Bug、达
46
65
  - **Plan 索引** — 所有 Plan 通过 `index.md` 集中索引,支持模糊匹配快速定位
47
66
  - **DevLog 时序记录** — 每一步操作写入 `{YYYY-MM}/{DD}/` 时间轴,可回溯任意历史状态
48
67
 
49
- ### Policy-Update-Loop:治理自我进化(脚手架不包含此架构能力,接下来会给到DEMO仓库让大家更好理解Policy-Update-Loop和Report体系)
68
+ ### Policy-Update-Loop:治理自我进化(脚手架不包含此架构能力,接下来会给到DEMO仓库让大家更好理解Policy-Update-Loop和Report体系)
50
69
 
51
70
  不是静态模板,而是**闭环自适应系统**:
52
71
 
@@ -56,7 +75,7 @@ AI 对话的致命缺陷:上次讨论的架构决策、已修复的 Bug、达
56
75
 
57
76
  运行时产生的 Report 会反过来更新 governance rules,实现治理策略的持续进化。
58
77
 
59
- ### 多 IDE 的 Hook 即治理层
78
+ ### 多 IDE 的 Hook 即治理层
60
79
 
61
80
  hook 不是「通知推送」,而是 **ADD 范式在 IDE agent 生命周期中的 17 个确定性治理卡位**。每个 IDE(Claude Code / Qoder CN / VS Code Copilot / Trae / Codex)有各自的 hook 机制,但治理逻辑统一——架构一致,适配层不同。
62
81
 
@@ -134,7 +153,21 @@ npx add-coder init
134
153
 
135
154
  ## MCP 审计工具链
136
155
 
137
- `init` 自动部署 MCP 服务器 (`mcp-server.ts`) 到项目中,IDE 通过 `mcp.json` 加载。提供以下审计与治理工具:
156
+ `init` 自动部署 MCP 服务器 (`mcp-server.ts`) 到项目中,IDE 通过 `mcp.json` 加载。基于 **MCP 协议六大能力**(四大原语 + 两个横切):
157
+
158
+ ```
159
+ MCP 能力 方向 当前状态 说明
160
+ ─────────────────────────────────────────────────────────────
161
+ Tools Client→Server ✅ 已实现 17 个审计与治理工具(pull 模式)
162
+ Resources+Sub Client←Server 🔜 本轮 Plan/Review/Route/Task 状态实时推送
163
+ Notifications Server→Client 🔜 本轮 HITL 就绪通知 / Hook 结果推送
164
+ Sampling Server→Client 🔜 本轮 服务端回调 AI 生成 Review
165
+ ── 横切 ──
166
+ Elicitation Server→Client 🔜 本轮 向用户请求 HITL 确认/风险输入
167
+ Tasks (实验性) 双向 🔜 本轮 长任务持久化 + 状态追踪
168
+ ```
169
+
170
+ **当前已实现的 17 个 Tools**:
138
171
 
139
172
  | 工具 | 用途 | 触发场景 |
140
173
  |------|------|---------|
@@ -148,7 +181,7 @@ npx add-coder init
148
181
  | `check_spec_sync` | Spec 文档勾选状态与代码一致性 | Spec 执行后 |
149
182
  | `find_related_docs` | 检索相关架构/规范文档 | 语境理解 |
150
183
 
151
- > 完整工具列表见 [MCP 工具链规范](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)。
184
+ > 完整六能力架构设计见 [MCP 重构 Plan](.qoder/plans/2026-07/23/add-coder-mcp-restructure-plan-v1.md)。
152
185
 
153
186
  ## 架构全景
154
187
 
@@ -249,7 +282,26 @@ Traditional AI development: Chat → Generate code → Dig through chat history
249
282
  | Auditing relies on developer discipline | The **MCP audit toolchain** automatically records every operation; system gateways enforce checks |
250
283
  | No traceability | Audit events are naturally linked: Plan → Spec → Task → Step → Tool Call, forming a complete evidence chain |
251
284
 
252
- ### ② Gateway-Driven, Not Free-Form Conversation
285
+ ### ② Prompt Cache Native — ¥218/mo, 98% Savings
286
+
287
+ The ADD paradigm isn't just methodology — its structured Step workflow naturally aligns with DeepSeek's Prompt Cache prefix-matching mechanism, delivering extreme token cost efficiency. **Real-world billing validation**:
288
+
289
+ | Metric | Value |
290
+ |--------|-------|
291
+ | July actual DeepSeek bill | **¥218.35** |
292
+ | Theoretical cost without cache | ¥11,100 |
293
+ | Cache hit rate | **99.31%** |
294
+ | Cache hit vs miss price gap | **120x** (¥0.025/M vs ¥3/M) |
295
+ | Total cost savings | **98.1%** |
296
+
297
+ ```
298
+ Traditional IDE free chat: cache hit rate 85–91%, ~5,000 MISS tokens/req
299
+ ADD paradigm + Qoder: cache hit rate 99.31%, only 2,426 MISS tokens/req
300
+ ```
301
+
302
+ > 📊 [Full analysis report](./docs/ADD范式缓存命中分析报告.md) — 4 Mermaid diagrams, 17-day daily data, cross-IDE comparison, and cost modeling.
303
+
304
+ ### ③ Gateway-Driven, Not Free-Form Conversation
253
305
 
254
306
  Traditional AI coding is "you say, I do" — quality depends entirely on the LLM's state that day. add-coder embeds **dual quality gateways** into the architecture:
255
307
 
@@ -260,7 +312,7 @@ RAHS (Runtime Architecture Health Score) — Runtime architecture health, < 90%
260
312
 
261
313
  These are not "suggestions" — they are **architectural blocks**. A Step cannot advance without passing its gateway.
262
314
 
263
- ### Cross-Session Memory, Not Per-Session Amnesia
315
+ ### Cross-Session Memory, Not Per-Session Amnesia
264
316
 
265
317
  The fatal flaw of AI conversations: architectural decisions from last session, bugs fixed, agreements reached — all forgotten in the next conversation. add-coder solves this at the architecture level:
266
318
 
@@ -268,7 +320,7 @@ The fatal flaw of AI conversations: architectural decisions from last session, b
268
320
  - **Plan Index** — All Plans are centrally indexed via `index.md`, supporting fuzzy-match quick lookup
269
321
  - **DevLog Timeline** — Every operation is written to the `{YYYY-MM}/{DD}/` timeline, enabling full historical state traceability
270
322
 
271
- ### 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)
323
+ ### 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)
272
324
 
273
325
  Not a static template, but a **closed-loop adaptive system**:
274
326
 
@@ -278,7 +330,7 @@ Execute → Audit → Boundary Report → Rule Adjustment → Next Execution
278
330
 
279
331
  Runtime-generated Reports feed back into governance rules, enabling continuous evolution of governance strategies.
280
332
 
281
- ### Multi-IDE Hooks as the Governance Layer
333
+ ### Multi-IDE Hooks as the Governance Layer
282
334
 
283
335
  Hooks are not "notification push" — they are the **IDE runtime interception layer**:
284
336
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-coder",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
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": {
@@ -2847,11 +2847,11 @@ server.registerTool(
2847
2847
  let specDirName = ""
2848
2848
  let specContent = ""
2849
2849
  let tasksContent = ""
2850
- // 从 Plan 绑定或 §7 提取
2851
- const specRef = planContent.match(/Spec:\s*\.(qoder|claude|add|vscode)\/specs\/([^/\s]+)/)
2850
+ // 从 Plan 绑定或 §7 提取(兼容 Spec: / Spec | / `path` 三种格式)
2851
+ const specRef = planContent.match(/Spec[:|\s`]+\.?(qoder|claude|add|vscode)\/specs\/([^/`\s]+)/)
2852
2852
  if (specRef) specDirName = specRef[2]
2853
2853
  if (!specDirName) {
2854
- const taskRef = planContent.match(/Tasks:\s*\.(qoder|claude|add|vscode)\/specs\/([^/\s]+)/)
2854
+ const taskRef = planContent.match(/Tasks[:|\s`]+\.?(qoder|claude|add|vscode)\/specs\/([^/`\s]+)/)
2855
2855
  if (taskRef) specDirName = taskRef[2]
2856
2856
  }
2857
2857
  if (!specDirName) {