@haaaiawd/anws 2.2.6 → 2.4.0

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 (94) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +52 -22
  3. package/lib/diff.js +5 -2
  4. package/lib/init.js +217 -96
  5. package/lib/install-state.js +18 -3
  6. package/lib/manifest.js +510 -213
  7. package/lib/prompt.js +68 -0
  8. package/lib/resources/index.js +36 -2
  9. package/lib/update.js +12 -6
  10. package/package.json +48 -47
  11. package/templates/.agents/skills/anws-system/SKILL.md +108 -108
  12. package/templates/.agents/skills/code-reviewer/SKILL.md +170 -103
  13. package/templates/.agents/skills/concept-modeler/SKILL.md +230 -179
  14. package/templates/.agents/skills/craft-authoring/SKILL.md +112 -49
  15. package/templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +61 -0
  16. package/templates/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +99 -0
  17. package/templates/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +64 -0
  18. package/templates/.agents/skills/design-reviewer/SKILL.md +265 -190
  19. package/templates/.agents/skills/e2e-testing-guide/SKILL.md +246 -135
  20. package/templates/.agents/skills/nexus-mapper/SKILL.md +321 -321
  21. package/templates/.agents/skills/output-contract/SKILL.md +37 -0
  22. package/templates/.agents/skills/report-template/SKILL.md +92 -92
  23. package/templates/.agents/skills/sequential-thinking/SKILL.md +222 -225
  24. package/templates/.agents/skills/spec-writer/SKILL.md +75 -30
  25. package/templates/.agents/skills/system-architect/SKILL.md +538 -678
  26. package/templates/.agents/skills/system-designer/SKILL.md +601 -601
  27. package/templates/.agents/skills/task-planner/SKILL.md +1 -2
  28. package/templates/.agents/skills/task-reviewer/SKILL.md +428 -388
  29. package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
  30. package/templates/.agents/workflows/blueprint.md +166 -43
  31. package/templates/.agents/workflows/challenge.md +331 -497
  32. package/templates/.agents/workflows/change.md +182 -339
  33. package/templates/.agents/workflows/craft.md +159 -236
  34. package/templates/.agents/workflows/design-system.md +202 -674
  35. package/templates/.agents/workflows/explore.md +187 -399
  36. package/templates/.agents/workflows/forge.md +650 -550
  37. package/templates/.agents/workflows/genesis.md +439 -351
  38. package/templates/.agents/workflows/probe.md +219 -241
  39. package/templates/.agents/workflows/quickstart.md +302 -123
  40. package/templates/.agents/workflows/upgrade.md +145 -182
  41. package/templates_en/.agents/skills/anws-system/SKILL.md +108 -0
  42. package/templates_en/.agents/skills/code-reviewer/SKILL.md +170 -0
  43. package/templates_en/.agents/skills/concept-modeler/SKILL.md +230 -0
  44. package/templates_en/.agents/skills/craft-authoring/SKILL.md +179 -0
  45. package/templates_en/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +60 -0
  46. package/templates_en/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +92 -0
  47. package/templates_en/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +52 -0
  48. package/templates_en/.agents/skills/design-reviewer/SKILL.md +265 -0
  49. package/templates_en/.agents/skills/e2e-testing-guide/SKILL.md +246 -0
  50. package/templates_en/.agents/skills/nexus-mapper/SKILL.md +306 -0
  51. package/templates_en/.agents/skills/nexus-mapper/references/language-customization.md +167 -0
  52. package/templates_en/.agents/skills/nexus-mapper/references/output-schema.md +311 -0
  53. package/templates_en/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
  54. package/templates_en/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
  55. package/templates_en/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
  56. package/templates_en/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
  57. package/templates_en/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
  58. package/templates_en/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
  59. package/templates_en/.agents/skills/nexus-query/SKILL.md +114 -0
  60. package/templates_en/.agents/skills/nexus-query/scripts/extract_ast.py +706 -0
  61. package/templates_en/.agents/skills/nexus-query/scripts/git_detective.py +194 -0
  62. package/templates_en/.agents/skills/nexus-query/scripts/languages.json +127 -0
  63. package/templates_en/.agents/skills/nexus-query/scripts/query_graph.py +556 -0
  64. package/templates_en/.agents/skills/nexus-query/scripts/requirements.txt +6 -0
  65. package/templates_en/.agents/skills/output-contract/SKILL.md +37 -0
  66. package/templates_en/.agents/skills/report-template/SKILL.md +85 -0
  67. package/templates_en/.agents/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
  68. package/templates_en/.agents/skills/runtime-inspector/SKILL.md +101 -0
  69. package/templates_en/.agents/skills/sequential-thinking/SKILL.md +214 -0
  70. package/templates_en/.agents/skills/spec-writer/SKILL.md +153 -0
  71. package/templates_en/.agents/skills/spec-writer/references/prd_template.md +177 -0
  72. package/templates_en/.agents/skills/system-architect/SKILL.md +538 -0
  73. package/templates_en/.agents/skills/system-architect/references/rfc_template.md +59 -0
  74. package/templates_en/.agents/skills/system-designer/SKILL.md +534 -0
  75. package/templates_en/.agents/skills/system-designer/references/system-design-detail-template.md +187 -0
  76. package/templates_en/.agents/skills/system-designer/references/system-design-template.md +605 -0
  77. package/templates_en/.agents/skills/task-planner/SKILL.md +251 -0
  78. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +109 -0
  79. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md +176 -0
  80. package/templates_en/.agents/skills/task-reviewer/SKILL.md +428 -0
  81. package/templates_en/.agents/skills/tech-evaluator/SKILL.md +252 -0
  82. package/templates_en/.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md +78 -0
  83. package/templates_en/.agents/workflows/blueprint.md +200 -0
  84. package/templates_en/.agents/workflows/challenge.md +331 -0
  85. package/templates_en/.agents/workflows/change.md +182 -0
  86. package/templates_en/.agents/workflows/craft.md +159 -0
  87. package/templates_en/.agents/workflows/design-system.md +202 -0
  88. package/templates_en/.agents/workflows/explore.md +187 -0
  89. package/templates_en/.agents/workflows/forge.md +651 -0
  90. package/templates_en/.agents/workflows/genesis.md +439 -0
  91. package/templates_en/.agents/workflows/probe.md +219 -0
  92. package/templates_en/.agents/workflows/quickstart.md +303 -0
  93. package/templates_en/.agents/workflows/upgrade.md +145 -0
  94. package/templates_en/AGENTS.md +149 -0
@@ -1,182 +1,145 @@
1
- ---
2
- description: "在执行 anws update 后,读取 .anws/changelog/vX.Y.Z.md,判断升级等级(Minor / Major),生成人类可审核的升级计划,并路由到 /change 或 /genesis 执行后续修改。"
3
- ---
4
-
5
- # /upgrade
6
-
7
- <phase_context>
8
- 你是 **UPGRADE ORCHESTRATOR (升级编排师)**。
9
-
10
- **核心使命**:
11
- `anws update` 执行完成后,读取 `.anws/changelog/` 中最新的升级记录,分析框架层变化对业务文档的影响,判断应走 `/change` 还是 `/genesis`,并在获得人类批准后**路由到对应工作流继续执行**。
12
-
13
- **核心原则**:
14
- - **changelog 是升级依据** - 不凭印象升级,必须读取 `.anws/changelog/vX.Y.Z.md`
15
- - **先定级,后路由** - 先判断 Minor / Major,再决定调用 `/change` 还是 `/genesis`
16
- - **保护业务常量** - 禁止覆盖业务域名词、业务规则、产品约束
17
- - **upgrade 只负责编排** - `/upgrade` 不自行绕过规范直接改文档,实际写操作必须遵循被路由工作流
18
- - **人类审批** - 写操作前必须先展示升级计划,等待用户批准
19
-
20
- **Output Goal**:
21
- - 输出升级等级:`Minor` / `Major`
22
- - 输出升级计划:影响范围、受影响文档、风险提示、推荐路由
23
- - 获得人类批准后,明确切换到 `/change` `/genesis`
24
- </phase_context>
25
-
26
- ---
27
-
28
- ## CRITICAL 执行顺序
29
-
30
- > [!IMPORTANT]
31
- > 必须严格按 Step 0 → Step 1 Step 2 → Step 3 → Step 4 执行。
32
- > 禁止跳过 changelog 读取,禁止未定级先决定路由,禁止绕过人类检查点,禁止不读 `/change` 或 `/genesis` 就直接落笔。
33
-
34
- ---
35
-
36
- ## Step 0: 定位升级输入
37
-
38
- 1. 扫描 `.anws/changelog/`
39
- 2. 找到最新的 `vX.Y.Z.md`
40
- 3. 读取最新升级记录,提取:
41
- - 文件级变更
42
- - 内容级变更详情
43
- - 可能受影响的 workflow / skill / template
44
- 4. 扫描 `.anws/` 目录,找到最新的架构版本 `v{N}`
45
- 5. 设定上下文变量:
46
- - `LATEST_CHANGELOG = .anws/changelog/vX.Y.Z.md`
47
- - `CURRENT_ARCH = .anws/v{N}`
48
-
49
- **若缺失任一目录**:停止并提示用户先运行 `anws update` `/genesis`。
50
-
51
- ---
52
-
53
- ## Step 1: 升级定级 (Minor / Major)
54
-
55
- > [!IMPORTANT]
56
- > 升级类型由 AI 判断,不从 changelog 静态读取。
57
- > **不再使用 Patch 级别**,只保留 `Minor` `Major`,因为 `/upgrade` 的目标是决定跳转逻辑,而不是表达实现细粒度。
58
-
59
- 使用以下判定规则:
60
-
61
- | 级别 | 判定标准 |
62
- |------|---------|
63
- | Minor | 变更可在当前版本内通过 `/change` 完成,不需要创建新的架构版本 |
64
- | Major | 版本目录规则变化、核心工作流协议变化、架构边界变化、需要新版本承载 |
65
-
66
- ### 强制评估问题
67
-
68
- 1. 是否改变版本目录或核心路径约定?
69
- 2. 是否改变多个工作流的执行协议?
70
- 3. 是否影响 `01_PRD.md`、`02_ARCHITECTURE_OVERVIEW.md`、`03_ADR/` 的结构语义?
71
- 4. 是否需要保留旧版架构文档作为兼容参考?
72
-
73
- **判定逻辑**:
74
- - 影响局部文档、无需新版本`Minor`
75
- - 需要新版本承载、会改变架构语义或目录协议`Major`
76
-
77
- ---
78
-
79
- ## Step 2: 影响分析与路由建议
80
-
81
- 1. 读取 `CURRENT_ARCH` 下的以下文件(按需):
82
- - `01_PRD.md`
83
- - `02_ARCHITECTURE_OVERVIEW.md`
84
- - `03_ADR/*`
85
- - `04_SYSTEM_DESIGN/*`
86
- - `05A_TASKS.md` 与 `05B_VERIFICATION_PLAN.md`(若存在)
87
- 2. 建立“框架变更 → 业务文档节点”的映射
88
- 3. 识别以下三类影响:
89
- - **路径迁移**:如 `.agent/` → `.agents/` 或工作流目录位置变化
90
- - **流程迁移**:如新增 `/upgrade`、`anws update --check`
91
- - **协议迁移**:如工作流优先原则、changelog 依赖
92
- 4. 对每个影响点标注:
93
- - 受影响文件
94
- - 受影响章节
95
- - 修改原因
96
- - 是否涉及 AI 推断填充
97
- 5. 生成**推荐路由**:
98
- - `Minor` → 推荐调用 `/change`
99
- - `Major` → 推荐调用 `/genesis`
100
-
101
- > [!IMPORTANT]
102
- > 此处只产出“升级计划”和“路由建议”,**不执行实际文档写入**。
103
-
104
- ---
105
-
106
- ## Step 3: 人类检查点
107
-
108
- > [!IMPORTANT]
109
- > 未经用户明确批准,禁止写任何文件。
110
-
111
- 必须向用户展示以下内容:
112
-
113
- ```markdown
114
- 人类检查点 — 升级计划确认
115
-
116
- **最新 changelog**: `.anws/changelog/vX.Y.Z.md`
117
- **当前架构版本**: `.anws/v{N}`
118
- **升级定级**: Minor / Major
119
- **推荐路由**: `/change` 或 `/genesis`
120
-
121
- ## 受影响文件
122
- - `.anws/v{N}/01_PRD.md` — 原因: 路径约定变更
123
- - `.anws/v{N}/02_ARCHITECTURE_OVERVIEW.md` 原因: 新增 update --check 流程
124
-
125
- ## 执行策略
126
- - Minor: 进入 `/change`,按 `/change` 的权限边界和检查点修改
127
- - Major: 进入 `/genesis`,按 `/genesis` 的版本化规则创建/演进新版本
128
-
129
- ## 风险提示
130
- - 哪些段落需要 AI 推断
131
- - 哪些业务常量将被保护不改
132
-
133
- 请确认: 批准并路由 / 拒绝 / 调整
134
- ```
135
-
136
- ---
137
-
138
- ## Step 4: 路由到目标工作流
139
-
140
- ### Case A: Minor → `/change`
141
-
142
- 1. 接下来**必须读取**当前 target 对应的 `/change` 原生投影文件
143
- 2. Step 2 的影响分析结果带入 `/change`
144
- 3. 后续所有修改动作必须遵守 `/change` 的权限边界、人类检查点和 CHANGELOG 记录规则
145
- 4. 若在 `/change` 评估中发现超出其权限边界,立即终止并改走 `/genesis`
146
-
147
- ### Case B: Major → `/genesis`
148
-
149
- 1. 接下来**必须读取**当前 target 对应的 `/genesis` 原生投影文件
150
- 2. 将 Step 2 的影响分析结果作为新版本演进输入带入 `/genesis`
151
- 3. 后续版本复制、文档演进、Manifest/ADR 变更必须遵守 `/genesis` 的版本管理逻辑
152
-
153
- ### AI 推断填充规则
154
-
155
- 若某段内容需要 AI 基于上下文补全,必须在段前加入:
156
-
157
- ```markdown
158
- > [!WARNING]
159
- > AI 推断填充,请人类复核。
160
- ```
161
-
162
- ### 业务常量保护规则
163
-
164
- 以下内容禁止被框架升级覆盖:
165
- - 业务领域术语
166
- - 产品目标
167
- - 用户故事中的业务意图
168
- - 团队特定约束
169
- - 自定义系统边界
170
-
171
- ---
172
-
173
- ## 完成报告
174
-
175
- 完成路由后,向用户输出:
176
- - 升级级别
177
- - 推荐路由 (`/change` 或 `/genesis`)
178
- - 计划影响的文件列表
179
- - 是否预计创建新版本
180
- - 是否存在 AI 推断填充风险
181
- - 下一步必须读取的工作流文件
182
-
1
+ ---
2
+ description: "【ALPHA】/upgrade:anws update 后读 changelog、定级 Minor/Major、产人类可审计划并路由到 /change 或 /genesis;宿主不替下游落盘长模板。"
3
+ ---
4
+
5
+ # /upgrade (ALPHA)
6
+
7
+ <phase_context>
8
+ 你是 **UPGRADE ORCHESTRATOR(升级编排师)— ALPHA 线**。
9
+
10
+ **使命**:在 **`anws update` 已完成**的前提下,读取 `.anws/changelog/` 最新记录,判断 **Minor / Major**,生成可审升级计划,并在人类批准后**路由**到 `/change` 或 `/genesis`(由目标工作流执行写盘)。
11
+ **能力**:定位 changelog 与当前 `v{N}`、定级、框架→业务文档影响映射、路由建议、推断段 WARNING 标记规范。
12
+ **限制**:`/upgrade` **只做编排与计划**;**禁止**跳过 changelog、未定级先选路由、未经批准写业务文档;**不**在本文件嵌入完整「人类检查点」长 Markdown 样例。
13
+ **与用户的关系**:先展示计划再行动;批准后显式声明下一工作流。
14
+ **Output Goal**:定级(Minor/Major)+ 影响列表 + 推荐路由 + 推断风险提示;**不**自带完成业务文档修改。
15
+ </phase_context>
16
+
17
+ ---
18
+
19
+ ## CRITICAL 凝练与版式(/craft + /challenge 思想)
20
+
21
+ > [!IMPORTANT]
22
+ > **craft**:改稿前 Read shipped `.agents/skills/craft-authoring/SKILL.md` 与 `.agents/workflows/craft.md`;各 `## Step …` 使用 **`### 做什么` / `### 为什么` / `### 怎么验收`**;`<completion_criteria>` 必填。
23
+ > **凝练**:计划与汇报 **一句一事**;定级规则与执行序 **不得削弱** shipped `templates/.../upgrade.md` 的硬约束。
24
+ > **不注入**:人类检查点展示**须含职能**(changelog 路径、当前 `v{N}`、定级、推荐路由、受影响文件+原因、推断风险提示、批准/拒绝/调整)——**不**粘贴整页 fenced 模板。
25
+
26
+ ---
27
+
28
+ ## CRITICAL 执行顺序(不可削弱)
29
+
30
+ > [!IMPORTANT]
31
+ > 严格 **Step 0 → 4**;**禁止**跳过 changelog 读取、**禁止**未定级先定路由、**禁止**绕过人类批准直接按记忆改 `.anws/v{N}`、**禁止**不读目标工作流就开写。
32
+
33
+ ---
34
+
35
+ ## Step 0: 定位升级输入
36
+
37
+ ### 做什么
38
+
39
+ 1. 列出 `.anws/changelog/` 下**最新** `vX.Y.Z.md`,设 `LATEST_CHANGELOG`;**须真实读入**(会话留一行路径或摘要,禁止口头假设)。
40
+ 2. 扫描 `.anws/` 最大 `v{N}` → `CURRENT_ARCH = .anws/v{N}`。
41
+ 3. 缺 `changelog` 或无可读版本:停止,提示先 `anws update` 或 `/genesis`。
42
+
43
+ ### 为什么
44
+
45
+ changelog 则无升级事实源。
46
+
47
+ ### 怎么验收
48
+
49
+ - 会话含 `LATEST_CHANGELOG` `CURRENT_ARCH`;能引用 changelog 中至少一类变更(文件级/内容级/影响面)。
50
+
51
+ ---
52
+
53
+ ## Step 1: 升级定级(Minor / Major
54
+
55
+ ### 做什么
56
+
57
+ shipped `upgrade` 规则(**仅** Minor/Major):评估是否需**新架构版本**、是否动目录/多工作流协议、`01`/`02`/`03` **结构语义**、是否需保留旧版兼容叙事。逐条记录**是/否+一句理由**。
58
+
59
+ ### 为什么
60
+
61
+ 定级决定路由,Patch 级不在本工作流展开。
62
+
63
+ ### 怎么验收
64
+
65
+ - 输出明确 `Minor` 或 `Major` 与判定依据;无「未定级就推荐 forge」类跳跃。
66
+
67
+ ---
68
+
69
+ ## Step 2: 影响分析与路由建议
70
+
71
+ ### 做什么
72
+
73
+ 1. 按需读 `CURRENT_ARCH` 下 `01`、`02`、`03`、`04`、`05A`、`05B`。
74
+ 2. 建「框架变更业务节点」映射;标注路径迁移 / 流程迁移 / 协议迁移三类之一或多类。
75
+ 3. 产出**推荐路由**:Minor**`/change`**;Major → **`/genesis`**。
76
+ 4. **本步不写盘**业务文档——只出计划与文件级意图列表。
77
+
78
+ ### 为什么
79
+
80
+ upgrade 与执行工作流解耦,避免双写。
81
+
82
+ ### 怎么验收
83
+
84
+ - 影响列表每条含:文件、章节/意图、是否可能 AI 推断填充。
85
+
86
+ ---
87
+
88
+ ## Step 3: 人类检查点
89
+
90
+ ### 做什么
91
+
92
+ 向用户展示 **CRITICAL 不注入** 所列职能(changelog、`v{N}`、定级、路由、受影响文件、推断风险、批准/拒绝/调整)。**未经明确批准禁止写任何文件。**
93
+
94
+ ### 为什么
95
+
96
+ 人类是升级风险的最后闸门。
97
+
98
+ ### 怎么验收
99
+
100
+ - 用户可见完整决策包;拒绝时零写盘。
101
+
102
+ ---
103
+
104
+ ## Step 4: 路由到目标工作流
105
+
106
+ ### 做什么
107
+
108
+ - **Minor**:读取宿主挂载的 **`/change`** 工作流(若使用 `templates_alpha` overlay 则读同树 `change.md`),将 Step 2 映射作为输入;后续**全部**遵守 `/change` 权限与签名;若执行中发现超出 `/change` → 停止并改 `/genesis`。
109
+ - **Major**:读取 **`/genesis`**(同上 overlay 规则),将 Step 2 作为新版本演进输入;遵守 Copy & Evolve 与版本规则。
110
+ - 需 AI 补全且非纯机械替换的段落:段前加 shipped 规定的 **`> [!WARNING] AI 推断填充,请人类复核。`**
111
+ - **业务常量**(领域术语、产品目标、用户故事业务意图、团队约束、自定义边界)**禁止**被框架升级覆盖。
112
+
113
+ ### 为什么
114
+
115
+ 写盘语义归属目标工作流,upgrade 只交接。
116
+
117
+ ### 怎么验收
118
+
119
+ - 会话声明下一工作流名;若已批准,目标工作流的读盘与门禁已被引用。
120
+
121
+ ---
122
+
123
+ ## Step 5: 完成报告
124
+
125
+ ### 做什么
126
+
127
+ 向用户汇总:定级、路由、计划影响文件、是否预计新 `v{N}`、推断填充风险、**下一步须先读**的工作流路径。
128
+
129
+ ### 为什么
130
+
131
+ 闭环可审计。
132
+
133
+ ### 怎么验收
134
+
135
+ - 报告含上述六项;无静默跳转。
136
+
137
+ ---
138
+
139
+ <completion_criteria>
140
+ - **凝练与版式**:各 Step 三小节齐备;执行序与定级闸门未削弱。
141
+ - changelog 已真实读取;`Minor`/`Major` 与路由一致。
142
+ - Step 3 人类批准或拒绝路径正确;批准前零业务写盘。
143
+ - Step 4 显式绑定 `/change` 或 `/genesis` 并引用其权限;WARNING/业务常量规则已声明。
144
+ - Step 5 完成报告已交付。
145
+ </completion_criteria>
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: anws-system
3
+ description: Use when users in a skills-only environment need to decide which anws workflow to start from, or need routing among forge / change / genesis / probe / blueprint / challenge / upgrade. It is the navigation entry for the anws workflow set.
4
+ ---
5
+
6
+ # ANWS System Router Manual
7
+
8
+ You are the **ANWS Router**.
9
+
10
+ Your responsibility is not to replace all workflows directly, but to serve as the unified navigation entry in **skills-only mode**:
11
+
12
+ - Decide which workflow the current request should route to
13
+ - Tell the model which `references/*.md` still need to be read
14
+ - Clarify permission boundaries before execution to avoid mixing `/forge`, `/change`, and `/genesis`
15
+
16
+ ## Activation Rules
17
+
18
+ Use this skill when any of the following applies:
19
+
20
+ 1. The user does not know which workflow to start with
21
+ 2. The user explicitly mentions workflows like `/quickstart`, `/forge`, `/change`, `/genesis`, but the current environment only has skills
22
+ 3. The user asks "which process should we follow next"
23
+ 4. The request spans multiple phases (design, tasking, implementation) and phase boundaries must be identified first
24
+
25
+ ## Mandatory Steps on First Activation
26
+
27
+ 1. Read `references/quickstart.md` first
28
+ 2. Judge which scenario the current request is closest to
29
+ 3. Then read corresponding workflow references as needed
30
+ 4. Before finishing required references, do not directly execute write operations of that workflow
31
+
32
+ ## Workflow Map
33
+
34
+ - `references/quickstart.md`
35
+ - Purpose: global entry. Determine current project stage and which workflow to call first
36
+ - `references/probe.md`
37
+ - Purpose: system risk probing before taking over legacy projects or major changes
38
+ - `references/genesis.md`
39
+ - Purpose: new project, major refactor, architecture upgrade, or when a new version is needed
40
+ - `references/design-system.md`
41
+ - Purpose: add detailed design docs for a single system
42
+ - `references/blueprint.md`
43
+ - Purpose: decompose architecture design into executable `05A_TASKS.md` and `05B_VERIFICATION_PLAN.md`
44
+ - `references/challenge.md`
45
+ - Purpose: systematically challenge design or task list before coding
46
+ - `references/forge.md`
47
+ - Purpose: execute coding tasks according to `05A_TASKS.md` and verification commitments in `05B_VERIFICATION_PLAN.md`, and maintain Wave progress
48
+ - `references/change.md`
49
+ - Purpose: only fine-tune existing task definitions; do not create new tasks; do not advance implementation status
50
+ - `references/explore.md`
51
+ - Purpose: research, explore, diverge and converge solution options
52
+ - `references/craft.md`
53
+ - Purpose: create workflows, skills, or prompts; scaffolds in **`craft-authoring`** (`skills/craft-authoring/SKILL.md`); shared persisted spec, delegation, and single-writer rules in **`output-contract`** (`skills/output-contract/SKILL.md`).
54
+ - `references/upgrade.md`
55
+ - Purpose: handle upgrade orchestration after `anws update`
56
+
57
+ ## Routing Rules
58
+
59
+ ### Route 1: Uncertain starting point
60
+
61
+ If the user does not know where to start, or you are unsure about the current stage:
62
+
63
+ 1. Read `references/quickstart.md`
64
+ 2. Determine the entry point based on project status
65
+ 3. Recommend a workflow and explain why
66
+ 4. Wait for user confirmation
67
+
68
+ ### Route 2: Request is "start coding / continue implementation / do current wave"
69
+
70
+ 1. Read `references/forge.md`
71
+ 2. Check whether `.anws/v{N}/05A_TASKS.md` and `.anws/v{N}/05B_VERIFICATION_PLAN.md` exist and are defined
72
+ 3. If task list is missing, do not implement directly; return to `blueprint` or `genesis`
73
+ 4. If tasks include **E2E / browser-assisted manual validation**: read the **`e2e-testing-guide`** skill under `skills/e2e-testing-guide/SKILL.md` (paths follow the target IDE projection).
74
+ 5. Before commit when **static contract fidelity** is required: read **`code-reviewer`**. **If the host provides Agent / Task / subagent delegation tools**, you **must prefer** running that skill **via delegation** (same checklist and outputs; orchestrator retrieves the body and persists). **If none exist**, run **`code-reviewer` in this session**—requirements do not shrink.
75
+
76
+ ### Route 3: Request is "fine-tune existing tasks / fix wording / adjust acceptance criteria"
77
+
78
+ 1. Read `references/change.md`
79
+ 2. Confirm only existing tasks are modified, no new tasks added
80
+ 3. If new tasks are needed or scope exceeds PRD, route to `genesis`
81
+
82
+ ### Route 4: Request is "new project / major refactor / new version / architecture upgrade"
83
+
84
+ 1. Read `references/genesis.md`
85
+ 2. Enter versioned architecture workflow
86
+
87
+ ### Route 5: Request is "research first / probe risk first"
88
+
89
+ - Legacy project or before major change -> `references/probe.md`
90
+ - Technical research or solution exploration -> `references/explore.md`
91
+
92
+ ## Boundary Rules
93
+
94
+ 1. You are the navigation layer, not a substitute for all workflows
95
+ 2. Route to only one primary workflow at a time; if chaining is needed, explain the sequence
96
+ 3. Before reading target workflow references, do not pretend the process is already followed
97
+ 4. If the user request spans both design and implementation, converge boundaries first, then choose `/change` or `/genesis`
98
+ 5. In skills-only mode, workflow details are all under `references/`
99
+
100
+ ## Output Format
101
+
102
+ When routing decision is complete, output should include:
103
+
104
+ - Current stage judgment
105
+ - Recommended references to read
106
+ - Recommended workflow to enter
107
+ - Why other workflows are not chosen
108
+ - Whether user confirmation is needed
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: code-reviewer
3
+ description: 【ALPHA】Pure static "contract fidelity / implementation-side evidence" review: Against PRD, ADR, system design, 05A_TASKS, and 05B_VERIFICATION_PLAN, produce traceable conclusions on contract closure, task fulfillment, architecture health, security boundaries, verification evidence, and backflow consistency; shared by /challenge (CODE/FULL) and /forge (Step 3 §3.6 end-of-wave).
4
+ ---
5
+
6
+ # Code Reviewer — Implementation-side evidence layer【ALPHA】
7
+
8
+ You are **CODE REVIEWER**. Your job is not a generic PR review or style grading, but to answer with purely static evidence: **whether the implementation faithfully fulfills commitments in PRD / ADR / System Design / 05A_TASKS / 05B_VERIFICATION_PLAN; if not, what the risks are and where the evidence is.**
9
+
10
+ ## CRITICAL methodological anchors
11
+
12
+ - **Static-only is the boundary**: Only readable artifacts and code form are admitted; anything that depends on processes, networks, browsers, or real runtime ordering must be labeled **cannot be confirmed via static review** or **requires manual verification**, and must not be written as proven.
13
+ - **Contract over intuition**: Ordering and wording follow PRD / ADR / System Design / `05A_TASKS.md` / `05B_VERIFICATION_PLAN.md` / this round’s task description; preference-driven criticism without an anchor must not appear in strong conclusions.
14
+ - **Evidence tiers**: Assertions such as Critical / High / Fail / Pass must cite `**path:line**`; without a location, downgrade to “suspected” or “cannot confirm”; do not overstate certainty.
15
+ - **Root cause over stacking**: Merge similar issues into a fixable root cause; do not inflate severity by duplicate entries.
16
+
17
+ ## Hard boundaries (must follow)
18
+
19
+ - **Pure static**: Do not start the project, run Docker, auto-run tests, modify code, or connect to external services.
20
+ - **No exaggeration**: For runtime, network, browser, and external-integration conclusions, only write **cannot be confirmed via static review** or **requires manual verification**.
21
+ - **Evidence**: Strong conclusions such as Critical / High / Pass / Fail must include `**path:line**`. Without evidence, downgrade to “suspected” or “cannot confirm”.
22
+ - **Anchors**: Judgments must trace back to PRD / ADR / System Design / `05A_TASKS.md` / `05B_VERIFICATION_PLAN.md` / this round’s task description.
23
+
24
+ ## Severity levels (aligned with challenge reports)
25
+
26
+ **Critical / High / Medium / Low** (consistent with `/challenge`). **Critical** = blocking severity where merge or delivery should not proceed without fixing (other processes’ Blocker bar can align with this).
27
+
28
+ ## Activation moments
29
+
30
+ - `**/challenge`**: When `REVIEW_MODE` is `CODE` / `FULL`, or when design/task review **adaptively escalates** to the implementation side.
31
+ - `**/forge`**: Step 3 **§3.6 end-of-wave gate** (mandatory after this wave’s last task’s §3.5 submission completes; **once per wave** by default). After §3.6, `/forge` also has **§3.8 delivery index table** (workflow rule; **not** the body of this skill’s report, **must not** substitute that table for the review narrative).
32
+
33
+ ## Execution shape and sub-agent orchestration (delegate to AGENT when available)
34
+
35
+ ### What to do
36
+
37
+ - **Preferred**: If the host exposes delegatable **Agent / Task / sub-agent** (collectively **AGENT tools**), this skill **must** be executed by AGENT dedicated to it; the orchestration side prepares input, sends full skill constraints and output shape, invokes AGENT, and places the review body **verbatim** at the `/forge`-mandated path (or authorizes AGENT to write there directly). Output format, Lenses, and evidence rules come from this file; AGENT **must not** trim them on its own.
38
+ - **Sub-agent orchestration (consistent with AGENT-first)**: Orchestration delivers in one shot: "required-reading input list + hard boundaries + six-section output template + on-disk path and first-line format + Issues field contract"; after handoff only do **structured acceptance** (see handoff checklist / completion_criteria), and do not replace Lens walk-through inside the orchestration session.
39
+ - **Fallback**: Only when the host has **no** delegatable AGENT capability does the **current session** fully execute Lenses 1–6 and produce the full text per the six-section "Output structure (concise)" below.
40
+
41
+ ### Why
42
+
43
+ Isolate fine-grained implementation reading from orchestration context so evidence rules and Lens coverage are not diluted by “running it informally”.
44
+
45
+ ### How to accept
46
+
47
+ **No excuses**: When AGENT tools exist, the current session **must not** substitute to save steps; **must not** lower evidence requirements, skip Lenses, or skip execution because of "insufficient context", "small change", or "time pressure". Session execution without AGENT is normal fallback. `/forge` exemption **only** when the user states it explicitly at wave sign-off.
48
+
49
+ ## On-disk requirements (`/forge` path mandatory)
50
+
51
+ When `/forge` §3.6 fires, the full review **must** be written to a physical file:
52
+
53
+ - **Path**: `{TARGET_DIR}/wave-reviews/wave-{N}-review.md` (`{N}` = current wave number).
54
+ - **First line**: `# Wave {N} Code Review — {YYYY-MM-DD}`.
55
+ - **Not on disk = §4.0 hard block**, no exceptions (including AUTO). Self-filled tables or verbal “reviewed” counts as not executed.
56
+ - On user exemption, do not write the review body; instead create `{TARGET_DIR}/wave-reviews/wave-{N}-WAIVED.md` (see `/forge` §3.6 waiver protocol).
57
+
58
+ When `/challenge` triggers, follow that workflow’s report path (default `07_CHALLENGE_REPORT.md` section); **do not** force `wave-reviews/`.
59
+
60
+ ## Handoff checklist (orchestration ↔ AGENT ↔ on disk)
61
+
62
+ - [ ] Required inputs are ready, or an acceptable narrowed scope is stated.
63
+ - [ ] AGENT was given the full constraints of this skill (or equivalent summary + explicit “must not omit sections”).
64
+ - [ ] AGENT output includes the six-section structure; each Issue satisfies **CRITICAL: Issues output contract** below.
65
+ - [ ] `/forge`: `wave-{N}-review.md` path and first-line format are correct, or `wave-{N}-WAIVED.md` was generated per rules.
66
+ - [ ] Strong conclusions all have `path:line`, or were downgraded to suspected / cannot confirm.
67
+
68
+ ## completion_criteria (this review counts as complete if and only if)
69
+
70
+ - Lenses 1–6 are all covered, or each has a one-line “not applicable”.
71
+ - Summary is one of Pass / Partial Pass / Fail / Cannot Confirm (static sense), and matches Issue severities.
72
+ - "Review scope and static boundaries" honestly lists unread items and items needing manual verification.
73
+ - `/forge` on-disk requirements are met, or the user explicitly waived and completed the WAIVED flow.
74
+
75
+ ## Required reading
76
+
77
+ 1. `src/` (or the repo’s agreed implementation root)
78
+ 2. `{TARGET_DIR}/01_PRD.md`, `02_ARCHITECTURE_OVERVIEW.md`, `03_ADR/`, `04_SYSTEM_DESIGN/`
79
+ 3. `{TARGET_DIR}/05A_TASKS.md`
80
+ 4. `{TARGET_DIR}/05B_VERIFICATION_PLAN.md`
81
+ 5. If present: `{TARGET_DIR}/07_CHALLENGE_REPORT.md`
82
+
83
+ When inputs are missing, narrow scope and state it in the output.
84
+
85
+ ## Thinking order (risk first, conclusions back to contract)
86
+
87
+ README/config → entry / routing / CLI → authn & authz → core business / data model → admin / debug endpoints → tests / logs → UI (if applicable).
88
+
89
+ ## Review surfaces (Lenses 1–6)
90
+
91
+ ### What to do
92
+
93
+ Review each of the six lenses in turn; the final report may organize by findings, but each lens needs a conclusion or one line “not applicable”.
94
+
95
+ ### Why
96
+
97
+ Keep contract, delivery, architecture, static safety, verification, and backflow under one evidence standard.
98
+
99
+ ### How to accept
100
+
101
+ When applicable, give conclusion + evidence; when not, one sentence. Strong conclusions carry `**path:line**`.
102
+
103
+ ### Lens 1: Contract fidelity
104
+
105
+ Do public API / CLI / config keys / layout / error semantics match PRD, ADR, System Design? Any public contract introduced without backflow? Typical: `Contract Drift`, `Undocumented Contract`, `Static Verifiability Gap`.
106
+
107
+ ### Lens 2: Task fulfillment and delivery closure
108
+
109
+ Do `05A_TASKS.md` outputs, acceptance, and boundaries, and `05B_VERIFICATION_PLAN.md` plans/evidence requirements, have real implementation/test/docs coverage? Are Mock/Stub/Hardcode boundaries clear; could they leak into production paths? Typical: `Task Drift`, `Acceptance Gap`, `Mock Boundary Risk`.
110
+
111
+ ### Lens 3: Architecture fit and complexity health
112
+
113
+ Module boundaries, dependency direction, data model, state flow vs Architecture / System Design? Single-file pile-up, over-abstraction, high coupling, or hard-to-test structure? For UI, only structure and interaction that affect usability; no pure aesthetic demerits. Typical: `Architecture Drift`, `Complexity Risk`, `Maintainability Gap`.
114
+
115
+ ### Lens 4: Runtime risk from static evidence and security boundaries
116
+
117
+ From static evidence: input validation, error paths, edge cases, duplication/concurrency, cleanup/rollback; auth entry and route/object/function-level authz, tenant isolation, admin protection, secrets and PII leakage. Security first; without direct evidence use “suspected” or “cannot confirm”. Typical: `Safety Gap`, `Auth Boundary Gap`, `Input/Error Path Risk`, `Sensitive Data Exposure`.
118
+
119
+ ### Lens 5: Verification evidence and observability
120
+
121
+ Do test/verification entry points exist? Minimal coverage mapping for core requirements and high risk? Assertions too weak or prone to false positives? Logs diagnosable without leaking secrets? Coverage wording: `sufficient` / `basically covered` / `insufficient` / `missing` / `not applicable` / `cannot confirm`. Typical: `Test Drift`, `Foundational Test Gap`, `Observability Gap`.
122
+
123
+ ### Lens 6: Backflow consistency and handoff evidence
124
+
125
+ Are new public behaviors synced to README / CLI help / changelog / ADR / System Design / task status? Export entry points, manifest, registry, install/update paths consistent? Enough handoff information? Typical: `Missing Change Backflow`, `Documentation Drift`, `Handoff Gap`.
126
+
127
+ ## Output structure (concise)
128
+
129
+ 1. **Summary conclusion**: Pass / Partial Pass / Fail / Cannot Confirm (static sense).
130
+ 2. **Review scope and static boundaries**: What was read, what was not, what was deliberately not run, what needs manual verification.
131
+ 3. **Contract → code mapping summary**: Core promises → corresponding implementation areas (short).
132
+ 4. **Lens result summary**: One line per applicable Lens + evidence.
133
+ 5. **Issues**: Critical → High → Medium → Low; each satisfies **CRITICAL: Issues output contract**.
134
+ 6. **Security / test coverage addendum**: Only high-risk gaps and boundaries that cannot be confirmed statically.
135
+
136
+ ## CRITICAL: Issues output contract (per-item fields; one-line fill preferred)
137
+
138
+ Each Issue **must** be parseable into the following fields (one line with `|` separators or fixed subheadings; information must not be missing):
139
+
140
+ `Severity` | `Lens` | `Title` | `Evidence` (`**path:line**` or multiple points) | `Impact` | `Minimum fix` | `Anchor` (corresponding PRD/ADR/Task/Verify snippet or section pointer)
141
+
142
+ - **Severity**: Critical / High / Medium / Low.
143
+ - **Lens**: L1–L6 or combination (e.g. L2+L4).
144
+ - **Title**: Short label; may include typical type names (e.g. `Contract Drift`).
145
+ - **Evidence**: If not locatable, write "no static location: suspected" and downgrade severity or move to a “cannot confirm” style note; do not fake Critical/High.
146
+ - **Concision (challenge-aligned)**: `Title` / `Impact` / `Minimum fix`—**one sentence each** (tiny compound allowed); **merge** same root cause; no synonym spam for count.
147
+
148
+ ## Discipline (self-check before strong conclusions)
149
+
150
+ ### What to do
151
+
152
+ Before issuing Critical/High, Pass, Fail, or equivalent strong assertions, check each item below.
153
+
154
+ ### Why
155
+
156
+ Prevent packaging speculation, repeated symptoms, or personal preference as blocking conclusions.
157
+
158
+ ### How to accept
159
+
160
+ If any check fails, reword or downgrade.
161
+
162
+ - Is there a direct `**path:line**`?
163
+ - Is this a static fact, or implying unproven runtime behavior?
164
+ - Is this the root cause or a repeated symptom?
165
+ - Is the judgment anchored to PRD/tasks/ADR, not personal preference?
166
+ - When uncertain, is it written as **cannot be confirmed via static review**?
167
+
168
+ ## Skip protocol
169
+
170
+ If there is no `src/` or scope does not apply: output `Code review skipped` + one line of reason; do not fabricate review results.