@haaaiawd/anws 2.0.1 → 2.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/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  <img src="assets/logo-cli.png" width="260" alt="Anws">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
- [![Version](https://img.shields.io/badge/version-v2.0.0-7FB5B6)](https://github.com/Haaaiawd/Anws/releases)
7
- [![Targets](https://img.shields.io/badge/Targets-Windsurf%20%7C%20Claude%20Code%20%7C%20Copilot%20%7C%20Cursor%20%7C%20Codex%20Preview%20%7C%20OpenCode-blueviolet)](https://github.com/Haaaiawd/Anws)
6
+ [![Version](https://img.shields.io/badge/version-v2.0.2-7FB5B6)](https://github.com/Haaaiawd/Anws/releases)
7
+ [![Targets](https://img.shields.io/badge/Targets-Windsurf%20%7C%20Claude%20Code%20%7C%20Copilot%20%7C%20Cursor%20%7C%20Codex%20Preview%20%7C%20OpenCode%20%7C%20Trae%20%7C%20Qoder%20%7C%20Kilo%20Code-blueviolet)](https://github.com/Haaaiawd/Anws)
8
8
 
9
9
  [English](./README.md) | [中文](./README_CN.md)
10
10
 
@@ -79,8 +79,13 @@ Anws addresses those problems with:
79
79
  - **Codex projection strategy update**
80
80
  - Codex is now treated as **Preview**
81
81
  - because Codex prompts are no longer available, Anws now packages workflow guidance into `.codex/skills/anws-system/`
82
- - `/quickstart` maps to `SKILL.md`
83
- - the rest of the workflow docs are exposed as `references/*.md` under the same aggregated skill
82
+ - `SKILL.md` is the navigation shell for the bundle
83
+ - workflow details, including `/quickstart`, now live under `references/*.md`
84
+
85
+ - **Trae / Qoder / Kilo Code support**
86
+ - Trae follows the same skills-only bundle family as Codex via `.trae/skills/anws-system/`
87
+ - Qoder adds native `.qoder/commands/` + `.qoder/skills/`
88
+ - Kilo Code adds native `.kilocode/workflows/` + `.kilocode/skills/`
84
89
 
85
90
  - **OpenCode support**
86
91
  - adds native projection support for `.opencode/commands/` and `.opencode/skills/`
@@ -135,6 +140,7 @@ anws update
135
140
  - **State source**
136
141
  - `anws update` reads `.anws/install-lock.json`
137
142
  - if the lock is missing or invalid, it falls back to directory scan
143
+ - a real `anws update` can rebuild `.anws/install-lock.json` from detected targets when fallback is active
138
144
 
139
145
  - **`AGENTS.md` behavior**
140
146
  - marker-based file -> update stable sections, preserve `AUTO` block
@@ -179,7 +185,7 @@ Every supported target now receives:
179
185
  - `workflows`
180
186
  - `commands`
181
187
  - `prompts`
182
- - aggregated `skills` for Codex Preview
188
+ - aggregated `skills` for Codex / Trae skills-only bundles
183
189
 
184
190
  | Environment | Status | Layout |
185
191
  | --- | --- | --- |
@@ -190,6 +196,9 @@ Every supported target now receives:
190
196
  | **Cursor** | ✅ Supported | `AGENTS.md` + `.cursor/commands/` + `.cursor/skills/` |
191
197
  | **Codex** | ⚠️ Preview | `AGENTS.md` + `.codex/skills/anws-system/` + `.codex/skills/<skill>/` |
192
198
  | **OpenCode** | ✅ Supported | `AGENTS.md` + `.opencode/commands/` + `.opencode/skills/` |
199
+ | **Trae** | ✅ Supported | `AGENTS.md` + `.trae/skills/anws-system/` + `.trae/skills/<skill>/` |
200
+ | **Qoder** | ✅ Supported | `AGENTS.md` + `.qoder/commands/` + `.qoder/skills/` |
201
+ | **Kilo Code** | ✅ Supported | `AGENTS.md` + `.kilocode/workflows/` + `.kilocode/skills/` |
193
202
 
194
203
  ---
195
204
 
@@ -262,6 +271,19 @@ your-project/
262
271
  ├── .opencode/
263
272
  │ ├── commands/
264
273
  │ └── skills/
274
+ ├── .qoder/
275
+ │ ├── commands/
276
+ │ └── skills/
277
+ ├── .kilocode/
278
+ │ ├── workflows/
279
+ │ └── skills/
280
+ ├── .trae/
281
+ │ └── skills/
282
+ │ ├── anws-system/
283
+ │ │ ├── SKILL.md
284
+ │ │ └── references/
285
+ │ └── <skill>/
286
+ │ └── SKILL.md
265
287
  └── .codex/
266
288
  ├── skills/
267
289
  │ ├── anws-system/
package/bin/cli.js CHANGED
@@ -23,12 +23,24 @@ OPTIONS
23
23
  -v, --version Print version number
24
24
  -h, --help Show this help message
25
25
  --target Target AI IDE(s) for \`init\`, comma-separated (${TARGET_IDS.join(', ')})
26
- --check Preview grouped update diffs without writing files or install-lock state
26
+ --check Preview grouped update diffs without writing files or rebuilding install-lock state
27
+
28
+ SUPPORTED TARGETS
29
+ windsurf workflows + skills
30
+ antigravity workflows + skills
31
+ cursor commands + skills
32
+ claude commands + skills
33
+ copilot prompts + skills
34
+ codex preview, skills-only bundle via anws-system
35
+ opencode commands + skills
36
+ trae skills-only bundle via anws-system
37
+ qoder commands + skills
38
+ kilo workflows + skills
27
39
 
28
40
  EXAMPLES
29
41
  anws init # Choose target IDEs and install their managed workflow projections
30
- anws init --target windsurf,codex
31
- anws update # Update all matched targets from install-lock or directory scan
42
+ anws init --target windsurf,codex,opencode
43
+ anws update # Update all matched targets from install-lock or directory scan fallback
32
44
  anws update --check # Preview grouped changes per target without writing files
33
45
  `.trimStart();
34
46
 
@@ -87,6 +87,47 @@ const TARGETS = {
87
87
  },
88
88
  detect: ['.codex/skills/anws-system/SKILL.md']
89
89
  },
90
+ trae: {
91
+ id: 'trae',
92
+ label: 'Trae (Preview)',
93
+ rootAgentFile: true,
94
+ projectionTypes: {
95
+ workflow: ['skills'],
96
+ skill: ['skills']
97
+ },
98
+ projections: {
99
+ skills: '.trae/skills'
100
+ },
101
+ detect: ['.trae/skills/anws-system/SKILL.md']
102
+ },
103
+ qoder: {
104
+ id: 'qoder',
105
+ label: 'Qoder',
106
+ rootAgentFile: true,
107
+ projectionTypes: {
108
+ workflow: ['commands'],
109
+ skill: ['skills']
110
+ },
111
+ projections: {
112
+ commands: '.qoder/commands',
113
+ skills: '.qoder/skills'
114
+ },
115
+ detect: ['.qoder/commands/genesis.md']
116
+ },
117
+ kilo: {
118
+ id: 'kilo',
119
+ label: 'Kilo Code',
120
+ rootAgentFile: true,
121
+ projectionTypes: {
122
+ workflow: ['workflows'],
123
+ skill: ['skills']
124
+ },
125
+ projections: {
126
+ workflows: '.kilocode/workflows',
127
+ skills: '.kilocode/skills'
128
+ },
129
+ detect: ['.kilocode/workflows/genesis.md']
130
+ },
90
131
  opencode: {
91
132
  id: 'opencode',
92
133
  label: 'OpenCode',
package/lib/init.js CHANGED
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  const path = require('node:path');
4
+ const fs = require('node:fs/promises');
4
5
  const { buildProjectionPlan } = require('./manifest');
5
6
  const { getTarget, listTargets } = require('./adapters');
6
- const { resolveAgentsInstall, printLegacyMigrationWarning, pathExists } = require('./agents');
7
+ const { planAgentsUpdate, resolveAgentsInstall, printLegacyMigrationWarning, pathExists } = require('./agents');
7
8
  const { ensureChangelogDir } = require('./changelog');
8
9
  const { ROOT_AGENTS_FILE, resolveCanonicalSource } = require('./resources');
9
10
  const { writeTargetFiles } = require('./copy');
@@ -39,6 +40,7 @@ async function init() {
39
40
 
40
41
  for (const targetPlan of targetPlans) {
41
42
  const target = getTarget(targetPlan.targetId);
43
+ const rootAgentsExists = await pathExists(path.join(cwd, 'AGENTS.md'));
42
44
  const agentsDecision = target.id === 'antigravity'
43
45
  ? await resolveAgentsInstall({
44
46
  cwd,
@@ -47,9 +49,17 @@ async function init() {
47
49
  })
48
50
  : {
49
51
  shouldWriteRootAgents: true,
50
- shouldWarnMigration: false
52
+ shouldWarnMigration: false,
53
+ rootExists: rootAgentsExists
51
54
  };
52
55
 
56
+ let agentsUpdatePlan = null;
57
+ if (agentsDecision.shouldWriteRootAgents && agentsDecision.rootExists) {
58
+ const templateContent = await fs.readFile(srcAgents, 'utf8');
59
+ const existingContent = await fs.readFile(path.join(cwd, 'AGENTS.md'), 'utf8');
60
+ agentsUpdatePlan = planAgentsUpdate({ templateContent, existingContent });
61
+ }
62
+
53
63
  const conflicting = await findConflicts(cwd, targetPlan.managedFiles, sessionWrittenFiles);
54
64
  if (conflicting.length > 0) {
55
65
  const confirmed = await askOverwrite(conflicting.length, target.label);
@@ -69,6 +79,7 @@ async function init() {
69
79
  protectedFiles: targetPlan.userProtectedFiles,
70
80
  srcAgents,
71
81
  shouldWriteRootAgents: agentsDecision.shouldWriteRootAgents,
82
+ agentsUpdatePlan,
72
83
  resolveCanonicalSource
73
84
  });
74
85
 
@@ -166,16 +166,24 @@ async function detectInstallState(cwd) {
166
166
  const lockResult = await readInstallLock(cwd);
167
167
  const scannedTargets = await detectInstalledTargets(cwd);
168
168
  const lockTargets = lockResult.lock?.targets || [];
169
+ const needsFallback = !lockResult.exists || !!lockResult.error;
170
+ const fallbackReason = !needsFallback
171
+ ? null
172
+ : (!lockResult.exists ? 'missing_lock' : 'invalid_lock');
169
173
  const selectedTargets = lockTargets.length > 0
170
174
  ? lockTargets.map((item) => item.targetId)
171
175
  : scannedTargets.map((item) => item.id);
176
+ const drift = detectLockDrift(lockResult.lock, scannedTargets);
172
177
 
173
178
  return {
174
179
  lockResult,
175
180
  scannedTargets,
176
181
  selectedTargets,
177
- drift: detectLockDrift(lockResult.lock, scannedTargets),
178
- needsFallback: !lockResult.exists || !!lockResult.error
182
+ drift,
183
+ needsFallback,
184
+ fallbackReason,
185
+ stateSource: needsFallback ? 'directory_scan_fallback' : 'install_lock',
186
+ canRebuildLock: needsFallback && selectedTargets.length > 0
179
187
  };
180
188
  }
181
189
 
package/lib/manifest.js CHANGED
@@ -19,6 +19,7 @@ const RESOURCE_REGISTRY = [
19
19
  { id: 'probe', type: 'workflow', source: '.agents/workflows/probe.md', fileName: 'probe.md' },
20
20
  { id: 'quickstart', type: 'workflow', source: '.agents/workflows/quickstart.md', fileName: 'quickstart.md' },
21
21
  { id: 'upgrade', type: 'workflow', source: '.agents/workflows/upgrade.md', fileName: 'upgrade.md' },
22
+ { id: 'anws-system', type: 'skill', source: '.agents/skills/anws-system/SKILL.md', fileName: 'anws-system/SKILL.md', targets: ['codex', 'trae'] },
22
23
  { id: 'concept-modeler', type: 'skill', source: '.agents/skills/concept-modeler/SKILL.md', fileName: 'concept-modeler/SKILL.md' },
23
24
  { id: 'design-reviewer', type: 'skill', source: '.agents/skills/design-reviewer/SKILL.md', fileName: 'design-reviewer/SKILL.md' },
24
25
  { id: 'nexus-mapper', type: 'skill', source: '.agents/skills/nexus-mapper/SKILL.md', fileName: 'nexus-mapper/SKILL.md' },
@@ -53,10 +54,8 @@ function toArray(value) {
53
54
  }
54
55
 
55
56
  function toProjectionFileName(resource, projectionType, targetId) {
56
- if (targetId === 'codex' && projectionType === 'skills' && resource.type === 'workflow') {
57
- return resource.id === 'quickstart'
58
- ? 'anws-system/SKILL.md'
59
- : `anws-system/references/${resource.id}.md`;
57
+ if ((targetId === 'codex' || targetId === 'trae') && projectionType === 'skills' && resource.type === 'workflow') {
58
+ return `anws-system/references/${resource.id}.md`;
60
59
  }
61
60
  if (projectionType === 'commands') {
62
61
  return `${resource.id}.md`;
@@ -75,6 +74,9 @@ function buildProjectionEntries(targetId) {
75
74
  const typeMap = target.projectionTypes;
76
75
 
77
76
  return RESOURCE_REGISTRY.flatMap((resource) => {
77
+ if (resource.targets && !resource.targets.includes(target.id)) {
78
+ return [];
79
+ }
78
80
  const projectionTypes = typeMap[resource.type];
79
81
  if (!projectionTypes) {
80
82
  return [];
@@ -129,6 +131,9 @@ function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_R
129
131
  const target = getTarget(targetId);
130
132
  const typeMap = target.projectionTypes;
131
133
  const projectionEntries = resources.flatMap((resource) => {
134
+ if (resource.targets && !resource.targets.includes(target.id)) {
135
+ return [];
136
+ }
132
137
  const projectionTypes = typeMap[resource.type];
133
138
  if (!projectionTypes) {
134
139
  return [];
package/lib/update.js CHANGED
@@ -128,6 +128,21 @@ async function update(options = {}) {
128
128
  logo();
129
129
  blank();
130
130
  }
131
+ printTargetSelection(installState, targetContexts.map((context) => context.target));
132
+ if (!check && installState.needsFallback && selectedTargetIds.length > 0) {
133
+ const generatedAt = new Date().toISOString();
134
+ await writeInstallLock(cwd, createInstallLock({
135
+ cliVersion: version,
136
+ generatedAt,
137
+ targets: dedupeTargets(targetPlans.map((targetPlan) => summarizeTargetState(targetPlan, version))),
138
+ lastUpdateSummary: {
139
+ successfulTargets: [],
140
+ failedTargets: [],
141
+ updatedAt: generatedAt
142
+ }
143
+ }));
144
+ info('Rebuilt .anws/install-lock.json from the detected target layout.');
145
+ }
131
146
  info(`Already up to date. Latest recorded version is v${versionState.latestVersion || version}.`);
132
147
  return;
133
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haaaiawd/anws",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Anws — A spec-driven workflow framework for AI-assisted development. Empowers prompt engineers to build production-ready software through structured PRD → Architecture → Task decomposition. Works with Claude Code, GitHub Copilot, Cursor, Windsurf, and any tool that reads AGENTS.md.",
5
5
  "keywords": [
6
6
  "anws",
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: anws-system
3
+ description: 当用户在 skills-only 环境中需要判断应该从哪个 anws 工作流开始,或需要在 forge / change / genesis / probe / blueprint / challenge / upgrade 之间路由时使用。它是 anws 工作流集合的导航入口。
4
+ ---
5
+
6
+ # ANWS System Router Manual
7
+
8
+ 你是 **ANWS Router**。
9
+
10
+ 你的职责不是直接替代所有工作流,而是作为 **skills-only 模式** 下的统一导航入口:
11
+
12
+ - 判断当前请求应路由到哪个工作流
13
+ - 告诉模型还需要读取哪个 `references/*.md`
14
+ - 在开始执行前明确权限边界,避免把 `/forge`、`/change`、`/genesis` 混用
15
+
16
+ ## 激活规则
17
+
18
+ 出现以下任一情况时使用本 Skill:
19
+
20
+ 1. 用户不知道该从哪个工作流开始
21
+ 2. 用户明确提到 `/quickstart`、`/forge`、`/change`、`/genesis` 等工作流,但当前环境只有 skills
22
+ 3. 用户请求涉及“下一步该走哪个流程”
23
+ 4. 用户请求跨越设计、任务、实现多个阶段,需要先判断阶段边界
24
+
25
+ ## 首次激活的强制步骤
26
+
27
+ 1. 先读取 `references/quickstart.md`
28
+ 2. 判断当前请求更接近哪一种场景
29
+ 3. 再按需读取对应 workflow reference
30
+ 4. 没有读完对应 reference 前,不得直接执行该 workflow 的写操作
31
+
32
+ ## Workflow Map
33
+
34
+ - `references/quickstart.md`
35
+ - 用途:总入口。用于判断项目目前处于哪一阶段,以及应先调用哪个工作流
36
+ - `references/probe.md`
37
+ - 用途:接手遗留项目、重大改动前做系统风险探测
38
+ - `references/genesis.md`
39
+ - 用途:新项目、重大重构、架构升级、需要新版本时使用
40
+ - `references/design-system.md`
41
+ - 用途:为单个系统补详细设计文档
42
+ - `references/blueprint.md`
43
+ - 用途:将架构设计拆成可执行的 `05_TASKS.md`
44
+ - `references/challenge.md`
45
+ - 用途:在编码前系统性挑战设计或任务清单
46
+ - `references/forge.md`
47
+ - 用途:按 `05_TASKS.md` 执行编码任务,并维护 Wave 进度
48
+ - `references/change.md`
49
+ - 用途:只微调已有任务定义,不创建新任务,不推进实现状态
50
+ - `references/explore.md`
51
+ - 用途:做调研、探索、方案发散与收敛
52
+ - `references/craft.md`
53
+ - 用途:创建新的 workflow、skill 或 prompt
54
+ - `references/upgrade.md`
55
+ - 用途:处理 `anws update` 之后的升级编排
56
+
57
+ ## 路由规则
58
+
59
+ ### Route 1: 不确定起点
60
+
61
+ 如果用户不知道从哪里开始,或你对当前阶段没有把握:
62
+
63
+ 1. 读取 `references/quickstart.md`
64
+ 2. 根据项目状态判断入口
65
+ 3. 给出建议 workflow,并说明理由
66
+ 4. 等待用户确认
67
+
68
+ ### Route 2: 请求是“开始编码 / 继续实现 / 做当前波次”
69
+
70
+ 1. 读取 `references/forge.md`
71
+ 2. 检查 `.anws/v{N}/05_TASKS.md` 是否存在且任务已定义
72
+ 3. 若缺任务清单,不得直接实现,先回到 `blueprint` 或 `genesis`
73
+
74
+ ### Route 3: 请求是“微调现有任务 / 修正文案 / 调整验收标准”
75
+
76
+ 1. 读取 `references/change.md`
77
+ 2. 确认只修改已有任务,不新增任务
78
+ 3. 若需要新增任务或超出 PRD,改走 `genesis`
79
+
80
+ ### Route 4: 请求是“新项目 / 大重构 / 新版本 / 架构升级”
81
+
82
+ 1. 读取 `references/genesis.md`
83
+ 2. 进入版本化架构流程
84
+
85
+ ### Route 5: 请求是“先调研 / 先探测风险”
86
+
87
+ - 遗留项目或重大变更前 → `references/probe.md`
88
+ - 技术调研或方案发散 → `references/explore.md`
89
+
90
+ ## 边界守则
91
+
92
+ 1. 你是导航层,不是所有 workflow 的替身
93
+ 2. 每次只路由到一个主 workflow;如需串联,必须说明顺序
94
+ 3. 未读取目标 workflow reference 前,不得假装已经遵循该流程
95
+ 4. 若用户请求同时跨越设计与实现,先收敛边界,再决定 `/change` 或 `/genesis`
96
+ 5. skills-only 模式下,workflow 详情全部位于 `references/`
97
+
98
+ ## 输出格式
99
+
100
+ 当你完成路由判断时,输出应包含:
101
+
102
+ - 当前判断的阶段
103
+ - 建议读取的 reference
104
+ - 建议进入的 workflow
105
+ - 为什么不是其他 workflow
106
+ - 是否需要等待用户确认
@@ -15,6 +15,7 @@ description: "处理微调级变更请求,仅允许修改已有任务的细节
15
15
  - **忠于 Blueprint** - 所有修改必须在 `01_PRD.md` 已定义的需求范围内
16
16
  - **人类审批** - 所有写操作必须先展示计划,经人类确认后才能执行
17
17
  - **可追溯** - 所有变更都记录在 CHANGELOG
18
+ - **不维护完成状态** - `/change` 只修改任务定义,不负责回填 `05_TASKS.md` checkbox
18
19
 
19
20
  **Output Goal**:
20
21
  - 更新 `.anws/v{N}/05_TASKS.md` (仅修改已有任务)
@@ -35,6 +36,8 @@ description: "处理微调级变更请求,仅允许修改已有任务的细节
35
36
  > | 调整已有任务的估时 | ✅ | |
36
37
  > | 标记任务阻塞/重分优先级 | ✅ | |
37
38
  > | 微调 `04_SYSTEM_DESIGN/` 中已有文件的细节 | ✅ | |
39
+ > | 更新任务说明字段,但不改变完成状态 | ✅ | |
40
+ > | **回填 `05_TASKS.md` checkbox** | | ❌ |
38
41
  > | **创建新任务 (T{X}.{Y}.{Z})** | | ❌ |
39
42
  > | **创建新文件** | | ❌ |
40
43
  > | **添加 AI 自认为好的功能** | | ❌ |
@@ -43,8 +46,6 @@ description: "处理微调级变更请求,仅允许修改已有任务的细节
43
46
  > | **修改 `02_ARCHITECTURE_OVERVIEW.md`** | | ❌ |
44
47
  > | **修改 `03_ADR/` 中的任何文件** | | ❌ |
45
48
  >
46
- > **单次 /change 最多影响 3 个已有任务 + 对应的设计文件微调。**
47
- >
48
49
  > **违反以上任何一条 → 变更无效,引导用户运行 `/genesis`。**
49
50
 
50
51
  ---
@@ -158,8 +159,8 @@ description: "处理微调级变更请求,仅允许修改已有任务的细节
158
159
 
159
160
  3. **定位任务**:
160
161
  - 找到与变更相关的已有任务 (如 `T2.1.3`)
161
- - **最多 3 个任务**受影响
162
- - 如果超过 3 个 → 跳转 Step 4
162
+ - 记录所有实际受影响的已有任务
163
+ - 如果需要创建新任务才能承接变更 → 跳转 Step 4
163
164
 
164
165
  4. **定位相关设计文件** (如需要):
165
166
  - 检查 `{TARGET_DIR}/04_SYSTEM_DESIGN/` 中是否有对应的系统设计文件
@@ -230,7 +231,9 @@ description: "处理微调级变更请求,仅允许修改已有任务的细节
230
231
  ### Step 3.1: 执行修改 (仅在人类批准后)
231
232
 
232
233
  1. **修改任务清单**:
233
- 使用 `replace_file_content` 修改 `{TARGET_DIR}/05_TASKS.md` 中的对应任务
234
+ 使用 `replace_file_content` 修改 `{TARGET_DIR}/05_TASKS.md` 中的对应任务定义
235
+ - 仅允许修改任务描述、验收标准、估时、优先级、阻塞说明等定义字段
236
+ - **禁止**在 `/change` 中将 `- [ ]` 改为 `- [x]` 或反向修改 checkbox
234
237
 
235
238
  2. **记录变更日志**:
236
239
  读取并追加到 `{TARGET_DIR}/06_CHANGELOG.md`:
@@ -225,6 +225,15 @@ T{X.Y.Z}, T{X.Y.Z}, T{X.Y.Z}
225
225
  读取该任务 `**输入**` 字段指定的文档和章节。
226
226
  如果任务依赖已完成的前置任务,浏览相关已有代码了解接口。
227
227
 
228
+ > [!IMPORTANT]
229
+ > **开始写代码前,必须对本波次每个任务都完成一次依赖读取。**
230
+ >
231
+ > - 至少读取该任务 `**输入**` 字段指定的文档/章节
232
+ > - 如任务依赖其他任务,补读前置任务相关接口或实现代码
233
+ > - 未完成该任务的依赖读取,不得开始该任务编码
234
+ >
235
+ > **为什么?** `/forge` 允许按本波次批量推进和批量回填 checkbox,但前提是每个任务都已完成最小上下文装载,不能只看标题就动手。
236
+
228
237
  ---
229
238
 
230
239
  ### 3.2 Think Before Code (编码前思考)
@@ -331,7 +340,10 @@ T{X.Y.Z}, T{X.Y.Z}, T{X.Y.Z}
331
340
  > 下次加载 TASKS.md 就能看到精确进度。
332
341
  > 配合 AGENTS.md 的 Wave 块形成**双层恢复机制**: 粗粒度(Wave) + 细粒度(Task checkbox)。
333
342
 
334
- - 将该任务的 `- [ ]` 改为 `- [x]`
343
+ - 本波次允许批量回填已全部验证通过的任务 checkbox
344
+ - 仅按 **Task ID** 精确定位并更新状态,禁止按标题模糊匹配
345
+ - 将对应任务的 `- [ ]` 改为 `- [x]`
346
+ - 不得顺手修改未完成、未验证或不在当前波次内的任务
335
347
  - 确保回写后的 `05_TASKS.md` 与实际进度一致
336
348
 
337
349
  3. **继续下一个任务** → 回到 3.1