architext 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +84 -7
  3. package/README.zh-CN.md +84 -7
  4. package/dist/index.js +38 -38
  5. package/dist/templates/en/briefs/_base.md +44 -11
  6. package/dist/templates/en/briefs/_modules.md +31 -4
  7. package/dist/templates/en/docs/prompts/audit.md +80 -94
  8. package/dist/templates/en/docs/prompts/code.md +87 -89
  9. package/dist/templates/en/docs/prompts/edit.md +47 -51
  10. package/dist/templates/en/docs/prompts/fix.md +49 -42
  11. package/dist/templates/en/docs/prompts/help.md +23 -31
  12. package/dist/templates/en/docs/prompts/inherit.md +91 -116
  13. package/dist/templates/en/docs/prompts/map.md +47 -69
  14. package/dist/templates/en/docs/prompts/plan.md +134 -239
  15. package/dist/templates/en/docs/prompts/recover.md +19 -34
  16. package/dist/templates/en/docs/prompts/ref.md +43 -138
  17. package/dist/templates/en/docs/prompts/remove.md +55 -107
  18. package/dist/templates/en/docs/prompts/revise.md +63 -106
  19. package/dist/templates/en/docs/prompts/scope.md +77 -117
  20. package/dist/templates/en/docs/prompts/start.md +89 -129
  21. package/dist/templates/en/rules/00_system.md +36 -79
  22. package/dist/templates/en/rules/01_workflow.md +59 -57
  23. package/dist/templates/en/rules/03_data_governance.md +46 -42
  24. package/dist/templates/en/skills/archi-data-sync/SKILL.md +12 -12
  25. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +3 -34
  26. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +1 -0
  27. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +4 -4
  28. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
  29. package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
  30. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +20 -20
  31. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
  32. package/dist/templates/zh/briefs/_base.md +44 -12
  33. package/dist/templates/zh/briefs/_modules.md +27 -0
  34. package/dist/templates/zh/docs/prompts/audit.md +42 -56
  35. package/dist/templates/zh/docs/prompts/code.md +47 -49
  36. package/dist/templates/zh/docs/prompts/edit.md +38 -42
  37. package/dist/templates/zh/docs/prompts/fix.md +30 -29
  38. package/dist/templates/zh/docs/prompts/help.md +13 -21
  39. package/dist/templates/zh/docs/prompts/inherit.md +59 -83
  40. package/dist/templates/zh/docs/prompts/map.md +24 -47
  41. package/dist/templates/zh/docs/prompts/plan.md +92 -197
  42. package/dist/templates/zh/docs/prompts/recover.md +9 -24
  43. package/dist/templates/zh/docs/prompts/ref.md +11 -106
  44. package/dist/templates/zh/docs/prompts/remove.md +31 -71
  45. package/dist/templates/zh/docs/prompts/revise.md +37 -86
  46. package/dist/templates/zh/docs/prompts/scope.md +51 -91
  47. package/dist/templates/zh/docs/prompts/start.md +67 -106
  48. package/dist/templates/zh/rules/00_system.md +18 -91
  49. package/dist/templates/zh/rules/01_workflow.md +60 -59
  50. package/dist/templates/zh/rules/03_data_governance.md +41 -68
  51. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +2 -33
  52. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +1 -0
  53. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
  54. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +1 -0
  55. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
  56. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,7 +6,33 @@ All notable changes are documented here, following [Keep a Changelog](https://ke
6
6
 
7
7
  ---
8
8
 
9
- ## [Unreleased](https://github.com/JiuNian3219/architext/compare/v0.0.4...HEAD) / 待发布
9
+ ## [Unreleased](https://github.com/JiuNian3219/architext/compare/v0.0.5...HEAD) / 待发布
10
+
11
+ ---
12
+
13
+ ## [0.0.5](https://github.com/JiuNian3219/architext/releases/tag/v0.0.5) - 2026-03-06
14
+
15
+ ### Added / 新增
16
+
17
+ - `FileModel` 注册表,实现声明式文件管理,替代分散的路径硬编码 / Introduced FileModel registry for declarative file management
18
+ - `archi init` 支持 `--yes` 和 `--brief` flag,实现非交互式初始化 / Added `--yes` and `--brief` flags for non-interactive init
19
+ - Brief 附件资产目录支持(`_modules.md` 等附件模块)/ Added Brief attachment asset directory support
20
+ - Skill 类型声明(`type: specialist` / `type: reviewer`)/ Added Skill type classification in frontmatter
21
+
22
+ ### Changed / 变更
23
+
24
+ - 重构 `init`、`uninstall`、`update` 命令,基于 FileModel 驱动,逻辑更一致 / Refactored commands to be driven by FileModel
25
+ - 拆分 `scaffold.ts` 为 `brief.ts` 和 `ide-integrations.ts`,拆分 `index.ts` 为 `collector.ts` 和 `serializer.ts` / Decomposed large source files for clarity
26
+ - 精简 14 个中文协议文件,总行数从 2474 压缩至 1852(-25%)/ Compressed 14 zh protocol files by 25%
27
+ - `01_workflow.md` 改造为 Chat Mode:高频命令(plan/code/edit/fix/scope)支持自然语言触发,AI 自动加载协议执行 / Workflow now supports natural-language intent detection for high-frequency commands
28
+ - 两阶段协议生成合并为统一协议,减少用户操作步骤 / Merged two-phase protocol generation into single flow
29
+ - 更新触发器描述,支持自然语言触发 / Updated trigger descriptions to support natural language
30
+ - 补充 `01_workflow` 中 `ref` 与 `recover` 命令路由 / Added routing for `ref` and `recover` commands
31
+
32
+ ### Fixed / 修复
33
+
34
+ - 修正 `inherit` 协议表述,避免误导用户认为会覆盖既有 `.architext` 数据 / Fixed `inherit` wording to prevent misunderstanding about overwriting existing data
35
+ - 补全 zh prompts 到 en 的完整翻译 / Completed full translation of zh prompts to en
10
36
 
11
37
  ---
12
38
 
package/README.md CHANGED
@@ -104,9 +104,10 @@ The AI reads the brief, interviews you on key decisions, and generates the proje
104
104
  The main trunk of a project lifecycle. Everything happens in your AI chat window.
105
105
 
106
106
  ```
107
- project-brief.md → /archi.start → [/archi.scope] → /archi.plan → /archi.code → /archi.audit
107
+ project-brief.md → /archi.start → /archi.plan → /archi.code → /archi.audit
108
108
 
109
- use when you have extra requirements to decompose
109
+ /archi.scope runs anytime you have NEW feature requirements
110
+ (not limited to "right after start" — mid-project, post-release, etc.)
110
111
  ```
111
112
 
112
113
  **Stage 1 — Initialize**
@@ -126,14 +127,15 @@ AI: [Analyzing project brief...]
126
127
  ✔ MODIFIED: .cursor/rules/02_tech_stack.mdc (filled with project tech decisions)
127
128
  ✔ MODIFIED: .cursor/rules/90_custom_rules.mdc (filled with team conventions)
128
129
 
129
- Next: run /archi.scope to decompose requirements into tasks.
130
+ Next: if the brief covers everything /archi.plan <first-task-id>
131
+ if you have more requirements → /archi.scope to add tasks first
130
132
  ```
131
133
 
132
134
  > **Existing codebase?** Use `/archi.inherit` instead — it reverse-engineers your project and registers existing features as `LEG-xx` tasks. Also generates `map.json`.
133
135
 
134
- **Stage 2 — Decompose (optional)**
136
+ **Stage 2 — Decompose (optional, runs anytime)**
135
137
 
136
- > Use `/archi.scope` when you have requirements beyond what's in the initial brief. If the brief already covers everything, go straight to Stage 3.
138
+ > `/archi.scope` is **not** "the step after start." Run it **whenever** you have new feature requirements beyond what's in the initial brief or current roadmap right after start, mid-project, or after all tasks are done.
137
139
 
138
140
  ```
139
141
  You: /archi.scope scope-brief.md ← provide a file, or run bare to trigger an interview
@@ -207,7 +209,80 @@ AI: [Reading code + spec + plan + vision + tech_stack...]
207
209
  [LOW] Token expiry not configurable via env var → suggest /archi.edit
208
210
  ```
209
211
 
210
- > **Daily development between commands** is driven by natural language Chat Mode — ask questions, tweak code, debugno slash commands needed. Four of the seven rule files act as always-on base rules: `00_system`, `02_tech_stack`, `90_custom_rules`, `99_context_glue`.
212
+ > **Daily development between commands** is driven by natural language **Chat Mode**. Describe what you want in plain language e.g. "add a login feature" or "fix the auth bug" and the AI will automatically load and execute the right protocol (scope/plan/code/edit/fix). No need to manually type `/archi.*` slash commands. For questions, trivial edits, and debugging, the AI answers directly. Four of the seven rule files act as always-on base rules: `00_system`, `02_tech_stack`, `90_custom_rules`, `99_context_glue`.
213
+
214
+ ---
215
+
216
+ ## Tutorials
217
+
218
+ Different scenarios, same protocol. Pick the one that matches your situation.
219
+
220
+ ### Tutorial A: New project, brief covers everything
221
+
222
+ Your `project-brief.md` already lists all features. No scope needed.
223
+
224
+ ```
225
+ /archi.start project-brief.md → /archi.plan FEAT-001 → /archi.code FEAT-001 → ...
226
+ ```
227
+
228
+ Start produces a roadmap. Go straight to plan the first task, then code.
229
+
230
+ ---
231
+
232
+ ### Tutorial B: New project, brief incomplete
233
+
234
+ You ran start, but later realize you forgot features or want to add more.
235
+
236
+ ```
237
+ /archi.start project-brief.md → /archi.scope scope-brief.md → /archi.plan FEAT-001 → ...
238
+ ```
239
+
240
+ Scope appends new tasks to `roadmap.json`. Then plan and code as usual.
241
+
242
+ ---
243
+
244
+ ### Tutorial C: Add features mid-project
245
+
246
+ You're already building. FEAT-001 is done, and you want to add FEAT-002, FEAT-003, etc.
247
+
248
+ ```
249
+ ... → /archi.scope scope-brief.md → /archi.plan FEAT-002 → /archi.code FEAT-002 → ...
250
+ ```
251
+
252
+ **Scope runs anytime** — not only after start. Whenever you have new requirements beyond the current roadmap, run scope.
253
+
254
+ ---
255
+
256
+ ### Tutorial D: Existing codebase
257
+
258
+ You have an existing repo. Adopt Architext without rewriting.
259
+
260
+ ```
261
+ npx archi init → /archi.inherit [project-brief.md] → /archi.edit LEG-xx 补全 Stub → /archi.code LEG-xx
262
+ ```
263
+
264
+ Inherit reverse-engineers the repo and registers features as `LEG-xx` tasks. Use edit to complete stub specs, then code when needed.
265
+
266
+ ---
267
+
268
+ ### Tutorial E: Bug fix
269
+
270
+ ```
271
+ /archi.fix FEAT-001 "login fails when password has special chars"
272
+ ```
273
+
274
+ Fix diagnoses, appends a Bugfix Phase to the plan, and repairs the code.
275
+
276
+ ---
277
+
278
+ ### When to use /archi.scope (summary)
279
+
280
+ | When | Action |
281
+ |:---|:---|
282
+ | Right after start, brief didn't cover everything | scope |
283
+ | Mid-project, new feature idea | scope |
284
+ | All tasks done, want to add a new module | scope |
285
+ | Brief already covers everything | Skip scope, go to plan |
211
286
 
212
287
  ---
213
288
 
@@ -215,6 +290,8 @@ AI: [Reading code + spec + plan + vision + tech_stack...]
215
290
 
216
291
  ### AI Chat Commands
217
292
 
293
+ You can trigger these either by typing `/archi.<command>` or by describing your intent in natural language — Chat Mode will automatically load and execute the matching protocol.
294
+
218
295
  | Command | Description |
219
296
  |:---|:---|
220
297
  | `/archi.start [brief]` | Read a project brief and generate foundation docs (vision / roadmap / tech_stack etc.) |
@@ -281,7 +358,7 @@ Agent mode is great for single sessions. Architext provides persistent context t
281
358
 
282
359
  **Q: Can I use this on an existing codebase?**
283
360
 
284
- Yes. Run `/archi.inherit` — Architext analyzes your existing code and generates a document skeleton. Existing features are registered as `LEG-xx` tasks with stub specs, so you can gradually adopt the workflow without a big-bang rewrite.
361
+ Yes. Run `npx archi init` first to deploy the framework, then run `/archi.inherit` — Architext analyzes your existing code and fills the document skeleton (does not overwrite your existing content). Existing features are registered as `LEG-xx` tasks with stub specs, so you can gradually adopt the workflow without a big-bang rewrite.
285
362
 
286
363
  > **Note**: `/archi.inherit` is still early-stage. Analysis results for large or complex repos may be incomplete and require manual cleanup. Feel free to open an Issue if you hit problems.
287
364
 
package/README.zh-CN.md CHANGED
@@ -104,9 +104,10 @@ AI 读取 Brief,就关键决策向你提问,生成项目的基础文档(`v
104
104
  项目全生命周期的主干路径,全部在 AI 对话框中完成。
105
105
 
106
106
  ```
107
- project-brief.md → /archi.start → [/archi.scope] → /archi.plan → /archi.code → /archi.audit
107
+ project-brief.md → /archi.start → /archi.plan → /archi.code → /archi.audit
108
108
 
109
- 有额外需求时使用,可多次运行
109
+ /archi.scope anytime you have NEW feature requirements
110
+ (不限「start 之后」——项目进行中、发布后均可)
110
111
  ```
111
112
 
112
113
  **第一阶段 · 初始化**
@@ -126,14 +127,15 @@ AI: [正在分析项目 Brief...]
126
127
  ✔ 填充: .cursor/rules/02_tech_stack.mdc (写入项目技术决策)
127
128
  ✔ 填充: .cursor/rules/90_custom_rules.mdc (写入团队编码规范)
128
129
 
129
- 下一步:运行 /archi.scope 将需求分解为任务。
130
+ 下一步:Brief 已覆盖全部需求 → /archi.plan <首个任务ID>
131
+ Brief 之外还有需求 → /archi.scope 先追加任务
130
132
  ```
131
133
 
132
134
  > **已有代码?** 改用 `/archi.inherit` —— 逆向分析项目,将已有功能注册为 `LEG-xx` 任务,并额外生成 `map.json`。
133
135
 
134
- **第二阶段 · 需求分解(可选)**
136
+ **第二阶段 · 需求分解(可选,随时可跑)**
135
137
 
136
- > 当你的 Brief 之外还有额外需求要拆解时使用 `/archi.scope`;若 Brief 已覆盖全部需求,可直接跳到第三阶段。
138
+ > `/archi.scope` **不是**「start 的下一步」。只要你有**除初始 Brief 之外的新功能需求**,随时可运行——start 后、项目进行中、所有任务完成后均可。
137
139
 
138
140
  ```
139
141
  你: /archi.scope scope-brief.md ← 提供文件;或直接 /archi.scope 触发访谈
@@ -207,7 +209,80 @@ AI: [正在读取 代码 + spec + plan + vision + tech_stack...]
207
209
  [低] Token 过期时间未通过环境变量配置 → 建议运行 /archi.edit
208
210
  ```
209
211
 
210
- > **命令之间的日常开发**由自然语言 **Chat Mode** 驱动——提问、微调代码、调试——无需斜杠命令。7 个规则文件中有 4 个作为始终在线的基底规则:`00_system`、`02_tech_stack`、`90_custom_rules`、`99_context_glue`,AI 不会因会话切换而"失忆"。
212
+ > **命令之间的日常开发**由自然语言 **Chat Mode** 驱动。用自然语言描述需求(如「加个登录功能」「修一下认证的 bug」),AI 会自动识别意图并加载对应协议(scope/plan/code/edit/fix)执行,**无需手动输入 `/archi.*` 斜杠命令**。提问、琐碎修改、调试则直接回答。7 个规则文件中有 4 个作为始终在线的基底规则:`00_system`、`02_tech_stack`、`90_custom_rules`、`99_context_glue`,AI 不会因会话切换而"失忆"。
213
+
214
+ ---
215
+
216
+ ## 教程
217
+
218
+ 不同场景,同一套协议。按你的情况选择对应路径。
219
+
220
+ ### 教程 A:新项目,Brief 已覆盖全部需求
221
+
222
+ `project-brief.md` 已列出所有功能,无需 scope。
223
+
224
+ ```
225
+ /archi.start project-brief.md → /archi.plan FEAT-001 → /archi.code FEAT-001 → ...
226
+ ```
227
+
228
+ Start 产出 roadmap 后,直接 plan 首个任务,再 code。
229
+
230
+ ---
231
+
232
+ ### 教程 B:新项目,Brief 不完整
233
+
234
+ start 跑完后发现漏了功能,或想追加更多。
235
+
236
+ ```
237
+ /archi.start project-brief.md → /archi.scope scope-brief.md → /archi.plan FEAT-001 → ...
238
+ ```
239
+
240
+ Scope 向 `roadmap.json` 追加任务,再按 plan → code 继续。
241
+
242
+ ---
243
+
244
+ ### 教程 C:项目进行中追加功能
245
+
246
+ FEAT-001 已做完,想加 FEAT-002、FEAT-003 等。
247
+
248
+ ```
249
+ ... → /archi.scope scope-brief.md → /archi.plan FEAT-002 → /archi.code FEAT-002 → ...
250
+ ```
251
+
252
+ **Scope 随时可跑**——不限「start 之后」。只要有超出当前 roadmap 的新需求,就运行 scope。
253
+
254
+ ---
255
+
256
+ ### 教程 D:已有代码库
257
+
258
+ 已有仓库,想纳入 Architext 管理。
259
+
260
+ ```
261
+ npx archi init → /archi.inherit [project-brief.md] → /archi.edit LEG-xx 补全 Stub → /archi.code LEG-xx
262
+ ```
263
+
264
+ Inherit 逆向分析项目,将已有功能注册为 `LEG-xx` 任务。用 edit 补全 Stub spec,再按需 code。
265
+
266
+ ---
267
+
268
+ ### 教程 E:Bug 修复
269
+
270
+ ```
271
+ /archi.fix FEAT-001 "密码含特殊字符时登录失败"
272
+ ```
273
+
274
+ Fix 诊断根因,向 plan 追加 Bugfix Phase,并修复代码。
275
+
276
+ ---
277
+
278
+ ### 何时用 /archi.scope(速查)
279
+
280
+ | 时机 | 操作 |
281
+ |:---|:---|
282
+ | start 后,Brief 未覆盖全部 | scope |
283
+ | 项目进行中,想到新功能 | scope |
284
+ | 所有任务 done,要加新模块 | scope |
285
+ | Brief 已覆盖全部 | 跳过 scope,直接 plan |
211
286
 
212
287
  ---
213
288
 
@@ -215,6 +290,8 @@ AI: [正在读取 代码 + spec + plan + vision + tech_stack...]
215
290
 
216
291
  ### AI 对话命令
217
292
 
293
+ 可通过输入 `/archi.<命令>` 或直接用自然语言描述意图触发——Chat Mode 会自动加载并执行对应协议。
294
+
218
295
  | 命令 | 说明 |
219
296
  |:---|:---|
220
297
  | `/archi.start [brief]` | 读取需求 Brief,生成项目基础文档(vision / roadmap / tech_stack 等) |
@@ -281,7 +358,7 @@ Agent 模式适合单次会话。Architext 提供跨会话、跨成员、跨 AI
281
358
 
282
359
  **我的已有项目能用吗?**
283
360
 
284
- 可以。运行 `/archi.inherit`,Architext 会分析你的现有代码并生成文档骨架。已有功能以 `LEG-xx` 形式注册为存根规格,渐进式接入,无需推倒重来。
361
+ 可以。先运行 `npx archi init` 部署框架,再运行 `/archi.inherit`,Architext 会分析你的现有代码并填充文档骨架(非覆盖既有内容)。已有功能以 `LEG-xx` 形式注册为存根规格,渐进式接入,无需推倒重来。
285
362
 
286
363
  > **注意**:`/archi.inherit` 目前处于早期阶段,对大型或复杂仓库的分析结果可能不够完整,需要手动补充。欢迎提交 Issue 反馈遇到的问题。
287
364