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.
- package/CHANGELOG.md +27 -1
- package/README.md +84 -7
- package/README.zh-CN.md +84 -7
- package/dist/index.js +38 -38
- package/dist/templates/en/briefs/_base.md +44 -11
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +87 -89
- package/dist/templates/en/docs/prompts/edit.md +47 -51
- package/dist/templates/en/docs/prompts/fix.md +49 -42
- package/dist/templates/en/docs/prompts/help.md +23 -31
- package/dist/templates/en/docs/prompts/inherit.md +91 -116
- package/dist/templates/en/docs/prompts/map.md +47 -69
- package/dist/templates/en/docs/prompts/plan.md +134 -239
- package/dist/templates/en/docs/prompts/recover.md +19 -34
- package/dist/templates/en/docs/prompts/ref.md +43 -138
- package/dist/templates/en/docs/prompts/remove.md +55 -107
- package/dist/templates/en/docs/prompts/revise.md +63 -106
- package/dist/templates/en/docs/prompts/scope.md +77 -117
- package/dist/templates/en/docs/prompts/start.md +89 -129
- package/dist/templates/en/rules/00_system.md +36 -79
- package/dist/templates/en/rules/01_workflow.md +59 -57
- package/dist/templates/en/rules/03_data_governance.md +46 -42
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +12 -12
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +3 -34
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +4 -4
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +20 -20
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
- package/dist/templates/zh/briefs/_base.md +44 -12
- package/dist/templates/zh/briefs/_modules.md +27 -0
- package/dist/templates/zh/docs/prompts/audit.md +42 -56
- package/dist/templates/zh/docs/prompts/code.md +47 -49
- package/dist/templates/zh/docs/prompts/edit.md +38 -42
- package/dist/templates/zh/docs/prompts/fix.md +30 -29
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +59 -83
- package/dist/templates/zh/docs/prompts/map.md +24 -47
- package/dist/templates/zh/docs/prompts/plan.md +92 -197
- package/dist/templates/zh/docs/prompts/recover.md +9 -24
- package/dist/templates/zh/docs/prompts/ref.md +11 -106
- package/dist/templates/zh/docs/prompts/remove.md +31 -71
- package/dist/templates/zh/docs/prompts/revise.md +37 -86
- package/dist/templates/zh/docs/prompts/scope.md +51 -91
- package/dist/templates/zh/docs/prompts/start.md +67 -106
- package/dist/templates/zh/rules/00_system.md +18 -91
- package/dist/templates/zh/rules/01_workflow.md +60 -59
- package/dist/templates/zh/rules/03_data_governance.md +41 -68
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +2 -33
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
- package/package.json +1 -1
|
@@ -11,18 +11,18 @@ alwaysApply: true
|
|
|
11
11
|
|
|
12
12
|
## 1. 数据文件清单
|
|
13
13
|
|
|
14
|
-
| 文件 |
|
|
15
|
-
|
|
16
|
-
| `roadmap.json` |
|
|
17
|
-
| `map.json` |
|
|
18
|
-
| `dictionary.json` |
|
|
19
|
-
| `design_tokens.json
|
|
20
|
-
| `data_snapshot.json
|
|
21
|
-
| `error_codes.json` |
|
|
22
|
-
| `api_snapshot.json
|
|
23
|
-
| `env_registry.json
|
|
24
|
-
| `command_api.json
|
|
25
|
-
| `public_api.json
|
|
14
|
+
| 文件 | 读取时机 | 写入时机 |
|
|
15
|
+
|:---|:---|:---|
|
|
16
|
+
| `roadmap.json` | plan/code 开始时 | start 创建; AI 编辑或 `npx archi task` 更新 |
|
|
17
|
+
| `map.json` | 触碰代码时 (via context_glue) | plan Step 3; inherit Step 3.6; /archi.map |
|
|
18
|
+
| `dictionary.json` | 生成变量名/命名时 | plan Step 3; code/fix 后 step_5 自动追加 |
|
|
19
|
+
| `design_tokens.json`(仅ui) | 生成 UI 代码时 | start 创建; 设计变更时更新 |
|
|
20
|
+
| `data_snapshot.json`(仅data) | plan 设计/code 实现时 | Plan 设计 Schema; Code 同步变更 |
|
|
21
|
+
| `error_codes.json` | 编写错误处理时 | plan Step 3; code/fix 后 step_5 自动追加 |
|
|
22
|
+
| `api_snapshot.json`(仅api) | 实现/对接端点时 | plan Step 3 注册; Code 同步 |
|
|
23
|
+
| `env_registry.json`(仅api) | 引入新配置项时 | Code 引入新 env var 后立即追加 |
|
|
24
|
+
| `command_api.json`(仅cli) | 实现/修改命令时 | plan Step 3 注册; Code 同步 |
|
|
25
|
+
| `public_api.json`(仅lib) | 新增/修改导出时 | plan Step 3 注册; Code 同步 |
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
@@ -30,19 +30,19 @@ alwaysApply: true
|
|
|
30
30
|
|
|
31
31
|
### 2.1 格式约束
|
|
32
32
|
|
|
33
|
-
- **JSON Only**:
|
|
34
|
-
- **Schema Stability**:
|
|
35
|
-
- **Tier 1 (严格)**: `roadmap.json`, `plan.json` — CLI
|
|
36
|
-
- **Tier 2 (宽松)**:
|
|
37
|
-
- **Valid JSON**:
|
|
33
|
+
- **JSON Only**: `.json` 是唯一真理源。`.md` 视图由 `npx archi render` 生成,禁直接编辑。
|
|
34
|
+
- **Schema Stability**:
|
|
35
|
+
- **Tier 1 (严格)**: `roadmap.json`, `plan.json` — CLI 直接依赖,Zod Schema 校验,禁随意变更。
|
|
36
|
+
- **Tier 2 (宽松)**: 其余文件仅校验顶层 key。**所有 Tier 2 文件均可自行扩展字段(新 key / 新数组属性),无需改 CLI。**
|
|
37
|
+
- **Valid JSON**: 无尾逗号、无注释。
|
|
38
38
|
|
|
39
39
|
### 2.2 读写纪律
|
|
40
40
|
|
|
41
41
|
| 场景 | 规则 |
|
|
42
42
|
|:---|:---|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
43
|
+
| 查阅数据 | 读 `.json`,禁读 `.md` 视图(可能过期) |
|
|
44
|
+
| 更新 Roadmap 状态 | 优先 `npx archi task <ID> --status <s>`; 批量时可直接编辑 JSON |
|
|
45
|
+
| 更新其他数据 | AI 直接编辑 `.json` |
|
|
46
46
|
| 更新后 | 运行 `npx archi render` 重新生成 `.md` 视图 |
|
|
47
47
|
|
|
48
48
|
---
|
|
@@ -60,68 +60,41 @@ alwaysApply: true
|
|
|
60
60
|
|
|
61
61
|
- **Directory Mapping**: 须反映真实物理文件树。
|
|
62
62
|
- **Logical Topology**: 须注册每个 Task Module 的职责。
|
|
63
|
-
- **Feature Relations
|
|
64
|
-
- **自我校正**:
|
|
65
|
-
- **可扩展**: 若现有字段不足以描述项目架构,可在 item 中自行添加字段(如 `tags`、`owner`),或添加新顶层 key。
|
|
63
|
+
- **Feature Relations**: `featureRelations` 记录聚合型 Task 与来源的联动关系,由 AI 在 plan/inherit 时写入。
|
|
64
|
+
- **自我校正**: 代码引用违反拓扑层级关系时,须报错并停止。
|
|
66
65
|
|
|
67
66
|
### `dictionary.json`
|
|
68
67
|
|
|
69
|
-
- **命名权威**:
|
|
70
|
-
- **Boundary**:
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
- **utilities**: 封装的共享工具(如 logger、AppError、fetchClient)须注册;AI 须用已注册工具替代原始 API(参照 `replaces` 字段)。
|
|
74
|
-
- **components** (仅ui项目): 创建新组件前须搜索现有组件,优先复用。
|
|
75
|
-
- **可扩展**: 若现有字段不足以描述某个术语/工具,可在对应数组 item 中自行添加字段(如 `tags`、`scope`、`deprecated`),也可添加新顶层数组(如 `enums`、`constants`)。
|
|
68
|
+
- **命名权威**: `entities[].codeName` 是最高法律;禁用 `forbiddenSynonyms` 中的词。
|
|
69
|
+
- **Boundary**: 仅注册项目业务域;Architext 框架概念禁注册。
|
|
70
|
+
- verbs 保持全项目动词一致;utilities 须注册并用已注册工具替代原始 API。
|
|
71
|
+
- 仅ui项目: components 创建前须搜索复用。
|
|
76
72
|
|
|
77
|
-
### `design_tokens.json
|
|
73
|
+
### `design_tokens.json`(仅ui项目)
|
|
78
74
|
|
|
79
75
|
- **Token Only**: 样式严格使用 Token;禁硬编码 Hex/px/rem。
|
|
80
76
|
- **Dark Mode**: 须同时定义 `light` 和 `dark` 值。
|
|
81
|
-
- **可扩展**: 若现有 Token 结构不足以覆盖项目需求(如 `motion`、`breakpoints`、`z-index`),可自行添加新属性。
|
|
82
77
|
|
|
83
|
-
### `data_snapshot.json
|
|
78
|
+
### `data_snapshot.json`(仅data项目)
|
|
84
79
|
|
|
85
|
-
- **结构**: `models[]
|
|
86
|
-
- **Design First**: Plan
|
|
87
|
-
- **Sync Back**: Code
|
|
88
|
-
- **可扩展**: 若现有字段不足以描述数据模型(如需记录 `indexes`、`triggers`、`seedData`),可在 model item 或顶层自行添加字段。
|
|
80
|
+
- **结构**: `models[]`(名称/字段/类型/约束)+ `relationships[]`(1:1/1:N/M:N/self-ref)。
|
|
81
|
+
- **Design First**: Plan 须定义模型结构,精确到字段名与类型,禁写 "TBD"。
|
|
82
|
+
- **Sync Back**: Code 完成后须将实际变更同步回此文件。
|
|
89
83
|
|
|
90
84
|
### `error_codes.json`
|
|
91
85
|
|
|
92
|
-
- **Boundary**:
|
|
93
|
-
-
|
|
94
|
-
- **Code
|
|
95
|
-
- **statusCode**: 按项目类型填写(HTTP status / Exit code / 留空)。
|
|
96
|
-
- **Design Before Code**: 编写错误处理代码前须先在此注册错误码,含 `message` 和 `recovery`。
|
|
97
|
-
- **可扩展**: 若现有字段不足以描述错误信息(如需记录 `severity`、`retryable`),可在 item 中自行添加字段。
|
|
86
|
+
- **Boundary**: 仅注册项目业务域错误;框架基础设施错误禁注册。
|
|
87
|
+
- **Code Format**: `ERR_[MODULE]_[REASON]`。
|
|
88
|
+
- **Design Before Code**: 编写错误处理前须先注册,含 `message` 和 `recovery`。
|
|
98
89
|
|
|
99
|
-
###
|
|
90
|
+
### 条件性文件专项
|
|
100
91
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- **Register on Introduce**: 代码中每引入一个新的 `process.env.X` 或等价配置读取,须立即在此追加记录。
|
|
109
|
-
- **required**: 必填项标 `true`;有合理默认值的标 `false` 并填写 `default`。
|
|
110
|
-
- **example**: 须提供示例值,禁留空(帮助新成员快速配置环境)。
|
|
111
|
-
- **可扩展**: 可追加 `sensitive`(是否为密钥)、`validValues`(枚举约束)等字段。
|
|
112
|
-
|
|
113
|
-
### `command_api.json` (仅cli项目)
|
|
114
|
-
|
|
115
|
-
- **Register on Introduce**: 每新增或修改 CLI 命令后同步更新此文件。
|
|
116
|
-
- **owner**: 每条命令须标注归属 Task ID。
|
|
117
|
-
- **可扩展**: 可追加 `examples`、`deprecated`、`since` 等字段。
|
|
118
|
-
|
|
119
|
-
### `public_api.json` (仅lib项目)
|
|
120
|
-
|
|
121
|
-
- **Stability First**: 导出 API 一旦标注 `stable`,变更须走 `/archi.edit` 流程,不可随意修改签名。
|
|
122
|
-
- **signature**: 须写完整 TypeScript 签名,禁模糊描述(如"返回用户对象")。
|
|
123
|
-
- **owner**: 每条导出须标注归属 Task ID。
|
|
124
|
-
- **可扩展**: 可追加 `since`、`examples`、`seeAlso` 等字段。
|
|
92
|
+
| 文件 | 核心规则 |
|
|
93
|
+
|:---|:---|
|
|
94
|
+
| `api_snapshot.json`(仅api) | endpoints[] 注册; Register First 禁实现未登记端点; owner 标注 Task ID |
|
|
95
|
+
| `env_registry.json`(仅api) | 引入即注册; required/example 必填 |
|
|
96
|
+
| `command_api.json`(仅cli) | 修改即同步; owner 标注 Task ID |
|
|
97
|
+
| `public_api.json`(仅lib) | stable 变更须走 /archi.edit; 完整 TS 签名; owner 标注 Task ID |
|
|
125
98
|
|
|
126
99
|
---
|
|
127
100
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: archi-decompose-roadmap
|
|
3
|
+
type: subagent
|
|
3
4
|
description: Architext 任务分解专家。五步分解法:先标定项目类型校准基建清单,再双视角提取业务 Task 和 Infra 任务,识别 Polish 打磨任务,NFR 横切关注点按权重决定注入或独立,建立真实依赖链并输出并行批次。任务通过 ID 前缀(INF/FEAT/POLISH/EDIT)编码类型,tag 字段承载业务领域标签。产出符合 Tier 1 Schema 的 roadmap.json 任务,作为 `/archi.plan` 的输入契约。
|
|
4
5
|
---
|
|
5
6
|
|
|
@@ -275,10 +276,6 @@ Brief → [本 Skill] → roadmap.json 任务
|
|
|
275
276
|
}
|
|
276
277
|
```
|
|
277
278
|
|
|
278
|
-
> **ID 前缀 vs tag 职责分离**:
|
|
279
|
-
> - `id` 前缀(`INF-` / `FEAT-` / `POLISH-` / `EDIT-`)= 任务类型,决定 `/archi.plan` 的 spec 验收格式
|
|
280
|
-
> - `tag` = 业务领域标签,仅用于人类分类浏览,不影响 AI 行为
|
|
281
|
-
|
|
282
279
|
`deps` 为空或全部 `done` → `pending`;有未完成 deps → `blocked`
|
|
283
280
|
|
|
284
281
|
---
|
|
@@ -291,35 +288,7 @@ Brief → [本 Skill] → roadmap.json 任务
|
|
|
291
288
|
|
|
292
289
|
产出三部分数据:
|
|
293
290
|
|
|
294
|
-
**①
|
|
295
|
-
|
|
296
|
-
```json
|
|
297
|
-
{
|
|
298
|
-
"phases": [
|
|
299
|
-
{
|
|
300
|
-
"id": "phase-infra",
|
|
301
|
-
"name": "Infrastructure",
|
|
302
|
-
"tasks": [
|
|
303
|
-
{ "id": "INF-01", "title": "...", "status": "pending", "description": "...", "goal": "...", "deps": [], "tag": "Infra", "slug": "..." }
|
|
304
|
-
]
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"id": "phase-core",
|
|
308
|
-
"name": "Core Features",
|
|
309
|
-
"tasks": [
|
|
310
|
-
{ "id": "FEAT-01", "title": "...", "status": "blocked", "description": "...", "goal": "...", "deps": ["INF-01"], "tag": "Core", "slug": "..." }
|
|
311
|
-
]
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"id": "phase-polish",
|
|
315
|
-
"name": "Polish & Launch",
|
|
316
|
-
"tasks": [
|
|
317
|
-
{ "id": "POLISH-01", "title": "...", "status": "blocked", "description": "...", "goal": "...", "deps": ["FEAT-01"], "tag": "Quality", "slug": "..." }
|
|
318
|
-
]
|
|
319
|
-
}
|
|
320
|
-
]
|
|
321
|
-
}
|
|
322
|
-
```
|
|
291
|
+
**① 任务数据**:直接对应 `roadmap.json` 的 `phases[].tasks[]` 结构,每个 task 遵循上方 Task JSON Schema。phases 按 `phase-infra` → `phase-core` → `phase-polish` 排列。
|
|
323
292
|
|
|
324
293
|
**② NFR 归并清单**(须随任务数据一并返回给调用方;调用方写入 roadmap 时追加为 `nfr` 顶层字段;`/archi.plan` 的 `step_1_load` 须读取此清单):
|
|
325
294
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: archi-interview-protocol
|
|
3
|
+
type: specialist
|
|
3
4
|
description: Architext 补充访谈协议。规范信息缺口的提问方式:选择题优先、AI 推荐 + [推荐] 标注、[Z] 自定义兜底、AI+/AI- 完整分析、选项说明描述具体行为。产出标准 Q-table 和 INPUT 提示行,供 /archi.start、/archi.scope、/archi.plan 的补充确认步骤引用。
|
|
4
5
|
---
|
|
5
6
|
|
|
@@ -19,7 +20,7 @@ description: Architext 补充访谈协议。规范信息缺口的提问方式:
|
|
|
19
20
|
> - 负责:问题如何提(格式/规则/语气)
|
|
20
21
|
> - 不负责:问什么内容(由调用方的缺口列表决定)、用户回答后如何处理(由调用方决定)
|
|
21
22
|
|
|
22
|
-
##
|
|
23
|
+
## 调用模式
|
|
23
24
|
|
|
24
25
|
| 调用方 | 触发步骤 | 触发条件 | 问题数上限 |
|
|
25
26
|
|:---|:---|:---|:---|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: archi-plan-options
|
|
3
|
+
type: subprocess
|
|
3
4
|
description: Architext 架构决策选项库。定义五个核心维度(Core Structure / Interaction Pattern / Data Flow / Error Handling / Access & Scope)的候选方案及 AI+/AI- 分析,覆盖 Web/CLI/API/Lib/Mobile/MiniApp/Extension/Desktop/AI Agent 等项目类型。含约定继承规则、项目标签路由逻辑、推荐 vs 展开判断准则,供 /archi.plan step_2 Part 2(架构建议阶段)引用。
|
|
4
5
|
---
|
|
5
6
|
|