architext 0.0.3 → 0.0.5

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 (118) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/README.md +94 -12
  3. package/README.zh-CN.md +94 -12
  4. package/dist/index.js +43 -39
  5. package/dist/templates/en/briefs/_base.md +44 -11
  6. package/dist/templates/en/briefs/_modules.md +31 -4
  7. package/dist/templates/en/docs/global/api_snapshot.json +24 -0
  8. package/dist/templates/en/docs/global/command_api.json +26 -0
  9. package/dist/templates/en/docs/global/env_registry.json +12 -0
  10. package/dist/templates/en/docs/global/map.json +5 -0
  11. package/dist/templates/en/docs/global/public_api.json +12 -0
  12. package/dist/templates/en/docs/prompts/audit.md +80 -94
  13. package/dist/templates/en/docs/prompts/code.md +100 -109
  14. package/dist/templates/en/docs/prompts/edit.md +52 -47
  15. package/dist/templates/en/docs/prompts/fix.md +49 -42
  16. package/dist/templates/en/docs/prompts/help.md +23 -31
  17. package/dist/templates/en/docs/prompts/inherit.md +110 -116
  18. package/dist/templates/en/docs/prompts/map.md +47 -69
  19. package/dist/templates/en/docs/prompts/plan.md +160 -171
  20. package/dist/templates/en/docs/prompts/recover.md +48 -0
  21. package/dist/templates/en/docs/prompts/ref.md +163 -0
  22. package/dist/templates/en/docs/prompts/remove.md +55 -107
  23. package/dist/templates/en/docs/prompts/revise.md +63 -106
  24. package/dist/templates/en/docs/prompts/scope.md +77 -117
  25. package/dist/templates/en/docs/prompts/start.md +93 -139
  26. package/dist/templates/en/docs/shared/verify-result-handling.md +6 -0
  27. package/dist/templates/en/docs/templates/design.template.md +77 -0
  28. package/dist/templates/en/docs/templates/spec.template.md +60 -25
  29. package/dist/templates/en/rules/00_system.md +36 -79
  30. package/dist/templates/en/rules/01_workflow.md +59 -57
  31. package/dist/templates/en/rules/03_data_governance.md +46 -42
  32. package/dist/templates/en/skills/archi-data-sync/SKILL.md +83 -0
  33. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +166 -151
  34. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +140 -0
  35. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +118 -0
  36. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
  37. package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
  38. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +118 -0
  39. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
  40. package/dist/templates/zh/briefs/_base.md +46 -14
  41. package/dist/templates/zh/briefs/_modules.md +29 -2
  42. package/dist/templates/zh/docs/global/api_snapshot.json +24 -0
  43. package/dist/templates/zh/docs/global/command_api.json +26 -0
  44. package/dist/templates/zh/docs/global/data_snapshot.json +0 -1
  45. package/dist/templates/zh/docs/global/design_tokens.json +0 -1
  46. package/dist/templates/zh/docs/global/dictionary.json +1 -1
  47. package/dist/templates/zh/docs/global/env_registry.json +12 -0
  48. package/dist/templates/zh/docs/global/error_codes.json +0 -8
  49. package/dist/templates/zh/docs/global/map.json +28 -3
  50. package/dist/templates/zh/docs/global/public_api.json +12 -0
  51. package/dist/templates/zh/docs/global/vision.md +1 -1
  52. package/dist/templates/zh/docs/prompts/audit.md +43 -57
  53. package/dist/templates/zh/docs/prompts/code.md +68 -77
  54. package/dist/templates/zh/docs/prompts/edit.md +44 -39
  55. package/dist/templates/zh/docs/prompts/fix.md +33 -26
  56. package/dist/templates/zh/docs/prompts/help.md +13 -21
  57. package/dist/templates/zh/docs/prompts/inherit.md +81 -87
  58. package/dist/templates/zh/docs/prompts/map.md +23 -45
  59. package/dist/templates/zh/docs/prompts/plan.md +134 -146
  60. package/dist/templates/zh/docs/prompts/recover.md +48 -0
  61. package/dist/templates/zh/docs/prompts/ref.md +163 -0
  62. package/dist/templates/zh/docs/prompts/remove.md +31 -83
  63. package/dist/templates/zh/docs/prompts/revise.md +43 -84
  64. package/dist/templates/zh/docs/prompts/scope.md +53 -93
  65. package/dist/templates/zh/docs/prompts/start.md +75 -121
  66. package/dist/templates/zh/docs/shared/verify-result-handling.md +6 -0
  67. package/dist/templates/zh/docs/templates/design.template.md +77 -0
  68. package/dist/templates/zh/docs/templates/spec.template.md +60 -25
  69. package/dist/templates/zh/rules/00_system.md +37 -80
  70. package/dist/templates/zh/rules/01_workflow.md +60 -58
  71. package/dist/templates/zh/rules/02_tech_stack.md +7 -6
  72. package/dist/templates/zh/rules/03_data_governance.md +43 -39
  73. package/dist/templates/zh/rules/99_context_glue.md +2 -2
  74. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +83 -0
  75. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +70 -56
  76. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +140 -0
  77. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +118 -0
  78. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
  79. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +26 -25
  80. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +118 -0
  81. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
  82. package/package.json +1 -1
  83. package/dist/templates/zh-Hant/briefs/_base.md +0 -115
  84. package/dist/templates/zh-Hant/briefs/_modules.md +0 -173
  85. package/dist/templates/zh-Hant/docs/global/data_snapshot.json +0 -31
  86. package/dist/templates/zh-Hant/docs/global/design_tokens.json +0 -135
  87. package/dist/templates/zh-Hant/docs/global/dictionary.json +0 -35
  88. package/dist/templates/zh-Hant/docs/global/error_codes.json +0 -19
  89. package/dist/templates/zh-Hant/docs/global/map.json +0 -94
  90. package/dist/templates/zh-Hant/docs/global/roadmap.json +0 -39
  91. package/dist/templates/zh-Hant/docs/global/vision.md +0 -82
  92. package/dist/templates/zh-Hant/docs/prompts/audit.md +0 -150
  93. package/dist/templates/zh-Hant/docs/prompts/code.md +0 -160
  94. package/dist/templates/zh-Hant/docs/prompts/edit.md +0 -87
  95. package/dist/templates/zh-Hant/docs/prompts/fix.md +0 -86
  96. package/dist/templates/zh-Hant/docs/prompts/help.md +0 -69
  97. package/dist/templates/zh-Hant/docs/prompts/inherit.md +0 -270
  98. package/dist/templates/zh-Hant/docs/prompts/map.md +0 -131
  99. package/dist/templates/zh-Hant/docs/prompts/plan.md +0 -252
  100. package/dist/templates/zh-Hant/docs/prompts/remove.md +0 -162
  101. package/dist/templates/zh-Hant/docs/prompts/revise.md +0 -160
  102. package/dist/templates/zh-Hant/docs/prompts/scope.md +0 -198
  103. package/dist/templates/zh-Hant/docs/prompts/start.md +0 -258
  104. package/dist/templates/zh-Hant/docs/templates/plan.template.json +0 -88
  105. package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +0 -58
  106. package/dist/templates/zh-Hant/docs/templates/spec.template.md +0 -51
  107. package/dist/templates/zh-Hant/docs/templates/ui.template.md +0 -51
  108. package/dist/templates/zh-Hant/rules/00_system.md +0 -123
  109. package/dist/templates/zh-Hant/rules/01_workflow.md +0 -93
  110. package/dist/templates/zh-Hant/rules/02_tech_stack.md +0 -192
  111. package/dist/templates/zh-Hant/rules/03_data_governance.md +0 -102
  112. package/dist/templates/zh-Hant/rules/04_cli_tools.md +0 -50
  113. package/dist/templates/zh-Hant/rules/90_custom_rules.md +0 -21
  114. package/dist/templates/zh-Hant/rules/99_context_glue.md +0 -53
  115. package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +0 -293
  116. package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +0 -86
  117. package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +0 -364
  118. package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +0 -337
@@ -1,5 +1,5 @@
1
1
  <protocol_plan>
2
- **Trigger**: `/archi.plan <ID> [context]`
2
+ **Trigger**: `/archi.plan <ID> [context]` | 自然语言触发时由 Workflow Dispatch 自动加载
3
3
  **Goal**: 通过深度架构访谈,定义功能的 Spec/UI/Plan。
4
4
  **Input**:
5
5
  - `<ID>` (必填): Roadmap 中已存在的任务 ID。须先通过 `/archi.scope` 或 `/archi.inherit` 创建任务。
@@ -17,71 +17,50 @@
17
17
  2. **AI-Native Perspective**: 所有选项 Pros/Cons 从 AI Agent 视角撰写。关注:Context Locality、Type Safety、Boilerplate、Ambiguity。
18
18
  3. **Flexible Interaction**: 选项为启发式建议,支持多选、混合或自定义。
19
19
  4. **Audit-Gated**: 只有通过审计的文档才能交付。
20
+ 5. **IDE-Native First**: 利用 IDE 原生能力驱动执行节奏,本协议定义质量标准和检查点,不对抗 IDE 的规划/执行机制。
20
21
  </principles>
21
22
  </meta>
22
23
 
23
24
  <step_1_load>
24
- **Role**: 系统分析师
25
25
  **Action**:
26
- 1. **Read Roadmap**: 读取 `[[__DOCS_DIR__]]/global/roadmap.json`。
27
- - **Pre-flight**: 仅读取 `<ID>` 对应的任务条目及其直接 deps `id/title/status`;检查 deps 是否已完成,未完成则拒绝 Plan(除非用户强制)。无需加载其他任务数据。
28
- 2. **Read Vision**: 读取 `[[__DOCS_DIR__]]/global/vision.md` 仅提取北极星指标和设计哲学段落;其余章节跳过。
29
- 3. **Read Tech Stack**: `02_tech_stack.md` (技术红线 + **Section 9 项目约定**)。
30
- - 提取 Section 9 中的全局架构约定(Error Handling / Data Flow / Auth & Access),供 step_2 约定继承使用。
31
- 4. [?UI] **Read Design Tokens**: `[[__DOCS_DIR__]]/global/design_tokens.json`。
32
- 4.5 [?UI] **Read UI Context**: `[[__DOCS_DIR__]]/global/ui_context.md`(如存在)。
33
- - 从屏幕索引中定位本功能对应的屏幕 ID(如 S-03)及其负责的状态。
34
- - 锁定屏幕范围,供 step_4 生成 `ui.md §1` 时直接填入,禁自行发明新屏幕 ID。
35
- - 若 `ui_context.md` 不存在 → 跳过,`ui.md` 按完整 ITP 格式填写。
36
- 5. [?Data] **Read Data Model**: `[[__DOCS_DIR__]]/global/data_snapshot.json`。
37
- 6. **Read Dependency Context** (如有依赖任务):
38
- - 仅读依赖任务 `spec.md` 的 Interface/Type 定义段(`## Interface` 或 `## Types` 章节);不读 Scenarios 等其余内容。
39
- - 仅当当前 spec/plan 出现 `ref: tasks/<dep_id>/spec.md#X` 引用时执行;无引用时跳过。
40
- - **Stub 兼容**: 如依赖任务的 Spec-Status 为 Stub,从 stub"关联文件"提取源码,读入口文件提取公共接口/导出类型,作为上游接口参考。
41
- - 避免重复定义上游接口,确保对接点精确对齐。
42
-
43
- **Output**: 向用户输出 **Task Context Brief**:
44
- ```
45
- ### Task Context: [功能名称] ([ID])
46
-
47
- **目标**: [roadmap task 的 goal,如含 [用户预设] 须高亮标注]
48
- **上游依赖**: [已完成的依赖任务及其关键接口/类型,无则写"无"]
49
- **项目特征**: [已激活的 UI/Data/CLI/Lib/API 标签]
50
- **技术约束**: [来自 02_tech_stack.md 的关键红线]
51
- **设计哲学**: [来自 vision.md 的北极星指标和设计原则]
52
- **项目约定**: [来自 02_tech_stack.md §9 — Error Handling: X | Data Flow: X | Auth: X,无则写"未设置"]
53
- ```
54
- 内部保留完整上下文素材,进入 step_2。
26
+ 1. **Pre-flight**: 读取 roadmap.json,仅读 `<ID>` 条目及直接 deps 的 `id/title/status`;deps 未完成则拒绝(除非用户强制)。
27
+ 2. **Load**: vision.md(仅北极星+设计哲学)、02_tech_stack.md(红线 + §9 项目约定,提取 Error Handling/Data Flow/Auth 继承值)、(仅ui项目)design_tokens.json + ui_context.md(定位屏幕 ID,锁定范围供 step_4 填入,禁自行发明新 ID;不存在则跳过)、(仅data项目)data_snapshot.json。
28
+ 3. **Dependency Context** (有依赖时): 仅读依赖任务 spec.md Interface/Type 段;无引用时跳过。Stub 依赖 → 从关联文件提取源码公共接口。
29
+ 4. **Refs** (如有): refs/index.json,按 tags 语义匹配,仅读命中 ref 文件;不存在则跳过。
30
+
31
+ **Output**: 向用户输出 **Task Context Brief** — 含任务类型(从 ID 前缀推断)、目标(goal,高亮 [用户预设])、上游依赖及关键接口、项目特征标签、技术约束、设计哲学、项目约定(§9 各项值,无则"未设置")、外部知识引用(命中 ref id 列表)。内部保留完整上下文,进入 step_2_complexity。
55
32
  </step_1_load>
56
33
 
57
- <step_1_5_complexity>
58
- **Role**: 产品顾问
59
- **Action**: 评估功能复杂度,决定是否走完整 step_2 流程:
34
+ <step_2_complexity>
35
+ **Action**: 检测任务类型,评估复杂度,决定流程路径。
60
36
 
61
- **① 粒度红线检查(优先于复杂度判定)**:
37
+ **⓪ Task Type + 粒度红线**:
62
38
 
63
- | 指标 | 上限 |
64
- |:---|:---|
65
- | 预估 spec.md Scenario | ≤ 6 |
66
- | 预估 plan.json Phase | ≤ 4 |
39
+ | ID 前缀 | Task Type | spec § 2 主维度 | § 4 Interface | AC 上限 | Phase 上限 |
40
+ |:---|:---|:---|:---|:---|:---|
41
+ | `INF-` | Infrastructure | Structural(配置契约) | **必填** | 8 Contracts | ≤ 5 |
42
+ | `FEAT-` | Feature | Behavioral(行为场景) | 有下游 deps 时必填 | 6 Scenarios | ≤ 4 |
43
+ | `POLISH-` | Quality | Quantitative(量化目标) | 通常省略 | ≤ 4 Targets | ≤ 3 |
44
+ | `EDIT-` | Edit | 继承原任务类型 | 继承 | 继承 | 继承 |
67
45
 
68
- > 预估方法:根据 step_1 加载的 roadmap task goal 和依赖上下文,快速列举核心行为路径数量。超出上限即触发,无需精确计算。
46
+ > 混合型任务可在 § 2 中组合多维度,用子标题区分。预估超出上限即触发拆分。
69
47
 
70
- **② 复杂度判定(粒度通过后执行)**:
48
+ **① 复杂度判定**:
71
49
 
72
50
  | 信号 | 判定 | 流程 |
73
51
  |:---|:---|:---|
74
- | 无依赖 + 无新实体 + 无架构决策 + 预估 ≤3 tasks | **Simple** | 跳过 step_2 访谈,直接生成 spec + plan |
75
- | 有依赖 或 有新实体 或 需架构决策 | **Standard** | 正常执行 step_2 Unified Proposal |
52
+ | 无依赖 + 无新实体 + 无架构决策 + 预估 ≤3 tasks | **Simple** | 跳过 step_3,直接生成 spec + plan(精简单 Phase,signoff 时确认) |
53
+ | 有依赖 或 有新实体 或 需架构决策 | **Standard** | 正常执行 step_3 Unified Proposal |
76
54
 
77
- **Simple 模式**:
78
- - 跳过 5 维度架构建议和 User Confirm Gate
79
- - spec 精简为 1-2 个 Gherkin 场景
80
- - plan 精简为单 Phase
81
- - signoff 时确认(替代 step_2 的 Gate)
82
- </step_1_5_complexity>
55
+ **② Design 信号检测**(Standard 后执行):
83
56
 
84
- <step_2_interview>
57
+ | 信号 | 判定 |
58
+ |:---|:---|
59
+ | AI- 含复杂度警告 或 涉及自定义状态机/非平凡算法/多组件协调/重试恢复 | **Standard + Design**(step_3 输出机制预览,step_5 额外生成 design.md) |
60
+ | 标准 CRUD / 配置 / 简单集成 | **Standard** |
61
+ </step_2_complexity>
62
+
63
+ <step_3_interview>
85
64
  **Role**: 架构师
86
65
 
87
66
  ---
@@ -113,141 +92,150 @@
113
92
 
114
93
  #### Part 2: Architecture Recommendations (架构建议)
115
94
 
116
- [[SKILL: 按 `archi-plan-options` Skill 的三步选用逻辑(约定继承 → 标签路由 → 推荐 vs 展开),从五个维度的选项库中为本功能生成架构建议]][[NO-SKILL: (Skill 未安装:请阅读 `[[__DOCS_DIR__]]/skills/archi-plan-options/SKILL.md` 并遵循其三步选用逻辑执行)]]
95
+ [[SKILL: archi-plan-options|按 skill 的三步选用逻辑(约定继承 → 标签路由 → 推荐 vs 展开),从五个维度的选项库中为本功能生成架构建议。]][[NO-SKILL: (Skill 未安装:请阅读 `[[__DOCS_DIR__]]/skills/archi-plan-options/SKILL.md` 并遵循其三步选用逻辑执行)]]
117
96
 
118
- 展开 Q-table 时,格式遵循 [[SKILL: `archi-interview-protocol` Skill 的标准输出格式]][[NO-SKILL: `[[__DOCS_DIR__]]/skills/archi-interview-protocol/SKILL.md`]]。
97
+ 展开 Q-table 时,格式遵循 [[SKILL: archi-interview-protocol|skill 的标准输出格式]][[NO-SKILL: (Skill 未安装:请阅读 `[[__DOCS_DIR__]]/skills/archi-interview-protocol/SKILL.md` 并遵循其规则执行)]]。
119
98
 
120
- #### Output Format
99
+ #### Part 1.5: Mechanism Preview (机制预览) 仅Complex任务:
121
100
 
122
- ```
123
- ## Task Proposal: [功能名称] ([ID])
101
+ 仅当 step_2 判定为 **Standard + Design** 时输出。列出需要技术方案设计的核心机制及拟用模式(机制 / 模式 / 简述表格)。用户可增删机制或修改模式选择。
124
102
 
125
- ### 功能设计
126
- [按复杂度级别输出,见上方 Part 1]
127
-
128
- ### 架构建议
129
- | 维度 | 推荐 | 来源 | 理由 |
130
- |:---|:---|:---|:---|
131
- | 核心结构 | [推荐选项] | 功能推荐 | [结合此功能的 1-2 句理由] |
132
- | 交互模式 | [推荐选项] | 功能推荐 | [理由] |
133
- | 错误处理 | [项目约定值] | 项目约定 | ref: 02_tech_stack.md §9 |
134
- | ... | ... | ... | ... |
135
-
136
- [仅对需要用户裁决的维度展开选项表]:
137
- **[Q<n>] 问题标题**
138
- > 为什么需要用户决定(一句话)
103
+ #### Output Format
139
104
 
140
- | ID | 选项 | 说明 | AI+ | AI- |
141
- |:---|:---|:---|:---|:---|
142
- | A [推荐] | ... | 具体行为(2-3句) | 完整句子 | 完整句子 |
143
- | B | ... | ... | ... | ... |
144
- | Z | 自定义 | (请描述) | - | - |
145
-
146
- ---
147
- > 回复 **OK** 接受全部建议;或标注要修改的部分,如:
148
- > - 设计修正: "注册不需要邮箱验证步骤"
149
- > - 维度覆写: "核心结构=C, 错误处理=B D"
150
- > - 问题回答: "Q1=B"
151
- ```
105
+ 输出 **Task Proposal** 含:功能设计(按 Part 1)、架构建议表(维度/推荐/来源/理由)、(仅 Standard+Design)机制预览表、(仅需用户裁决的维度)展开的 Q-table(ID/选项/说明/AI+/AI-,A 为推荐,Z 为自定义)。末尾附确认指引:OK 接受全部;或标注修改项(设计修正/维度覆写/问题回答/机制修改)。
152
106
 
153
107
  **Goal**: 锁定 `spec`, `ui`(如适用), `data_snapshot.json`(如适用)。
154
108
 
155
- **⌨️ INPUT**: 回复 **OK** 全部接受;或自由文本标注修改项。无需按固定格式。
156
- </step_2_interview>
109
+ **⌨️ INPUT**: 回复 **OK** 全部接受(→ 进入 step_4_global_sync);或自由文本标注修改项(→ 进入 step_3_5_refinement)。无需按固定格式。
110
+ </step_3_interview>
157
111
 
158
- <step_2_5_refinement>
159
- **Role**: 咨询顾问
112
+ <step_3_5_refinement>
160
113
  **Trigger**: 用户回复非 OK,含修正、疑问、覆写或明显逻辑冲突。
161
114
  **Action**: 不生成文档。融入用户反馈,刷新 Unified Proposal 重新输出,等待再次确认。
162
115
  - 如是功能设计疑问 → 给出替代方案对比,重新提出设计
163
116
  - 如是架构维度疑问 → 结合此功能具体场景解释差异,更新推荐
164
117
  - 如是维度覆写 → 直接替换推荐并调整相关设计
165
- </step_2_5_refinement>
166
118
 
167
- <step_3_global_sync>
168
- **Role**: 系统管理员
119
+ 用户回复 OK → 进入 step_4_global_sync。
120
+ </step_3_5_refinement>
121
+
122
+ <step_4_global_sync>
169
123
  **Constraint**: 在生成 Task 文档**之前**,须先更新以下全局文件。
170
124
 
171
125
  **Boundary**: 仅注册**项目业务域**内容。Architext 框架概念(scripts、scaffold、roadmap、plan 等)和框架基础设施错误禁注册到全局文件。
172
126
 
173
127
  **Action Checklist**:
174
128
  1. **`map.json`**: 在 `directoryMapping` 注册 `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>`;在 `logicalTopology` 定义模块职责与依赖。
175
- 2. **`dictionary.json`**: 提取提案中的**项目业务**新术语填入 `entities`/`verbs`;注册新共享工具到 `utilities`;注册新公共组件到 `components`。
176
- 3. [?Data] **`data_snapshot.json`**: 根据架构建议中核心结构的选择新增/修改 Schema。禁写"待定",须写出字段名和类型。
177
- 4. **`error_codes.json`**: 根据架构建议中错误处理的选择注册新**业务**错误码。框架脚本错误由 exit code + stderr 处理,禁注册。
178
- 5. **`map.json` featureRelations**: 判断本 Task 是否属于「聚合型 Task」——即其核心职责是**列举、汇总或动态反映**其他一类 Task(如「列出所有命令」「汇总所有页面入口」「注册所有路由」)。若是,在 `featureRelations` 中追加一条记录:
179
- ```json
180
- {
181
- "aggregator": "<本 Task ID 或文件路径>",
182
- "sources": "<一句话描述聚合来源范围,如'所有 CLI 命令类 Task'>",
183
- "evidence": "<依据,如'spec.md §X 描述本 Task 会动态列出所有 Y 类 Task'>",
184
- "checkNote": "此类 Task 新增或删除时,检查 <aggregator> 是否需要同步"
185
- }
186
- ```
187
- 若非聚合型 Task,跳过此步。
188
-
189
- **Output**: 上述文件的变更 Diff (简要)。
190
- </step_3_global_sync>
191
-
192
- <step_4_generate>
193
- **Role**: 文档工程师
194
- **Input**: 确认的 Unified Proposal(功能设计 + 架构建议)+ 已更新的全局上下文。
129
+ 2. **数据治理同步** (`dictionary.json` / `error_codes.json` / `data_snapshot.json` 等): 按 `03_data_governance.md` 规则,将提案中涉及的新业务术语、错误码、Schema 增量同步至对应全局文件。
130
+ 3. **`map.json` featureRelations**: [[SUBAGENT: archi-feature-relations|mode: register, context: 判断本 Task 是否为聚合型,若是则注册 featureRelations 条目]][[NO-SKILL: (Skill 未安装:请阅读 `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`,按 mode: register 的逻辑执行)]]
131
+
132
+ **Output**: 上述文件的变更 Diff (简要)。进入 step_5_generate。
133
+ </step_4_global_sync>
134
+
135
+ <step_5_generate>
136
+ **Input**: 确认的 Unified Proposal(功能设计 + 架构建议)+ 已更新的全局上下文 + step_2 检测的 Task Type。
195
137
  **Action**: 在 `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/` 下生成标准文档。
196
138
 
197
139
  **1. `spec.md`** (必须):
198
140
  - 模板: `templates/spec.template.md`。
199
- - 基于确认的功能设计和架构建议,转化为 Gherkin Scenarios。
200
- - 每个 Scenario 须对应功能设计中的具体流程步骤或异常路径,禁凭空编造场景。
201
- - 若为上游任务,须包含明确的 Interface/Type 定义。
202
141
 
203
- **2. `ui.md`** [?UI]:
142
+ **spec § 2 Task Type 选择维度格式**:
143
+
144
+ | Task Type | § 2 主维度 | 格式要求 |
145
+ |:---|:---|:---|
146
+ | Feature | Behavioral | Gherkin (Given/When/Then),每个 Scenario 对应功能设计中的具体流程步骤或异常路径 |
147
+ | Infrastructure | Structural | Configuration Contract,每个配置文件/服务一个 Contract(Path + Key Settings + Constraints + Verify)。Key Settings **须写出具体值**,禁泛化描述 |
148
+ | Quality | Quantitative | Quality Target,每个优化目标含 Metric + Baseline + Target + Verify |
149
+ | Edit | 继承原任务 | 同原任务类型 |
150
+
151
+ > 混合型任务在 § 2 内用子标题区分维度。
152
+
153
+ **spec § 4 Interface Exports**:INF 任务**必填**,FEAT 任务有下游 deps 时必填。
154
+ **spec § 5 Constraints**:**必填** — 从 vision.md + 02_tech_stack.md 提取与本任务相关的红线。
155
+
156
+ **通用规则**:
157
+ - 禁凭空编造 AC 条目,须对应功能设计中的具体内容。
158
+ - 若为上游任务,须在 § 4 包含明确的 Interface/Type 定义。
159
+
160
+ **2. `ui.md`** (本任务涉及UI时):
204
161
  - 模板 `templates/ui.template.md`。
205
162
  - **有 `ui_context.md`(主路径)**:
206
- 1. **UI 偏差检查**(写 `ui.md` 前必须执行):对比 step_2 确认的功能设计与 `ui_context.md` 中的屏幕索引,识别偏差:
163
+ 1. **UI 偏差检查**(写 `ui.md` 前必须执行):对比功能设计与屏幕索引,识别偏差。[[SKILL: archi-ui-wireframe|按 skill 的协议处理 UI 偏差]][[NO-SKILL: (Skill 未安装:请阅读 `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` 并遵循其协议执行)]]。
207
164
 
208
165
  | 偏差类型 | 判定标准 | 处理方式 |
209
166
  |:---|:---|:---|
210
167
  | 无偏差 | 屏幕索引与设计一致 | 直接写 `ui.md`,引用屏幕 ID |
211
- | 轻微增量 | 新增状态/弹窗/局部区域,不改整体布局 | 调用 `archi-ui-wireframe` Skill(Plan 细化模式)更新 `ui_concept.html` + `ui_context.md`,在 `ui.md` 注明 `MODIFIED: S-XX` |
212
- | 结构性偏差 | 布局重构、新增独立屏幕、流程路径变化 | **暂停**,向用户输出偏差说明,等待 **OK** 后调用 Skill 更新 `ui_concept.html` + `ui_context.md`,再写 `ui.md` |
168
+ | 轻微增量 | 新增状态/弹窗/局部区域,不改整体布局 | 调用 skill 更新 `ui_concept.html` + `ui_context.md`,注明 `MODIFIED: S-XX` |
169
+ | 结构性偏差 | 布局重构、新增独立屏幕、流程路径变化 | **暂停**,向用户输出偏差说明,等待 **OK** 后调用 skill 更新,再写 `ui.md` |
213
170
 
214
171
  2. 完成偏差处理后,按 `ui.template.md` 填写屏幕范围声明和差异组件。
215
172
  - **无 `ui_context.md`(降级路径)**: 按完整 ITP v3.0 描述组件树,引用 `design_tokens.json` Token 定义。
216
173
 
217
- **3. `plan.json`** (必须):
218
- - 模板: `templates/plan.template.json`。
219
- - 根据项目类型动态调整 Phase;确保每个 Task 上下文自包含。
220
- - 任务描述中明确 "Additive Only" + "Respect Unknowns"。
221
- - **`decisions`**: 按各维度填写;`choice` 支持多选(如 `A B`,空格分隔)、自定义(`Z: …`);`rationale` 须填写理由,供 code 阶段参照,禁留空。
222
- - **`notes`**: 每个 task 的 `notes` 须填写:`[范围] · [spec 引用] · [关键约束] · 验证: [具体操作]`;供 `/archi.code` step_4 精确定位并执行 e2e,禁留空。
223
- > 示例:`实现 POST /auth/login · spec §3.1 · JWT 禁含 password · 验证: curl POST /auth/login 返回 200 + token 字段`
224
- - 生成后运行 `npx archi render` 生成可读的 `.md` 视图。
225
- </step_4_generate>
226
-
227
- <step_5_audit>
228
- **Role**: 首席审计官
229
- **Checklist**:
230
- 1. **Design Fidelity**: Spec 中的 Scenarios 是否完整覆盖确认的功能设计(流程步骤和异常路径)?
231
- 2. **Tech Consistency**: 是否用了未声明技术?
232
- 3. **Data Integrity**: Scenario 中的实体和字段是否与确认的核心实体一致?
233
- 4. **Error Handling**: 是否覆盖架构建议中错误处理的选择?
234
- 5. **AX Compliance**: 是否遵守 Anti-Clobbering 和 Interface Stability?
235
-
236
- 如有问题则静默修正;严重问题标记 `⚠️ Risk Warning`。
237
- </step_5_audit>
238
-
239
- <step_6_signoff>
240
- **Terminal Gate** (禁止跳过,须在输出总结前全部完成):
174
+ **3. 仅Complex任务: `design.md`**:
175
+ - 模板: `templates/design.template.md`。仅在 **Standard + Design** 时生成。
176
+ - § 2 Core Mechanisms: 按确认的机制预览,调用 [[SKILL: archi-design-patterns|skill 的模式选择指南和标准格式生成机制描述并执行自检]][[NO-SKILL: (Skill 未安装:请阅读 `[[__DOCS_DIR__]]/skills/archi-design-patterns/SKILL.md` 并遵循其模式格式和自检清单执行)]]。
177
+ - § 3 Parameters: 数值须具体化,禁模糊。§ 4 Invariants: 须可测试,对应 plan.json test 条目。§ 5 Failure Modes: 须有检测+降级。§ 6 Trace Verification: 从 spec § 2 每条 AC 追踪设计路径,有 Gap 须回补。
178
+
179
+ **4. `plan.json`** (必须):
180
+ - 模板: `templates/plan.template.json`。根据项目类型动态调整 Phase;每个 Task 上下文自包含。
181
+ - 每个 Phase 须包含 `rationale` 字段,记录该阶段关键设计决策的依据(用户选择/AI 推荐理由)。
182
+
183
+ **WBS 分解三原则**:
184
+
185
+ **原则 1 — 交付物导向**: 每个 task 的 `title` 描述**产出物**而非活动。
186
+ > Red Flag: `配置 TypeScript` ← 应为 `apps/web/tsconfig.json — strict + path aliases`
187
+
188
+ **原则 2 100% 覆盖**: spec § 2 每个 AC → ≥1 task 覆盖;§ 4 每个 Interface → 有 task 创建;§ 5 每个 Constraint → 有 task notes 引用。遗漏则补充。
189
+
190
+ **原则 3 — 粒度与互斥**:
191
+ | 信号 | 判定 |
192
+ |:---|:---|
193
+ | task 涉及 ≥3 个不相关文件 | 太粗 — 拆分 |
194
+ | title 无法对应具体产出文件 | 太抽象 — 具体化 |
195
+ | 两个 task 修改同一文件同一区域 | 违反互斥 — 合并或重划 |
196
+ | notes 只有一句话且无验证项 | 信息量不足 — 补充 |
197
+
198
+ **`decisions` 质量**: `rationale` 须含实施指导,不仅说明"为什么选",须说明"选了怎么配"。
199
+ > Red Flag: `Brief 明确要求` ← 零实施指导
200
+
201
+ **`notes` 质量**: 格式 `[产出文件路径] · [spec 引用] · [关键约束] · 验证: [可执行命令 + 期望结果]`。禁留空。
202
+ > Red Flag: notes 退化为 title 同义重复。每个 notes 须包含 title 中**不存在**的信息量。
203
+
204
+ - 生成后运行 `npx archi render` 生成可读的 `.md` 视图。进入 step_6_verify。
205
+ </step_5_generate>
206
+
207
+ <step_6_verify>
208
+ **Role**: 独立审查官
209
+ [[SUBAGENT: archi-silent-audit|mode: plan-docs, context: 审查 step_5 生成的文档(spec.md, ui.md, plan.json, design.md)]][[NO-SKILL: (Skill 未安装:请阅读 `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`,按 mode: plan-docs 的审查维度表逐项检查)]]
210
+
211
+ [[INCLUDE: shared/verify-result-handling.md]]
212
+ </step_6_verify>
213
+
214
+ <step_7_signoff>
215
+ **Terminal Gate** (禁止跳过): 标准检查 (task --check + render)。
241
216
  | 步骤 | 命令 | 通过条件 |
242
217
  |:---|:---|:---|
243
- | 1 | `npx archi task --check` | ERROR 级问题 |
244
- | 2 | `npx archi task <ID> --status active` | 任务已标记为进行中 |
245
- | 3 | `npx archi render` | `.md` 视图生成完成 |
246
-
247
- **Action** (Gate 通过后):
218
+ | 1 | `npx archi task <ID> --status active` | 任务已标记为进行中 |
219
+
220
+ **Pre-signoff Checklist** (Gate 通过后、输出前须逐项确认):
221
+ □ spec.md § 2 — AC/场景/契约对应功能设计中的具体内容(无凭空捏造)
222
+ spec.md § 4 Interface — 已填写(INF 任务 / 有下游 deps 时必填)
223
+ □ spec.md § 5 Constraints — 已从 vision + tech_stack 提取(非空)
224
+ □ plan.json — spec § 2 每条 AC → ≥1 task 覆盖(100% 覆盖原则)
225
+ □ plan.json — 每个 task notes 含验证字段(非空,非 title 同义重复)
226
+ □ map.json — tasks/<ID>_<Slug> 已在 directoryMapping 注册
227
+ □ 全局文件 — 新术语/错误码/Schema 已同步(dictionary/error_codes/data_snapshot)
228
+ □ Step 6 Silent Audit — 已执行,所有 CRITICAL 问题已修复
229
+
230
+ **Action** (Checklist 全部确认后):
248
231
  1. 输出总结。
249
232
 
250
- **Output**: Task 定义摘要,含架构建议确认表(各维度最终选择及理由)和 Next Steps 表格。
251
- </step_6_signoff>
233
+ **Output**: Task 定义摘要,含架构建议确认表(各维度最终选择及理由)和 Next Steps
234
+
235
+ | 优先级 | 动作 | 说明 |
236
+ |:---|:---|:---|
237
+ | 1 | `/archi.code <ID>` | Spec 和 Plan 已就绪,开始实现(须用户确认) |
238
+ | 可选 | 审查 spec.md / plan.json | 在动手前再检查一遍文档 |
239
+ </step_7_signoff>
252
240
 
253
241
  </protocol_plan>
@@ -0,0 +1,48 @@
1
+ <protocol_recover>
2
+ **Trigger**: `/archi.recover <pack-file>`
3
+ **Goal**: 读取 pack 文件,将其中所有用户数据(文档、任务、自定义规则)写入当前项目对应路径,完成框架升级后的数据还原。
4
+
5
+ <meta>
6
+ <style>Precise, Efficient, Non-interactive</style>
7
+ <language>简体中文</language>
8
+ <principles>
9
+ 1. **User Data Only**: pack 文件仅含用户数据(`global/`、`tasks/`、`scripts/`、`refs/`、自定义规则),全部写入,无需过滤。
10
+ 2. **Overwrite Always**: 目标路径已存在时直接覆盖(框架升级场景下旧数据即为空模板,安全替换)。
11
+ 3. **Delta Notation**: 输出须以 `ADDED` / `MODIFIED` 标注每个写入文件。
12
+ 4. **No Partial Write**: 任一文件写入失败则立即停止并报告;已写入文件不回滚(幂等,重跑安全)。
13
+ </principles>
14
+ </meta>
15
+
16
+ <step_1_ingest>
17
+ **Role**: 情报分析官
18
+ **Action**:
19
+ 1. 读取 `<pack-file>` 路径的文件内容。
20
+ 2. 解析 XML,提取 `<files>` 下每个 `<file>` 元素的 `path` 属性与 CDATA 内容。
21
+
22
+ | 情况 | 处理 |
23
+ |:---|:---|
24
+ | 文件不存在或无法读取 | 停止 — 告知用户检查路径,提示先运行 `archi pack` 生成 |
25
+ | XML 格式错误 | 停止 — 提示文件可能损坏,重新运行 `archi pack` |
26
+ | `<files>` 为空 | 停止 — 告知 pack 为空 |
27
+
28
+ **Output**: 内部文件列表(路径 + 内容),不输出给用户。
29
+ </step_1_ingest>
30
+
31
+ <step_2_apply>
32
+ **Action**:
33
+ 1. 对每个 `<file>` 条目:以 `path`(相对项目根)为写入目标,已存在 → 覆盖(`MODIFIED`),不存在 → 新建(`ADDED`)。写入 CDATA 完整内容,保留原始换行与编码。
34
+ 2. pack 中路径可能含嵌套子目录,须确保父目录存在。
35
+
36
+ **Output**: 每个文件的 `ADDED` / `MODIFIED` 状态列表。
37
+ </step_2_apply>
38
+
39
+ <step_3_signoff>
40
+ **Output**: 还原摘要 — 总计写入文件数(ADDED / MODIFIED 分别统计)+ Next Steps:
41
+
42
+ | 步骤 | 说明 |
43
+ |:---|:---|
44
+ | 确认框架状态 | 运行 `/archi.help` 查看项目当前状态与建议下一步 |
45
+ | 清理 pack 文件 | 可删除 `<pack-file>`,已不再需要 |
46
+ </step_3_signoff>
47
+
48
+ </protocol_recover>
@@ -0,0 +1,163 @@
1
+ <protocol_ref>
2
+ **Trigger**: `/archi.ref <sub> [args]`
3
+ **Goal**: 管理外部知识引用(第三方 API、公司内部 SDK、业务规则等),结构化存入 `refs/`,供 `plan`/`code` 按需注入上下文。
4
+
5
+ **子命令**:
6
+ | 子命令 | 格式 | 作用 |
7
+ |:---|:---|:---|
8
+ | `add` | `/archi.ref add [input]` | 摘要并存储外部知识(核心) |
9
+ | `list` | `/archi.ref list` | 列出所有已存引用 |
10
+ | `update` | `/archi.ref update <id>` | 重新摘要指定引用 |
11
+ | `remove` | `/archi.ref remove <id>` | 删除指定引用 |
12
+
13
+ <meta>
14
+ <style>Analytical, Precise, Context-Aware</style>
15
+ <language>简体中文</language>
16
+ <principles>
17
+ 1. **Summarize, Not Copy**: 禁全量复制原文;须提炼为 AI 可高效使用的结构化摘要(关键接口 / 约束 / 示例),压缩比不低于 50%。
18
+ 2. **Format-Aware**: 根据内容类型自动选择最合适的载体格式(`.md` / `.json` / `.yaml`),保留原始格式的语义优势。
19
+ 3. **Tag-Driven**: 每个 ref 须携带 tags,供 `plan`/`code` 按需匹配注入,禁无 tag 引用。
20
+ 4. **Index-First**: 所有操作须同步更新 `refs/index.json`,AI 通过索引按需加载,禁全量扫描。
21
+ </principles>
22
+ </meta>
23
+
24
+ <!-- ─── 载体格式选择规则 ─── -->
25
+ <format_selection>
26
+ **Format-Aware 规则**(step_3_store 执行时参照):
27
+
28
+ | 内容类型 | 推荐格式 | 理由 |
29
+ |:---|:---|:---|
30
+ | 网页 / URL / PDF / 纯文本 | `.md` | 结构化摘要,AI 读取效率最高 |
31
+ | OpenAPI / Swagger 规范 | `.yaml` | 保留机器可读结构,禁转为 .md |
32
+ | JSON Schema / 配置文件 | `.json` | 结构化数据原格式最优 |
33
+ | 混合(含大量代码示例)| `.md`(含代码块)| 代码块保留语法,加说明上下文 |
34
+ | 用户直接粘贴(纯 Markdown) | `.md` | 同格式存储,可精炼 |
35
+ </format_selection>
36
+
37
+ <!-- ═══════════════════════════════════════════════ -->
38
+ <!-- ADD 子命令 -->
39
+ <!-- ═══════════════════════════════════════════════ -->
40
+
41
+ <sub_add>
42
+
43
+ <step_0_ingest>
44
+ **Role**: 情报分析官
45
+ **Trigger**: `/archi.ref add [input]`
46
+ **Action**: 解析 `[input]`,确定输入来源。
47
+
48
+ | input 形式 | 处理 |
49
+ |:---|:---|
50
+ | 本地文件路径(如 `./docs/api.yaml`) | 读取文件内容,记录 `sourceType: local-file` |
51
+ | URL(如 `https://...`) | 抓取页面内容,记录 `sourceType: url` |
52
+ | 未提供(对话模式)| 告知用户粘贴内容或提供路径/URL,等待输入,记录 `sourceType: manual` |
53
+
54
+ 检查 `[[__DOCS_DIR__]]/refs/index.json` 是否存在:
55
+ - 存在 → 读取,获取现有 id 列表(防重复命名)
56
+ - 不存在 → 初始化为 `{ "refs": [] }`
57
+
58
+ **Output**: 内部(原始内容 + sourceType + 现有 id 列表),进入 `<step_1_analyze>`。
59
+ </step_0_ingest>
60
+
61
+ <step_1_analyze>
62
+ **Action**:
63
+ 1. **内容类型识别**: 判断原始内容属于哪种类型(参照 `<format_selection>`),确定推荐存储格式。
64
+ 2. **关键信息提取**: 核心接口/端点/签名、参数与类型、重要约束/限制、认证方式(如有)、典型示例(≤3 个)。
65
+ 3. **信息缺口识别**: id 命名(推断候选值)、tags 分类(从标准 tag 推断:`api`/`sdk`/`internal`/`payment`/`auth`/`map`/`notification`/`storage`/自定义)、关注侧重点(内容庞大时确认用户最关心的接口)。
66
+
67
+ **Output**: 内部分析摘要,进入 `<step_2_interview>`(有缺口时)或直接 `<step_3_store>`(信息完整时)。
68
+ </step_1_analyze>
69
+
70
+ <step_2_interview>
71
+ **Trigger**: 仅当 id / tags / 侧重点任一不确定时执行。
72
+ **Action**: 向用户提问,问题上限 3 题,选项优先。
73
+
74
+ **Output**: 引用信息确认 — 含内容类型与存储格式、内容摘要、Q1 引用 ID(AI 推断候选 + 自定义)、Q2 分类 Tags(多选)、(内容庞大时)Q3 关注侧重。
75
+
76
+ **Gate**: 等待用户回复后进入 `<step_3_store>`。
77
+ </step_2_interview>
78
+
79
+ <step_3_store>
80
+ **Action**:
81
+ 1. 确定存储参数:`id`(用户确认或 AI 推断)、`format`(由 format_selection 决定)、`filename: {id}.{format}`、`tags`。
82
+
83
+ 2. **生成引用文件内容**(按格式):
84
+ - **`.md`**: frontmatter(id/title/tags/sourceType/source/created/updated)+ 4 个 section(核心信息、关键接口表、重要约束、示例≤3个)
85
+ - **`.yaml`**: 直接存储精简后的 OpenAPI/Swagger(移除冗余 example 字段,保留 schema)
86
+ - **`.json`**: 直接存储原始结构(移除注释,保留结构)
87
+
88
+ 3. **写入文件**: `[[__DOCS_DIR__]]/refs/{id}.{ext}`
89
+
90
+ 4. **更新索引**: 向 `[[__DOCS_DIR__]]/refs/index.json` 的 `refs` 数组追加条目(id/title/tags/format/file/sourceType/updatedAt)。
91
+
92
+ **Output**:
93
+ ```
94
+ ADDED [[__DOCS_DIR__]]/refs/{id}.{ext}
95
+ MODIFIED [[__DOCS_DIR__]]/refs/index.json
96
+ ```
97
+ </step_3_store>
98
+
99
+ <step_4_signoff_add>
100
+ **Output**: 添加摘要,含引用 ID、存储格式及理由、Tags、文件路径、使用说明(plan 时自动读取 / code 时补充上下文 / 手动引用)。
101
+ </step_4_signoff_add>
102
+
103
+ </sub_add>
104
+
105
+ <!-- ═══════════════════════════════════════════════ -->
106
+ <!-- LIST 子命令 -->
107
+ <!-- ═══════════════════════════════════════════════ -->
108
+
109
+ <sub_list>
110
+
111
+ **Trigger**: `/archi.ref list`
112
+ **Action**: 读取 `[[__DOCS_DIR__]]/refs/index.json`。
113
+
114
+ | 情况 | 处理 |
115
+ |:---|:---|
116
+ | 索引不存在 / refs 为空 | 提示"当前无引用,运行 `/archi.ref add` 添加第一个" |
117
+ | 正常 | 按 tags 分组展示(ID / 标题 / 格式 / 更新时间) |
118
+
119
+ </sub_list>
120
+
121
+ <!-- ═══════════════════════════════════════════════ -->
122
+ <!-- UPDATE 子命令 -->
123
+ <!-- ═══════════════════════════════════════════════ -->
124
+
125
+ <sub_update>
126
+
127
+ **Trigger**: `/archi.ref update <id>`
128
+ **Action**:
129
+ 1. 从 `index.json` 找到 `<id>` 对应的 `file` 和 `sourceType`。
130
+ 2. 若 `sourceType` 为 `url` → 重新抓取;`local-file` → 重新读取;`manual` → 提示粘贴新内容。
131
+ 3. 重新执行 `<step_1_analyze>` + `<step_3_store>`(保留原 id/tags/format,仅刷新内容和 `updatedAt`)。
132
+
133
+ | 情况 | 处理 |
134
+ |:---|:---|
135
+ | id 不存在于 index.json | 停止 — 提示检查 id,可运行 `/archi.ref list` 查看 |
136
+
137
+ </sub_update>
138
+
139
+ <!-- ═══════════════════════════════════════════════ -->
140
+ <!-- REMOVE 子命令 -->
141
+ <!-- ═══════════════════════════════════════════════ -->
142
+
143
+ <sub_remove>
144
+
145
+ **Trigger**: `/archi.ref remove <id>`
146
+ **Action**:
147
+ 1. 从 `index.json` 中找到并移除 `<id>` 条目。
148
+ 2. 删除对应的 `refs/{id}.{ext}` 文件。
149
+ 3. 更新 `index.json`。
150
+
151
+ **Output**:
152
+ ```
153
+ REMOVED [[__DOCS_DIR__]]/refs/{id}.{ext}
154
+ MODIFIED [[__DOCS_DIR__]]/refs/index.json
155
+ ```
156
+
157
+ | 情况 | 处理 |
158
+ |:---|:---|
159
+ | id 不存在 | 停止 — 提示检查 id,可运行 `/archi.ref list` 查看 |
160
+
161
+ </sub_remove>
162
+
163
+ </protocol_ref>