architext 0.0.2
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/CHANGELOG.md +63 -0
- package/LICENSE +21 -0
- package/README.md +326 -0
- package/README.zh-CN.md +326 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -0
- package/dist/templates/en/briefs/_base.md +115 -0
- package/dist/templates/en/briefs/_modules.md +173 -0
- package/dist/templates/en/docs/global/data_snapshot.json +31 -0
- package/dist/templates/en/docs/global/design_tokens.json +150 -0
- package/dist/templates/en/docs/global/dictionary.json +35 -0
- package/dist/templates/en/docs/global/error_codes.json +19 -0
- package/dist/templates/en/docs/global/map.json +94 -0
- package/dist/templates/en/docs/global/roadmap.json +39 -0
- package/dist/templates/en/docs/global/vision.md +82 -0
- package/dist/templates/en/docs/prompts/audit.md +150 -0
- package/dist/templates/en/docs/prompts/code.md +160 -0
- package/dist/templates/en/docs/prompts/edit.md +87 -0
- package/dist/templates/en/docs/prompts/fix.md +86 -0
- package/dist/templates/en/docs/prompts/help.md +69 -0
- package/dist/templates/en/docs/prompts/inherit.md +270 -0
- package/dist/templates/en/docs/prompts/map.md +131 -0
- package/dist/templates/en/docs/prompts/plan.md +252 -0
- package/dist/templates/en/docs/prompts/remove.md +162 -0
- package/dist/templates/en/docs/prompts/revise.md +160 -0
- package/dist/templates/en/docs/prompts/scope.md +198 -0
- package/dist/templates/en/docs/prompts/start.md +258 -0
- package/dist/templates/en/docs/templates/plan.template.json +113 -0
- package/dist/templates/en/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/en/docs/templates/spec.template.md +51 -0
- package/dist/templates/en/docs/templates/ui.template.md +51 -0
- package/dist/templates/en/rules/00_system.md +123 -0
- package/dist/templates/en/rules/01_workflow.md +93 -0
- package/dist/templates/en/rules/02_tech_stack.md +197 -0
- package/dist/templates/en/rules/03_data_governance.md +102 -0
- package/dist/templates/en/rules/04_cli_tools.md +50 -0
- package/dist/templates/en/rules/90_custom_rules.md +22 -0
- package/dist/templates/en/rules/99_context_glue.md +53 -0
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +292 -0
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +342 -0
- package/dist/templates/zh/briefs/_base.md +116 -0
- package/dist/templates/zh/briefs/_modules.md +173 -0
- package/dist/templates/zh/docs/global/data_snapshot.json +31 -0
- package/dist/templates/zh/docs/global/design_tokens.json +135 -0
- package/dist/templates/zh/docs/global/dictionary.json +35 -0
- package/dist/templates/zh/docs/global/error_codes.json +19 -0
- package/dist/templates/zh/docs/global/map.json +94 -0
- package/dist/templates/zh/docs/global/roadmap.json +39 -0
- package/dist/templates/zh/docs/global/vision.md +82 -0
- package/dist/templates/zh/docs/prompts/audit.md +150 -0
- package/dist/templates/zh/docs/prompts/code.md +160 -0
- package/dist/templates/zh/docs/prompts/edit.md +87 -0
- package/dist/templates/zh/docs/prompts/fix.md +86 -0
- package/dist/templates/zh/docs/prompts/help.md +69 -0
- package/dist/templates/zh/docs/prompts/inherit.md +270 -0
- package/dist/templates/zh/docs/prompts/map.md +131 -0
- package/dist/templates/zh/docs/prompts/plan.md +253 -0
- package/dist/templates/zh/docs/prompts/remove.md +162 -0
- package/dist/templates/zh/docs/prompts/revise.md +160 -0
- package/dist/templates/zh/docs/prompts/scope.md +198 -0
- package/dist/templates/zh/docs/prompts/start.md +258 -0
- package/dist/templates/zh/docs/templates/plan.template.json +88 -0
- package/dist/templates/zh/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/zh/docs/templates/spec.template.md +51 -0
- package/dist/templates/zh/docs/templates/ui.template.md +51 -0
- package/dist/templates/zh/rules/00_system.md +123 -0
- package/dist/templates/zh/rules/01_workflow.md +93 -0
- package/dist/templates/zh/rules/02_tech_stack.md +192 -0
- package/dist/templates/zh/rules/03_data_governance.md +102 -0
- package/dist/templates/zh/rules/04_cli_tools.md +50 -0
- package/dist/templates/zh/rules/90_custom_rules.md +21 -0
- package/dist/templates/zh/rules/99_context_glue.md +53 -0
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +293 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +339 -0
- package/dist/templates/zh-Hant/briefs/_base.md +115 -0
- package/dist/templates/zh-Hant/briefs/_modules.md +173 -0
- package/dist/templates/zh-Hant/docs/global/data_snapshot.json +31 -0
- package/dist/templates/zh-Hant/docs/global/design_tokens.json +135 -0
- package/dist/templates/zh-Hant/docs/global/dictionary.json +35 -0
- package/dist/templates/zh-Hant/docs/global/error_codes.json +19 -0
- package/dist/templates/zh-Hant/docs/global/map.json +94 -0
- package/dist/templates/zh-Hant/docs/global/roadmap.json +39 -0
- package/dist/templates/zh-Hant/docs/global/vision.md +82 -0
- package/dist/templates/zh-Hant/docs/prompts/audit.md +150 -0
- package/dist/templates/zh-Hant/docs/prompts/code.md +160 -0
- package/dist/templates/zh-Hant/docs/prompts/edit.md +87 -0
- package/dist/templates/zh-Hant/docs/prompts/fix.md +86 -0
- package/dist/templates/zh-Hant/docs/prompts/help.md +69 -0
- package/dist/templates/zh-Hant/docs/prompts/inherit.md +270 -0
- package/dist/templates/zh-Hant/docs/prompts/map.md +131 -0
- package/dist/templates/zh-Hant/docs/prompts/plan.md +252 -0
- package/dist/templates/zh-Hant/docs/prompts/remove.md +162 -0
- package/dist/templates/zh-Hant/docs/prompts/revise.md +160 -0
- package/dist/templates/zh-Hant/docs/prompts/scope.md +198 -0
- package/dist/templates/zh-Hant/docs/prompts/start.md +258 -0
- package/dist/templates/zh-Hant/docs/templates/plan.template.json +88 -0
- package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +58 -0
- package/dist/templates/zh-Hant/docs/templates/spec.template.md +51 -0
- package/dist/templates/zh-Hant/docs/templates/ui.template.md +51 -0
- package/dist/templates/zh-Hant/rules/00_system.md +123 -0
- package/dist/templates/zh-Hant/rules/01_workflow.md +93 -0
- package/dist/templates/zh-Hant/rules/02_tech_stack.md +192 -0
- package/dist/templates/zh-Hant/rules/03_data_governance.md +102 -0
- package/dist/templates/zh-Hant/rules/04_cli_tools.md +50 -0
- package/dist/templates/zh-Hant/rules/90_custom_rules.md +21 -0
- package/dist/templates/zh-Hant/rules/99_context_glue.md +53 -0
- package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +293 -0
- package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +86 -0
- package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +364 -0
- package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +337 -0
- package/package.json +85 -0
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
**简体中文** · [English](https://github.com/JiuNian3219/architext/blob/main/README.md)
|
|
4
|
+
|
|
5
|
+
# 🏛️ Architext
|
|
6
|
+
|
|
7
|
+
**AI 原生架构协议 · 先想清楚,再让 AI 实现**
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/architext)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](https://nodejs.org)
|
|
12
|
+
|
|
13
|
+
**支持的 IDE:** Cursor *(推荐)* · Windsurf · Trae · VS Code
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
> **🚧 项目早期公告**
|
|
18
|
+
>
|
|
19
|
+
> Architext 目前处于早期阶段。核心工作流(init → start → plan → code)已基本跑通,但仍有不少细节有待打磨。如果你在使用中遇到任何问题,欢迎[提交 Issue](../../issues) —— 我会尽快跟进修复。你的每一条反馈都会直接推动项目成长,感谢你愿意在早期就参与进来。
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 这是什么?
|
|
24
|
+
|
|
25
|
+
Architext 是一套**文档驱动 AI 开发 (DDAD)** 协议,将你的 AI 编程助手从"随意的代码生成器"升级为"严谨的世界级架构师"。
|
|
26
|
+
|
|
27
|
+
在写下任何一行代码之前,Architext 强制你和 AI 就以下问题达成一致:**要构建什么**、**为什么要做**、**具体怎么实现** —— 通过跨会话持久存储的结构化文档来确保这一点。
|
|
28
|
+
|
|
29
|
+
> **无文档,不代码。** 代码只是文档的下游产物。
|
|
30
|
+
|
|
31
|
+
Architext 以两个层次协同运作:
|
|
32
|
+
|
|
33
|
+
| 层次 | 触发方式 | 职责 |
|
|
34
|
+
|:---|:---|:---|
|
|
35
|
+
| **CLI 工具层** | `npx archi <命令>` | 将规则文件、Prompt、Skills 部署到项目中 |
|
|
36
|
+
| **AI 命令层** | 在 AI 编辑器中输入 `/archi.<命令>` | 生成文档、规划功能、编写代码、审查修复 |
|
|
37
|
+
|
|
38
|
+
CLI 层负责一次性部署框架,AI 命令层在这些文件的基础上驱动所有开发工作。
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 为什么选择 Architext?
|
|
43
|
+
|
|
44
|
+
| | AI 全权代理模式<br>*(Trae Solo / Bolt / v0)* | **Architext** |
|
|
45
|
+
|:---|:---|:---|
|
|
46
|
+
| **核心假设** | AI 知道用户要什么 | 用户知道自己要什么,但还没想清楚 |
|
|
47
|
+
| **AI 的角色** | 全权代理人 | 产品顾问 + 严格执行者 |
|
|
48
|
+
| **你的角色** | 验收者(做完了才知道是什么) | 决策者(动手前就看清全貌) |
|
|
49
|
+
| **信息流向** | AI → 用户("你看这行不行") | 用户 → AI("我要的是这个") |
|
|
50
|
+
| **决策权** | AI 隐式决定功能逻辑 | 用户显式定义,AI 严格执行 |
|
|
51
|
+
|
|
52
|
+
> 其他工具让 AI 替你做决定,Architext 帮你自己做决定。
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 快速开始
|
|
57
|
+
|
|
58
|
+
**第一步 · CLI:部署框架**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install -g architext
|
|
62
|
+
npx archi init
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
✔ 选择语言 › 简体中文
|
|
67
|
+
✔ 选择 IDE › Cursor (多选 — Cursor / Windsurf / Trae / VS Code)
|
|
68
|
+
✔ 选择项目类型 › Web SPA / PWA
|
|
69
|
+
|
|
70
|
+
● 正在部署 Architext...
|
|
71
|
+
✔ 文档已部署 → .architext/
|
|
72
|
+
prompts/ global/ templates/ tasks/
|
|
73
|
+
✔ 规则文件已部署 → .cursor/rules/ (Cursor: .mdc)
|
|
74
|
+
00_system · 01_workflow · 02_tech_stack · 03_data_governance
|
|
75
|
+
04_cli_tools · 90_custom_rules · 99_context_glue
|
|
76
|
+
✔ 命令文件已部署 → .cursor/commands/ (仅 Cursor)
|
|
77
|
+
archi.start · archi.scope · archi.plan · archi.code · archi.audit · ...
|
|
78
|
+
✔ Skills 已部署 → .cursor/skills/ (Cursor)
|
|
79
|
+
archi-decompose-roadmap · archi-interview-protocol · archi-plan-options · archi-ui-wireframe
|
|
80
|
+
✔ project-brief.md 已生成 → 项目根目录
|
|
81
|
+
|
|
82
|
+
◆ 完成!填写 project-brief.md,然后在 AI 编辑器中运行 /archi.start。
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**第二步 · AI 对话:初始化项目**
|
|
86
|
+
|
|
87
|
+
`archi init` 会在项目根目录自动生成一份 `project-brief.md`。填写完毕后,在 AI 编辑器中运行:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
/archi.start project-brief.md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
AI 读取 Brief,就关键决策向你提问,生成项目的基础文档(`vision.md`、`roadmap.json`、`tech_stack` 等)。
|
|
94
|
+
|
|
95
|
+
> **已有代码?** 跳过 `/archi.start`,改用 `/archi.inherit` —— 逆向分析项目,将已有功能注册为 `LEG-xx` 任务,同时生成 `map.json`。
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 工作流示例
|
|
100
|
+
|
|
101
|
+
项目全生命周期的主干路径,全部在 AI 对话框中完成。
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
project-brief.md → /archi.start → [/archi.scope] → /archi.plan → /archi.code → /archi.audit
|
|
105
|
+
↑
|
|
106
|
+
有额外需求时使用,可多次运行
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**第一阶段 · 初始化**
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
你: /archi.start project-brief.md
|
|
113
|
+
|
|
114
|
+
AI: [正在分析项目 Brief...]
|
|
115
|
+
[就技术栈、架构风格、项目类型向你提问...]
|
|
116
|
+
|
|
117
|
+
✔ 新增: .architext/global/vision.md
|
|
118
|
+
✔ 新增: .architext/global/roadmap.json
|
|
119
|
+
✔ 新增: .architext/global/dictionary.json
|
|
120
|
+
✔ 新增: .architext/global/error_codes.json
|
|
121
|
+
✔ 新增: .architext/global/ui_context.md (仅 UI 类项目)
|
|
122
|
+
✔ 新增: .architext/global/ui_concept.html (仅 UI 类项目)
|
|
123
|
+
✔ 填充: .cursor/rules/02_tech_stack.mdc (写入项目技术决策)
|
|
124
|
+
✔ 填充: .cursor/rules/90_custom_rules.mdc (写入团队编码规范)
|
|
125
|
+
|
|
126
|
+
下一步:运行 /archi.scope 将需求分解为任务。
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
> **已有代码?** 改用 `/archi.inherit` —— 逆向分析项目,将已有功能注册为 `LEG-xx` 任务,并额外生成 `map.json`。
|
|
130
|
+
|
|
131
|
+
**第二阶段 · 需求分解(可选)**
|
|
132
|
+
|
|
133
|
+
> 当你的 Brief 之外还有额外需求要拆解时使用 `/archi.scope`;若 Brief 已覆盖全部需求,可直接跳到第三阶段。
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
你: /archi.scope scope-brief.md ← 提供文件;或直接 /archi.scope 触发访谈
|
|
137
|
+
|
|
138
|
+
AI: [正在读取 vision.md, roadmap.json, map.json, tech_stack...]
|
|
139
|
+
[扫描现有任务,评估影响范围...]
|
|
140
|
+
|
|
141
|
+
已分解为 3 个任务:
|
|
142
|
+
✔ 更新: .architext/global/roadmap.json
|
|
143
|
+
新增任务 FEAT-001 · auth-login (状态: pending)
|
|
144
|
+
新增任务 FEAT-002 · auth-session (状态: pending, 依赖: FEAT-001)
|
|
145
|
+
新增任务 FEAT-003 · user-profile (状态: pending, 依赖: FEAT-001)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**第三阶段 · 深度规划**
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
你: /archi.plan FEAT-001
|
|
152
|
+
|
|
153
|
+
AI: [正在读取 vision.md, tech_stack.md, map.json, 依赖任务 spec...]
|
|
154
|
+
[就功能逻辑、数据流、边界条件向你提问...]
|
|
155
|
+
|
|
156
|
+
Q1. 认证方式?[A] JWT [B] Session Cookie [C] OAuth [推荐: A]
|
|
157
|
+
Q2. 会话是否需要跨设备同步?[Y/N]
|
|
158
|
+
Q3. ...
|
|
159
|
+
|
|
160
|
+
你: A | N | ...
|
|
161
|
+
|
|
162
|
+
AI: ✔ 新增: .architext/tasks/FEAT-001_auth-login/spec.md
|
|
163
|
+
✔ 新增: .architext/tasks/FEAT-001_auth-login/plan.json
|
|
164
|
+
✔ 新增: .architext/tasks/FEAT-001_auth-login/ui.md (仅 UI 类项目)
|
|
165
|
+
✔ 更新: .architext/global/roadmap.json (FEAT-001: pending → active)
|
|
166
|
+
✔ 更新: .architext/global/map.json
|
|
167
|
+
✔ 更新: .architext/global/dictionary.json
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
代码动工前,审阅生成的规格文档:
|
|
171
|
+
- `spec.md` — 功能逻辑、Gherkin 验收标准、接口契约
|
|
172
|
+
- `plan.json` — 实施阶段、文件级任务拆解、决策记录
|
|
173
|
+
- `ui.md` — 交互说明,对照 `ui_context.md` 中的屏幕定义(仅 UI 类项目)
|
|
174
|
+
|
|
175
|
+
确认"这就是我要的"之后,再进入实现阶段。
|
|
176
|
+
|
|
177
|
+
**第四阶段 · 实现**
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
你: /archi.code FEAT-001
|
|
181
|
+
|
|
182
|
+
AI: [正在读取 spec.md, plan.json, tech_stack.md...]
|
|
183
|
+
[状态门控:FEAT-001 状态为 active ✔]
|
|
184
|
+
[运行静默审计循环:依赖 / 技术红线 / 架构边界...]
|
|
185
|
+
|
|
186
|
+
正在实现 阶段 A:核心认证逻辑
|
|
187
|
+
✔ 新增: src/features/auth/auth.service.ts
|
|
188
|
+
✔ 新增: src/features/auth/auth.controller.ts
|
|
189
|
+
✔ 更新: src/app.module.ts
|
|
190
|
+
✔ 更新: .architext/tasks/FEAT-001_auth-login/plan.json (阶段 A → 完成)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**第五阶段 · 代码审查(可选,强烈建议)**
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
你: /archi.audit FEAT-001 ← 带 ID: 审查该任务实现;不带 ID: 做项目级全面体检
|
|
197
|
+
|
|
198
|
+
AI: [正在读取 代码 + spec + plan + vision + tech_stack...]
|
|
199
|
+
|
|
200
|
+
✔ 新增: .architext/tasks/FEAT-001_auth-login/audit.md
|
|
201
|
+
|
|
202
|
+
发现 2 个问题:
|
|
203
|
+
[中] /auth/login 缺少速率限制 → 建议运行 /archi.fix
|
|
204
|
+
[低] Token 过期时间未通过环境变量配置 → 建议运行 /archi.edit
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
> **命令之间的日常开发**由自然语言 **Chat Mode** 驱动——提问、微调代码、调试——无需斜杠命令。7 个规则文件中有 4 个作为始终在线的基底规则:`00_system`、`02_tech_stack`、`90_custom_rules`、`99_context_glue`,AI 不会因会话切换而"失忆"。
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 命令速查
|
|
212
|
+
|
|
213
|
+
### AI 对话命令
|
|
214
|
+
|
|
215
|
+
| 命令 | 说明 |
|
|
216
|
+
|:---|:---|
|
|
217
|
+
| `/archi.start [brief]` | 读取需求 Brief,生成项目基础文档(vision / roadmap / tech_stack 等) |
|
|
218
|
+
| `/archi.inherit` | 逆向分析已有代码库,生成文档骨架并注册为 `LEG-xx` 任务 |
|
|
219
|
+
| `/archi.scope [file_path]` | 将额外需求拆解为 Roadmap 任务;无文件则自动发起访谈 |
|
|
220
|
+
| `/archi.plan <ID> [context]` | 深度架构访谈 → 生成 spec / plan([?UI] 附 ui.md + ui_concept.html);可附加已知上下文减少提问 |
|
|
221
|
+
| `/archi.code <ID>` | 按 plan 分阶段实现代码;仅 `active` 任务可进入 |
|
|
222
|
+
| `/archi.edit <ID> [context]` | 修改功能规格 → 追加新开发 Phase;不覆盖历史记录 |
|
|
223
|
+
| `/archi.revise [context]` | 全局架构/技术栈变更 → 输出影响评估 → 用户确认后级联更新 |
|
|
224
|
+
| `/archi.audit [ID]` | 深度代码审查,输出审计报告;带 ID 审查单任务,不带 ID 做项目级体检 |
|
|
225
|
+
| `/archi.fix [ID] <context>` | 诊断根因并修复 Bug;ID 可选,context 描述问题现象 |
|
|
226
|
+
| `/archi.map` | 对比 map.json 与实际目录树,同步架构地图 |
|
|
227
|
+
| `/archi.remove <ID>` | 全链路下线功能:删除代码 + 文档,清理 roadmap / map 引用 |
|
|
228
|
+
| `/archi.help [question]` | 无参数:推荐下一步行动;有问题:定位相关文件回答 |
|
|
229
|
+
|
|
230
|
+
### 终端命令
|
|
231
|
+
|
|
232
|
+
| 命令 | 用途 |
|
|
233
|
+
|:---|:---|
|
|
234
|
+
| `npx archi init` | 部署框架文件(规则、Prompt、Skills) |
|
|
235
|
+
| `npx archi update` | 将已部署文件更新至最新版本 |
|
|
236
|
+
| `npx archi doctor` | 检查项目健康状态 |
|
|
237
|
+
| `npx archi render` | 将 JSON 数据生成可读 Markdown 视图 |
|
|
238
|
+
| `npx archi task [--check]` | 查看/校验 Roadmap 任务状态 |
|
|
239
|
+
| `npx archi plan <id>` | 检查指定功能的 plan 完成度 |
|
|
240
|
+
| `npx archi template <name>` | 获取模板文件到项目根目录 |
|
|
241
|
+
| `npx archi uninstall` | 从项目中移除 Architext 文件 |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## 核心哲学
|
|
246
|
+
|
|
247
|
+
**① 文档驱动 (DDAD)**
|
|
248
|
+
|
|
249
|
+
代码是文档的下游产物。每次变更都从修改文档开始——先有规格,再有代码。每一个决策都可追溯,每一个 AI 输出都可预期。
|
|
250
|
+
|
|
251
|
+
**② 用户主权**
|
|
252
|
+
|
|
253
|
+
AI 的职责是挖掘和澄清你的真实意图,而非替代你做判断。在开发开始之前,你就能看到完整的功能逻辑、数据流和交互模型。所有关键决策的最终决定权在你手中。
|
|
254
|
+
|
|
255
|
+
**③ 元框架**
|
|
256
|
+
|
|
257
|
+
Architext 不强制规定架构。它通过 AI 无法绕过的规则和边界,严格执行**你所选择的**任意架构(MFA、FSD、DDD、整洁架构等)。
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 关于愿景
|
|
262
|
+
|
|
263
|
+
AI 开发的演进速度,比我们任何人预想的都要快。新模型、新工具、新范式——几乎每隔几个月,整个行业就会重新洗牌一次。
|
|
264
|
+
|
|
265
|
+
Architext 是我在这个方向上的一次探索:尝试为"如何与 AI 协作开发软件"这件事提供一些结构。它并不是一个宣称找到了终极答案的框架,只是我认为行得通的一个方向——核心信念是:动手之前想清楚,无论 AI 变得多强大,都会带来更好的结果。
|
|
266
|
+
|
|
267
|
+
如果它对你有用,那很好。如果你有更好的想法,我真的很想听。
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## 常见问题
|
|
272
|
+
|
|
273
|
+
**这和 Cursor Agent 模式有什么区别?**
|
|
274
|
+
|
|
275
|
+
Agent 模式适合单次会话。Architext 提供跨会话、跨成员、跨 AI 工具的持久上下文。你的规格文档存在仓库里,关闭对话窗口也不会消失。
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
**我的已有项目能用吗?**
|
|
280
|
+
|
|
281
|
+
可以。运行 `/archi.inherit`,Architext 会分析你的现有代码并生成文档骨架。已有功能以 `LEG-xx` 形式注册为存根规格,渐进式接入,无需推倒重来。
|
|
282
|
+
|
|
283
|
+
> **注意**:`/archi.inherit` 目前处于早期阶段,对大型或复杂仓库的分析结果可能不够完整,需要手动补充。欢迎提交 Issue 反馈遇到的问题。
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
**支持哪些 IDE?**
|
|
288
|
+
|
|
289
|
+
目前支持 4 个 IDE,在 `archi init` 交互式选择中手动勾选,支持多选,可同时为多个 IDE 部署:
|
|
290
|
+
|
|
291
|
+
| IDE | 规则目录 | 扩展名 | 状态 |
|
|
292
|
+
|:---|:---|:---|:---|
|
|
293
|
+
| Cursor | `.cursor/rules/` | `.mdc` | 推荐 — 测试最完善 |
|
|
294
|
+
| Windsurf | `.windsurf/rules/` | `.md` | 支持 |
|
|
295
|
+
| Trae | `.trae/rules/` | `.md` | 支持 |
|
|
296
|
+
| VS Code | `.github/instructions/` | `.instructions.md` | 支持 |
|
|
297
|
+
|
|
298
|
+
后续计划扩展更多编辑器支持。
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
**支持哪些项目类型?**
|
|
303
|
+
|
|
304
|
+
不绑定特定项目类型。CLI 工具、Web 应用、小程序、API、后端服务均适用。模板在初始化时会根据项目类型自动适配。
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
**必须用全部命令吗?**
|
|
309
|
+
|
|
310
|
+
不必。可以只从 `/archi.plan` + `/archi.code` 开始,随着熟悉程度逐步引入其他命令。整个系统按照渐进式接入的方式设计。
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
**Token 消耗大吗?**
|
|
315
|
+
|
|
316
|
+
是的,相比普通对话,Architext 的每条命令都会加载多个上下文文件并执行深度分析,**Token 消耗明显高于直接提问**。这是文档驱动开发的固有成本——换来的是更可预期的输出和更少的反复。
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
<div align="center">
|
|
321
|
+
|
|
322
|
+
**[贡献指南](https://github.com/JiuNian3219/architext/blob/main/CONTRIBUTING.md) · [更新日志](https://github.com/JiuNian3219/architext/blob/main/CHANGELOG.md) · [Issues](https://github.com/JiuNian3219/architext/issues)**
|
|
323
|
+
|
|
324
|
+
> 这就是 Architext:一套让 AI 真正像资深架构师一样工作的元框架协议。
|
|
325
|
+
|
|
326
|
+
</div>
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{cac as Vo}from"cac";var ye={name:"architext",version:"0.0.2",description:"The DDAD (Document-Driven AI Development) protocol and prompt scaffolder for AI-native engineering.",type:"module",scripts:{build:"tsup src/index.ts --format esm --dts",dev:"tsx src/index.ts",lint:"eslint . && prettier --check .",test:"vitest","test:ui":"vitest --ui","test:coverage":"vitest --coverage","test:run":"vitest run",prepublishOnly:"npm run build",prepare:"husky"},"lint-staged":{ignore:["website/.astro/**"],"*.{js,ts,tsx,jsx}":["eslint --fix","prettier --write"],"*.{json,md}":["prettier --write"]},files:["dist","README.md","README.zh-CN.md","CHANGELOG.md","LICENSE"],bin:{architext:"./dist/index.js",archi:"./dist/index.js"},keywords:["architext","ddad","document-driven","ai","llm","prompt-engineering","scaffold","cli","architecture","spec","template","code-generation"],author:"JiuNian3219 <qin0yu0lou@gmail.com>",license:"MIT",devDependencies:{"@commitlint/cli":"^20.3.1","@commitlint/config-angular":"^20.3.1","@eslint/js":"^9.39.2","@types/fs-extra":"^11.0.4","@types/node":"^25.2.1","@vitest/coverage-v8":"^4.0.18","@vitest/ui":"^4.0.18",eslint:"^9.39.2","eslint-config-prettier":"^10.1.8",globals:"^17.1.0",husky:"^9.1.7","lint-staged":"^16.2.7","mock-fs":"^5.5.0",prettier:"^3.8.1",tsup:"^8.5.1",tsx:"^4.21.0",typescript:"^5.9.3","typescript-eslint":"^8.53.1",vitest:"^4.0.18"},dependencies:{"@clack/prompts":"^0.11.0",cac:"^6.7.14",chalk:"^5.6.2","fs-extra":"^11.3.3",picocolors:"^1.1.1",zod:"^4.3.6"}};import{intro as Ya,outro as qe}from"@clack/prompts";import v from"picocolors";import te from"picocolors";var l={info:e=>console.log(te.cyan(e)),success:e=>console.log(te.green(e)),warn:e=>console.warn(te.yellow(e)),error:e=>console.error(te.red(e)),dim:e=>console.log(te.dim(e)),step:e=>console.log(te.cyan(`\u27A4 ${e}`)),done:e=>console.log(te.green(`\u2714 ${e}`)),fail:e=>console.error(te.red(`\u2716 ${e}`)),raw:e=>console.log(e),clear:()=>console.clear()};var Tt={common:{coming_soon:"\u{1F6A7} This feature is coming soon, stay tuned!",error:{unexpected:"\u274C Unexpected Error: {msg}",unknown:"\u274C Unknown error occurred",internal:"\u274C Internal Error [{code}]: {msg}",cancel:"\u{1F6AB} {msg}"}},init:{desc:"Initialize Architext Framework, configure editor rules and document skeleton",editor:"Target IDE, multiple selection is supported, separated by commas",lang:"Rules and document skeleton language",doc:"Custom document path, default is .architext",type:"Project type (web|fullstack|api|cli|lib|mobile|miniapp|desktop|web-desktop|extension|realtime|ai-agent|hybrid)",failed:"Initialization failed"},update:{desc:"Sync latest rules, update editor rules and document skeleton",dry_run:"Dry run, do not actually execute the update operation, only display the update content",failed:"Update failed",dry_run_msg:"\u{1F50D} Dry run mode enabled.",construction:"Update feature is under construction..."},uninstall:{desc:"Remove Architext framework and generated files"},doctor:{desc:"Project health check: config, doc structure, global files and IDE rules",failed:"System check failed",success:"System Check: All Good"},task:{desc:"Manage project roadmap tasks",status:"Update task status (pending|active|done|blocked)",check:"Check roadmap consistency"},plan:{desc:"Check implementation plan (plan.json) completion status",id_required:"Please specify Task ID (e.g.: archi plan SUB-01)"},render:{desc:"Render JSON data files into Markdown views"},template:{desc:"Fetch template files to project root"},help:{desc:"Display Architext command help information"},scaffold:{fallback:"Template for {lang} not found, falling back to 'zh'",step_docs:"Scaffolding documentation structure...",step_rules:"Installing core rules...",step_ide:"Distributing IDE rules...",step_processing:"Processing {group}...",complete:"Scaffold complete."},templates:{error:{root_not_found:"Templates directory not found. Searched in: {paths}"}},command:{init:{title:"Initialize Architext Framework for deploying standardized AI context protocols & IDE rules.",select_editor:"Select target editors",select_lang:"Select documentation language",select_type:"Select project type",select_doc_dir:"Enter documentation directory",config_exists:"Existing config (architext.json) detected. Overwrite?",config_saved:"Config saved to architext.json",conflict_title:"\u26A0\uFE0F File Conflict Detected",conflict_msg:"The following files already exist. How to proceed?",conflict_more:" ... ({count} more files)",conflict_overwrite:"Overwrite",conflict_skip:"Skip",conflict_cancel:"Cancel",installing:"Copying files...",cancel:"Initialization cancelled",failed:"Initialization failed",success:"Architext initialized successfully! \u{1F680}"},uninstall:{desc:"Remove Architext framework and generated files",title:"Architext Uninstall Wizard",confirm_title:"\u26A0\uFE0F Danger Zone",confirm_msg:"This will PERMANENTLY delete the following. Continue?",files_to_delete:"Files/Directories to be deleted:",done:"Uninstall done",success:"Architext successfully removed.",error:"Uninstall error occurred.",cancel:"Uninstall cancelled.",not_found:"Configuration (architext.json) not found. Cannot auto-uninstall.",cleaning:"Cleaning up..."},task:{check:{invalid_dep:"Task [{id}] has invalid dependency: [{depId}] does not exist in task list",consistent:"Roadmap is consistent."},update:{id_required:"Task ID is required for status update. Usage: architext task <id> --status <status>",updating:"Updating task [{id}] to {status}...",done:"Task [{id}] -> {status}",unblocked:"Task [{id}] unblocked -> pending (all deps done)"},list:{empty:"No tasks found in roadmap.",title:"Project Roadmap Status"}},plan:{title:"Plan Check: {id} {name}",section_pass:"[{done}/{total}]",section_manual:"[{done}/{total}] (skipped \u2014 manual verification)",unchecked_item:" L{line}: {content}",total:"Total: {done}/{total} ({percent}%)",all_done:"All automated tasks complete!",remaining:"{count} tasks remaining",empty:"No checkbox tasks found in plan file",not_found:"Plan file not found for [{id}] (plan.json)"},template:{usage:"Usage: npx archi template <name> Available templates:",unknown:'Unknown template "{name}". Available: {available}',exists:"{path} already exists, skipped. Delete it first to regenerate.",done:"Generated {path}. Fill it in and run /archi.scope to start decomposition.",not_found:"Template file {name} not found. Run npx archi init first."},render:{empty:"No JSON data files found to render.",done:"Render complete. Generated {count} Markdown view(s).",plan:{header_comment:"<!-- \u26A0\uFE0F AUTO-GENERATED from plan.json \u2014 DO NOT EDIT DIRECTLY -->",header_ai:"<!-- AI: Read plan.json, not this file -->",title:"Implementation Plan: {featureName}",feature_id:"Task ID",status:"Status",section_decisions:"Technical Decisions",section_steps:"Implementation Steps",section_tests:"Test Plan",subsection_automated:"Automated Tests",subsection_manual:"Manual Verification"},roadmap:{header_comment:"<!-- \u26A0\uFE0F AUTO-GENERATED from roadmap.json \u2014 DO NOT EDIT DIRECTLY -->",header_ai:"<!-- AI: Read roadmap.json, not this file -->",title:"Project Roadmap",status:"Status",updated:"Updated",phase:"Phase",goal:"Goal",dep:"Dep",dep_none:"None",tag:"Tag",slug:"Slug"}},update:{title:"Architext Update Wizard",no_config:"No config file (architext.json) found. Please run npx archi init first.",cancel:"Update cancelled",success:"Update complete!",failed:"Update failed",version_checking:"Checking latest version...",version_check_skip:"Version check skipped (network unavailable)",version_outdated:"New version v{latest} available (current: v{current})",version_upgrade_hint:"Upgrade command: {cmd}",version_up_to_date:"Already up to date: v{version}",updating_silent:"Updating prompt and document templates...",updated_silent:"Updated {count} template files",rules_overwrite_warning:"The following framework rule files will be fully overwritten. Back them up if you have custom changes:",rules_confirm:"Confirm overwriting the above rule files?",schema_auditing:"Running Schema compatibility audit...",summary:"Update Summary",summary_updated:"Rules updated: {list}",summary_templated:"New template \u2192 {docDir}/templates/02_tech_stack.template.md (merge manually)",summary_skipped:"Skipped: {list}",schema:{parse_error:"JSON parse failed \u2014 file may be corrupted",version_too_new:"File version (v{current}) is newer than CLI expected version (v{expected}). Please upgrade the CLI.",roadmap_migrated:"{file}: migrated from v{from} to v{to}",roadmap_ok:"{file}: schema compatible",roadmap_error:"{file}: schema incompatible",no_plans:"No plan.json files found, skipping audit",plans_ok:"All {count} plan.json files are schema-compatible",plan_error:"{file}: schema incompatible (please review manually)"}},doctor:{title:"Architext Project Health Check",no_config:"Config file not found, remaining checks skipped",group:{config:"Configuration",doc_structure:"Doc Directory Structure",global_files:"Global Files",ide_rules:"IDE Rules"},summary:{result:"Result: {parts}",passed:"{n} passed",warned:"{n} warnings",failed:"{n} failed"},success:"Health check passed \u2014 everything looks good",with_warnings:"Check complete with warnings \u2014 review recommended",with_errors:"Check complete with errors \u2014 please fix before proceeding",check:{config:{not_found:"Config file not found",hint_init:"Run npx archi init to initialize the project",format_label:"Config file format",format_fail:"JSON parse failed \u2014 file may be corrupted",editors_label:"Editor config",editors_empty:"No editors configured",editors_invalid:"Contains invalid editors: {list}",editors_ok:"Editors: {list}",lang_label:"Language config",lang_invalid:"Unsupported language: {lang}",lang_ok:"Language: {lang}",doc_dir:"Doc dir: {dir}",doc_dir_unset:"(not set)",doc_dir_empty:"docDir field is empty"},dir:{missing:"Directory not found",hint_init:"Run npx archi init to reinitialize",hint_update:"Run npx archi update to restore",hint_features:"Create manually: mkdir {docDir}/tasks",hint_tasks:"Create manually: mkdir {docDir}/tasks"},global:{required_missing:"Required file missing",optional_missing:"File missing (non-blocking)",parse_fail:"JSON parse failed",roadmap_ok:"roadmap.json (Schema v{version} compatible)",roadmap_hint:"Run npx archi update to attempt auto-fix"},rules:{dir_missing:"Rules directory not found",dir_hint:"Run npx archi update to restore rule files",file_missing:"Rule file missing",file_hint:"Run npx archi update to restore"}}},help:{tagline:"No Docs, No Code. \u2014 AI-Native Architecture Protocol",section:{ai:"AI Commands (use in Chat)",cli:"CLI Commands (use in Terminal)",quick:"Quick Start",workflow:"Typical Workflow"},ai:{start:{desc:"Cold start a new project. Interview vision, tech stack, generate doc skeleton.",detail:"Output: Vision + Tech Stack + Roadmap + Global doc skeleton",example:"e.g. /archi.start I want to build a Todo CLI tool in Rust"},inherit:{desc:"Take over a legacy project. Full code scan, reverse-engineer architecture, fill docs.",detail:"For existing codebases lacking Architext documentation"},scope:{desc:"Requirement decomposition. Read Scope Brief, break large requirements into Roadmap tasks with dependencies.",detail:"Output: Multiple Roadmap tasks (with ID/goal/deps). Falls back to interview mode without Brief",example:"e.g. /archi.scope scope-brief.md"},plan:{desc:"Deep task planning. Architecture interview for existing Roadmap tasks, generate full docs.",detail:"Output: Spec (logic) + UI (visual, if applicable) + Plan (steps)",example1:"e.g. /archi.plan INF-001 needs OAuth login support",example2:"e.g. /archi.plan FEAT-01"},code:{desc:"Translate docs to code. Read Plan, implement step by step with checks & audit.",detail:"Prerequisite: Task must have complete Spec + Plan",example:"e.g. /archi.code INF-001"},audit:{desc:"Independent deep code audit. Find bugs, gaps, and compliance issues.",detail:"With ID: audit specific task's code | No ID: project-level health check",example1:"e.g. /archi.audit INF-001",example2:"e.g. /archi.audit"},fix:{desc:"Fix a bug (not a requirement change). Diagnose and fix code, usually no Spec change.",detail:"Auto-records fix process to Plan for documentation consistency",example:"e.g. /archi.fix INF-001 login returns 403 error"},edit:{desc:"Local requirement change. Update Spec/UI docs first, then sync code changes.",detail:"Change chain: Update Spec/UI --> Append Plan steps --> Modify code",example:"e.g. /archi.edit INF-001 add remember-me feature"},revise:{desc:"Global change (tech stack, architecture). Analyzes impact, cascades updates to affected Tasks after confirmation.",detail:"Scope: Vision / Tech Stack / Roadmap / Related Task docs",example:"e.g. /archi.revise migrate from REST to GraphQL"},map:{desc:"Refresh architecture map. Rescan directory tree, update map.json.",detail:"Use when directory structure changes to keep map.json in sync"},remove:{desc:"Decommission a task. Full cleanup: impact analysis \u2192 delete docs+code \u2192 purge global refs.",detail:"Scope: Task docs / business code / roadmap / map / context_glue",example:"e.g. /archi.remove FEAT-003"},help:{desc:"Project navigator & contextual Q&A. Analyze state, suggest next actions.",detail:"No args: smart next-step recommendation; with question: project-aware answer",example1:"e.g. /archi.help",example2:"e.g. /archi.help what does the data model look like?"}},cli:{init:{desc:"Initialize Architext framework. Generate rules, doc directory, prompt templates, Project Brief.",editor:"Target IDE (cursor / trae / windsurf)",lang:"Language (zh / en / zh-Hant)",doc:"Custom doc directory name (default: .architext)",type:"Project type (web / fullstack / api / cli / lib / mobile / miniapp / desktop / web-desktop / extension / realtime / ai-agent / hybrid)"},update:{desc:"Sync latest rule templates to project, keep rules aligned with framework version.",dry_run:"Preview changes only, no actual writes"},doctor:{desc:"Read-only health scan: config validity, directory integrity, global file schemas, IDE rule files."},task:{desc:"Manage Roadmap tasks. View progress, update status, check dependency consistency.",detail:"No args: list all tasks | --check: verify dependency consistency",example:"e.g. npx archi task INF-001 --status done"},plan:{desc:"Check Task Plan completion (auto-detects manual verification sections).",example:"e.g. npx archi plan INF-001"},render:{desc:"Render JSON data files (roadmap/plan) into human-readable Markdown views."},template:{desc:"Fetch template files to project root for filling.",example:"e.g. npx archi template scope-brief"},uninstall:{desc:"Remove Architext framework and all generated files (rules, docs, config)."}},quick:{new_project:"New project from scratch",legacy:"Take over legacy project",new_feature:"Plan a new task",write_code:"Implement code",fix_bug:"Fix a bug",check_health:"Check project health"},workflow:{init_flow:"Initial setup",new_feature:"New task:",change_spec:"Spec change:",standalone:"Standalone ops:"}}}};var Et={common:{coming_soon:"\u{1F6A7} \u8A72\u529F\u80FD\u6B63\u5728\u958B\u767C\u4E2D\uFF0C\u656C\u8ACB\u671F\u5F85\uFF01",error:{unexpected:"\u274C \u975E\u9810\u671F\u932F\u8AA4: {msg}",unknown:"\u274C \u767C\u751F\u672A\u77E5\u932F\u8AA4",internal:"\u274C \u5167\u90E8\u932F\u8AA4 [{code}]: {msg}",cancel:"\u{1F6AB} {msg}"}},init:{desc:"\u521D\u59CB\u5316 Architext \u6846\u67B6\uFF0C\u914D\u7F6E\u7DE8\u8F2F\u5668\u898F\u5247\u548C\u6A94\u6848\u9AA8\u67B6",editor:"\u6846\u67B6\u76EE\u6A19 IDE\uFF0C\u53EF\u591A\u9078\uFF0C\u9017\u865F\u5206\u9694",lang:"\u898F\u5247\u8207\u6A94\u6848\u9AA8\u67B6\u8A9E\u8A00",doc:"\u81EA\u5B9A\u7FA9\u6A94\u6848\u8DEF\u5F91\uFF0C\u9810\u8A2D\u4F7F\u7528.architext",type:"\u5C08\u6848\u578B\u5225 (web|fullstack|api|cli|lib|mobile|miniapp|desktop|web-desktop|extension|realtime|ai-agent|hybrid)",failed:"\u521D\u59CB\u5316\u5931\u6557"},update:{desc:"\u540C\u6B65\u6700\u65B0\u898F\u5247\uFF0C\u66F4\u65B0\u7DE8\u8F2F\u5668\u898F\u5247\u548C\u6A94\u6848\u9AA8\u67B6",dry_run:"\u9810\u6F14\u6A21\u5F0F\uFF0C\u4E0D\u5BE6\u969B\u57F7\u884C\u66F4\u65B0\u64CD\u4F5C\uFF0C\u50C5\u986F\u793A\u66F4\u65B0\u5167\u5BB9",failed:"\u5347\u7D1A\u5931\u6557",dry_run_msg:"\u{1F50D} \u9810\u6F14\u6A21\u5F0F\u5DF2\u555F\u7528\u3002",construction:"\u66F4\u65B0\u529F\u80FD\u6B63\u5728\u5EFA\u8A2D\u4E2D..."},uninstall:{desc:"\u79FB\u9664 Architext \u6846\u67B6\u53CA\u5176\u751F\u6210\u7684\u6A94\u6848"},doctor:{desc:"\u5C08\u6848\u5065\u5EB7\u6AA2\u67E5\uFF1A\u8A2D\u5B9A\u3001\u76EE\u9304\u7D50\u69CB\u3001\u5168\u57DF\u6587\u4EF6\u8207 IDE \u898F\u5247",failed:"\u74B0\u5883\u81EA\u6AA2\u5931\u6557",success:"\u7CFB\u7D71\u6AA2\u67E5\u901A\u904E\uFF1A\u4E00\u5207\u6B63\u5E38"},task:{desc:"\u7BA1\u7406\u5C08\u6848 Roadmap \u4EFB\u52D9",status:"\u66F4\u65B0\u4EFB\u52D9\u72C0\u614B (pending|active|done|blocked)",check:"\u6AA2\u67E5 Roadmap \u4E00\u81F4\u6027"},plan:{desc:"\u6AA2\u67E5\u529F\u80FD\u5BE6\u73FE\u8A08\u756B (plan.json) \u7684\u5B8C\u6210\u5EA6",id_required:"\u8ACB\u6307\u5B9A Task ID (\u4F8B\u5982: archi plan SUB-01)"},render:{desc:"\u5C07 JSON \u8CC7\u6599\u6A94\u6848\u6E32\u67D3\u70BA Markdown \u8996\u5716"},template:{desc:"\u53D6\u5F97\u7BC4\u672C\u6A94\u6848\u5230\u5C08\u6848\u6839\u76EE\u9304"},help:{desc:"\u986F\u793A Architext \u547D\u4EE4\u5E6B\u52A9\u4FE1\u606F"},scaffold:{fallback:"\u672A\u627E\u5230 {lang} \u6A21\u677F\uFF0C\u56DE\u9000\u4F7F\u7528 'zh'",step_docs:"\u6B63\u5728\u521D\u59CB\u5316\u6A94\u6848\u9AA8\u67B6...",step_rules:"\u6B63\u5728\u5B89\u88DD\u6838\u5FC3\u898F\u5247...",step_ide:"\u6B63\u5728\u5206\u767C IDE \u898F\u5247...",step_processing:"\u6B63\u5728\u8655\u7406 {group}...",complete:"\u8173\u624B\u67B6\u751F\u6210\u5B8C\u6210\u3002"},templates:{error:{root_not_found:"\u672A\u627E\u5230\u6A21\u677F\u76EE\u9304\u3002\u5DF2\u641C\u7D22\u8DEF\u5F91: {paths}"}},command:{init:{title:"\u521D\u59CB\u5316 Architext \u6846\u67B6\uFF0C\u7528\u65BC\u90E8\u7F72\u6A19\u6E96\u5316\u7684 AI \u4E0A\u4E0B\u6587\u5354\u8B70\u8207 IDE \u898F\u5247\u3002",select_editor:"\u8ACB\u9078\u64C7\u60A8\u7684\u76EE\u6A19\u7DE8\u8F2F\u5668",select_lang:"\u8ACB\u9078\u64C7\u5C08\u6848\u6587\u4EF6\u8A9E\u8A00",select_type:"\u8ACB\u9078\u64C7\u5C08\u6848\u578B\u5225",select_doc_dir:"\u8ACB\u8F38\u5165\u6587\u4EF6\u76EE\u9304",config_exists:"\u6AA2\u6E2C\u5230\u73FE\u6709\u8A2D\u5B9A\u6A94 (architext.json)\u3002\u662F\u5426\u8986\u84CB\uFF1F",config_saved:"\u8A2D\u5B9A\u5DF2\u5132\u5B58\u5230 architext.json",conflict_title:"\u26A0\uFE0F \u6AA2\u6E2C\u5230\u6A94\u6848\u885D\u7A81",conflict_msg:"\u4EE5\u4E0B\u6A94\u6848\u5DF2\u5B58\u5728\uFF0C\u5C07\u5982\u4F55\u8655\u7406\uFF1F",conflict_more:" ... (\u9084\u6709 {count} \u500B\u6A94\u6848)",conflict_overwrite:"\u8986\u84CB",conflict_skip:"\u8DF3\u904E",conflict_cancel:"\u53D6\u6D88",installing:"\u6B63\u5728\u8907\u88FD\u6A94\u6848...",cancel:"\u5DF2\u53D6\u6D88\u521D\u59CB\u5316",failed:"\u521D\u59CB\u5316\u5931\u6557",success:"Architext \u521D\u59CB\u5316\u6210\u529F\uFF01 \u{1F680}"},uninstall:{desc:"\u79FB\u9664 Architext \u6846\u67B6\u53CA\u5176\u751F\u6210\u7684\u6A94\u6848",title:"Architext \u5378\u8F09\u56AE\u5C0E",confirm_title:"\u26A0\uFE0F \u5371\u96AA\u64CD\u4F5C\u8B66\u544A",confirm_msg:"\u6B64\u64CD\u4F5C\u5C07\u6C38\u4E45\u522A\u9664\u4EE5\u4E0B\u5167\u5BB9\uFF0C\u662F\u5426\u7E7C\u7E8C\uFF1F",files_to_delete:"\u5C07\u522A\u9664\u7684\u6A94\u6848/\u76EE\u9304\uFF1A",done:"\u5378\u8F09\u5B8C\u6210",success:"Architext \u5DF2\u6210\u529F\u79FB\u9664\u3002",error:"\u5378\u8F09\u904E\u7A0B\u4E2D\u767C\u751F\u932F\u8AA4\u3002",cancel:"\u5DF2\u53D6\u6D88\u5378\u8F09\u3002",not_found:"\u672A\u627E\u5230\u8A2D\u5B9A\u6A94 (architext.json)\uFF0C\u7121\u6CD5\u81EA\u52D5\u5378\u8F09\u3002",cleaning:"\u6B63\u5728\u6E05\u7406..."},task:{check:{invalid_dep:"\u4EFB\u52D9 [{id}] \u7684\u4F9D\u8CF4\u7121\u6548: [{depId}] \u4E0D\u5B58\u5728\u65BC\u4EFB\u52D9\u5217\u8868\u4E2D",consistent:"Roadmap \u4E00\u81F4\u6027\u6AA2\u67E5\u901A\u904E\u3002"},update:{id_required:"\u66F4\u65B0\u72C0\u614B\u9700\u8981\u6307\u5B9A\u4EFB\u52D9 ID\u3002\u7528\u6CD5: architext task <id> --status <status>",updating:"\u6B63\u5728\u66F4\u65B0\u4EFB\u52D9 [{id}] \u72C0\u614B\u70BA {status}...",done:"\u4EFB\u52D9 [{id}] -> {status}",unblocked:"\u4EFB\u52D9 [{id}] \u5DF2\u89E3\u9396 -> pending (\u6240\u6709\u4F9D\u8CF4\u5DF2\u5B8C\u6210)"},list:{empty:"Roadmap \u4E2D\u672A\u627E\u5230\u4EFB\u52D9\u3002",title:"\u5C08\u6848 Roadmap \u72C0\u614B"}},plan:{title:"Plan \u6AA2\u67E5: {id} {name}",section_pass:"[{done}/{total}]",section_manual:"[{done}/{total}] (\u8DF3\u904E \u2014 \u4EBA\u5DE5\u9A57\u6536)",unchecked_item:" L{line}: {content}",total:"\u5408\u8A08: {done}/{total} ({percent}%)",all_done:"\u6240\u6709\u81EA\u52D5\u5316\u4EFB\u52D9\u5DF2\u5B8C\u6210\uFF01",remaining:"\u5269\u9918 {count} \u500B\u4EFB\u52D9\u672A\u5B8C\u6210",empty:"Plan \u6A94\u6848\u4E2D\u6C92\u6709 checkbox \u4EFB\u52D9",not_found:"\u672A\u627E\u5230 [{id}] \u7684\u5BE6\u73FE\u8A08\u756B\u6A94\u6848 (plan.json)"},template:{usage:"\u7528\u6CD5: npx archi template <name> \u53EF\u7528\u7BC4\u672C:",unknown:'\u672A\u77E5\u7BC4\u672C "{name}"\u3002\u53EF\u7528\u7BC4\u672C: {available}',exists:"{path} \u5DF2\u5B58\u5728\uFF0C\u8DF3\u904E\u3002\u5982\u9700\u8986\u84CB\u8ACB\u5148\u522A\u9664\u3002",done:"\u5DF2\u7522\u751F {path}\uFF0C\u586B\u5BEB\u5F8C\u57F7\u884C /archi.scope \u958B\u59CB\u5206\u89E3\u3002",not_found:"\u7BC4\u672C\u6A94\u6848 {name} \u672A\u627E\u5230\u3002\u8ACB\u5148\u57F7\u884C npx archi init\u3002"},render:{empty:"\u672A\u627E\u5230\u53EF\u6E32\u67D3\u7684 JSON \u8CC7\u6599\u6A94\u6848\u3002",done:"\u6E32\u67D3\u5B8C\u6210\uFF0C\u5171\u7522\u751F {count} \u500B Markdown \u8996\u5716\u3002",plan:{header_comment:"<!-- \u26A0\uFE0F \u7531 plan.json \u81EA\u52D5\u751F\u6210 \u2014 \u8ACB\u52FF\u76F4\u63A5\u7DE8\u8F2F -->",header_ai:"<!-- AI: \u8ACB\u8B80\u53D6 plan.json \u800C\u975E\u6B64\u6A94\u6848 -->",title:"\u5BE6\u65BD\u8A08\u756B\uFF1A{featureName}",feature_id:"Task ID",status:"\u72C0\u614B",section_decisions:"\u6280\u8853\u6C7A\u7B56",section_steps:"\u5BE6\u65BD\u6B65\u9A5F",section_tests:"\u6E2C\u8A66\u8A08\u756B",subsection_automated:"\u81EA\u52D5\u5316\u6E2C\u8A66",subsection_manual:"\u4EBA\u5DE5\u9A57\u6536"},roadmap:{header_comment:"<!-- \u26A0\uFE0F \u7531 roadmap.json \u81EA\u52D5\u751F\u6210 \u2014 \u8ACB\u52FF\u76F4\u63A5\u7DE8\u8F2F -->",header_ai:"<!-- AI: \u8ACB\u8B80\u53D6 roadmap.json \u800C\u975E\u6B64\u6A94\u6848 -->",title:"\u5C08\u6848 Roadmap",status:"\u72C0\u614B",updated:"\u66F4\u65B0\u65BC",phase:"\u968E\u6BB5",goal:"\u76EE\u6A19",dep:"\u4F9D\u8CF4",dep_none:"\u7121",tag:"\u6A19\u7C64",slug:"\u76EE\u9304"}},update:{title:"Architext \u5347\u7D1A\u7CBE\u9748",no_config:"\u672A\u627E\u5230\u8A2D\u5B9A\u6A94 (architext.json)\uFF0C\u8ACB\u5148\u57F7\u884C npx archi init",cancel:"\u5DF2\u53D6\u6D88\u66F4\u65B0",success:"\u66F4\u65B0\u5B8C\u6210\uFF01",failed:"\u66F4\u65B0\u5931\u6557",version_checking:"\u6AA2\u67E5\u6700\u65B0\u7248\u672C...",version_check_skip:"\u7248\u672C\u6AA2\u67E5\u5DF2\u7565\u904E\uFF08\u7DB2\u8DEF\u4E0D\u53EF\u7528\uFF09",version_outdated:"\u767C\u73FE\u65B0\u7248 v{latest}\uFF08\u76EE\u524D v{current}\uFF09",version_upgrade_hint:"\u5347\u7D1A\u6307\u4EE4: {cmd}",version_up_to_date:"\u5DF2\u662F\u6700\u65B0\u7248 v{version}",updating_silent:"\u66F4\u65B0\u63D0\u793A\u8A5E\u7BC4\u672C\u8207\u6587\u4EF6\u7BC4\u672C...",updated_silent:"\u5DF2\u66F4\u65B0 {count} \u500B\u7BC4\u672C\u6A94\u6848",rules_overwrite_warning:"\u4EE5\u4E0B\u6846\u67B6\u898F\u5247\u6A94\u6848\u5C07\u88AB\u5B8C\u5168\u8986\u84CB\uFF0C\u5982\u6709\u81EA\u8A02\u4FEE\u6539\u8ACB\u5148\u624B\u52D5\u5099\u4EFD\uFF1A",rules_confirm:"\u78BA\u8A8D\u8986\u84CB\u4EE5\u4E0A\u898F\u5247\u6A94\u6848\uFF1F",schema_auditing:"Schema \u76F8\u5BB9\u6027\u5BE9\u8A08...",summary:"\u66F4\u65B0\u5F59\u7E3D",summary_updated:"\u5DF2\u66F4\u65B0\u898F\u5247: {list}",summary_templated:"\u65B0\u7248\u7BC4\u672C \u2192 {docDir}/templates/02_tech_stack.template.md\uFF08\u8ACB\u624B\u52D5\u5408\u4F75\uFF09",summary_skipped:"\u5DF2\u7565\u904E: {list}",schema:{parse_error:"JSON \u89E3\u6790\u5931\u6557\uFF0C\u6A94\u6848\u53EF\u80FD\u5DF2\u640D\u6BC0",version_too_new:"\u6A94\u6848\u7248\u672C (v{current}) \u9AD8\u65BC CLI \u671F\u671B\u7248\u672C (v{expected})\uFF0C\u8ACB\u5148\u5347\u7D1A CLI",roadmap_migrated:"{file}: \u5DF2\u5F9E v{from} \u9077\u79FB\u81F3 v{to}",roadmap_ok:"{file}: \u7D50\u69CB\u76F8\u5BB9",roadmap_error:"{file}: \u7D50\u69CB\u4E0D\u76F8\u5BB9",no_plans:"\u672A\u627E\u5230 plan.json \u6A94\u6848\uFF0C\u7565\u904E\u5BE9\u8A08",plans_ok:"\u6240\u6709 {count} \u500B plan.json \u7D50\u69CB\u76F8\u5BB9",plan_error:"{file}: \u7D50\u69CB\u4E0D\u76F8\u5BB9\uFF08\u8ACB\u624B\u52D5\u6AA2\u67E5\uFF09"}},doctor:{title:"Architext \u5C08\u6848\u5065\u5EB7\u6AA2\u67E5",no_config:"\u672A\u627E\u5230\u8A2D\u5B9A\u6A94\uFF0C\u5F8C\u7E8C\u6AA2\u67E5\u5DF2\u8DF3\u904E",group:{config:"\u5C08\u6848\u8A2D\u5B9A",doc_structure:"\u6587\u4EF6\u76EE\u9304\u7D50\u69CB",global_files:"\u5168\u57DF\u6587\u4EF6",ide_rules:"IDE \u898F\u5247"},summary:{result:"\u7D50\u679C: {parts}",passed:"{n} \u901A\u904E",warned:"{n} \u8B66\u544A",failed:"{n} \u5931\u6557"},success:"\u5C08\u6848\u5065\u5EB7\u6AA2\u67E5\u901A\u904E\uFF0C\u4E00\u5207\u6B63\u5E38",with_warnings:"\u6AA2\u67E5\u5B8C\u6210\uFF0C\u5B58\u5728\u8B66\u544A\uFF0C\u5EFA\u8B70\u95DC\u6CE8",with_errors:"\u6AA2\u67E5\u5B8C\u6210\uFF0C\u5B58\u5728\u554F\u984C\uFF0C\u8ACB\u4FEE\u5FA9\u5F8C\u91CD\u8A66",check:{config:{not_found:"\u8A2D\u5B9A\u6A94\u4E0D\u5B58\u5728",hint_init:"\u57F7\u884C npx archi init \u521D\u59CB\u5316\u5C08\u6848",format_label:"\u8A2D\u5B9A\u6A94\u683C\u5F0F",format_fail:"JSON \u89E3\u6790\u5931\u6557\uFF0C\u6A94\u6848\u53EF\u80FD\u5DF2\u640D\u6BC0",editors_label:"\u7DE8\u8F2F\u5668\u8A2D\u5B9A",editors_empty:"\u672A\u8A2D\u5B9A\u4EFB\u4F55\u7DE8\u8F2F\u5668",editors_invalid:"\u542B\u7121\u6548\u7DE8\u8F2F\u5668: {list}",editors_ok:"\u7DE8\u8F2F\u5668: {list}",lang_label:"\u8A9E\u8A00\u8A2D\u5B9A",lang_invalid:"\u4E0D\u652F\u63F4\u7684\u8A9E\u8A00: {lang}",lang_ok:"\u8A9E\u8A00: {lang}",doc_dir:"\u6587\u4EF6\u76EE\u9304: {dir}",doc_dir_unset:"(\u672A\u8A2D\u5B9A)",doc_dir_empty:"docDir \u6B04\u4F4D\u70BA\u7A7A"},dir:{missing:"\u76EE\u9304\u4E0D\u5B58\u5728",hint_init:"\u57F7\u884C npx archi init \u91CD\u65B0\u521D\u59CB\u5316",hint_update:"\u57F7\u884C npx archi update \u6062\u5FA9",hint_features:"\u624B\u52D5\u5EFA\u7ACB\u5373\u53EF\uFF1Amkdir {docDir}/tasks",hint_tasks:"\u624B\u52D5\u5EFA\u7ACB\u5373\u53EF\uFF1Amkdir {docDir}/tasks"},global:{required_missing:"\u5FC5\u8981\u6587\u4EF6\u7F3A\u5931",optional_missing:"\u6587\u4EF6\u7F3A\u5931\uFF08\u4E0D\u5F71\u97FF\u904B\u884C\uFF09",parse_fail:"JSON \u89E3\u6790\u5931\u6557",roadmap_ok:"roadmap.json (Schema v{version} \u76F8\u5BB9)",roadmap_hint:"\u57F7\u884C npx archi update \u5617\u8A66\u81EA\u52D5\u4FEE\u5FA9"},rules:{dir_missing:"\u898F\u5247\u76EE\u9304\u4E0D\u5B58\u5728",dir_hint:"\u57F7\u884C npx archi update \u6062\u5FA9\u898F\u5247\u6A94\u6848",file_missing:"\u898F\u5247\u6A94\u6848\u7F3A\u5931",file_hint:"\u57F7\u884C npx archi update \u6062\u5FA9"}}},help:{tagline:"No Docs, No Code. \u2014 AI \u539F\u751F\u67B6\u69CB\u5354\u8B70",section:{ai:"AI Commands (\u5728 Chat \u4E2D\u4F7F\u7528)",cli:"CLI Commands (\u5728\u7D42\u7AEF\u4E2D\u4F7F\u7528)",quick:"Quick Start (\u5FEB\u901F\u6C7A\u7B56)",workflow:"Typical Workflow (\u5178\u578B\u5DE5\u4F5C\u6D41)"},ai:{start:{desc:"\u65B0\u5C08\u6848\u51B7\u555F\u52D5\u3002\u900F\u904E\u8A2A\u8AC7\u78BA\u7ACB\u9858\u666F\u3001\u6280\u8853\u5806\u758A\uFF0C\u7522\u751F\u6A94\u6848\u9AA8\u67B6\u3002",detail:"\u7522\u51FA: Vision + Tech Stack + Roadmap + \u5168\u57DF\u6A94\u6848\u9AA8\u67B6",example:"\u4F8B: /archi.start \u6211\u8981\u505A\u4E00\u500B Todo CLI \u5DE5\u5177\uFF0C\u7528 Rust \u5BEB"},inherit:{desc:"\u63A5\u7BA1\u820A\u5C08\u6848\u3002\u5168\u91CF\u6383\u63CF\u7A0B\u5F0F\u78BC\uFF0C\u9006\u5411\u63A8\u5C0E\u67B6\u69CB\uFF0C\u586B\u5145\u5168\u57DF\u6A94\u6848\u3002",detail:"\u9069\u7528\u65BC\u5DF2\u6709\u7A0B\u5F0F\u78BC\u5EAB\u4F46\u7F3A\u5C11 Architext \u6A94\u6848\u7684\u5C08\u6848"},scope:{desc:"\u9700\u6C42\u5206\u89E3\u3002\u8B80\u53D6 Scope Brief\uFF0C\u5C07\u5927\u9700\u6C42\u62C6\u89E3\u70BA\u591A\u500B Roadmap \u4EFB\u52D9\u4E26\u5EFA\u7ACB\u4F9D\u8CF4\u95DC\u4FC2\u3002",detail:"\u7522\u51FA: \u591A\u500B Roadmap \u4EFB\u52D9 (\u542B ID/\u76EE\u6A19/\u4F9D\u8CF4)\u3002\u7121 Brief \u6642\u81EA\u52D5\u9032\u5165\u8A2A\u8AC7\u6A21\u5F0F",example:"\u4F8B: /archi.scope scope-brief.md"},plan:{desc:"\u529F\u80FD\u6DF1\u5EA6\u898F\u5283\u3002\u5C0D Roadmap \u4E2D\u5DF2\u6709\u4EFB\u52D9\u505A\u67B6\u69CB\u8A2A\u8AC7\uFF0C\u7522\u751F\u5B8C\u6574\u6587\u4EF6\u3002",detail:"\u7522\u51FA: Spec (\u529F\u80FD\u908F\u8F2F) + UI (\u8996\u89BA\u8A2D\u8A08, \u5982\u9069\u7528) + Plan (\u5BE6\u65BD\u6B65\u9A5F)",example1:"\u4F8B: /archi.plan INF-001 \u9700\u8981\u652F\u63F4 OAuth \u767B\u5165",example2:"\u4F8B: /archi.plan FEAT-01"},code:{desc:"\u5C07\u6A94\u6848\u7FFB\u8B6F\u70BA\u7A0B\u5F0F\u78BC\u3002\u8B80\u53D6 Plan\uFF0C\u9010\u6B65\u5BE6\u73FE\uFF0C\u542B\u975C\u614B\u6AA2\u67E5\u8207\u5BE9\u8A08\u3002",detail:"\u524D\u7F6E: \u5C0D\u61C9 Task \u9808\u6709\u5B8C\u6574\u7684 Spec + Plan",example:"\u4F8B: /archi.code INF-001"},audit:{desc:"\u7368\u7ACB\u6DF1\u5EA6\u7A0B\u5F0F\u78BC\u5BE9\u67E5\u3002\u627E Bug\u3001\u627E\u7F3A\u6F0F\u3001\u67E5\u5408\u898F\u3002",detail:"\u5E36 ID: \u5BE9\u67E5\u6307\u5B9A\u4EFB\u52D9\u7684\u7A0B\u5F0F\u78BC\u5BE6\u73FE | \u7121 ID: \u5C08\u6848\u7D1A\u5065\u5EB7\u9AD4\u6AA2",example1:"\u4F8B: /archi.audit INF-001",example2:"\u4F8B: /archi.audit"},fix:{desc:"\u4FEE\u5FA9 Bug\uFF08\u975E\u9700\u6C42\u8B8A\u66F4\uFF09\u3002\u8A3A\u65B7\u932F\u8AA4\u4E26\u4FEE\u5FA9\u7A0B\u5F0F\u78BC\uFF0C\u901A\u5E38\u4E0D\u6539 Spec\u3002",detail:"\u81EA\u52D5\u8A18\u9304\u4FEE\u5FA9\u904E\u7A0B\u5230 Plan\uFF0C\u4FDD\u6301\u6A94\u6848\u4E00\u81F4\u6027",example:"\u4F8B: /archi.fix INF-001 \u767B\u5165\u6642\u5831 403 \u932F\u8AA4"},edit:{desc:"\u5C40\u90E8\u9700\u6C42\u8B8A\u66F4\u3002\u5148\u6539 Spec/UI \u6A94\u6848\uFF0C\u518D\u540C\u6B65\u4FEE\u6539\u7A0B\u5F0F\u78BC\u3002",detail:"\u8B8A\u66F4\u93C8\u8DEF: \u66F4\u65B0 Spec/UI --> \u8FFD\u52A0 Plan \u6B65\u9A5F --> \u4FEE\u6539\u7A0B\u5F0F\u78BC",example:"\u4F8B: /archi.edit INF-001 \u589E\u52A0\u8A18\u4F4F\u5BC6\u78BC\u529F\u80FD"},revise:{desc:"\u5168\u57DF\u8B8A\u66F4\uFF08\u6280\u8853\u5806\u758A\u3001\u67B6\u69CB\u7B49\uFF09\u3002\u5206\u6790\u5F71\u97FF\u7BC4\u570D\uFF0C\u7D93\u78BA\u8A8D\u5F8C\u7D1A\u806F\u66F4\u65B0\u76F8\u95DC Task\u3002",detail:"\u5F71\u97FF\u7BC4\u570D: Vision / Tech Stack / Roadmap / \u76F8\u95DC Task \u6A94\u6848",example:"\u4F8B: /archi.revise \u5F9E REST \u9077\u79FB\u5230 GraphQL"},map:{desc:"\u91CD\u65B0\u6574\u7406\u67B6\u69CB\u5730\u5716\u3002\u91CD\u65B0\u6383\u63CF\u76EE\u9304\u6A39\uFF0C\u66F4\u65B0 map.json\u3002",detail:"\u7576\u76EE\u9304\u7D50\u69CB\u767C\u751F\u8B8A\u5316\u6642\u4F7F\u7528\uFF0C\u4FDD\u6301 map.json \u8207\u5BE6\u969B\u6A94\u6848\u7CFB\u7D71\u540C\u6B65"},remove:{desc:"\u7279\u6027\u4E0B\u7DDA\u3002\u5168\u93C8\u8DEF\u6E05\u9664\uFF1A\u5F71\u97FF\u5206\u6790 \u2192 \u522A\u9664\u6A94\u6848+\u7A0B\u5F0F\u78BC \u2192 \u6E05\u7406\u5168\u57DF\u5F15\u7528\u3002",detail:"\u6E05\u7406\u7BC4\u570D: Task \u6A94\u6848 / \u696D\u52D9\u7A0B\u5F0F\u78BC / roadmap / map / context_glue",example:"\u4F8B: /archi.remove FEAT-003"},help:{desc:"\u5C08\u6848\u5C0E\u822A\u8207\u4E0A\u4E0B\u6587\u554F\u7B54\u3002\u5206\u6790\u5C08\u6848\u72C0\u614B\uFF0C\u5EFA\u8B70\u4E0B\u4E00\u6B65\u64CD\u4F5C\u3002",detail:"\u7121\u53C3\u6578\u6642\u667A\u6167\u63A8\u85A6\u4E0B\u4E00\u6B65\uFF1B\u5E36\u554F\u984C\u6642\u57FA\u65BC\u5C08\u6848\u4E0A\u4E0B\u6587\u56DE\u7B54",example1:"\u4F8B: /archi.help",example2:"\u4F8B: /archi.help \u9019\u500B\u5C08\u6848\u7684\u8CC7\u6599\u6A21\u578B\u9577\u4EC0\u9EBC\u6A23\uFF1F"}},cli:{init:{desc:"\u521D\u59CB\u5316 Architext \u6846\u67B6\u3002\u7522\u751F\u898F\u5247\u6A94\u6848\u3001\u6A94\u6848\u76EE\u9304\u3001Prompt \u7BC4\u672C\u3001Project Brief\u3002",editor:"\u6307\u5B9A IDE (cursor / trae / windsurf)",lang:"\u6307\u5B9A\u8A9E\u8A00 (zh / en / zh-Hant)",doc:"\u81EA\u5B9A\u7FA9\u6A94\u6848\u76EE\u9304\u540D (\u9810\u8A2D .architext)",type:"\u5C08\u6848\u578B\u5225 (web / fullstack / api / cli / lib / mobile / miniapp / desktop / web-desktop / extension / realtime / ai-agent / hybrid)"},update:{desc:"\u540C\u6B65\u6700\u65B0\u898F\u5247\u7BC4\u672C\u5230\u5C08\u6848\uFF0C\u4FDD\u6301\u898F\u5247\u6A94\u6848\u8207\u6846\u67B6\u7248\u672C\u4E00\u81F4\u3002",dry_run:"\u50C5\u9810\u89BD\u8B8A\u66F4\uFF0C\u4E0D\u5BE6\u969B\u5BEB\u5165"},doctor:{desc:"\u552F\u8B80\u5065\u5EB7\u6383\u63CF\uFF1A\u8A2D\u5B9A\u6709\u6548\u6027\u3001\u76EE\u9304\u5B8C\u6574\u6027\u3001\u5168\u57DF\u6587\u4EF6 Schema\u3001IDE \u898F\u5247\u6A94\u6848\u3002"},task:{desc:"\u7BA1\u7406 Roadmap \u4EFB\u52D9\u3002\u67E5\u770B\u9032\u5EA6\u3001\u66F4\u65B0\u72C0\u614B\u3001\u6AA2\u67E5\u4F9D\u8CF4\u4E00\u81F4\u6027\u3002",detail:"\u7121\u53C3\u6578: \u5217\u51FA\u6240\u6709\u4EFB\u52D9 | --check: \u6AA2\u67E5\u4F9D\u8CF4\u4E00\u81F4\u6027",example:"\u4F8B: npx archi task INF-001 --status done"},plan:{desc:"\u6AA2\u67E5\u6307\u5B9A Task \u7684 Plan \u5B8C\u6210\u5EA6\uFF08\u81EA\u52D5\u8B58\u5225\u4EBA\u5DE5\u9A57\u6536\u5340\u57DF\uFF09\u3002",example:"\u4F8B: npx archi plan INF-001"},render:{desc:"\u5C07 JSON \u8CC7\u6599\u6A94\u6848 (roadmap/plan) \u6E32\u67D3\u70BA\u4EBA\u985E\u53EF\u8B80\u7684 Markdown \u8996\u5716\u3002"},template:{desc:"\u53D6\u5F97\u7BC4\u672C\u6A94\u6848\u5230\u5C08\u6848\u6839\u76EE\u9304\u4F9B\u586B\u5BEB\u3002",example:"\u4F8B: npx archi template scope-brief"},uninstall:{desc:"\u79FB\u9664 Architext \u6846\u67B6\u53CA\u5176\u7522\u751F\u7684\u6240\u6709\u6A94\u6848\uFF08\u898F\u5247\u3001\u6A94\u6848\u3001\u8A2D\u5B9A\uFF09\u3002"}},quick:{new_project:"\u65B0\u5C08\u6848\u5F9E\u96F6\u958B\u59CB",legacy:"\u63A5\u7BA1\u820A\u5C08\u6848",new_feature:"\u898F\u5283\u65B0\u4EFB\u52D9",write_code:"\u5BE6\u73FE\u7A0B\u5F0F\u78BC",fix_bug:"\u4FEE\u5FA9 Bug",check_health:"\u6AA2\u67E5\u5C08\u6848\u5065\u5EB7"},workflow:{init_flow:"\u5C08\u6848\u555F\u52D5:",new_feature:"\u65B0\u589E\u4EFB\u52D9:",change_spec:"\u9700\u6C42\u8B8A\u66F4:",standalone:"\u7368\u7ACB\u64CD\u4F5C:"}}}};var Dt={common:{coming_soon:"\u{1F6A7} \u8BE5\u529F\u80FD\u6B63\u5728\u5F00\u53D1\u4E2D\uFF0C\u656C\u8BF7\u671F\u5F85\uFF01",error:{unexpected:"\u274C \u975E\u9884\u671F\u9519\u8BEF: {msg}",unknown:"\u274C \u53D1\u751F\u672A\u77E5\u9519\u8BEF",internal:"\u274C \u5185\u90E8\u9519\u8BEF [{code}]: {msg}",cancel:"\u{1F6AB} {msg}"}},init:{desc:"\u521D\u59CB\u5316 Architext \u6846\u67B6\uFF0C\u914D\u7F6E\u7F16\u8F91\u5668\u89C4\u5219\u548C\u6587\u6863\u9AA8\u67B6",editor:"\u6846\u67B6\u76EE\u6807IDE\uFF0C\u53EF\u591A\u9009\uFF0C\u9017\u53F7\u5206\u9694",lang:"\u89C4\u5219\u4E0E\u6587\u6863\u9AA8\u67B6\u8BED\u8A00",doc:"\u81EA\u5B9A\u4E49\u6587\u6863\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4F7F\u7528.architext",type:"\u9879\u76EE\u7C7B\u578B (web|fullstack|api|cli|lib|mobile|miniapp|desktop|web-desktop|extension|realtime|ai-agent|hybrid)",failed:"\u521D\u59CB\u5316\u5931\u8D25"},update:{desc:"\u540C\u6B65\u6700\u65B0\u89C4\u5219\uFF0C\u66F4\u65B0\u7F16\u8F91\u5668\u89C4\u5219\u548C\u6587\u6863\u9AA8\u67B6",dry_run:"\u9884\u6F14\u6A21\u5F0F\uFF0C\u4E0D\u5B9E\u9645\u6267\u884C\u66F4\u65B0\u64CD\u4F5C\uFF0C\u4EC5\u663E\u793A\u66F4\u65B0\u5185\u5BB9",failed:"\u5347\u7EA7\u5931\u8D25",dry_run_msg:"\u{1F50D} \u9884\u6F14\u6A21\u5F0F\u5DF2\u542F\u7528\u3002",construction:"\u66F4\u65B0\u529F\u80FD\u6B63\u5728\u5EFA\u8BBE\u4E2D..."},uninstall:{desc:"\u79FB\u9664 Architext \u6846\u67B6\u53CA\u5176\u751F\u6210\u7684\u6587\u4EF6"},doctor:{desc:"\u9879\u76EE\u5065\u5EB7\u68C0\u67E5\uFF1A\u914D\u7F6E\u3001\u76EE\u5F55\u7ED3\u6784\u3001\u5168\u5C40\u6587\u6863\u4E0E IDE \u89C4\u5219",failed:"\u73AF\u5883\u81EA\u68C0\u5931\u8D25",success:"\u7CFB\u7EDF\u68C0\u67E5\u901A\u8FC7\uFF1A\u4E00\u5207\u6B63\u5E38"},task:{desc:"\u7BA1\u7406\u9879\u76EE Roadmap \u4EFB\u52A1",status:"\u66F4\u65B0\u4EFB\u52A1\u72B6\u6001 (pending|active|done|blocked)",check:"\u68C0\u67E5 Roadmap \u4E00\u81F4\u6027"},plan:{desc:"\u68C0\u67E5\u529F\u80FD\u5B9E\u73B0\u8BA1\u5212 (plan.json) \u7684\u5B8C\u6210\u5EA6",id_required:"\u8BF7\u6307\u5B9A Task ID (\u4F8B\u5982: archi plan SUB-01)"},render:{desc:"\u5C06 JSON \u6570\u636E\u6587\u4EF6\u6E32\u67D3\u4E3A Markdown \u89C6\u56FE"},template:{desc:"\u83B7\u53D6\u6A21\u677F\u6587\u4EF6\u5230\u9879\u76EE\u6839\u76EE\u5F55"},help:{desc:"\u663E\u793A Architext \u547D\u4EE4\u5E2E\u52A9\u4FE1\u606F"},scaffold:{fallback:"\u672A\u627E\u5230 {lang} \u6A21\u677F\uFF0C\u56DE\u9000\u4F7F\u7528 'zh'",step_docs:"\u6B63\u5728\u521D\u59CB\u5316\u6587\u6863\u9AA8\u67B6...",step_rules:"\u6B63\u5728\u5B89\u88C5\u6838\u5FC3\u89C4\u5219...",step_ide:"\u6B63\u5728\u5206\u53D1 IDE \u89C4\u5219...",step_processing:"\u6B63\u5728\u5904\u7406 {group}...",complete:"\u811A\u624B\u67B6\u751F\u6210\u5B8C\u6210\u3002"},templates:{error:{root_not_found:"\u672A\u627E\u5230\u6A21\u677F\u76EE\u5F55\u3002\u5DF2\u641C\u7D22\u8DEF\u5F84: {paths}"}},command:{init:{title:"\u521D\u59CB\u5316 Architext \u6846\u67B6\uFF0C\u7528\u4E8E\u90E8\u7F72\u6807\u51C6\u5316\u7684 AI \u4E0A\u4E0B\u6587\u534F\u8BAE\u4E0E IDE \u89C4\u5219\u3002",select_editor:"\u8BF7\u9009\u62E9\u60A8\u7684\u76EE\u6807\u7F16\u8F91\u5668",select_lang:"\u8BF7\u9009\u62E9\u9879\u76EE\u6587\u6863\u8BED\u8A00",select_type:"\u8BF7\u9009\u62E9\u9879\u76EE\u7C7B\u578B",select_doc_dir:"\u8BF7\u8F93\u5165\u6587\u6863\u76EE\u5F55",config_exists:"\u68C0\u6D4B\u5230\u73B0\u6709\u914D\u7F6E\u6587\u4EF6 (architext.json)\u3002\u662F\u5426\u8986\u76D6\uFF1F",config_saved:"\u914D\u7F6E\u5DF2\u4FDD\u5B58\u5230 architext.json",conflict_title:"\u26A0\uFE0F \u68C0\u6D4B\u5230\u6587\u4EF6\u51B2\u7A81",conflict_msg:"\u4EE5\u4E0B\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u5C06\u5982\u4F55\u5904\u7406\uFF1F",conflict_more:" ... (\u8FD8\u6709 {count} \u4E2A\u6587\u4EF6)",conflict_overwrite:"\u8986\u76D6",conflict_skip:"\u8DF3\u8FC7",conflict_cancel:"\u53D6\u6D88",installing:"\u6B63\u5728\u590D\u5236\u6587\u4EF6...",cancel:"\u5DF2\u53D6\u6D88\u521D\u59CB\u5316",failed:"\u521D\u59CB\u5316\u5931\u8D25",success:"Architext \u521D\u59CB\u5316\u6210\u529F\uFF01 \u{1F680}"},uninstall:{desc:"\u79FB\u9664 Architext \u6846\u67B6\u53CA\u5176\u751F\u6210\u7684\u6587\u4EF6",title:"Architext \u5378\u8F7D\u5411\u5BFC",confirm_title:"\u26A0\uFE0F \u5371\u9669\u64CD\u4F5C\u8B66\u544A",confirm_msg:"\u6B64\u64CD\u4F5C\u5C06\u6C38\u4E45\u5220\u9664\u4EE5\u4E0B\u5185\u5BB9\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F",files_to_delete:"\u5C06\u5220\u9664\u7684\u6587\u4EF6/\u76EE\u5F55\uFF1A",done:"\u5378\u8F7D\u5B8C\u6210",success:"Architext \u5DF2\u6210\u529F\u79FB\u9664\u3002",error:"\u5378\u8F7D\u8FC7\u7A0B\u4E2D\u53D1\u751F\u9519\u8BEF\u3002",cancel:"\u5DF2\u53D6\u6D88\u5378\u8F7D\u3002",not_found:"\u672A\u627E\u5230\u914D\u7F6E\u6587\u4EF6 (architext.json)\uFF0C\u65E0\u6CD5\u81EA\u52A8\u5378\u8F7D\u3002",cleaning:"\u6B63\u5728\u6E05\u7406..."},task:{check:{invalid_dep:"\u4EFB\u52A1 [{id}] \u7684\u4F9D\u8D56\u65E0\u6548: [{depId}] \u4E0D\u5B58\u5728\u4E8E\u4EFB\u52A1\u5217\u8868\u4E2D",consistent:"Roadmap \u4E00\u81F4\u6027\u68C0\u67E5\u901A\u8FC7\u3002"},update:{id_required:"\u66F4\u65B0\u72B6\u6001\u9700\u8981\u6307\u5B9A\u4EFB\u52A1 ID\u3002\u7528\u6CD5: architext task <id> --status <status>",updating:"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1 [{id}] \u72B6\u6001\u4E3A {status}...",done:"\u4EFB\u52A1 [{id}] -> {status}",unblocked:"\u4EFB\u52A1 [{id}] \u5DF2\u89E3\u9501 -> pending (\u6240\u6709\u4F9D\u8D56\u5DF2\u5B8C\u6210)"},list:{empty:"Roadmap \u4E2D\u672A\u627E\u5230\u4EFB\u52A1\u3002",title:"\u9879\u76EE Roadmap \u72B6\u6001"}},plan:{title:"Plan \u68C0\u67E5: {id} {name}",section_pass:"[{done}/{total}]",section_manual:"[{done}/{total}] (\u8DF3\u8FC7 \u2014 \u4EBA\u5DE5\u9A8C\u6536)",unchecked_item:" L{line}: {content}",total:"\u5408\u8BA1: {done}/{total} ({percent}%)",all_done:"\u6240\u6709\u81EA\u52A8\u5316\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF01",remaining:"\u5269\u4F59 {count} \u4E2A\u4EFB\u52A1\u672A\u5B8C\u6210",empty:"Plan \u6587\u4EF6\u4E2D\u6CA1\u6709 checkbox \u4EFB\u52A1",not_found:"\u672A\u627E\u5230 [{id}] \u7684\u5B9E\u73B0\u8BA1\u5212\u6587\u4EF6 (plan.json)"},template:{usage:"\u7528\u6CD5: npx archi template <name> \u53EF\u7528\u6A21\u677F:",unknown:'\u672A\u77E5\u6A21\u677F "{name}"\u3002\u53EF\u7528\u6A21\u677F: {available}',exists:"{path} \u5DF2\u5B58\u5728\uFF0C\u8DF3\u8FC7\u3002\u5982\u9700\u8986\u76D6\u8BF7\u5148\u5220\u9664\u3002",done:"\u5DF2\u751F\u6210 {path}\uFF0C\u586B\u5199\u540E\u8FD0\u884C /archi.scope \u5F00\u59CB\u5206\u89E3\u3002",not_found:"\u6A21\u677F\u6587\u4EF6 {name} \u672A\u627E\u5230\u3002\u8BF7\u5148\u8FD0\u884C npx archi init\u3002"},render:{empty:"\u672A\u627E\u5230\u53EF\u6E32\u67D3\u7684 JSON \u6570\u636E\u6587\u4EF6\u3002",done:"\u6E32\u67D3\u5B8C\u6210\uFF0C\u5171\u751F\u6210 {count} \u4E2A Markdown \u89C6\u56FE\u3002",plan:{header_comment:"<!-- \u26A0\uFE0F \u7531 plan.json \u81EA\u52A8\u751F\u6210 \u2014 \u8BF7\u52FF\u76F4\u63A5\u7F16\u8F91 -->",header_ai:"<!-- AI: \u8BF7\u8BFB\u53D6 plan.json \u800C\u975E\u6B64\u6587\u4EF6 -->",title:"\u5B9E\u65BD\u8BA1\u5212\uFF1A{featureName}",feature_id:"Task ID",status:"\u72B6\u6001",section_decisions:"\u6280\u672F\u51B3\u7B56",section_steps:"\u5B9E\u65BD\u6B65\u9AA4",section_tests:"\u6D4B\u8BD5\u8BA1\u5212",subsection_automated:"\u81EA\u52A8\u5316\u6D4B\u8BD5",subsection_manual:"\u4EBA\u5DE5\u9A8C\u6536"},roadmap:{header_comment:"<!-- \u26A0\uFE0F \u7531 roadmap.json \u81EA\u52A8\u751F\u6210 \u2014 \u8BF7\u52FF\u76F4\u63A5\u7F16\u8F91 -->",header_ai:"<!-- AI: \u8BF7\u8BFB\u53D6 roadmap.json \u800C\u975E\u6B64\u6587\u4EF6 -->",title:"\u9879\u76EE Roadmap",status:"\u72B6\u6001",updated:"\u66F4\u65B0\u4E8E",phase:"\u9636\u6BB5",goal:"\u76EE\u6807",dep:"\u4F9D\u8D56",dep_none:"\u65E0",tag:"\u6807\u7B7E",slug:"\u76EE\u5F55"}},update:{title:"Architext \u5347\u7EA7\u5411\u5BFC",no_config:"\u672A\u627E\u5230\u914D\u7F6E\u6587\u4EF6 (architext.json)\uFF0C\u8BF7\u5148\u8FD0\u884C npx archi init",cancel:"\u5DF2\u53D6\u6D88\u66F4\u65B0",success:"\u66F4\u65B0\u5B8C\u6210\uFF01",failed:"\u66F4\u65B0\u5931\u8D25",version_checking:"\u68C0\u67E5\u6700\u65B0\u7248\u672C...",version_check_skip:"\u7248\u672C\u68C0\u67E5\u5DF2\u8DF3\u8FC7\uFF08\u7F51\u7EDC\u4E0D\u53EF\u7528\uFF09",version_outdated:"\u53D1\u73B0\u65B0\u7248 v{latest}\uFF08\u5F53\u524D v{current}\uFF09",version_upgrade_hint:"\u5347\u7EA7\u547D\u4EE4: {cmd}",version_up_to_date:"\u5DF2\u662F\u6700\u65B0\u7248 v{version}",updating_silent:"\u66F4\u65B0\u63D0\u793A\u8BCD\u6A21\u677F\u4E0E\u6587\u6863\u6A21\u677F...",updated_silent:"\u5DF2\u66F4\u65B0 {count} \u4E2A\u6A21\u677F\u6587\u4EF6",rules_overwrite_warning:"\u4EE5\u4E0B\u6846\u67B6\u89C4\u5219\u6587\u4EF6\u5C06\u88AB\u5B8C\u5168\u8986\u76D6\uFF0C\u5982\u6709\u81EA\u5B9A\u4E49\u4FEE\u6539\u8BF7\u5148\u624B\u52A8\u5907\u4EFD\uFF1A",rules_confirm:"\u786E\u8BA4\u8986\u76D6\u4EE5\u4E0A\u89C4\u5219\u6587\u4EF6\uFF1F",schema_auditing:"Schema \u517C\u5BB9\u6027\u5BA1\u8BA1...",summary:"\u66F4\u65B0\u6C47\u603B",summary_updated:"\u5DF2\u66F4\u65B0\u89C4\u5219: {list}",summary_templated:"\u65B0\u7248\u6A21\u677F \u2192 {docDir}/templates/02_tech_stack.template.md\uFF08\u8BF7\u624B\u52A8\u5408\u5E76\uFF09",summary_skipped:"\u5DF2\u8DF3\u8FC7: {list}",schema:{parse_error:"JSON \u89E3\u6790\u5931\u8D25\uFF0C\u6587\u4EF6\u53EF\u80FD\u5DF2\u635F\u574F",version_too_new:"\u6587\u4EF6\u7248\u672C (v{current}) \u9AD8\u4E8E CLI \u671F\u671B\u7248\u672C (v{expected})\uFF0C\u8BF7\u5148\u5347\u7EA7 CLI",roadmap_migrated:"{file}: \u5DF2\u4ECE v{from} \u8FC1\u79FB\u81F3 v{to}",roadmap_ok:"{file}: \u7ED3\u6784\u517C\u5BB9",roadmap_error:"{file}: \u7ED3\u6784\u4E0D\u517C\u5BB9",no_plans:"\u672A\u627E\u5230 plan.json \u6587\u4EF6\uFF0C\u8DF3\u8FC7\u5BA1\u8BA1",plans_ok:"\u6240\u6709 {count} \u4E2A plan.json \u7ED3\u6784\u517C\u5BB9",plan_error:"{file}: \u7ED3\u6784\u4E0D\u517C\u5BB9\uFF08\u8BF7\u624B\u52A8\u68C0\u67E5\uFF09"}},doctor:{title:"Architext \u9879\u76EE\u5065\u5EB7\u68C0\u67E5",no_config:"\u672A\u627E\u5230\u914D\u7F6E\u6587\u4EF6\uFF0C\u540E\u7EED\u68C0\u67E5\u5DF2\u8DF3\u8FC7",group:{config:"\u9879\u76EE\u914D\u7F6E",doc_structure:"\u6587\u6863\u76EE\u5F55\u7ED3\u6784",global_files:"\u5168\u5C40\u6587\u6863",ide_rules:"IDE \u89C4\u5219"},summary:{result:"\u7ED3\u679C: {parts}",passed:"{n} \u901A\u8FC7",warned:"{n} \u8B66\u544A",failed:"{n} \u5931\u8D25"},success:"\u9879\u76EE\u5065\u5EB7\u68C0\u67E5\u901A\u8FC7\uFF0C\u4E00\u5207\u6B63\u5E38",with_warnings:"\u68C0\u67E5\u5B8C\u6210\uFF0C\u5B58\u5728\u8B66\u544A\uFF0C\u5EFA\u8BAE\u5173\u6CE8",with_errors:"\u68C0\u67E5\u5B8C\u6210\uFF0C\u5B58\u5728\u95EE\u9898\uFF0C\u8BF7\u4FEE\u590D\u540E\u91CD\u8BD5",check:{config:{not_found:"\u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728",hint_init:"\u8FD0\u884C npx archi init \u521D\u59CB\u5316\u9879\u76EE",format_label:"\u914D\u7F6E\u6587\u4EF6\u683C\u5F0F",format_fail:"JSON \u89E3\u6790\u5931\u8D25\uFF0C\u6587\u4EF6\u53EF\u80FD\u5DF2\u635F\u574F",editors_label:"\u7F16\u8F91\u5668\u914D\u7F6E",editors_empty:"\u672A\u914D\u7F6E\u4EFB\u4F55\u7F16\u8F91\u5668",editors_invalid:"\u542B\u65E0\u6548\u7F16\u8F91\u5668: {list}",editors_ok:"\u7F16\u8F91\u5668: {list}",lang_label:"\u8BED\u8A00\u914D\u7F6E",lang_invalid:"\u4E0D\u652F\u6301\u7684\u8BED\u8A00: {lang}",lang_ok:"\u8BED\u8A00: {lang}",doc_dir:"\u6587\u6863\u76EE\u5F55: {dir}",doc_dir_unset:"(\u672A\u8BBE\u7F6E)",doc_dir_empty:"docDir \u5B57\u6BB5\u4E3A\u7A7A"},dir:{missing:"\u76EE\u5F55\u4E0D\u5B58\u5728",hint_init:"\u8FD0\u884C npx archi init \u91CD\u65B0\u521D\u59CB\u5316",hint_update:"\u8FD0\u884C npx archi update \u6062\u590D",hint_features:"\u624B\u52A8\u521B\u5EFA\u5373\u53EF\uFF1Amkdir {docDir}/tasks",hint_tasks:"\u624B\u52A8\u521B\u5EFA\u5373\u53EF\uFF1Amkdir {docDir}/tasks"},global:{required_missing:"\u5FC5\u8981\u6587\u6863\u7F3A\u5931",optional_missing:"\u6587\u6863\u7F3A\u5931\uFF08\u4E0D\u5F71\u54CD\u8FD0\u884C\uFF09",parse_fail:"JSON \u89E3\u6790\u5931\u8D25",roadmap_ok:"roadmap.json (Schema v{version} \u517C\u5BB9)",roadmap_hint:"\u8FD0\u884C npx archi update \u5C1D\u8BD5\u81EA\u52A8\u4FEE\u590D"},rules:{dir_missing:"\u89C4\u5219\u76EE\u5F55\u4E0D\u5B58\u5728",dir_hint:"\u8FD0\u884C npx archi update \u6062\u590D\u89C4\u5219\u6587\u4EF6",file_missing:"\u89C4\u5219\u6587\u4EF6\u7F3A\u5931",file_hint:"\u8FD0\u884C npx archi update \u6062\u590D"}}},help:{tagline:"No Docs, No Code. \u2014 AI \u539F\u751F\u67B6\u6784\u534F\u8BAE",section:{ai:"AI Commands (\u5728 Chat \u4E2D\u4F7F\u7528)",cli:"CLI Commands (\u5728\u7EC8\u7AEF\u4E2D\u4F7F\u7528)",quick:"Quick Start (\u5FEB\u901F\u51B3\u7B56)",workflow:"Typical Workflow (\u5178\u578B\u5DE5\u4F5C\u6D41)"},ai:{start:{desc:"\u65B0\u9879\u76EE\u51B7\u542F\u52A8\u3002\u901A\u8FC7\u8BBF\u8C08\u786E\u7ACB\u613F\u666F\u3001\u6280\u672F\u6808\uFF0C\u751F\u6210\u6587\u6863\u9AA8\u67B6\u3002",detail:"\u4EA7\u51FA: Vision + Tech Stack + Roadmap + \u5168\u5C40\u6587\u6863\u9AA8\u67B6",example:"\u4F8B: /archi.start \u6211\u8981\u505A\u4E00\u4E2A Todo CLI \u5DE5\u5177\uFF0C\u7528 Rust \u5199"},inherit:{desc:"\u63A5\u7BA1\u65E7\u9879\u76EE\u3002\u5168\u91CF\u626B\u63CF\u4EE3\u7801\uFF0C\u9006\u5411\u63A8\u5BFC\u67B6\u6784\uFF0C\u586B\u5145\u5168\u5C40\u6587\u6863\u3002",detail:"\u9002\u7528\u4E8E\u5DF2\u6709\u4EE3\u7801\u5E93\u4F46\u7F3A\u5C11 Architext \u6587\u6863\u7684\u9879\u76EE"},scope:{desc:"\u9700\u6C42\u5206\u89E3\u3002\u8BFB\u53D6 Scope Brief\uFF0C\u5C06\u5927\u9700\u6C42\u62C6\u89E3\u4E3A\u591A\u4E2A Roadmap \u4EFB\u52A1\u5E76\u5EFA\u7ACB\u4F9D\u8D56\u5173\u7CFB\u3002",detail:"\u4EA7\u51FA: \u591A\u4E2A Roadmap \u4EFB\u52A1 (\u542B ID/\u76EE\u6807/\u4F9D\u8D56)\u3002\u65E0 Brief \u65F6\u81EA\u52A8\u8FDB\u5165\u8BBF\u8C08\u6A21\u5F0F",example:"\u4F8B: /archi.scope scope-brief.md"},plan:{desc:"\u529F\u80FD\u6DF1\u5EA6\u89C4\u5212\u3002\u5BF9 Roadmap \u4E2D\u5DF2\u6709\u4EFB\u52A1\u505A\u67B6\u6784\u8BBF\u8C08\uFF0C\u751F\u6210\u5B8C\u6574\u6587\u6863\u3002",detail:"\u4EA7\u51FA: Spec (\u529F\u80FD\u903B\u8F91) + UI (\u89C6\u89C9\u8BBE\u8BA1, \u5982\u9002\u7528) + Plan (\u5B9E\u65BD\u6B65\u9AA4)",example1:"\u4F8B: /archi.plan INF-001 \u9700\u8981\u652F\u6301 OAuth \u767B\u5F55",example2:"\u4F8B: /archi.plan FEAT-01"},code:{desc:"\u5C06\u6587\u6863\u7FFB\u8BD1\u4E3A\u4EE3\u7801\u3002\u8BFB\u53D6 Plan\uFF0C\u9010\u6B65\u5B9E\u73B0\uFF0C\u542B\u9759\u6001\u68C0\u67E5\u4E0E\u5BA1\u8BA1\u3002",detail:"\u524D\u7F6E: \u5BF9\u5E94 Task \u987B\u6709\u5B8C\u6574\u7684 Spec + Plan",example:"\u4F8B: /archi.code INF-001"},audit:{desc:"\u72EC\u7ACB\u6DF1\u5EA6\u4EE3\u7801\u5BA1\u67E5\u3002\u627E Bug\u3001\u627E\u7F3A\u6F0F\u3001\u67E5\u5408\u89C4\u3002",detail:"\u5E26 ID: \u5BA1\u67E5\u6307\u5B9A\u4EFB\u52A1\u7684\u4EE3\u7801\u5B9E\u73B0 | \u65E0 ID: \u9879\u76EE\u7EA7\u5065\u5EB7\u4F53\u68C0",example1:"\u4F8B: /archi.audit INF-001",example2:"\u4F8B: /archi.audit"},fix:{desc:"\u4FEE\u590D Bug\uFF08\u975E\u9700\u6C42\u53D8\u66F4\uFF09\u3002\u8BCA\u65AD\u9519\u8BEF\u5E76\u4FEE\u590D\u4EE3\u7801\uFF0C\u901A\u5E38\u4E0D\u6539 Spec\u3002",detail:"\u81EA\u52A8\u8BB0\u5F55\u4FEE\u590D\u8FC7\u7A0B\u5230 Plan\uFF0C\u4FDD\u6301\u6587\u6863\u4E00\u81F4\u6027",example:"\u4F8B: /archi.fix INF-001 \u767B\u5F55\u65F6\u62A5 403 \u9519\u8BEF"},edit:{desc:"\u5C40\u90E8\u9700\u6C42\u53D8\u66F4\u3002\u5148\u6539 Spec/UI \u6587\u6863\uFF0C\u518D\u540C\u6B65\u4FEE\u6539\u4EE3\u7801\u3002",detail:"\u53D8\u66F4\u94FE\u8DEF: \u66F4\u65B0 Spec/UI --> \u8FFD\u52A0 Plan \u6B65\u9AA4 --> \u4FEE\u6539\u4EE3\u7801",example:"\u4F8B: /archi.edit INF-001 \u589E\u52A0\u8BB0\u4F4F\u5BC6\u7801\u529F\u80FD"},revise:{desc:"\u5168\u5C40\u53D8\u66F4\uFF08\u6280\u672F\u6808\u3001\u67B6\u6784\u7B49\uFF09\u3002\u5206\u6790\u5F71\u54CD\u8303\u56F4\uFF0C\u7ECF\u786E\u8BA4\u540E\u7EA7\u8054\u66F4\u65B0\u76F8\u5173 Task\u3002",detail:"\u5F71\u54CD\u8303\u56F4: Vision / Tech Stack / Roadmap / \u76F8\u5173 Task \u6587\u6863",example:"\u4F8B: /archi.revise \u4ECE REST \u8FC1\u79FB\u5230 GraphQL"},map:{desc:"\u5237\u65B0\u67B6\u6784\u5730\u56FE\u3002\u91CD\u65B0\u626B\u63CF\u76EE\u5F55\u6811\uFF0C\u66F4\u65B0 map.json\u3002",detail:"\u5F53\u76EE\u5F55\u7ED3\u6784\u53D1\u751F\u53D8\u5316\u65F6\u4F7F\u7528\uFF0C\u4FDD\u6301 map.json \u4E0E\u5B9E\u9645\u6587\u4EF6\u7CFB\u7EDF\u540C\u6B65"},remove:{desc:"\u7279\u6027\u4E0B\u7EBF\u3002\u5168\u94FE\u8DEF\u6E05\u9664\uFF1A\u5F71\u54CD\u5206\u6790 \u2192 \u5220\u9664\u6587\u6863+\u4EE3\u7801 \u2192 \u6E05\u7406\u5168\u5C40\u5F15\u7528\u3002",detail:"\u6E05\u7406\u8303\u56F4: Task \u6587\u6863 / \u4E1A\u52A1\u4EE3\u7801 / roadmap / map / context_glue",example:"\u4F8B: /archi.remove FEAT-003"},help:{desc:"\u9879\u76EE\u5BFC\u822A\u4E0E\u4E0A\u4E0B\u6587\u95EE\u7B54\u3002\u5206\u6790\u9879\u76EE\u72B6\u6001\uFF0C\u5EFA\u8BAE\u4E0B\u4E00\u6B65\u64CD\u4F5C\u3002",detail:"\u65E0\u53C2\u6570\u65F6\u667A\u80FD\u63A8\u8350\u4E0B\u4E00\u6B65\uFF1B\u5E26\u95EE\u9898\u65F6\u57FA\u4E8E\u9879\u76EE\u4E0A\u4E0B\u6587\u56DE\u7B54",example1:"\u4F8B: /archi.help",example2:"\u4F8B: /archi.help \u8FD9\u4E2A\u9879\u76EE\u7684\u6570\u636E\u6A21\u578B\u957F\u4EC0\u4E48\u6837\uFF1F"}},cli:{init:{desc:"\u521D\u59CB\u5316 Architext \u6846\u67B6\u3002\u751F\u6210\u89C4\u5219\u6587\u4EF6\u3001\u6587\u6863\u76EE\u5F55\u3001Prompt \u6A21\u677F\u3001Project Brief\u3002",editor:"\u6307\u5B9A IDE (cursor / trae / windsurf)",lang:"\u6307\u5B9A\u8BED\u8A00 (zh / en / zh-Hant)",doc:"\u81EA\u5B9A\u4E49\u6587\u6863\u76EE\u5F55\u540D (\u9ED8\u8BA4 .architext)",type:"\u9879\u76EE\u7C7B\u578B (web / fullstack / api / cli / lib / mobile / miniapp / desktop / web-desktop / extension / realtime / ai-agent / hybrid)"},update:{desc:"\u540C\u6B65\u6700\u65B0\u89C4\u5219\u6A21\u677F\u5230\u9879\u76EE\uFF0C\u4FDD\u6301\u89C4\u5219\u6587\u4EF6\u4E0E\u6846\u67B6\u7248\u672C\u4E00\u81F4\u3002",dry_run:"\u4EC5\u9884\u89C8\u53D8\u66F4\uFF0C\u4E0D\u5B9E\u9645\u5199\u5165"},doctor:{desc:"\u53EA\u8BFB\u5065\u5EB7\u626B\u63CF\uFF1A\u914D\u7F6E\u6709\u6548\u6027\u3001\u76EE\u5F55\u5B8C\u6574\u6027\u3001\u5168\u5C40\u6587\u6863 Schema\u3001IDE \u89C4\u5219\u6587\u4EF6\u3002"},task:{desc:"\u7BA1\u7406 Roadmap \u4EFB\u52A1\u3002\u67E5\u770B\u8FDB\u5EA6\u3001\u66F4\u65B0\u72B6\u6001\u3001\u68C0\u67E5\u4F9D\u8D56\u4E00\u81F4\u6027\u3002",detail:"\u65E0\u53C2\u6570: \u5217\u51FA\u6240\u6709\u4EFB\u52A1 | --check: \u68C0\u67E5\u4F9D\u8D56\u4E00\u81F4\u6027",example:"\u4F8B: npx archi task INF-001 --status done"},plan:{desc:"\u68C0\u67E5\u6307\u5B9A Task \u7684 Plan \u5B8C\u6210\u5EA6\uFF08\u81EA\u52A8\u8BC6\u522B\u4EBA\u5DE5\u9A8C\u6536\u533A\u57DF\uFF09\u3002",example:"\u4F8B: npx archi plan INF-001"},render:{desc:"\u5C06 JSON \u6570\u636E\u6587\u4EF6 (roadmap/plan) \u6E32\u67D3\u4E3A\u4EBA\u7C7B\u53EF\u8BFB\u7684 Markdown \u89C6\u56FE\u3002"},template:{desc:"\u83B7\u53D6\u6A21\u677F\u6587\u4EF6\u5230\u9879\u76EE\u6839\u76EE\u5F55\u4F9B\u586B\u5199\u3002",example:"\u4F8B: npx archi template scope-brief"},uninstall:{desc:"\u79FB\u9664 Architext \u6846\u67B6\u53CA\u5176\u751F\u6210\u7684\u6240\u6709\u6587\u4EF6\uFF08\u89C4\u5219\u3001\u6587\u6863\u3001\u914D\u7F6E\uFF09\u3002"}},quick:{new_project:"\u65B0\u9879\u76EE\u4ECE\u96F6\u5F00\u59CB",legacy:"\u63A5\u7BA1\u65E7\u9879\u76EE",new_feature:"\u89C4\u5212\u65B0\u4EFB\u52A1",write_code:"\u5B9E\u73B0\u4EE3\u7801",fix_bug:"\u4FEE\u590D Bug",check_health:"\u68C0\u67E5\u9879\u76EE\u5065\u5EB7"},workflow:{init_flow:"\u9996\u6B21\u542F\u52A8:",new_feature:"\u65B0\u589E\u4EFB\u52A1:",change_spec:"\u9700\u6C42\u53D8\u66F4:",standalone:"\u72EC\u7ACB\u64CD\u4F5C:"}}}};var st={zh:Dt,"zh-Hant":Et,en:Tt};function Se(e,t){if(e)return t.split(".").reduce((a,i)=>{if(a!=null&&typeof a=="object")return a[i]},e)}function g(){let e=process.env.ARCHITEXT_LANG;if(e&&(e==="zh-Hant"||e==="zh"||e==="en"))return e;let t=new Intl.DateTimeFormat().resolvedOptions().locale;return["zh-Hant","zh-TW","zh-HK","zh-MO"].some(a=>t.startsWith(a))?"zh-Hant":t.startsWith("zh")?"zh":"en"}function u(e="zh",t){let a=st[e]||st.zh,i=st.en,o=t?Se(a,t):a,n=t?Se(i,t):i;return(r,s)=>{let c;return t?c=Se(o,r)||Se(n,r):c=Se(a,r)||Se(i,r),c?s?String(c).replace(/\{(\w+)\}/g,(d,m)=>s[m]!==void 0?String(s[m]):d):String(c):r}}import ue from"fs-extra";import W from"path";var $e=["00_system.md","01_workflow.md","02_tech_stack.md","03_data_governance.md","04_cli_tools.md","90_custom_rules.md","99_context_glue.md"],O={DEFAULT_DOC_DIR:".architext",PATHS:{DOCS_SOURCE:"docs",RULES_SOURCE:"rules",RULES_TARGET:"rules",PROMPTS_SOURCE:"docs/prompts",BRIEFS_SOURCE:"briefs",SKILLS_SOURCE:"skills",SKILLS_DOC_TARGET:"skills"},PLACEHOLDERS:{DOCS_DIR:"[[__DOCS_DIR__]]",PROJECT_TYPE:"[[__PROJECT_TYPE__]]"}},rt={zh:{label:"\u4E2D\u6587"},"zh-Hant":{label:"\u4E2D\u6587\uFF08\u7E41\u4F53\uFF09"},en:{label:"English"}},I={cursor:{label:"Cursor",targetDir:".cursor/rules",targetExt:".mdc",commands:{targetDir:".cursor/commands"},skills:{targetDir:".cursor/skills"}},windsurf:{label:"Windsurf",targetDir:".windsurf/rules",targetExt:".md",skills:{targetDir:".windsurf/skills"}},trae:{label:"Trae",targetDir:".trae/rules",targetExt:".md",skills:{targetDir:".trae/skills"}},vscode:{label:"VS Code",targetDir:".github/instructions",targetExt:".instructions.md",skills:{targetDir:".github/skills"}}},Re=Object.keys(I),le={web:{label:"Web SPA / PWA",features:["ui","data"]},fullstack:{label:"\u5168\u6808 Web (SSR/SSG)",features:["ui","data","api"]},api:{label:"API \u670D\u52A1 (REST/GraphQL)",features:["api","data"]},cli:{label:"CLI \u5DE5\u5177",features:["cli"]},lib:{label:"\u5E93 / SDK / NPM \u5305",features:["lib"]},mobile:{label:"\u79FB\u52A8\u7AEF App (RN/Flutter/Expo)",features:["data","mobile"]},miniapp:{label:"\u5C0F\u7A0B\u5E8F (\u5FAE\u4FE1/\u652F\u4ED8\u5B9D/uni-app)",features:["data","miniapp"]},desktop:{label:"\u684C\u9762\u7AEF App (Electron/Tauri)",features:["ui","data","desktop"]},"web-desktop":{label:"Web + \u684C\u9762\u7AEF (Hybrid)",features:["ui","data","api","desktop"]},extension:{label:"\u6D4F\u89C8\u5668\u6269\u5C55 (Chrome/Firefox)",features:["extension"]},realtime:{label:"\u5B9E\u65F6/\u534F\u4F5C\u578B App",features:["ui","data","api","realtime"]},"ai-agent":{label:"AI Agent / MCP \u5DE5\u5177",features:["api","ai"]},hybrid:{label:"\u5168\u901A\u7528\u7279\u5F81 (\u5176\u4ED6\u7C7B\u578B\u4E0D\u7B26\u65F6\u9009\u6B64\u9879)",features:["ui","data","cli","lib","api"]}},ct=Object.keys(le),Ne={"scope-brief":{file:"scope-brief.template.md",output:"scope-brief.md"}},Rt="_base.md",vt="_modules.md",Pt="project-brief.md";function Ct(e,t){return e=e.replace(/\[\[SKILL: ([^\]]+)\]\]/g,(a,i)=>t.hasSkills?i:""),e=e.replace(/\[\[NO-SKILL: ([^\]]+)\]\]/g,(a,i)=>t.hasSkills?"":i),e}import{ZodError as Ka}from"zod";var x=class extends Error{code;isUserError;constructor(t,a="INTERNAL_ERROR",i=!1){super(t),this.name="AppError",this.code=a,this.isUserError=i}},ae=class extends x{constructor(t="Operation cancelled"){super(t,"USER_CANCEL",!0)}};var ve=class extends x{constructor(t){super(t,"CONFIG_PARSE_ERROR",!0)}},Fe=class extends x{constructor(){super("Roadmap file not found. Please create 'roadmap.json' or configure 'roadmap' in architext.json","ROADMAP_NOT_FOUND",!0)}},Ue=class extends x{constructor(t){super(`Task [${t}] not found.`,"TASK_NOT_FOUND",!0)}},Me=class extends x{constructor(t){super(`Invalid status: '${t}'. Valid values: pending, active, done, blocked`,"INVALID_TASK_STATUS",!0)}},pe=class extends x{constructor(t){super(`Plan file not found for task [${t}]. Expected at: {docDir}/tasks/${t}_*/plan.json`,"PLAN_NOT_FOUND",!0)}},ze=class extends x{issues;constructor(t){super(`Roadmap has ${t.length} inconsistencies.`,"ROADMAP_INCONSISTENCY",!0),this.issues=t}};import{z as P}from"zod";var jt=P.enum(["pending","active","done","blocked"]),At=P.object({id:P.string().min(1),title:P.string().min(1),status:jt,goal:P.string().optional(),deps:P.array(P.string()).optional(),tag:P.string().optional(),slug:P.string().optional()}),Ga=P.object({id:P.string().min(1),name:P.string().min(1),tasks:P.array(At)}),X=P.object({version:P.number(),projectStatus:P.string(),lastUpdated:P.string(),phases:P.array(Ga)});import{z as D}from"zod";var lt=D.object({id:D.string().min(1),title:D.string().min(1),notes:D.string().optional(),done:D.boolean()}),qa=D.object({name:D.string().min(1),tasks:D.array(lt)}),Ba=D.object({category:D.string(),choice:D.string(),rationale:D.string().optional()}),Ja=D.object({automated:D.array(lt),manual:D.array(lt)}),de=D.object({featureId:D.string().min(1),featureName:D.string().min(1),status:D.string(),decisions:D.array(Ba),phases:D.array(qa),tests:Ja});import{z as b}from"zod";var Ge=b.record(b.string(),b.unknown()),Ot=b.object({entities:b.array(Ge),verbs:b.array(Ge)}).catchall(b.unknown()),It=b.object({businessErrors:b.array(Ge)}).catchall(b.unknown()),Lt=b.object({models:b.array(Ge)}).catchall(b.unknown()),$t=b.object({semanticTokens:b.record(b.string(),b.unknown())}).catchall(b.unknown()),Nt=b.object({governance:b.record(b.string(),b.unknown())}).catchall(b.unknown()),pt={"dictionary.json":Ot,"error_codes.json":It,"data_snapshot.json":Lt,"design_tokens.json":$t,"map.json":Nt};import{z as L}from"zod";var Ft=L.enum(["trae","cursor","windsurf","vscode"]),Ut=L.enum(["ui","data","cli","lib","api","mobile","desktop","extension","miniapp","realtime","ai"]),Va=L.object({language:L.enum(["zh","zh-Hant","en"]),editors:L.array(Ft).min(1),docDir:L.string().min(1),features:L.array(Ut),projectType:L.string().optional()}),Ha=L.enum(["zh","zh-Hant","en"]),dt=L.object({language:Ha,docDir:L.string().min(1),features:L.array(Ut).optional(),roadmap:L.string().optional(),editors:L.array(Ft).min(1),version:L.string().optional(),updatedAt:L.string().min(1),lastScaffold:Va.optional()});function me(e,t,a){try{return e.parse(t)}catch(i){if(i instanceof Ka){let o=i.issues.map(n=>` - ${n.path.join(".")}: ${n.message}`).join(`
|
|
3
|
+
`);throw new x(`${a} schema validation failed:
|
|
4
|
+
${o}`,"SCHEMA_VALIDATION_ERROR",!0)}throw i}}var _=u(g(),"command.doctor");async function Mt(e){let t=[],a=W.join(e,"architext.json");if(!await ue.pathExists(a))return t.push({label:"architext.json",status:"fail",detail:_("check.config.not_found"),hint:_("check.config.hint_init")}),{config:null,results:t};t.push({label:"architext.json",status:"pass"});let i;try{i=await ue.readJSON(a)}catch{return t.push({label:_("check.config.format_label"),status:"fail",detail:_("check.config.format_fail")}),{config:null,results:t}}t.push({label:_("check.config.format_label"),status:"pass"});let o=i.editors??[],n=o.filter(c=>!Re.includes(c));o.length===0?t.push({label:_("check.config.editors_label"),status:"warn",detail:_("check.config.editors_empty")}):n.length>0?t.push({label:_("check.config.editors_label"),status:"warn",detail:_("check.config.editors_invalid",{list:n.join(", ")})}):t.push({label:_("check.config.editors_ok",{list:o.join(", ")}),status:"pass"}),["zh","zh-Hant","en"].includes(i.language)?t.push({label:_("check.config.lang_ok",{lang:i.language}),status:"pass"}):t.push({label:_("check.config.lang_label"),status:"warn",detail:_("check.config.lang_invalid",{lang:i.language})});let s=i.docDir||_("check.config.doc_dir_unset");return t.push({label:_("check.config.doc_dir",{dir:s}),status:i.docDir?"pass":"warn",detail:i.docDir?void 0:_("check.config.doc_dir_empty")}),{config:i,results:t}}async function zt(e,t){let a=[{rel:e.docDir,label:`${e.docDir}/`,required:!0,hint:_("check.dir.hint_init")},{rel:W.join(e.docDir,"global"),label:"global/",required:!0,hint:_("check.dir.hint_init")},{rel:W.join(e.docDir,"prompts"),label:"prompts/",required:!1,hint:_("check.dir.hint_update")},{rel:W.join(e.docDir,"templates"),label:"templates/",required:!1,hint:_("check.dir.hint_update")},{rel:W.join(e.docDir,"tasks"),label:"tasks/",required:!1,hint:_("check.dir.hint_tasks",{docDir:e.docDir})}],i=[];for(let o of a){let n=await ue.pathExists(W.join(t,o.rel));i.push(n?{label:o.label,status:"pass"}:{label:o.label,status:o.required?"fail":"warn",detail:_("check.dir.missing"),hint:o.hint})}return i}var Wa=[{name:"vision.md",required:!1},{name:"roadmap.json",required:!0},{name:"map.json",required:!1,schemaKey:"map.json"},{name:"dictionary.json",required:!1,schemaKey:"dictionary.json"}];async function Gt(e,t){let a=[],i=W.join(t,e.docDir,"global");for(let o of Wa){let n=W.join(i,o.name);if(!await ue.pathExists(n)){a.push({label:o.name,status:o.required?"fail":"warn",detail:o.required?_("check.global.required_missing"):_("check.global.optional_missing")});continue}if(!o.name.endsWith(".json")){a.push({label:o.name,status:"pass"});continue}let r;try{r=await ue.readJSON(n)}catch{a.push({label:o.name,status:"fail",detail:_("check.global.parse_fail")});continue}if(o.name==="roadmap.json"){let s=X.safeParse(r),c=r&&typeof r=="object"&&"version"in r?String(r.version):"?";a.push({label:s.success?_("check.global.roadmap_ok",{version:c}):"roadmap.json",status:s.success?"pass":"warn",detail:s.success?void 0:s.error.issues.map(d=>d.message).join("; "),hint:s.success?void 0:_("check.global.roadmap_hint")});continue}if(o.schemaKey){let c=pt[o.schemaKey].safeParse(r);a.push({label:o.name,status:c.success?"pass":"warn",detail:c.success?void 0:c.error.issues.map(d=>`${d.path.join(".")}: ${d.message}`).join("; ")});continue}a.push({label:o.name,status:"pass"})}return a}async function qt(e,t){let a=[];for(let i of e.editors){let o=I[i];if(!o)continue;let n=W.join(t,o.targetDir),r=await ue.pathExists(n);if(a.push({label:`[${o.label}] ${o.targetDir}/`,status:r?"pass":"fail",detail:r?void 0:_("check.rules.dir_missing"),hint:r?void 0:_("check.rules.dir_hint")}),!!r)for(let s of $e){let c=s.replace(".md",o.targetExt),d=await ue.pathExists(W.join(n,c));a.push({label:` ${c}`,status:d?"pass":"warn",detail:d?void 0:_("check.rules.file_missing"),hint:d?void 0:_("check.rules.file_hint")})}}return a}var G=u(g(),"command.doctor"),Qa={pass:v.green("\u2713"),warn:v.yellow("\u26A0"),fail:v.red("\u2717")};function Za(e){let t=Qa[e.status],a=e.status==="fail"?v.red(e.label):e.status==="warn"?v.yellow(e.label):e.label,i=e.detail?v.dim(` \u2014 ${e.detail}`):"";l.raw(` ${t} ${a}${i}`),e.hint&&l.raw(` ${v.dim(`\u2192 ${e.hint}`)}`)}function Bt(e){l.raw(`
|
|
5
|
+
${v.bold(`\u25BA ${e.title}`)}`);for(let t of e.checks)Za(t)}async function Jt(){l.clear(),Ya(v.bgCyan(v.black(` ${G("title")} `)));let e=process.cwd(),t=[],{config:a,results:i}=await Mt(e);if(t.push({title:G("group.config"),checks:i}),!a){for(let y of t)Bt(y);l.raw(""),qe(v.red(G("no_config")));return}let o=await zt(a,e);t.push({title:G("group.doc_structure"),checks:o});let n=await Gt(a,e);t.push({title:G("group.global_files"),checks:n});let r=await qt(a,e);r.length>0&&t.push({title:G("group.ide_rules"),checks:r});for(let y of t)Bt(y);let s=t.flatMap(y=>y.checks),c=s.filter(y=>y.status==="pass").length,d=s.filter(y=>y.status==="warn").length,m=s.filter(y=>y.status==="fail").length,w=[v.green(G("summary.passed",{n:c})),d>0?v.yellow(G("summary.warned",{n:d})):null,m>0?v.red(G("summary.failed",{n:m})):null].filter(Boolean).join(v.dim(" \xB7 "));l.raw(`
|
|
6
|
+
${v.dim("\u2500".repeat(48))}`),l.raw(G("summary.result",{parts:w})),m===0&&d===0?qe(v.green(G("success"))):m===0?qe(v.yellow(G("with_warnings"))):qe(v.red(G("with_errors")))}import{intro as mo,outro as ut}from"@clack/prompts";import He from"picocolors";import mt from"fs-extra";import Vt from"path";var be="architext.json";function Xa(e){let t=e.issues.map(a=>` - ${a.path.length>0?a.path.join("."):"(root)"}: ${a.message}`).join(`
|
|
7
|
+
`);return`${be} schema validation failed:
|
|
8
|
+
${t}`}async function $(e=process.cwd()){let t=Vt.join(e,be);if(!await mt.pathExists(t))return null;let a;try{a=await mt.readJSON(t)}catch(o){throw o instanceof SyntaxError?new ve(`Failed to parse ${be}: ${o.message}`):o}let i=dt.safeParse(a);if(!i.success)throw new ve(Xa(i.error));return i.data}async function Ht(e,t=process.cwd()){let a=Vt.join(t,be),i={...e,updatedAt:new Date().toISOString()};await mt.writeJSON(a,i,{spaces:2})}import z from"fs-extra";import T from"path";import oe from"fs-extra";import fe from"path";import{fileURLToPath as to}from"url";var Kt=fe.dirname(to(import.meta.url)),ao=u(g(),"templates"),S=class{static async getRoot(){let t=[fe.join(Kt,"../templates"),fe.resolve(Kt,"../../templates")];for(let a of t)if(await oe.pathExists(a))return a;throw new x(ao("error.root_not_found",{paths:t.join(", ")}),"TEMPLATE_ROOT_NOT_FOUND")}static async plan(t,a,i={}){let o=[];if(!await oe.pathExists(t))return o;let n=await oe.readdir(t,{withFileTypes:!0});for(let r of n){let s=fe.join(t,r.name),c=fe.join(a,r.name);if(r.isDirectory()){let m=await this.plan(s,c,i);o.push(...m);continue}if(!r.isFile())continue;(this.shouldReplace(r.name)?"template":"copy")==="template"?o.push({src:s,dest:c,type:"template",replacements:i}):o.push({src:s,dest:c,type:"copy"})}return o}static async execute(t,a={}){for(let i of t)a.overwrite===!1&&await oe.pathExists(i.dest)||(await oe.ensureDir(fe.dirname(i.dest)),i.type==="template"?await this.processFile(i.src,i.dest,i.replacements,i.resolver):await oe.copy(i.src,i.dest))}static shouldReplace(t){let a=fe.extname(t).toLowerCase();return[".md",".json",".ts",".js",".yaml",".yml"].includes(a)}static async processFile(t,a,i,o){let n=await oe.readFile(t,"utf-8");for(let[r,s]of Object.entries(i)){let c=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(c,"g");n=n.replace(d,s)}o&&(n=o(n)),await oe.writeFile(a,n,"utf-8")}};var Pe=u(g(),"scaffold"),Be=class{static async run(t,a){let{language:i,docDir:o,editors:n,features:r=[],projectType:s}=t,c=await S.getRoot(),d=i;await z.pathExists(T.join(c,d))||(l.warn(Pe("fallback",{lang:i})),d="zh");let m=T.join(c,d),w=T.resolve(process.cwd(),o);await z.ensureDir(T.join(w,"scripts")),await z.ensureDir(T.join(w,"tasks"));let y=s?`${le[s]?.label??s} (${s})`:"\u672A\u6307\u5B9A",j={[O.PLACEHOLDERS.DOCS_DIR]:o,[O.PLACEHOLDERS.PROJECT_TYPE]:y},ee=n.some(U=>!!I[U]?.skills),q=U=>Ct(U,{hasSkills:ee}),F=[],Q=T.join(m,O.PATHS.DOCS_SOURCE);if(await z.pathExists(Q)){let U=await S.plan(Q,w,j);U.forEach(A=>{A.group="docs",A.type==="template"&&(A.resolver=q)}),F.push(...U)}let Z=T.join(m,O.PATHS.RULES_SOURCE);if(await z.pathExists(Z)){let A=(await z.readdir(Z)).filter(M=>M.endsWith(".md"));for(let M of n){let K=I[M];if(!K)continue;let we=T.join(process.cwd(),K.targetDir);for(let ce of A){let ot=T.join(Z,ce),it=T.basename(ce,".md")+K.targetExt,nt=T.join(we,it);F.push({src:ot,dest:nt,type:"template",replacements:j,group:"ide"})}}}let xe=T.join(m,O.PATHS.SKILLS_SOURCE);if(await z.pathExists(xe)){for(let A of n){let M=I[A];if(!M?.skills)continue;let K=T.join(process.cwd(),M.skills.targetDir),we=await S.plan(xe,K,j);we.forEach(ce=>ce.group="ide"),F.push(...we)}if(n.some(A=>!I[A]?.skills)){let A=T.join(w,O.PATHS.SKILLS_DOC_TARGET),M=await S.plan(xe,A,j);M.forEach(K=>K.group="docs"),F.push(...M)}}let De=T.join(m,O.PATHS.PROMPTS_SOURCE);if(await z.pathExists(De)){let A=(await z.readdir(De)).filter(M=>M.endsWith(".md"));for(let M of n){let K=I[M];if(!K?.commands)continue;let we=T.join(process.cwd(),K.commands.targetDir);for(let ce of A){let ot=T.join(De,ce),it=`archi.${T.basename(ce,".md")}.md`,nt=T.join(we,it);F.push({src:ot,dest:nt,type:"template",replacements:j,resolver:q,group:"ide"})}}}let Le=a?.resolveConflicts?await a.resolveConflicts(F):F,at=["docs","ide"],$a={docs:Pe("step_docs"),ide:Pe("step_ide")};for(let U of at){let A=Le.filter(M=>M.group===U);A.length>0&&(l.step($a[U]||Pe("step_processing",{group:U})),await S.execute(A))}let bt=Le.filter(U=>!U.group);bt.length>0&&await S.execute(bt),await this.generateBrief(m,r,j),l.success(Pe("complete"))}static async generateBrief(t,a,i){let o=T.join(t,O.PATHS.BRIEFS_SOURCE),n=T.join(o,Rt);if(!await z.pathExists(n))return;let r=await z.readFile(n,"utf-8"),s=T.join(o,vt),c=await z.pathExists(s)?await z.readFile(s,"utf-8"):"",d=new Set(a),m=[],w=[],y=/<!-- @(tech|style):(\w+) -->\n([\s\S]*?)<!-- @end -->/g,j;for(;(j=y.exec(c))!==null;){let[,q,F,Q]=j;if(!d.has(F))continue;let Z=Q.trimEnd();q==="tech"?m.push(Z):q==="style"&&w.push(Z)}r=r.replace("<!-- @slot:tech -->",m.join(`
|
|
9
|
+
`)),r=r.replace("<!-- @slot:style -->",w.length>0?w.join(`
|
|
10
|
+
|
|
11
|
+
`)+`
|
|
12
|
+
|
|
13
|
+
`:"");for(let[q,F]of Object.entries(i)){let Q=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(Q,"g"),F)}r=r.replace(/\n{3,}/g,`
|
|
14
|
+
|
|
15
|
+
`);let ee=T.join(process.cwd(),Pt);await z.writeFile(ee,r,"utf-8")}};import{select as oo}from"@clack/prompts";import io from"fs-extra";import Wt from"path";var he=u(g(),"command.init"),Ce=class{static async resolve(t){let a=await this.detectConflicts(t);if(a.length===0)return t;let i=await this.promptAction(a);if(i==="cancel")throw new ae(he("cancel"));if(i==="overwrite")return t;if(i==="skip"){let o=new Set(a);return t.filter(n=>!o.has(Wt.relative(process.cwd(),n.dest)))}return t}static async detectConflicts(t){let a=await Promise.all(t.map(i=>io.pathExists(i.dest)));return t.filter((i,o)=>a[o]).map(i=>Wt.relative(process.cwd(),i.dest))}static async promptAction(t){l.warn(he("conflict_title"));let a=5;t.slice(0,a).forEach(o=>l.info(` - ${o}`)),t.length>a&&l.dim(he("conflict_more",{count:t.length-a}));let i=await oo({message:he("conflict_msg"),options:[{value:"overwrite",label:he("conflict_overwrite")},{value:"skip",label:he("conflict_skip")},{value:"cancel",label:he("conflict_cancel")}]});return typeof i=="symbol"?"cancel":i}};import{confirm as no,isCancel as Je,multiselect as so,select as Yt}from"@clack/prompts";var Ve=u(g(),"command.init");async function ro(e){if(!e)return!0;let t=await no({message:Ve("config_exists")});return!(Je(t)||!t)}async function co(e,t){let a=Object.keys(rt);if(e&&a.includes(e))return e;let i=await Yt({message:Ve("select_lang"),options:Object.entries(rt).map(([o,n])=>({value:o,label:n.label})),initialValue:t?.language??"zh"});return Je(i)?null:i}async function lo(e){if(e){let i=e.split(",").map(o=>o.trim()).filter(o=>Re.includes(o));if(i.length>0)return i}let t=await so({message:Ve("select_editor"),options:Re.map(a=>({value:a,label:I[a].label})),required:!0});return Je(t)?null:t}async function po(e){if(e){let a=e.trim();if(ct.includes(a))return a}let t=await Yt({message:Ve("select_type"),options:ct.map(a=>({value:a,label:`${le[a].label} (${le[a].features.join(", ")})`}))});return Je(t)?null:t}async function Qt(e){let t=await $();if(!await ro(t))return null;let i=await co(e.language,t);if(!i)return null;let o=await lo(e.editor);if(!o)return null;let n=await po(e.type);if(!n)return null;let r=le[n].features,s=e.doc||t?.docDir||".architext";return{language:i,editors:o,docDir:s,features:r,projectType:n}}var Ke=u(g(),"command.init");async function Zt(e){l.clear(),mo(He.bgCyan(He.black(` ${Ke("title")} `)));let t=await Qt(e);if(!t){ut(He.yellow(Ke("cancel")));return}await Ht({language:t.language,editors:t.editors,docDir:t.docDir,features:t.features});try{await Be.run(t,{resolveConflicts:Ce.resolve.bind(Ce)})}catch(a){if(a instanceof ae){ut(He.yellow(Ke("cancel")));return}throw a}ut(Ke("success"))}import{confirm as uo,intro as fo,isCancel as ho,outro as We,spinner as go}from"@clack/prompts";import _o from"fs-extra";import ko from"path";import ge from"picocolors";import J from"fs-extra";import V from"path";async function Xt(e){let t=await $(e),a=[],i=V.resolve(e,be);if(await J.pathExists(i)&&a.push(i),!t)return a;if(t.docDir){let o=V.resolve(e,t.docDir);await J.pathExists(o)&&a.push(o)}if(t.editors&&t.editors.length>0){let o=[];try{let n=await S.getRoot(),r=V.join(n,"zh",O.PATHS.RULES_SOURCE);await J.pathExists(r)&&(o=(await J.readdir(r)).filter(c=>c.endsWith(".md")).map(c=>V.basename(c,".md")))}catch{}o.length===0&&(o=$e.map(n=>V.basename(n,".md")));for(let n of t.editors){let r=I[n];if(r){let s=V.resolve(e,r.targetDir);if(await J.pathExists(s))for(let c of o){let d=c+r.targetExt,m=V.join(s,d);await J.pathExists(m)&&a.push(m)}if(r.commands){let c=V.resolve(e,r.commands.targetDir);if(await J.pathExists(c))try{let d=await S.getRoot(),m=V.join(d,"zh",O.PATHS.PROMPTS_SOURCE);if(await J.pathExists(m)){let w=await J.readdir(m);for(let y of w)if(y.endsWith(".md")){let ee=`archi.${V.basename(y,".md")}.md`,q=V.join(c,ee);await J.pathExists(q)&&a.push(q)}}}catch{await J.pathExists(c)&&a.push(c)}}}}}return Array.from(new Set(a))}var H=u(g(),"command.uninstall"),ea=async()=>{l.clear(),fo(ge.bgRed(ge.black(` ${H("title")} `)));let e=process.cwd();if(!await $(e)){We(ge.yellow(H("not_found")));return}let a=await Xt(e);if(a.length===0){We(ge.green(H("success")));return}l.warn(H("confirm_title")),l.dim(H("files_to_delete")),a.forEach(n=>{l.error(` - ${ko.relative(e,n)}`)});let i=await uo({message:H("confirm_msg")});if(ho(i)||!i){We(ge.yellow(H("cancel")));return}let o=go();o.start(H("cleaning"));try{for(let n of a)await _o.remove(n);o.stop(H("done")),We(ge.green(H("success")))}catch(n){o.stop(ge.red(H("error")));let r=n instanceof Error?n.message:String(n);throw new x(r)}};import{intro as bo,outro as gt,spinner as To}from"@clack/prompts";import Y from"picocolors";var ta=[];async function aa(){try{let e=await fetch("https://registry.npmjs.org/architext/latest",{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let a=(await e.json()).version,i=ye.version;return{current:i,latest:a,isOutdated:xo(a,i)>0}}catch{return null}}function xo(e,t){let a=e.split(".").map(Number),i=t.split(".").map(Number);for(let o=0;o<3;o++){let n=(a[o]??0)-(i[o]??0);if(n!==0)return n}return 0}import{confirm as wo,isCancel as yo}from"@clack/prompts";import _e from"fs-extra";import C from"path";var oa=u(g(),"command.update"),ia=["00_system","01_workflow","03_data_governance","99_context_glue"],ft="02_tech_stack",So=["90_custom_rules"];async function na(e,t){return await _e.pathExists(C.join(e,t))?t:"zh"}function sa(e){return{[O.PLACEHOLDERS.DOCS_DIR]:e.docDir}}async function ra(e,t){let a=await S.getRoot(),i=await na(a,e.language),o=C.join(a,i),n=C.resolve(t,e.docDir),r=sa(e),s=0,c=C.join(o,O.PATHS.PROMPTS_SOURCE),d=C.join(n,"prompts"),m=await S.plan(c,d,r);await S.execute(m),s+=m.length;let w=C.join(o,"docs","templates"),y=C.join(n,"templates"),j=await S.plan(w,y,r);await S.execute(j),s+=j.length;let q=(await _e.readdir(c).catch(()=>[])).filter(F=>F.endsWith(".md"));for(let F of e.editors){let Q=I[F];if(!Q?.commands)continue;let Z=C.join(t,Q.commands.targetDir);await _e.ensureDir(Z);for(let xe of q){let De=C.join(c,xe),Le=C.basename(xe,".md"),at=C.join(Z,`archi.${Le}.md`);await S.processFile(De,at,r),s++}}return{count:s}}async function ca(e,t){let a=await S.getRoot(),i=await na(a,e.language),o=C.join(a,i,O.PATHS.RULES_SOURCE),n=sa(e);l.warn(oa("rules_overwrite_warning")),ia.forEach(d=>l.dim(` ${d}`));let r=await wo({message:oa("rules_confirm")});if(yo(r)||!r)return null;let s={updated:[],skipped:[],templated:[]};for(let d of e.editors){let m=I[d];if(!m)continue;let w=C.join(t,m.targetDir);await _e.ensureDir(w);for(let y of ia){let j=C.join(o,`${y}.md`);if(!await _e.pathExists(j))continue;let ee=C.join(w,`${y}${m.targetExt}`);await S.processFile(j,ee,n),s.updated.includes(y)||s.updated.push(y)}}let c=C.join(o,`${ft}.md`);if(await _e.pathExists(c)){let d=C.join(t,e.docDir,"templates",`${ft}.template.md`);await _e.ensureDir(C.dirname(d)),await S.processFile(c,d,n),s.templated.push(ft)}return So.forEach(d=>s.skipped.push(d)),s}import ke from"fs-extra";import je from"path";var ht=u(g(),"command.update");async function la(e,t){let a=je.join(t,e.docDir,"global","roadmap.json"),i=je.relative(t,a);if(!await ke.pathExists(a))return{file:i,compatible:!0,migrated:!1};let o;try{o=await ke.readJSON(a)}catch{return{file:i,compatible:!1,migrated:!1,errors:[ht("schema.parse_error")]}}let n=typeof o.version=="number"?o.version:0;if(n>1)return{file:i,compatible:!1,migrated:!1,fromVersion:n,errors:[ht("schema.version_too_new",{current:n,expected:1})]};if(n===1){let c=X.safeParse(o);return c.success?{file:i,compatible:!0,migrated:!1}:{file:i,compatible:!1,migrated:!1,errors:c.error.issues.map(d=>`${d.path.join(".")}: ${d.message}`)}}let r=ta.filter(c=>c.fromVersion>=n&&c.fromVersion<1).sort((c,d)=>c.fromVersion-d.fromVersion),s=o;for(let c of r)s=c.migrate(s);return s.version=1,await ke.writeJSON(a,s,{spaces:2}),{file:i,compatible:!0,migrated:!0,fromVersion:n,toVersion:1}}async function pa(e,t){let a=je.join(t,e.docDir,"tasks"),i=[];if(!await ke.pathExists(a))return i;let o;try{o=await ke.readdir(a)}catch{return i}for(let n of o){let r=je.join(a,n,"plan.json"),s=je.relative(t,r);if(!await ke.pathExists(r))continue;let c;try{c=await ke.readJSON(r)}catch{i.push({file:s,compatible:!1,errors:[ht("schema.parse_error")]});continue}let d=de.safeParse(c);d.success?i.push({file:s,compatible:!0}):i.push({file:s,compatible:!1,errors:d.error.issues.map(m=>`${m.path.join(".")}: ${m.message}`)})}return i}var E=u(g(),"command.update");async function da(e){l.clear(),bo(Y.bgCyan(Y.black(` ${E("title")} `)));let t=process.cwd(),a=await $(t);if(!a){gt(Y.yellow(E("no_config")));return}let i=To();i.start(E("version_checking"));let o=await aa();o?o.isOutdated?(i.stop(Y.yellow(E("version_outdated",{current:o.current,latest:o.latest}))),l.info(E("version_upgrade_hint",{cmd:`npm install -g architext@${o.latest}`}))):i.stop(Y.green(E("version_up_to_date",{version:o.current}))):i.stop(Y.dim(E("version_check_skip"))),i.start(E("updating_silent"));let n=0;try{n=(await ra(a,t)).count}catch(d){i.stop(Y.red(E("failed")));let m=d instanceof Error?d.message:String(d);throw new x(m)}i.stop(Y.green(E("updated_silent",{count:n}))),l.dim("");let r=await ca(a,t);if(!r){gt(Y.yellow(E("cancel")));return}l.dim(""),l.step(E("schema_auditing"));let s=await la(a,t),c=await pa(a,t);if(s.compatible?s.migrated?l.success(E("schema.roadmap_migrated",{file:s.file,from:s.fromVersion??0,to:s.toVersion??1})):l.success(E("schema.roadmap_ok",{file:s.file})):(l.fail(E("schema.roadmap_error",{file:s.file})),s.errors?.forEach(d=>l.dim(` ${d}`))),c.length===0)l.dim(E("schema.no_plans"));else{let d=c.filter(m=>!m.compatible);d.length===0?l.success(E("schema.plans_ok",{count:c.length})):d.forEach(m=>{l.fail(E("schema.plan_error",{file:m.file})),m.errors?.forEach(w=>l.dim(` ${w}`))})}l.dim(""),l.step(E("summary")),r.updated.length>0&&l.done(E("summary_updated",{list:r.updated.join(" \xB7 ")})),r.templated.length>0&&l.info(E("summary_templated",{docDir:a.docDir})),l.dim(E("summary_skipped",{list:r.skipped.join(", ")})),gt(Y.green(E("success")))}import vo from"fs-extra";import Ae from"picocolors";function ma(e,t,a){let i=u(g(),"command.plan");if(l.info(""),l.info(Ae.bold(`\u{1F4CB} ${i("title",{id:e,name:t})}`)),l.info(""),a.sections.length===0){l.warn(i("empty"));return}let o=0,n=0;for(let s of a.sections){let c=s.done===s.total;if(s.isManual)l.dim(`${s.name.padEnd(36)} ${i("section_manual",{done:s.done,total:s.total})}`);else{o+=s.total,n+=s.done;let d=c?Ae.green("\u2705"):Ae.yellow("\u26A0\uFE0F"),m=i("section_pass",{done:s.done,total:s.total});if(l.info(`${s.name.padEnd(36)} ${c?Ae.green(m):Ae.yellow(m)} ${d}`),!c)for(let w of s.items)w.done||l.error(` - ${w.id}: ${w.title}`)}}l.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");let r=o>0?Math.round(n/o*100):0;l.info(i("total",{done:n,total:o,percent:r})),n===o&&o>0?l.success(i("all_done")):o>0&&l.warn(i("remaining",{count:o-n})),l.info("")}var Eo=["manual verification","manual check","manual","\u4EBA\u5DE5\u9A8C\u6536","\u624B\u52A8\u9A8C\u8BC1","\u624B\u52D5\u9A57\u8B49","\u4EBA\u5DE5\u9A57\u6536"];function ua(e){let t=[];for(let a of e.phases){let i=Eo.some(o=>a.name.toLowerCase().includes(o));t.push({name:a.name,isManual:i,items:a.tasks,done:a.tasks.filter(o=>o.done).length,total:a.tasks.length})}return e.tests&&(e.tests.automated&&e.tests.automated.length>0&&t.push({name:"Automated Tests",isManual:!1,items:e.tests.automated,done:e.tests.automated.filter(a=>a.done).length,total:e.tests.automated.length}),e.tests.manual&&e.tests.manual.length>0&&t.push({name:"Manual Verification",isManual:!0,items:e.tests.manual,done:e.tests.manual.filter(a=>a.done).length,total:e.tests.manual.length})),{sections:t}}import _t from"fs-extra";import ga from"path";import fa from"fs-extra";import ha from"path";var Do=[".architext"];async function ne(e=process.cwd()){let t=await $(e);if(t?.docDir){let a=ha.resolve(e,t.docDir);if(await fa.pathExists(a))return a}for(let a of Do){let i=ha.resolve(e,a);if(await fa.pathExists(i))return i}return null}var Ro="plan.json";async function _a(e,t=process.cwd()){let a=await ne(t);if(!a)throw new pe(e);let i=ga.join(a,"tasks");if(!await _t.pathExists(i))throw new pe(e);let n=(await _t.readdir(i)).find(c=>c.startsWith(`${e}_`));if(!n)throw new pe(e);let r=ga.join(i,n,Ro);if(!await _t.pathExists(r))throw new pe(e);let s=n.replace(`${e}_`,"").replace(/_/g," ");return{filePath:r,featureName:s}}async function ka(e){if(!e){let r=u(g(),"plan");throw new x(r("id_required"),"PLAN_ID_REQUIRED",!0)}let{filePath:t,featureName:a}=await _a(e),i=await vo.readJSON(t),o=me(de,i,`${e}/plan.json`),n=ua(o);ma(e,a,n)}import se from"fs-extra";import Oe from"path";var Po={pending:" ",active:" ",done:"x",blocked:" "},Co={pending:"\u23F3",active:"\u{1F7E2}",done:"\u2705",blocked:"\u{1F9F1}"},jo={pending:"pending",active:"active",done:"done",blocked:"blocked"};function kt(e){return e.replace(/"/g,"#quot;")}function Ao(e){return e.replace(/([;;.。])\s*/g,"$1<br/>").trimEnd().replace(/<br\/>$/,"")}function Oo(e){let t=kt(e.id),a=kt(e.title);if(e.goal){let i=Ao(kt(e.goal));return`"<b>[${t}] ${a}</b><br/>${i}"`}return`"<b>[${t}] ${a}</b>"`}function xa(e,t="zh"){let a=u(t,"command.render"),o=[a("roadmap.header_comment")+`
|
|
16
|
+
`+a("roadmap.header_ai")+`
|
|
17
|
+
|
|
18
|
+
`];o.push(`# ${a("roadmap.title")}
|
|
19
|
+
`),o.push(`> **${a("roadmap.status")}**: ${e.projectStatus} | **${a("roadmap.updated")}**: ${e.lastUpdated}
|
|
20
|
+
`),o.push(`<!-- TASKS_START -->
|
|
21
|
+
`);for(let s of e.phases){o.push(`## ${a("roadmap.phase")}: ${s.name}
|
|
22
|
+
`);for(let c of s.tasks)o.push(Io(c)),c.goal&&o.push(` - \u{1F3AF} ${a("roadmap.goal")}: ${c.goal}`),c.deps&&c.deps.length>0?o.push(` - \u{1F517} ${a("roadmap.dep")}: ${c.deps.map(d=>`[${d}]`).join(", ")}`):o.push(` - \u{1F517} ${a("roadmap.dep")}: ${a("roadmap.dep_none")}`),c.tag&&o.push(` - \u{1F3F7}\uFE0F ${a("roadmap.tag")}: ${c.tag}`),c.slug&&o.push(` - \u{1F4C1} ${a("roadmap.slug")}: ${c.slug}`);o.push("")}o.push(`<!-- TASKS_END -->
|
|
23
|
+
`),o.push(`<!-- VISUAL_START -->
|
|
24
|
+
`),o.push("```mermaid"),o.push("graph LR"),o.push(""),o.push(" classDef done fill:#4ade80,stroke:#16a34a,color:#000;"),o.push(" classDef active fill:#60a5fa,stroke:#2563eb,color:#000;"),o.push(" classDef pending fill:#e2e8f0,stroke:#94a3b8,color:#000;"),o.push(" classDef blocked fill:#fca5a5,stroke:#dc2626,color:#000;"),o.push("");let n=e.phases.flatMap(s=>s.tasks);for(let s of n)o.push(` ${s.id}[${Oo(s)}]`);o.push("");let r=$o(n);for(let s of n)if(s.deps)for(let c of s.deps)r.has(`${c}-->${s.id}`)||o.push(` ${c} --> ${s.id}`);o.push("");for(let s of n)o.push(` class ${s.id} ${jo[s.status]};`);return o.push("```\n"),o.push("<!-- VISUAL_END -->"),o.join(`
|
|
25
|
+
`)}function Io(e){let t=Po[e.status],a=Co[e.status];return`- [${t}] ${a} **[${e.id}]** ${e.title}`}function Lo(e,t,a){let i=new Set,o=[e];for(;o.length>0;){let n=o.shift();if(n===t)return!0;if(!i.has(n)){i.add(n);for(let r of a.get(n)??[])o.push(r)}}return!1}function $o(e){let t=new Map;for(let i of e)for(let o of i.deps??[])t.has(o)||t.set(o,new Set),t.get(o).add(i.id);let a=new Set;for(let i of e)for(let o of i.deps??[])for(let n of t.get(o)??[])if(n!==i.id&&Lo(n,i.id,t)){a.add(`${o}-->${i.id}`);break}return a}function wa(e,t="zh"){let a=u(t,"command.render"),o=[a("plan.header_comment")+`
|
|
26
|
+
`+a("plan.header_ai")+`
|
|
27
|
+
|
|
28
|
+
`];if(o.push(`# ${a("plan.title",{featureName:e.featureName})}
|
|
29
|
+
`),o.push(`> **${a("plan.feature_id")}**: ${e.featureId} | **${a("plan.status")}**: ${e.status}
|
|
30
|
+
`),e.decisions&&e.decisions.length>0){o.push(`## 1. ${a("plan.section_decisions")}
|
|
31
|
+
`);for(let n of e.decisions)o.push(`- **${n.category}**: ${n.choice}`),n.rationale&&o.push(` - \u{1F4DD} ${n.rationale}`);o.push("")}o.push(`## 2. ${a("plan.section_steps")}
|
|
32
|
+
`);for(let n of e.phases){let s=n.tasks.every(c=>c.done)?"x":" ";o.push(`* [${s}] **${n.name}**`);for(let c of n.tasks){let d=c.done?"x":" ";o.push(` - [${d}] ${c.title}`),c.notes&&o.push(` - \u{1F4DD} ${c.notes}`)}o.push("")}if(e.tests){if(o.push(`## 3. ${a("plan.section_tests")}
|
|
33
|
+
`),e.tests.automated&&e.tests.automated.length>0){o.push(`### ${a("plan.subsection_automated")}
|
|
34
|
+
`);for(let n of e.tests.automated){let r=n.done?"x":" ";o.push(`* [${r}] ${n.title}`),n.notes&&o.push(` - \u{1F4DD} ${n.notes}`)}o.push("")}if(e.tests.manual&&e.tests.manual.length>0){o.push(`### ${a("plan.subsection_manual")}
|
|
35
|
+
`);for(let n of e.tests.manual){let r=n.done?"x":" ";o.push(`* [${r}] ${n.title}`),n.notes&&o.push(` - \u{1F4DD} ${n.notes}`)}o.push("")}}return o.join(`
|
|
36
|
+
`)}var ya=u(g(),"command.render");async function No(){return(await $())?.language??g()}async function Sa(){let e=await ne();if(!e)throw new x("Documentation directory not found. Run 'archi init' first.","DOC_DIR_NOT_FOUND",!0);let t=0,a=await No(),i=Oe.join(e,"global","roadmap.json");if(await se.pathExists(i)){let n=await se.readJSON(i),r=me(X,n,"roadmap.json"),s=xa(r,a),c=Oe.join(e,"global","roadmap.md");await se.writeFile(c,s,"utf-8"),l.step("roadmap.json \u2192 roadmap.md"),t++}let o=Oe.join(e,"tasks");if(await se.pathExists(o)){let n=await se.readdir(o);for(let r of n){let s=Oe.join(o,r,"plan.json");if(await se.pathExists(s)){let c=await se.readJSON(s),d=me(de,c,`${r}/plan.json`),m=wa(d,a),w=Oe.join(o,r,"plan.md");await se.writeFile(w,m,"utf-8"),l.step(`${r}/plan.json \u2192 plan.md`),t++}}}t===0?l.warn(ya("empty")):l.success(ya("done",{count:t}))}import Fo from"fs-extra";var Ye=class{async parse(t){let a=await Fo.readJSON(t);return me(X,a,"roadmap.json")}};import Go from"fs-extra";import va from"picocolors";function ba(e){return e.phases.flatMap(t=>t.tasks)}function xt(e){let t=new Map;for(let a of e.phases)for(let i of a.tasks)t.set(i.id,i);return t}import Qe from"picocolors";var wt=["pending","active","done","blocked"],Ta={pending:"\u23F3",active:"\u{1F7E2}",done:"\u2705",blocked:"\u{1F9F1}"},Ea={pending:Qe.white,active:Qe.green,done:Qe.blue,blocked:Qe.red};import Uo from"picocolors";function Mo(e){return Ta[e]??"\u23F3"}function zo(e){return Ea[e]??Uo.dim}function Da(e,t,a=30){let i=t>0?Math.round(e/t*100):0,o=Math.round(i/100*a);return`Progress: [${"\u2588".repeat(o)+"\u2591".repeat(a-o)}] ${i}% (${e}/${t})`}function Ra(e){let t=Mo(e.status);return zo(e.status)(`${t} [${e.id}] ${e.title}`)}async function Pa(e){let t=u(g(),"command.task"),a=[],i=xt(e),o=new Set;for(let n of e.phases)for(let r of n.tasks)o.has(r.id)&&a.push(`Duplicate task ID: [${r.id}]`),o.add(r.id);for(let[n,r]of i)if(r.deps)for(let s of r.deps)s&&!i.has(s)&&a.push(t("check.invalid_dep",{id:n,depId:s}));for(let[n,r]of i)wt.includes(r.status)||a.push(`Task [${n}] has invalid status: "${r.status}"`);if(a.length>0)throw a.forEach(n=>l.error(n)),new ze(a);l.success(t("check.consistent"))}async function Ca(e,t,a,i){let o=u(g(),"command.task");if(!a)throw new x(o("update.id_required"),"MISSING_TASK_ID",!0);if(!wt.includes(i))throw new Me(i);let n=i,r=!1;for(let s of e.phases){for(let c of s.tasks)if(c.id===a){l.step(o("update.updating",{id:a,status:n})),c.status=n,r=!0;break}if(r)break}if(!r)throw new Ue(a);if(n==="done"){let s=qo(e,a);for(let c of s)l.done(o("update.unblocked",{id:c}))}e.lastUpdated=new Date().toISOString().split("T")[0],await Go.writeJSON(t,e,{spaces:2}),l.done(o("update.done",{id:a,status:n}))}function qo(e,t){let a=xt(e),i=[];for(let o of e.phases)for(let n of o.tasks){if(n.status!=="blocked"||!n.deps?.includes(t))continue;n.deps.every(s=>{let c=a.get(s);return c&&c.status==="done"})&&(n.status="pending",i.push(n.id))}return i}function ja(e){let t=u(g(),"command.task"),a=ba(e);if(a.length===0){l.warn(t("list.empty"));return}let i={pending:0,active:0,done:0,blocked:0};a.forEach(o=>i[o.status]++),l.info(va.bold(`
|
|
37
|
+
\u{1F4CA} ${t("list.title")}`)),l.info(Da(i.done,a.length)),l.info("");for(let o of e.phases)if(o.tasks.length>0){l.info(va.dim(`\u2500\u2500 ${o.name} \u2500\u2500`));for(let n of o.tasks)l.info(Ra(n));l.info("")}}import Ze from"fs-extra";import Xe from"path";var Bo=["global/roadmap.json","roadmap.json"];async function Aa(e=process.cwd()){let t=await $(e);if(t?.roadmap){let i=Xe.resolve(e,t.roadmap);if(await Ze.pathExists(i))return i}if(t?.docDir){let i=Xe.join(e,t.docDir,"global/roadmap.json");if(await Ze.pathExists(i))return i}let a=await ne(e);if(a){let i=Xe.join(a,"global/roadmap.json");if(await Ze.pathExists(i))return i}for(let i of Bo){let o=Xe.join(e,i);if(await Ze.pathExists(o))return o}throw new Fe}async function Oa(e,t){let a=await Aa(),o=await new Ye().parse(a);if(t.check){await Pa(o);return}if(t.status){await Ca(o,a,e,t.status);return}ja(o)}import k from"picocolors";var p=u(g(),"command.help");function R(e,t,a){let i=[` ${k.cyan(e)}`,` ${t}`];if(a)for(let o of a)i.push(` ${k.dim(o)}`);return i.push(""),i.join(`
|
|
38
|
+
`)}function et(e){return`
|
|
39
|
+
${k.bold(k.underline(e))}
|
|
40
|
+
`}function Te(e,t){return` ${e.padEnd(22)} ${k.dim("-->")} ${k.cyan(t)}`}async function Ia(){let e=["",` ${k.bold("Architext")} ${k.dim(`v${ye.version}`)}`,` ${k.dim(p("tagline"))}`,` ${k.dim("\u2500".repeat(50))}`].join(`
|
|
41
|
+
`),t=[et(p("section.ai")),R("/archi.start [file_path]",p("ai.start.desc"),[p("ai.start.detail"),p("ai.start.example")]),R("/archi.inherit",p("ai.inherit.desc"),[p("ai.inherit.detail")]),R("/archi.scope [file_path]",p("ai.scope.desc"),[p("ai.scope.detail"),p("ai.scope.example")]),R("/archi.plan <ID> [context]",p("ai.plan.desc"),[p("ai.plan.detail"),p("ai.plan.example1"),p("ai.plan.example2")]),R("/archi.code <id>",p("ai.code.desc"),[p("ai.code.detail"),p("ai.code.example")]),R("/archi.audit [id]",p("ai.audit.desc"),[p("ai.audit.detail"),p("ai.audit.example1"),p("ai.audit.example2")]),R("/archi.fix [id] <context>",p("ai.fix.desc"),[p("ai.fix.detail"),p("ai.fix.example")]),R("/archi.edit <id> [context]",p("ai.edit.desc"),[p("ai.edit.detail"),p("ai.edit.example")]),R("/archi.revise [context]",p("ai.revise.desc"),[p("ai.revise.detail"),p("ai.revise.example")]),R("/archi.map",p("ai.map.desc"),[p("ai.map.detail")]),R("/archi.remove <id>",p("ai.remove.desc"),[p("ai.remove.detail"),p("ai.remove.example")]),R("/archi.help [question]",p("ai.help.desc"),[p("ai.help.detail"),p("ai.help.example1"),p("ai.help.example2")])].join(`
|
|
42
|
+
`),a=[et(p("section.cli")),R("npx archi init [-e editor] [-l lang] [-d path]",p("cli.init.desc"),[`-e, --editor <type> ${p("cli.init.editor")}`,`-l, --language <lang> ${p("cli.init.lang")}`,`-d, --doc <path> ${p("cli.init.doc")}`]),R("npx archi update [--dry-run]",p("cli.update.desc"),[`--dry-run ${p("cli.update.dry_run")}`]),R("npx archi doctor",p("cli.doctor.desc")),R("npx archi task [id] [--status <s>] [--check]",p("cli.task.desc"),[p("cli.task.detail"),p("cli.task.example")]),R("npx archi plan <id>",p("cli.plan.desc"),[p("cli.plan.example")]),R("npx archi render",p("cli.render.desc")),R("npx archi template <name>",p("cli.template.desc"),[p("cli.template.example")]),R("npx archi uninstall",p("cli.uninstall.desc"))].join(`
|
|
43
|
+
`),i=[et(p("section.quick")),Te(p("quick.new_project"),"/archi.start [desc]"),Te(p("quick.legacy"),"/archi.inherit"),Te(p("quick.new_feature"),"/archi.scope [file_path]"),Te(p("quick.write_code"),"/archi.code <id>"),Te(p("quick.fix_bug"),"/archi.fix [id] <desc>"),Te(p("quick.check_health"),"/archi.audit"),""].join(`
|
|
44
|
+
`),o=[et(p("section.workflow")),` ${k.dim(p("workflow.init_flow"))}`,` ${k.cyan("/archi.start")} ${k.dim("-->")} ${k.cyan("/archi.plan")} ${k.dim("-->")} ${k.cyan("/archi.code")}`,"",` ${k.dim(p("workflow.new_feature"))}`,` ${k.cyan("/archi.scope")} ${k.dim("-->")} ${k.cyan("/archi.plan")} ${k.dim("-->")} ${k.cyan("/archi.code")}`,"",` ${k.dim(p("workflow.change_spec"))}`,` ${k.cyan("/archi.edit")} ${k.dim("-->")} ${k.cyan("/archi.code")}`,"",` ${k.dim(p("workflow.standalone"))}`,` ${k.cyan("/archi.fix")} ${k.cyan("/archi.revise")} ${k.cyan("/archi.audit")} ${k.cyan("/archi.remove")}`,""].join(`
|
|
45
|
+
`);l.raw([e,t,a,i,o].join(`
|
|
46
|
+
`))}import Ie from"fs-extra";import yt from"path";var Ee=u(g(),"command.template");async function Jo(){return(await $())?.language??g()}async function La(e){if(!e){let s=Object.keys(Ne);l.info(Ee("usage")),l.info("");for(let c of s)l.info(` ${c}`);l.info("");return}let t=Ne[e];if(!t){let s=Object.keys(Ne).join(", ");throw new x(Ee("unknown",{name:e,available:s}),"UNKNOWN_TEMPLATE",!0)}let a=yt.join(process.cwd(),t.output);if(await Ie.pathExists(a)){l.warn(Ee("exists",{path:t.output}));return}let i=await ne();if(i){let s=yt.join(i,"templates",t.file);if(await Ie.pathExists(s)){await Ie.copy(s,a),l.success(Ee("done",{path:t.output}));return}}let o=await Jo(),n=await S.getRoot(),r=yt.join(n,o,"docs","templates",t.file);if(await Ie.pathExists(r)){await Ie.copy(r,a),l.success(Ee("done",{path:t.output}));return}throw new x(Ee("not_found",{name:t.file}),"TEMPLATE_NOT_FOUND",!0)}var tt=u(g(),"common.error"),St=e=>{e instanceof ae&&(l.warn(tt("cancel",{msg:e.message})),process.exit(0)),e instanceof x&&(e.isUserError?l.error(tt("internal",{code:e.code,msg:e.message})):l.error(e.stack||e.message),process.exit(1)),e instanceof Error&&(l.error(tt("unexpected",{msg:e.message})),l.error(e.stack||e.message),process.exit(1)),l.error(tt("unknown")),process.exit(1)};var B=Vo("architext"),Ho=g(),N=u(Ho),re=e=>async(...t)=>{try{await e(...t)}catch(a){St(a)}};B.command("init",N("init.desc")).option("-e, --editor <type>",N("init.editor")).option("-l, --language <lang>",N("init.lang")).option("-d, --doc <path>",N("init.doc")).option("-t, --type <type>",N("init.type")).action(re(Zt));B.command("update",N("update.desc")).option("-d, --dry-run",N("update.dry_run"),{default:!1}).action(re(da));B.command("doctor",N("doctor.desc")).action(async()=>{try{await Jt()}catch(e){St(e)}});B.command("uninstall",N("uninstall.desc")).alias("remove").alias("rm").action(re(ea));B.command("task [id]",N("task.desc")).option("--status <status>",N("task.status")).option("--check",N("task.check")).action(re(Oa));B.command("plan <id>",N("plan.desc")).action(re(ka));B.command("render",N("render.desc")).action(re(Sa));B.command("template [name]",N("template.desc")).action(re(La));B.command("help",N("help.desc")).action(re(Ia));B.help();B.version(ye.version);B.parse();
|