easy-coding-harness 0.5.3 → 0.6.1

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 (27) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +13 -11
  3. package/dist/cli.js +134 -2
  4. package/dist/cli.js.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/claude/agents/ec-implementer.md +3 -0
  7. package/templates/codex/agents/ec-implementer.toml +3 -0
  8. package/templates/common/bundled-skills/ec-init/SKILL.md +1 -1
  9. package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +12 -5
  10. package/templates/common/skills/ec-analysis/SKILL.md +87 -51
  11. package/templates/common/skills/ec-brainstorming/SKILL.md +2 -1
  12. package/templates/common/skills/ec-git/SKILL.md +1 -1
  13. package/templates/common/skills/ec-implementing/SKILL.md +42 -13
  14. package/templates/common/skills/ec-memory/SKILL.md +46 -20
  15. package/templates/common/skills/ec-reviewing/SKILL.md +10 -6
  16. package/templates/common/skills/ec-task-close/SKILL.md +1 -1
  17. package/templates/common/skills/ec-task-management/SKILL.md +1 -1
  18. package/templates/common/skills/ec-verification/SKILL.md +25 -26
  19. package/templates/common/skills/ec-workflow/SKILL.md +119 -69
  20. package/templates/main-constraint/AGENTS.md.tpl +20 -12
  21. package/templates/main-constraint/CLAUDE.md.tpl +20 -12
  22. package/templates/qoder/agents/ec-implementer.md +3 -0
  23. package/templates/runtime/memory/SHORT_MEMORY_TEMPLATE.md +2 -0
  24. package/templates/runtime/templates/dev-spec-skeleton.md +41 -46
  25. package/templates/shared-hooks/easy_coding_state.py +1040 -39
  26. package/templates/shared-hooks/inject-workflow-state.py +1 -176
  27. package/templates/shared-hooks/session-start.py +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-coding-harness",
3
- "version": "0.5.3",
3
+ "version": "0.6.1",
4
4
  "description": "CLI scaffold for installing Easy Coding harness files into agent-native directories.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,8 @@ complete exactly that unit. Your reply IS the return value, not a message to a h
9
9
  ## Hard constraints
10
10
 
11
11
  - Modify only the files listed in the task card's "Editable scope". Touch nothing else.
12
+ - If the editable scope is `NONE — read-only deliverable`, modify nothing and return the full
13
+ requested result in `deliverable`.
12
14
  - Do not call any Skill tool.
13
15
  - Do not read `.claude/skills/`, `.agents/skills/`, `.qoder/skills/`, or any `.easy-coding/`
14
16
  file. All context you need is already in the task card.
@@ -20,6 +22,7 @@ complete exactly that unit. Your reply IS the return value, not a message to a h
20
22
 
21
23
  - `changed_files`: the files you actually modified
22
24
  - `summary`: one line describing what you did
25
+ - `deliverable`: full no-code result, or `null` for a code unit
23
26
  - `issues`: problems you hit (empty array if none)
24
27
  - `needs_attention`: anything the main agent must decide (empty array if none)
25
28
 
@@ -8,6 +8,8 @@ complete exactly that unit. Your reply IS the return value, not a message to a h
8
8
 
9
9
  Hard constraints:
10
10
  - Modify only the files listed in the task card's "Editable scope". Touch nothing else.
11
+ - If the editable scope is NONE — read-only deliverable, modify nothing and return the full
12
+ requested result in deliverable.
11
13
  - Do not call any Skill tool.
12
14
  - Do not read .agents/skills/, .codex/, or any .easy-coding/ file. All needed context is in
13
15
  the card.
@@ -18,6 +20,7 @@ Hard constraints:
18
20
  Output (return exactly this):
19
21
  - changed_files: the files you actually modified
20
22
  - summary: one line describing what you did
23
+ - deliverable: full no-code result, or null for a code unit
21
24
  - issues: problems you hit (empty array if none)
22
25
  - needs_attention: anything the main agent must decide (empty array if none)
23
26
 
@@ -162,7 +162,7 @@ agent must be able to see what was generated and on what evidence.
162
162
  - TEST_STRATEGY.md (skeleton for the chosen framework)
163
163
  3. **Skip ABSTRACT.md** — no architecture exists yet. Note in init_log:
164
164
  "ABSTRACT pending; ec-memory backfills after the first substantive task." (ec-memory
165
- detects the missing file during MEMORY_LONG and generates it from the then-current code.)
165
+ detects the missing file during MEMORY and generates it from the then-current code.)
166
166
  4. Memory migration probe and memory init, same as iterative steps 5-7.
167
167
  5. Recommend: design first with `{{skill_trigger}}ec-brainstorming`, then build via
168
168
  `{{skill_trigger}}ec-workflow`.
@@ -42,10 +42,16 @@ analysis, workflow operation). The CLI never analyzes the project.
42
42
 
43
43
  ## Workflow state machine
44
44
 
45
- 8 stages + 2 terminals, owned by ec-workflow:
46
- `INIT → ANALYSIS → WAITING_CONFIRM → IMPLEMENT → REVIEW → VERIFICATION → MEMORY_SHORT
47
- MEMORY_LONG → COMPLETE`, plus `CLOSED` (user abort, no memory flow). WAITING_CONFIRM and
48
- VERIFICATION are hard gates. The active task pointer lives in `sessions/{ppid}.json`;
45
+ 6 work stages + 2 terminals, owned by ec-workflow:
46
+ `INIT → ANALYSIS → IMPLEMENT → REVIEW → VERIFICATION → MEMORY COMPLETE`, plus `CLOSED`
47
+ (user abort, no memory flow). INIT → ANALYSIS and completed MEMORY → COMPLETE are restricted
48
+ automatic edges. A validated read-only `doc` / `analysis` / `report` task also auto-completes
49
+ from IMPLEMENT after its full deliverable is shown, without REVIEW, VERIFICATION, MEMORY, or
50
+ task memory. Other stage edges record `task.json.pending_transition` and require explicit user
51
+ confirmation; code tasks may skip REVIEW and enter VERIFICATION directly. VERIFICATION remains
52
+ the code-task fresh-evidence hard gate, and MEMORY keeps the conditional long-memory threshold
53
+ gate. The active task
54
+ pointer lives in `sessions/{ppid}.json`;
49
55
  when the task reaches `COMPLETE` or `CLOSED`, the state API clears `current_task` so the
50
56
  session returns to Ready. Each task's stage persists in its `task.json`. Hooks inject the
51
57
  session and task state as breadcrumbs so every reply can render the status line.
@@ -57,7 +63,8 @@ stage in `task.json`; no data is lost. Each task folder is self-contained.
57
63
 
58
64
  ## Task persistence
59
65
 
60
- Each task is a folder. `task.json` is metadata; `dev-spec.md` is the human-readable plan;
66
+ Each task is a folder. `task.json` is metadata, including the current stage and any
67
+ `pending_transition`; `dev-spec.md` is the human-readable plan;
61
68
  `execution.jsonl` is an append-only plan-and-log (one `plan` record, then `dispatch`/`result`
62
69
  /`review`/`verify`/`handoff` records). Because plan and log live on disk, not in an agent's
63
70
  context window, a task survives session end and agent switches with zero information loss.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ec-analysis
3
- description: ANALYSIS-stage skill. Use when ec-workflow enters ANALYSIS. Creates the dev-spec skeleton FIRST (template-first), then fills incrementally — producing the narrative plan, execution plan (execution.jsonl), and test strategy. Ends in WAITING_CONFIRM. Grounds every conclusion in real code, never restates the requirement.
3
+ description: ANALYSIS-stage skill. Use when ec-workflow enters ANALYSIS. Creates the dev-spec skeleton FIRST, resolves user decisions during analysis, then fills the final plan and execution plan; code tasks also receive a standalone test strategy, while read-only tasks do not. Ends by requesting the confirmed edge to IMPLEMENT. Grounds every conclusion in real code, never restates the requirement.
4
4
  ---
5
5
 
6
6
  > **SKELETON FIRST — your first two tool calls MUST be: (1) Read `.easy-coding/templates/dev-spec-skeleton.md`, (2) Write its EXACT content to the task's dev-spec.md. No exceptions. Do not analyze or think before the skeleton file exists on disk.**
@@ -23,33 +23,43 @@ Communicate with the user in the user's language.
23
23
  If dev-spec.md does not exist with the correct template after your second tool call,
24
24
  you have already failed. Do not read code, think aloud, or analyze before the skeleton
25
25
  is on disk.
26
- 2. **All subsequent analysis** fills sections of this file via edits. You do NOT hold analysis
27
- in your head and dump it at the end you write each section into the file as you go.
28
- 3. **Your chat output to the user IS dev-spec.md, verbatim.** After dev-spec.md is complete,
29
- use the Read tool to read it back, then output exactly what you read as your reply this
26
+ 2. **Resolve decisions before filling.** After the exact skeleton is on disk, load the required
27
+ inputs and inspect source code without editing dev-spec.md. As soon as analysis reveals a
28
+ decision that affects technical direction, API, scope, delivery form, state flow, encoding,
29
+ or acceptance, ask the user immediately and stop. Prefer the platform's native user-choice
30
+ tool when available. Keep dev-spec.md as the untouched skeleton until every decision is
31
+ resolved; never write an unresolved question or an assumed answer into the final plan.
32
+ 3. **Decision questions are the only pre-plan chat exception.** While the decision gate is
33
+ unresolved, ask only the evidence-backed question needed to continue; do not present a draft
34
+ report. After all decisions are resolved and dev-spec.md is complete, your chat output to the
35
+ user IS dev-spec.md verbatim. Use the Read tool to read it back, then output exactly what you
36
+ read as your reply — this
30
37
  is a copy operation, not a re-narration. Do NOT reconstruct it from memory, do NOT
31
38
  abbreviate, do NOT invent a different format. No "执行计划" summary tables, no bullet-point
32
39
  plans, no freestyle answers. The template IS the format. If your reply does not contain
33
40
  every mandatory section header from the template, you have failed.
34
- 4. **Three files must exist** in `.easy-coding/tasks/{task-id}/` when you finish:
35
- `dev-spec.md`, `execution.jsonl` (plan record), `test-strategy.md`. Missing any one = failed.
41
+ 4. **Required artifacts depend on delivery mode.** Code tasks require `dev-spec.md`,
42
+ `execution.jsonl` (plan record), and `test-strategy.md`. Read-only `doc` / `analysis` /
43
+ `report` tasks require only `dev-spec.md` and `execution.jsonl`; they MUST NOT create
44
+ `test-strategy.md` because they never enter VERIFICATION.
36
45
  5. **Stay faithful to the user's delivery form (anti-downgrade).** The delivery form —
37
46
  change real code vs. produce a document — is set by the user's original request, NOT by
38
47
  you. If the user asked to refactor / fix / add a feature (a CODE task), you MUST plan real
39
48
  code changes. You may NOT downgrade it to "produce a report / audit / inventory only" or
40
49
  "defer all changes to follow-up sub-tasks." A large change surface is NOT a reason to
41
- downgrade: decompose it into batches/units in 实施拆解, and surface "split into batches? /
42
- which subset this round?" as an explicit item in 待用户决策 for the user to decide. Never
43
- make a scope-narrowing decision yourself and present it as settled. Never fabricate a
50
+ downgrade: during the pre-fill decision gate, ask "split into batches? / which subset this
51
+ round?" and wait for the user to decide. Never make a scope-narrowing decision yourself and
52
+ present it as settled. Never fabricate a
44
53
  premise such as "the user already fixed scope X in INIT" or "auto_mode already selected Y"
45
- to justify narrowing — `auto_mode` only waives the WAITING_CONFIRM confirmation step and
46
- carries NO scope or delivery-form decision whatsoever.
54
+ to justify narrowing — `auto_mode` only waives stage-boundary prompts under an explicit
55
+ autonomous user request and carries NO scope or delivery-form decision whatsoever.
47
56
  6. **改动范围 lists ONLY real project code.** The 改动范围 table carries only changes to real
48
57
  project source/config files. Any harness artifact under `.easy-coding/` (dev-spec.md,
49
58
  execution.jsonl, test-strategy.md, memory files, generated reports, etc.) is FORBIDDEN in
50
59
  this table — those are process outputs, not "changes." The table MAY be empty, but ONLY
51
60
  when the user explicitly asked for a no-code delivery form (e.g. a pure documentation
52
- request); in that case declare the deliverable in 需求解析 > 输出. If the task type is a
61
+ request) and `task.json.type` is `doc`, `analysis`, or `report`; in that case declare the
62
+ deliverable in 需求解析 > 输出. If the task type is a
53
63
  code task (重构 / Bug 修复 / 新功能 / 性能优化) yet 改动范围 is empty, you have downgraded
54
64
  the task — this is a failed analysis.
55
65
 
@@ -82,22 +92,31 @@ You MUST execute these steps in exact order. Do not rearrange, skip, or combine
82
92
  1. **Write skeleton** — FIRST TWO tool calls:
83
93
  - Read `.easy-coding/templates/dev-spec-skeleton.md` (the template file).
84
94
  - Write its exact content to `.easy-coding/tasks/{task-id}/dev-spec.md`.
85
- This is a copy operation, not a generation task. Every section header and every `{待填写}`
86
- placeholder in the template must appear in the written file unchanged.
87
- 2. **Fill 项目模式 + 任务类型** edit dev-spec.md in place.
88
- 3. **Fill 需求解析** edit dev-spec.md: 目标 / 输入 / 输出 / 边界.
89
- 4. **Read source code, fill 现状** read the actual files, then edit dev-spec.md with
90
- evidence. Every claim must cite file:line. No file references = invalid section.
91
- 5. **Fill 冲突摘要 + 待用户决策**edit dev-spec.md.
92
- 6. **Fill 影响面分析 + 改动范围** edit dev-spec.md, fill the table with encoding evidence.
93
- 7. **Fill 修改方案 + 实施拆解** edit dev-spec.md, design approach and decompose units.
94
- 8. **Fill 测试策略 + 风险与注意事项** — edit dev-spec.md.
95
- 9. **Fill conditional sections** — edit dev-spec.md: 背景数据应用 / 核心改动明细 /
95
+ This is a copy operation, not a generation task. Every section header and every
96
+ `[[EC_TODO:...]]` marker in the template must appear in the written file unchanged.
97
+ 2. **Inspect before filling**load the required inputs in the order above and read the actual
98
+ source files. Do not edit dev-spec.md yet. Collect evidence and identify every decision that
99
+ could change technical direction, API, scope, delivery form, state flow, encoding, or
100
+ acceptance.
101
+ 3. **Resolve the decision gate**if any decision exists, ask it during ANALYSIS immediately,
102
+ using the native user-choice tool when available, then stop and wait. After the user answers,
103
+ repeat the evidence check and ask any newly exposed decision. Do not fill dev-spec.md,
104
+ execution.jsonl, or (for code tasks) test-strategy.md until the decision set is empty.
105
+ 4. **Fill 项目模式 + 任务类型** — edit dev-spec.md in place only after the decision gate clears.
106
+ 5. **Fill 需求解析** — edit dev-spec.md: 目标 / 输入 / 输出 / 边界.
107
+ 6. **Fill 现状 + 冲突摘要** — write evidence-backed conclusions. Every current-state claim
108
+ must cite file:line. No file references = invalid section.
109
+ 7. **Fill 影响面分析 + 改动范围** — edit dev-spec.md, fill the table with encoding evidence.
110
+ 8. **Fill 修改方案 + 实施拆解** — edit dev-spec.md, design approach and decompose units.
111
+ 9. **Fill 测试策略 + 风险与注意事项** — edit dev-spec.md.
112
+ 10. **Fill conditional sections** — edit dev-spec.md: 背景数据应用 / 核心改动明细 /
96
113
  前端实现映射 only if applicable. Remove inapplicable conditional sections entirely.
97
- 10. **Write execution.jsonl** — append the plan record (see section below).
98
- 11. **Write test-strategy.md** — write the testability table (see section below).
99
- 12. **Self-check** run the gates below. Fix any failure in the files.
100
- 13. **Present to user** — Read dev-spec.md back from disk and output exactly what you read as
114
+ 11. **Write execution.jsonl** — append the plan record (see section below).
115
+ 12. **Write test-strategy.md for code tasks only** — write the testability table (see section
116
+ below). For a read-only task, do not create this file; fill the dev-spec `测试策略` section
117
+ with `不适用:只读报告任务不进入 VERIFICATION`.
118
+ 13. **Self-check** — run the gates below. Fix any failure in the files.
119
+ 14. **Present to user** — Read dev-spec.md back from disk and output exactly what you read as
101
120
  your reply. Do not summarize, abbreviate, reformat, or reconstruct from memory. The
102
121
  dev-spec.md content on disk IS your reply.
103
122
 
@@ -114,7 +133,7 @@ If the hook injects `[easy-coding:analysis-template-drift:missing:...]`, you hav
114
133
  from the template. Re-read the template file, compare it against your dev-spec.md, and fix
115
134
  any missing or renamed section headers immediately.
116
135
 
117
- **Mandatory section headers** (all 13 must be present in the skeleton — the hook validates these):
136
+ **Mandatory section headers** (all 12 must be present in the skeleton — the hook validates these):
118
137
 
119
138
  1. `## 技术方案`
120
139
  2. `### 项目模式`
@@ -122,13 +141,12 @@ any missing or renamed section headers immediately.
122
141
  4. `### 需求解析`
123
142
  5. `### 现状`
124
143
  6. `### 冲突摘要`
125
- 7. `### 待用户决策`
126
- 8. `### 影响面分析`
127
- 9. `### 改动范围`
128
- 10. `### 修改方案`
129
- 11. `### 实施拆解`
130
- 12. `### 测试策略`
131
- 13. `### 风险与注意事项`
144
+ 7. `### 影响面分析`
145
+ 8. `### 改动范围`
146
+ 9. `### 修改方案`
147
+ 10. `### 实施拆解`
148
+ 11. `### 测试策略`
149
+ 12. `### 风险与注意事项`
132
150
 
133
151
  > **Encoding rule**: modified files keep their original encoding; new files declare the
134
152
  > project encoding with evidence; conflicting or unknown encoding → mark "需用户确认".
@@ -146,6 +164,7 @@ any missing or renamed section headers immediately.
146
164
  - Restating requirements without citing code evidence.
147
165
  - Listing "loaded information" without a concrete implementation approach.
148
166
  - Including conditional sections that are irrelevant to the current task.
167
+ - Including `[阶段:ANALYSIS]`, a `待用户决策` section, or any unresolved decision in the report.
149
168
 
150
169
  ## Implementation units → execution.jsonl
151
170
 
@@ -153,7 +172,7 @@ Decompose the work into units, then append ONE `plan` record to
153
172
  `.easy-coding/tasks/{task-id}/execution.jsonl`:
154
173
 
155
174
  ```json
156
- {"type":"plan","strategy":"parallel","units":[{"id":"U1","title":"...","type":"backend","files":["..."],"depends_on":[],"rules_sections":["naming","error-handling"],"abstract_modules":["user-service"]}],"parallel_groups":[{"level":0,"units":["U1","U2"]},{"level":1,"units":["U3"]}]}
175
+ {"type":"plan","strategy":"parallel","units":[{"id":"U1","title":"Implement service","type":"backend","files":["src/service.ts"],"depends_on":[],"rules_sections":["naming","error-handling"],"abstract_modules":["user-service"]},{"id":"U2","title":"Implement adapter","type":"backend","files":["src/adapter.ts"],"depends_on":[],"rules_sections":["naming"],"abstract_modules":["user-service"]},{"id":"U3","title":"Add integration tests","type":"test","files":["test/service.test.ts"],"depends_on":["U1","U2"],"rules_sections":["testing"],"abstract_modules":["user-service"]}],"parallel_groups":[{"level":0,"units":["U1","U2"]},{"level":1,"units":["U3"]}]}
157
176
  ```
158
177
 
159
178
  Strategy selection (drives ec-implementing's sub-agent orchestration shape — every strategy
@@ -168,7 +187,18 @@ Each unit carries `rules_sections` and `abstract_modules` so ec-implementing can
168
187
  precise task card without the sub-agent re-reading the whole repo. `depends_on` sets the
169
188
  parallel-group levels.
170
189
 
171
- ## Test strategy (presented with the plan, saved for VERIFICATION)
190
+ For an explicitly no-code `doc` / `analysis` / `report` task, use a `single` plan whose unit
191
+ has `files:[]`. The state API permits an empty file scope only for those task types. The unit
192
+ must still include `id`, `title`, `type`, `depends_on`, `rules_sections`, and
193
+ `abstract_modules`; its sub-agent returns the full read-only result in `deliverable` and must
194
+ not modify project files. After IMPLEMENT shows that full result, the task auto-completes without
195
+ REVIEW, VERIFICATION, MEMORY, or a memory write. Never use an empty `files` list for
196
+ feature/bugfix/refactor/perf code tasks.
197
+
198
+ ## Test strategy (code tasks only; presented with the plan, saved for VERIFICATION)
199
+
200
+ Read-only `doc` / `analysis` / `report` tasks skip this entire standalone artifact. Do not
201
+ create `test-strategy.md`; only mark the mandatory dev-spec `测试策略` section as not applicable.
172
202
 
173
203
  **1. Testability table** — classify every change:
174
204
 
@@ -193,32 +223,37 @@ owning unit and the verify command.
193
223
  **5. Cannot-verify items** — items that cannot be verified in the current environment,
194
224
  with reason (missing infra, data, credentials, or API contract).
195
225
 
196
- Write the confirmed strategy to `.easy-coding/tasks/{task-id}/test-strategy.md` (the
197
- VERIFICATION baseline).
226
+ For a code task, write the confirmed strategy to
227
+ `.easy-coding/tasks/{task-id}/test-strategy.md` (the VERIFICATION baseline).
198
228
 
199
229
  ## Self-check gates (ALL must pass — reject your own output if ANY fails)
200
230
 
201
231
  - [ ] `dev-spec.md` 文件是否已写入 `.easy-coding/tasks/{task-id}/`?
202
232
  - [ ] `execution.jsonl` 文件是否已写入?
203
- - [ ] `test-strategy.md` 文件是否已写入?
204
- - [ ] dev-spec.md 是否包含全部 13 个必填章节标题(参见上方清单)?
233
+ - [ ] 代码任务是否已写入 `test-strategy.md`?只读任务是否确认该文件不存在?
234
+ - [ ] dev-spec.md 是否包含全部 12 个必填章节标题(参见上方清单)?
205
235
  - [ ] 每个"现状"断言是否引用了真实文件/类/行号?
206
236
  - [ ] 是否有具体的修改方案,而非仅罗列"已加载的文件"?
207
237
  - [ ] 不适用的条件章节是否已完全省略(而非留空)?
208
238
  - [ ] 实施拆解的单元、依赖、策略是否与改动范围表一致?
209
239
  - [ ] 改动范围表中每行是否填写了文件编码及证据?
210
- - [ ] 所有 `{待填写}` 占位符是否已替换为实际内容?
240
+ - [ ] 所有 `[[EC_TODO:...]]` 占位标记是否已替换为实际内容?
211
241
  - [ ] 回复给用户的内容是否是 dev-spec.md 的完整内容(而非自创的缩略格式)?
212
242
  - [ ] 交付形态是否忠于用户原始需求?代码类任务(重构/修复/功能)是否规划了真实代码改动,而非降级为"仅出报告/分析清单/留作后续子任务"?
213
243
  - [ ] 「改动范围」是否只含真实项目源码/配置,且不含任何 `.easy-coding/` 下的 harness 产物(dev-spec/execution/test-strategy/记忆/报告)?
214
244
  - [ ] 若「改动范围」为空,是否确为用户明确要求的无代码交付形态,而非 AI 自行降级的结果?
215
- - [ ] 任何"本次不做全部 / 分批落地 / 范围收窄"的决定,是否已列入「待用户决策」交由用户拍板,而非自行拍板并假托既定?
245
+ - [ ] unit.files 为空,task.json.type 是否为 `doc` / `analysis` / `report`,且计划是否为 single 只读交付?
246
+ - [ ] 是否在填充方案前通过分析中的即时问答解决了全部用户决策项,且最终报告不含未决问题或 `[阶段:ANALYSIS]`?
247
+ - [ ] 任何"本次不做全部 / 分批落地 / 范围收窄"的决定,是否已在填充方案前询问并获得用户确认,而非自行拍板并假托既定?
216
248
 
217
249
  ## Revision handling
218
250
 
219
- > 修订同样受 HARD RULE 5/6 约束:用户的修订诉求若是扩大或细化代码改动,不得借机把任务降级为"出报告";范围收窄仍须作为 待用户决策 项由用户确认。
251
+ > 修订同样受 HARD RULE 5/6 约束:用户的修订诉求若是扩大或细化代码改动,不得借机把任务降级为"出报告";范围收窄必须在重写报告前即时询问并获得用户确认。
220
252
 
221
- On user revision request at WAITING_CONFIRM, do NOT reply with only a change summary.
253
+ On user revision or Other feedback while ANALYSIS has a pending transition, first cancel the
254
+ pending edge. Re-run the pre-fill decision gate before editing the existing report. If the
255
+ revision exposes an unresolved decision, ask it immediately and wait without writing a partial
256
+ revision. Do NOT reply with only a change summary.
222
257
  Re-output the COMPLETE revised dev-spec.md:
223
258
 
224
259
  1. Prepend a `### 修订摘要` listing each user request and its impact on the plan. If the
@@ -226,12 +261,13 @@ Re-output the COMPLETE revised dev-spec.md:
226
261
  2. Re-output the full plan following the template above (核心必填 + applicable conditional
227
262
  sections), incorporating all revisions.
228
263
  3. Overwrite the `plan` record in execution.jsonl with the new strategy.
229
- 4. Update test-strategy.md if test scope changed.
230
- 5. Re-enter WAITING_CONFIRM and wait for explicit user confirmation.
264
+ 4. For code tasks, update test-strategy.md if test scope changed. For read-only tasks, keep the
265
+ file absent.
266
+ 5. Request ANALYSIS -> IMPLEMENT again and present the standard confirmation/handoff/Other gate.
231
267
 
232
268
  ## End state
233
269
 
234
270
  Read dev-spec.md back from disk and output the COMPLETE content as your reply to the user —
235
- not a summary, not a different format, not a table you invented. Then set stage to
236
- WAITING_CONFIRM and hand control back to ec-workflow. Never start implementing from this
237
- skill.
271
+ not a summary, not a different format, not a table you invented. Then ask ec-workflow to
272
+ record `pending_transition: ANALYSIS -> IMPLEMENT`, present the standard boundary choices,
273
+ and stop. Never start implementing from this skill.
@@ -66,7 +66,8 @@ After saving the design doc, ask the user: "Design confirmed. Start a task based
66
66
  design now?" Offer two options:
67
67
 
68
68
  1. **Start task now** — invoke `{{skill_trigger}}ec-workflow` with the design topic as the
69
- task prompt. ec-workflow will create the task (step 4) and enter INIT ANALYSIS.
69
+ task prompt. ec-workflow will create the task and enter INIT. After INIT completes, it
70
+ automatically enters ANALYSIS without a confirmation/handoff gate.
70
71
  ec-analysis will discover the design doc in `.easy-coding/spec/` and use it as input.
71
72
  2. **Later** — tell the user the design is saved and they can run
72
73
  `{{skill_trigger}}ec-workflow` whenever ready.
@@ -17,7 +17,7 @@ Communicate with the user in the user's language.
17
17
  |---|---|---|
18
18
  | `sessions/` | **never** | personal runtime state, differs per developer |
19
19
  | `config.yaml` | yes | shared team config |
20
- | `tasks/*/task.json` `dev-spec.md` `execution.jsonl` `test-strategy.md` | yes | per-task folders, no merge conflicts; team-readable decision record |
20
+ | `tasks/*/task.json` `dev-spec.md` `execution.jsonl` and code-task `test-strategy.md` | yes | per-task folders, no merge conflicts; team-readable decision record |
21
21
  | `SOUL.md` `RULES.md` `ABSTRACT.md` `TEST_STRATEGY.md` `CHANGELOG.md` | yes | shared project knowledge |
22
22
  | `memory/` | yes | shared knowledge sinks |
23
23
  | `spec/` | yes | spec store |
@@ -1,13 +1,14 @@
1
1
  ---
2
2
  name: ec-implementing
3
- description: IMPLEMENT-stage skill. Use when ec-workflow enters IMPLEMENT with a confirmed plan. Executes execution.jsonl units under strict file-scope control, enforces RULES compliance and encoding preservation, writes tests per strategy, and dispatches sub-agents for every unit regardless of strategy.
3
+ description: IMPLEMENT-stage skill. Use when ec-workflow enters IMPLEMENT with a confirmed plan. Executes code or explicit no-code execution.jsonl units under strict scope control, enforces RULES compliance and encoding preservation, writes code-task tests per strategy, and dispatches sub-agents for every unit regardless of strategy.
4
4
  ---
5
5
 
6
6
  # ec-implementing — execute the confirmed plan
7
7
 
8
- ec-workflow dispatches you when a confirmed task enters IMPLEMENT. You turn the plan into
9
- code without re-opening decisions. Inputs: `dev-spec.md` (confirmed), `execution.jsonl`
10
- (plan record), `.easy-coding/RULES.md`, `.easy-coding/ABSTRACT.md`, `test-strategy.md`.
8
+ ec-workflow dispatches you when a confirmed task enters IMPLEMENT. You execute the confirmed
9
+ delivery without re-opening decisions. Inputs: `task.json`, `dev-spec.md` (confirmed), `execution.jsonl`
10
+ (plan record), `.easy-coding/RULES.md`, `.easy-coding/ABSTRACT.md`, and `test-strategy.md` for
11
+ code tasks only. A read-only task has no test-strategy.md.
11
12
 
12
13
  Communicate with the user in the user's language.
13
14
 
@@ -28,8 +29,13 @@ Communicate with the user in the user's language.
28
29
  6. **Self-audit gate.** When the unit is done, audit: are all edits within scope? any
29
30
  undeclared dependency change? any leftover TODO/FIXME you introduced? Report failures;
30
31
  never skip silently.
31
- 7. **Tests (soft rule).** Write tests for [must-test]/[should-test] items per
32
+ 7. **Tests (code tasks only, soft rule).** Write tests for [must-test]/[should-test] items per
32
33
  test-strategy.md. Soft means: no project test infra → not forced; infra exists → required.
34
+ Read-only tasks have no test-strategy.md and write no tests.
35
+ 8. **No-code delivery is explicit and read-only.** Only a task whose `task.json.type` is
36
+ `doc`, `analysis`, or `report` may have `unit.files:[]`. Dispatch it with editable scope
37
+ `NONE — read-only deliverable`; the sub-agent modifies nothing and returns the full result
38
+ in `deliverable`. An empty scope on any code task is a gate failure, not permission to roam.
33
39
 
34
40
  ## Sub-agent dispatch
35
41
 
@@ -46,8 +52,8 @@ EVERY STRATEGY = MANDATORY SUB-AGENT DISPATCH. NO EXCEPTIONS.
46
52
 
47
53
  You MUST dispatch sub-agents using {{sub_agent_dispatch}} for every unit, whatever the
48
54
  strategy. You are FORBIDDEN from implementing any unit yourself in the main agent. Doing the
49
- work inline instead of dispatching is a protocol violation equivalent to skipping
50
- WAITING_CONFIRM.
55
+ work inline instead of dispatching is a protocol violation equivalent to bypassing the
56
+ ANALYSIS -> IMPLEMENT confirmation gate.
51
57
 
52
58
  Self-check before writing ANY implementation code:
53
59
  - Am I about to write implementation code in the main agent? → STOP. Dispatch a sub-agent.
@@ -70,8 +76,14 @@ goes through a sub-agent — this isolates implementation context from the main
70
76
  await the level, then advance.
71
77
  Platform spawn rule: {{platform_spawn_instruction}}
72
78
  4. After each unit/level returns: check for file conflicts (two units touched the same file),
73
- collect `issues` and `needs_attention`. Resolve conflicts before advancing.
74
- 5. After all units/levels, summarize.
79
+ collect `issues` and `needs_attention`. Resolve conflicts before advancing. For a no-code
80
+ unit, additionally require `changed_files:[]` and a non-empty string `deliverable`; a missing
81
+ deliverable or any file modification is a unit failure and must be re-dispatched.
82
+ 5. After recording a successful no-code result, output the complete `deliverable` to the user
83
+ verbatim in the current response before any summary or completion action. Never replace,
84
+ truncate, or hide it behind the one-line `summary` or leave it only in execution.jsonl.
85
+ 6. After all units/levels, summarize. For no-code delivery, the summary is supplemental and
86
+ must appear after the full deliverable.
75
87
 
76
88
  ## Task card — the sub-agent contract
77
89
 
@@ -88,11 +100,13 @@ structured results. Reply content IS the return value, not a message to a human.
88
100
  - Modify only files in "Editable scope".
89
101
  - Make no stage-transition decisions.
90
102
  ## Task {unit description extracted from dev-spec}
91
- ## Editable scope {unit.files}
103
+ ## Delivery mode {code | no-code read-only, derived from task.type and unit.files}
104
+ ## Editable scope {unit.files | NONE — read-only deliverable}
92
105
  ## Coding rules {RULES.md sections selected by unit.rules_sections}
93
106
  ## Architecture {ABSTRACT.md sections selected by unit.abstract_modules}
94
107
  ## Output format
95
- Return: changed_files[], summary (one line), issues[], needs_attention[].
108
+ Return: changed_files[], summary (one line), deliverable (full no-code result or null),
109
+ issues[], needs_attention[].
96
110
  ```
97
111
 
98
112
  This enforces the three-layer escape guard: task boundary (only its files), stage boundary
@@ -107,8 +121,19 @@ let sub-agents re-dispatch each other.
107
121
 
108
122
  ## End state
109
123
 
110
- All units done and self-audited hand back to ec-workflow to advance to REVIEW. If you
111
- hit something that invalidates the plan, return to ANALYSIS instead of improvising.
124
+ - **Code task:** after all units are done and self-audited, hand back to ec-workflow. It records
125
+ IMPLEMENT -> REVIEW as the recommended pending edge, then presents: (1) enter REVIEW,
126
+ (2) skip REVIEW and enter VERIFICATION, (3) hand off, plus native free-form Other.
127
+ - **No-code read-only task:** after recording the successful result and showing the complete
128
+ deliverable, call `auto-transition --stage COMPLETE` through ec-workflow. Do not request or
129
+ enter REVIEW, VERIFICATION, or MEMORY; do not write short or long memory. The state API only
130
+ accepts this terminal edge when the latest plan is `single` with `files:[]` and the latest
131
+ result has `changed_files:[]`, a non-empty `deliverable`, and no issues/needs_attention.
132
+ A matching `dispatch` record must immediately precede the accepted result among that unit's
133
+ execution records; an inline report without dispatch cannot complete.
134
+
135
+ If something invalidates the plan before completion, request IMPLEMENT -> ANALYSIS and wait at
136
+ the standard gate instead of improvising.
112
137
 
113
138
  ## Self-check gates (before handing back)
114
139
 
@@ -117,3 +142,7 @@ hit something that invalidates the plan, return to ANALYSIS instead of improvisi
117
142
  - [ ] Each dispatched unit has a `dispatch` record in execution.jsonl?
118
143
  - [ ] Each returned unit has a `result` record?
119
144
  - [ ] No files modified outside the change-scope table?
145
+ - [ ] For a no-code unit: changed_files is empty, deliverable is non-empty, and the full
146
+ deliverable was output verbatim to the user before automatic completion?
147
+ - [ ] For a no-code task: IMPLEMENT -> COMPLETE was automatic, with no REVIEW, VERIFICATION,
148
+ MEMORY, or memory write?
@@ -1,18 +1,20 @@
1
1
  ---
2
2
  name: ec-memory
3
- description: MEMORY_SHORT and MEMORY_LONG stage skill — part of the archive flow, triggered only after user acceptance. Use when ec-workflow enters the memory stages. Writes schema-v2 short memory with a sliding window, distills long memory into BUSINESS/TECHNICAL with conflict resolution, and backfills ABSTRACT on architecture changes.
3
+ description: MEMORY-stage skill — part of the archive flow, triggered only after user acceptance and a confirmed stage edge. Writes one schema-v2 short memory, runs the authoritative conditional long-memory gate, performs optional distillation, and automatically completes the task.
4
4
  ---
5
5
 
6
6
  # ec-memory — archive what was learned
7
7
 
8
- ec-workflow dispatches you during MEMORY_SHORT and MEMORY_LONG, which run only after the
9
- user accepts the task. Inputs: the task's `dev-spec.md`, `execution.jsonl` (the `result` and
8
+ ec-workflow dispatches you during MEMORY, which runs only after the user accepts the task and
9
+ confirms entry. Inputs: the task's `dev-spec.md`, `execution.jsonl` (the `result` and
10
10
  `verify` records are precise source material), the changed-files list, existing memory files.
11
+ Read-only `doc` / `analysis` / `report` tasks auto-complete from IMPLEMENT and never enter
12
+ MEMORY or write task memory.
11
13
 
12
14
  Communicate with the user in the user's language. Memory file content follows the project's
13
15
  recorded comment/doc language.
14
16
 
15
- ## MEMORY_SHORT — write one short memory entry
17
+ ## Step 1 — write one short memory entry
16
18
 
17
19
  Create one file under `.easy-coding/memory/short/` following the format in
18
20
  `.easy-coding/memory/SHORT_MEMORY_TEMPLATE.md`. File naming convention:
@@ -23,6 +25,7 @@ Frontmatter (all fields required):
23
25
  ---
24
26
  memory_schema: 2
25
27
  id: SM-{YYYYMMDD}-{NN}
28
+ source_task: {current task id, exact}
26
29
  date: {YYYY-MM-DD}
27
30
  task_type: {feature | bugfix | refactor | perf | doc | workflow}
28
31
  project_mode: {startup | iteration}
@@ -45,6 +48,13 @@ conversation. Refer to SHORT_MEMORY_TEMPLATE.md for the complete section format.
45
48
 
46
49
  If the task was cross-repo, record the repo names involved and the collaboration reason.
47
50
 
51
+ After the file is successfully written, record the checkpoint immediately:
52
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py memory-short-complete --session-file <P> --file "<relative-short-memory-path>" --agent <agent-id>`.
53
+ Use the returned `status_context` as authoritative. On resume, if `memory_progress` already
54
+ shows `short_memory_written:true`, do not create a duplicate entry; continue from Step 2.
55
+ The state API validates `memory_schema: 2`, requires `source_task` to equal the current task id,
56
+ and fingerprints the file. Do not reuse an older task's memory file as this checkpoint.
57
+
48
58
  ## Supermodule memory routing
49
59
 
50
60
  If the current project config contains `supermodule.role: super-parent`, archive memory by
@@ -67,26 +77,27 @@ create a new one instead. Short memories serve as both a recent-detail sliding w
67
77
  distillation buffer for long-term memory.
68
78
 
69
79
  **Sliding window (informational):** The short memory directory has a soft cap defined by
70
- `memory.short_term_max` (default 10). MEMORY_SHORT only WRITES one entry per completed task
71
- it never counts, trims, or triggers distillation. Trimming is exclusively MEMORY_LONG's
72
- responsibility and only runs when the threshold is exceeded.
80
+ `memory.short_term_max` (default 10). Step 1 only writes and checkpoints one entry per
81
+ completed task. It never decides whether to distill.
73
82
 
74
- ## MEMORY_LONGdistill durable knowledge (CONDITIONAL)
83
+ ## Step 2 run the long-memory gate (CONDITIONAL)
75
84
 
76
85
  <HARD-GATE>
77
- MEMORY_LONG IS CONTROLLED BY THE STATE API `memory_long` INSTRUCTION.
86
+ LONG-MEMORY WORK IS CONTROLLED BY THE STATE API `memory` INSTRUCTION.
78
87
 
79
88
  Before performing ANY distillation work:
80
- 1. Read the `memory_long` object returned by the state API transition to MEMORY_LONG.
81
- If it is not visible in context, re-run the same transition command for MEMORY_LONG to
82
- re-emit the snapshot, then use that `memory_long` object.
83
- 2. Treat `memory_long.action` as authoritative. Do NOT recount short memories yourself and
89
+ 1. After Step 1 is checkpointed, call
90
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py memory-instruction --session-file <P>`.
91
+ This ordering is mandatory: the current task's short entry must be counted first.
92
+ The first successful call is frozen in `memory_progress.instruction`; resumed work reuses
93
+ the same action and trim count even after consumed short files are deleted.
94
+ 2. Treat the returned `memory.action` as authoritative. Do NOT recount short memories yourself and
84
95
  do NOT override the state API instruction with prompt reasoning.
85
- 3. If `action == "no-op"`: output "MEMORY_LONG: no-op (short memory count = {short_count},
86
- threshold = {short_term_max})" and immediately hand back to ec-workflow to advance to
87
- COMPLETE. Do NOT read long memory files, do NOT attempt distillation, do NOT modify any file.
88
- 4. If `action == "distill"`: distill exactly the older `trim_count` short-memory entries
89
- and keep the latest `short_term_keep` entries.
96
+ 3. If `action == "no-op"`: output "MEMORY: long-memory no-op (short memory count =
97
+ {short_count}, threshold = {short_term_max})". Do NOT read or modify long memory files.
98
+ 4. If `action == "distill"`: treat `memory.candidate_files` and `memory.kept_files` as the
99
+ frozen authoritative sets. Distill and delete exactly `candidate_files`; preserve every
100
+ `kept_files` entry. Do not rebuild either set from the live directory.
90
101
 
91
102
  This gate is absolute. Even a single short memory entry below threshold does NOT trigger
92
103
  long-term compression regardless of any other signal.
@@ -100,8 +111,8 @@ Three-file long memory:
100
111
  - `TECHNICAL.md` — architecture decisions, implementation patterns, gotchas.
101
112
 
102
113
  Distillation steps:
103
- 1. Use `memory_long.short_term_keep` and `memory_long.trim_count`. Keep the latest
104
- `short_term_keep` entries; the older `trim_count` entries become distillation candidates.
114
+ 1. Use `memory.candidate_files` and `memory.kept_files`; their sizes correspond to
115
+ `memory.trim_count` and the retained window calculated at instruction time.
105
116
  2. Read the `target_long` of candidate short memories; route to business/technical.
106
117
  3. **Progressive loading** — read only the existing long entries matching this round's
107
118
  domain/tags/related_files. No unbounded whole-repo memory scan.
@@ -116,6 +127,21 @@ Distillation steps:
116
127
  This is sliding-window consumption after successful distillation, not destructive
117
128
  deletion of durable long-term knowledge.
118
129
 
130
+ After either branch succeeds, record completion with the same authoritative action:
131
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py memory-complete --session-file <P> --action <no-op|distill> --agent <agent-id>`.
132
+ The state API rejects an action that disagrees with the current threshold calculation.
133
+ For `distill`, it also rejects completion while any frozen candidate still exists or any
134
+ frozen retained file is missing. A candidate checkpoint may disappear only because it is
135
+ explicitly listed in `candidate_files`.
136
+
137
+ ## Step 3 — automatically enter COMPLETE
138
+
139
+ Only after `memory_progress.completed:true`, hand control to ec-workflow to call:
140
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py auto-transition --session-file <P> --stage COMPLETE --agent <agent-id>`.
141
+ MEMORY -> COMPLETE is a mechanical edge: do not create `pending_transition`, present another
142
+ confirmation/handoff gate, or stop before closeout. Use the returned Ready status context and
143
+ emit the final task summary.
144
+
119
145
  ## ABSTRACT backfill / update
120
146
 
121
147
  While distilling technical memory, if you detect an architecture change — module added or