easy-coding-harness 0.8.3 → 0.9.0-beta.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 (31) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +16 -10
  3. package/dist/cli.js +256 -47
  4. package/dist/cli.js.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/claude/agents/ec-fixer.md +3 -2
  7. package/templates/claude/agents/ec-implementer.md +4 -1
  8. package/templates/claude/agents/ec-reviewer.md +4 -2
  9. package/templates/claude/agents/ec-verifier.md +6 -3
  10. package/templates/codex/agents/ec-fixer.toml +3 -2
  11. package/templates/codex/agents/ec-implementer.toml +4 -1
  12. package/templates/codex/agents/ec-reviewer.toml +4 -2
  13. package/templates/codex/agents/ec-verifier.toml +6 -3
  14. package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +9 -7
  15. package/templates/common/skills/ec-analysis/SKILL.md +92 -266
  16. package/templates/common/skills/ec-implementing/SKILL.md +82 -131
  17. package/templates/common/skills/ec-memory/SKILL.md +23 -149
  18. package/templates/common/skills/ec-reviewing/SKILL.md +54 -73
  19. package/templates/common/skills/ec-task-management/SKILL.md +34 -94
  20. package/templates/common/skills/ec-verification/SKILL.md +54 -79
  21. package/templates/common/skills/ec-workflow/SKILL.md +109 -302
  22. package/templates/main-constraint/AGENTS.md.tpl +19 -17
  23. package/templates/main-constraint/CLAUDE.md.tpl +19 -17
  24. package/templates/qoder/agents/ec-fixer.md +3 -2
  25. package/templates/qoder/agents/ec-implementer.md +4 -1
  26. package/templates/qoder/agents/ec-reviewer.md +4 -2
  27. package/templates/qoder/agents/ec-verifier.md +6 -3
  28. package/templates/runtime/memory/SHORT_MEMORY_TEMPLATE.md +2 -0
  29. package/templates/runtime/templates/dev-spec-skeleton.md +14 -6
  30. package/templates/shared-hooks/easy_coding_state.py +1240 -89
  31. package/templates/shared-hooks/inject-subagent-context.py +3 -0
@@ -1,315 +1,122 @@
1
1
  ---
2
2
  name: ec-workflow
3
- description: Unified Easy Coding workflow entrypoint. Use when the user runs {{skill_trigger}}ec-workflow, asks to start or continue coding work, or when hook breadcrumbs show an active or handed-off task. Owns the stage state machine, task discovery and resume, and stage-skill dispatch.
3
+ description: Main Easy Coding entrypoint. Creates or resumes a task, orchestrates the unchanged state machine, separates approval from execution depth, and dispatches the stage skill for the current state.
4
4
  ---
5
5
 
6
- # ec-workflow — the workflow state machine
6
+ # ec-workflow — state orchestration
7
7
 
8
- You are the conductor. You own stage transitions and the task lifecycle. Stage-specific work
9
- is delegated to the stage skills (ec-analysis, ec-implementing, ec-reviewing,
10
- ec-verification, ec-memory) — you decide *when* they run, they define *how*.
11
-
12
- Communicate with the user in the user's language. Skill text being English does not mean
13
- replies are English.
14
-
15
- ## Startup sequence (run on every activation, in order)
16
-
17
- If `[easy-coding:no-harness]` is present, do not start or resume this workflow. The current
18
- session is intentionally using native agent behavior; only `ec-no-harness` may restore Easy
19
- Coding for that session.
20
-
21
- 1. **Init guard.** Read `.easy-coding/tasks/project-init/task.json`.
22
- - Missing → tell the user to run the `easy-coding init` CLI first. Stop.
23
- - `status != "COMPLETE"` → tell the user to run `{{skill_trigger}}ec-init` first. Stop.
24
- Do not perform project initialization yourself; that is ec-init's job.
25
- - `[easy-coding:upgrade-init-pending:X]` in breadcrumbs → tell the user: "Harness upgraded
26
- to vX. Running `{{skill_trigger}}ec-init` is recommended to adapt project knowledge and
27
- complete migration. You can skip and start working — the reminder will persist until
28
- ec-init runs." Do NOT stop. Proceed with normal startup.
29
- 2. **Required reading** (cheap, always):
30
- - `.easy-coding/SOUL.md` — project identity and dialogue standards; obey for the session.
31
- - `.easy-coding/RULES.md` — coding rules; re-checked before every write.
32
- - Latest 5 entries in `.easy-coding/memory/short/` — recent task context.
33
- Do NOT bulk-read ABSTRACT.md or long memory here; ec-analysis loads them on demand.
34
- 3. **State check + Intent routing.** Read the hook-injected breadcrumbs (`[current-task:X]`,
35
- `[workflow-state:Y]`, `[easy-coding:session-file:P]`) to determine the active task,
36
- stage, and session file. Then call the task list API with the current agent id:
37
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py list-tasks --agent <agent-id>`.
38
- Use only non-terminal tasks (`active == true`) for routing.
39
-
40
- **Current task pointer exists:**
41
- - The current task has priority. Resume it by default, even if the user only runs the bare
42
- skill trigger.
43
- - If the prompt clearly matches the current task, resume it with the prompt as additional
44
- context.
45
- - If the prompt clearly matches a different unfinished task, ask whether to switch to that
46
- task. Show whether it is `continue` or `takeover`; for takeover show `previous_agent`.
47
- On confirmation, claim the matched task (see Task switching).
48
- - If the prompt clearly describes unrelated new work, ask whether to create a new task and
49
- suspend the current one at its persisted stage.
50
-
51
- **No current task pointer:**
52
- - If the prompt matches exactly one unfinished task, show that task and ask whether to
53
- continue/take it over. For takeover show the previous agent and latest handoff summary.
54
- On confirmation, claim it (see Task switching).
55
- - If the prompt matches multiple unfinished tasks, list the matches with `continue` /
56
- `takeover` labels and ask the user to choose one.
57
- - If the prompt matches none, or there is no prompt beyond the bare skill trigger, list all
58
- unfinished tasks with `continue` / `takeover` labels. For takeover entries, show the
59
- previous agent. Let the user choose one to claim, or choose to start a new task.
60
- - If there are no unfinished tasks, create a new task only when the user supplied a real
61
- task prompt; otherwise report that the harness is ready for a new task.
62
-
63
- 4. **New task.** When creating a task (from step 3), create
64
- the task through the state API, which creates `task.json`, sets `status:"INIT"`, writes
65
- `stage_history`, and sets the session `current_task`:
66
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task --session-file <P> --task-id <MM-DD-task-slug> --type <feature|bugfix|refactor|perf|doc|analysis|report|workflow> --title "<one-line summary>" --agent <agent-id>`.
67
- Use the returned `status_context` as the current status source. Then enter INIT.
8
+ Use this as the only normal entrypoint for Easy Coding development work. Communicate in the
9
+ user's language.
68
10
 
69
11
  ## State machine
70
12
 
71
- ```
72
- INIT --[always auto]--> ANALYSIS -> IMPLEMENT -> REVIEW -> VERIFICATION -> MEMORY --[always auto]--> COMPLETE
73
- \----------------> VERIFICATION
74
- \--[read-only, mode-aware]-----------------------> COMPLETE
75
- ^ ^ | |
76
- +-- replan ---+ +--- fix -----+
77
- ^ |
78
- +------- repair ----------+
79
- edge behavior --[effective confirm mode: approve / guard / lite / auto]--> target stage
80
- any stage --[user abort via ec-task-close]--> CLOSED
81
- ```
82
-
83
- | Stage | Owner skill | What happens | Exit condition |
84
- |---|---|---|---|
85
- | INIT | ec-workflow | collect context, settle scope AND delivery form (change code vs. produce a document) | work complete; auto-transition to ANALYSIS |
86
- | ANALYSIS | ec-analysis | dev-spec + execution plan; code tasks also get test strategy | mode-aware transition to IMPLEMENT |
87
- | IMPLEMENT | ec-implementing | code changes or one read-only deliverable | guard/auto default to REVIEW; lite enters VERIFICATION; approve chooses |
88
- | REVIEW | ec-reviewing | multi-dimension code review | verdict selects a legal mode-aware target |
89
- | VERIFICATION | ec-verification | hard gate: lint/typecheck/test + coverage | mode-aware transition to MEMORY or IMPLEMENT |
90
- | MEMORY | ec-memory | write short memory, then run the conditional long-memory gate | memory work complete; auto-transition to COMPLETE |
91
- | COMPLETE | ec-workflow | clear current_task, set task status, summary | automatic terminal after MEMORY or validated read-only IMPLEMENT |
92
- | CLOSED | ec-task-close | user abort; no memory flow | terminal |
93
-
94
- > **INIT delivery-form rule.** When creating the task, `type` and `title` must faithfully
95
- > reflect the delivery form implied by the user's request. A refactor/fix/feature is a CODE
96
- > task; do not record it as an analysis/report task. Do not let ANALYSIS later re-interpret a
97
- > code task into a documentation-only task — that is a downgrade (see ec-analysis HARD RULE 5).
98
- > Use `doc`, `analysis`, or `report` only when the user's original request explicitly asks for
99
- > a no-code deliverable. Those task types may carry execution units with an empty file scope;
100
- > code task types may not. After its full deliverable is shown, a successful empty-scope task
101
- > follows the effective confirm mode from IMPLEMENT to COMPLETE; it never creates
102
- > test-strategy.md or enters REVIEW, VERIFICATION, or MEMORY.
103
-
104
- ## Task switching
13
+ ```text
14
+ INIT --auto--> ANALYSIS -> IMPLEMENT -> REVIEW -> VERIFICATION -> MEMORY --auto--> COMPLETE
15
+ ^ ^ | |
16
+ +--replan---+ +---repair-----+
105
17
 
106
- When the user confirms switching from task A to task B:
107
- 1. Task A's status is already persisted in its `task.json` — nothing extra to save.
108
- 2. Claim the selected task through the state API:
109
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py claim-task --session-file <P> --task-id <task-b-id> --agent <agent-id>`.
110
- 3. Use the returned `status_context` as the current status source, then read task B's
111
- `task.json` to determine its current stage. If the result says `action:"takeover"`, tell
112
- the user which previous agent owned the task.
113
- 4. Resume task B's stage via the appropriate stage skill.
114
-
115
- No data is lost — task A's dev-spec and execution.jsonl stay intact, as does test-strategy.md
116
- for a code task. To return to task A later, the same intent routing applies: the user mentions
117
- it, routing matches, and switching happens again.
118
-
119
- ## Transition rules (hard)
120
-
121
- - **Code tasks may skip only REVIEW.** ANALYSIS cannot jump to VERIFICATION and code tasks never
122
- skip VERIFICATION. In `guard` and `auto`, an automatic code path chooses REVIEW as the default
123
- successor to IMPLEMENT. In `lite`, IMPLEMENT must enter VERIFICATION directly and the state
124
- API rejects IMPLEMENT -> REVIEW. In `approve`, the user may explicitly choose REVIEW or skip
125
- it and enter VERIFICATION.
126
- - **Resolve the effective confirm mode first.** Read `[easy-coding:confirm-mode:X]` or the state
127
- API snapshot. Session mode overrides project `behavior.confirm_mode`; missing project
128
- configuration defaults to `guard`.
129
- - `approve`: every legal edge requires `request-transition` and explicit confirmation except
130
- INIT -> ANALYSIS and MEMORY -> COMPLETE.
131
- - `guard` (default): only ANALYSIS -> IMPLEMENT and VERIFICATION -> MEMORY require explicit
132
- confirmation. Every other legal edge uses `auto-transition` after its owner selects the
133
- evidence-backed target.
134
- - `lite`: uses the same two confirmation gates as guard, but code IMPLEMENT automatically
135
- enters VERIFICATION and never dispatches REVIEW.
136
- - `auto`: every legal edge uses `auto-transition`.
137
- `ec-task-close` remains an explicit user abort and is not triggered by confirm mode.
138
- - **Confirmation policy changes prompts, not evidence.** No mode chooses product scope,
139
- delivery form, API contracts, or risk decisions for the user. Lite intentionally omits REVIEW;
140
- every mode still preserves its applicable dev-spec, execution, verification, and memory gates.
141
- - **Lite pending-edge compatibility.** If the status context contains
142
- `[easy-coding:lite-review-bypass-required:IMPLEMENT->REVIEW]`, cancel that stale pending edge,
143
- then call `auto-transition --stage VERIFICATION`. Never consume or re-request REVIEW in lite.
144
- - **Always-automatic mechanical edges.** After INIT work completes, call `auto-transition` for
145
- ANALYSIS. After `memory-complete`, call `auto-transition` for COMPLETE. These two edges never
146
- create `pending_transition` in any mode.
147
- - **Native choice rendering is mandatory (hard requirement).** When the effective mode requires
148
- confirmation, call `request-transition`. After it succeeds, the boundary is not fully presented
149
- until the user can actually choose every required business branch. When the agent/platform
150
- exposes a native user-choice tool, you MUST actually invoke it in the same turn; mentioning the
151
- tool, recommending a reply, or printing only a confirmation sentence is not a substitute. Offer
152
- exactly these business branches through that native UI:
153
- 1. Confirm entering/returning to `<target-stage>` (recommended)
154
- 2. Hand off to another agent
155
- 3. Other — use the native tool's built-in free-form Other input.
156
- Code-task IMPLEMENT completion is the one special gate: offer (1) enter REVIEW (recommended),
157
- (2) skip REVIEW and enter VERIFICATION, and (3) hand off; use the native free-form Other
158
- input for revisions. Record REVIEW as the recommended pending edge first. If the user chooses
159
- VERIFICATION, cancel that edge, request IMPLEMENT -> VERIFICATION, and immediately confirm it
160
- because that selection is explicit confirmation of the alternate target.
161
- Before invoking a native choice tool, determine whether it explicitly guarantees an indefinite
162
- wait. When it does, disable or omit any timeout or auto-resolution setting so the request waits
163
- for explicit user input; a long finite timeout is not equivalent. When that guarantee is absent
164
- or uncertain, render the matching complete numbered fallback as normal assistant text before
165
- invoking the native tool once. Label it as the persistent fallback to use if the native choice
166
- closes, so it remains available even when a timeout ends or suspends the current turn.
167
- Plain-text numbered choices are fallback only: use them when no native user-choice tool exists,
168
- pre-render them when an indefinite native wait is not guaranteed, or render them after an
169
- unexpected invalid native result. An ordinary gate must list all three branches rather than
170
- collapsing to "reply confirm":
171
- `1. Confirm entering/returning to <target-stage> (recommended)`,
172
- `2. Hand off to another agent`, `3. Other (describe revisions or another instruction)`.
173
- The code-task IMPLEMENT completion fallback must preserve its special branch set:
174
- `1. Enter REVIEW (recommended)`, `2. Skip REVIEW and enter VERIFICATION`,
175
- `3. Hand off to another agent`, `4. Other (describe revisions or another instruction)`.
176
- An empty, dismissed, timed-out, or unparseable choice result is not confirmation. Preserve the
177
- pending edge. If no numbered fallback is already visible, render the matching complete fallback
178
- immediately when control returns; otherwise do not duplicate it. State that the user may reply
179
- with its number at any later time. Do not invoke or retry the native choice again in that turn.
180
- Never report "no valid choice" and then show only a confirmation instruction. The runtime hook
181
- never mutates workflow state from user-prompt text.
182
- Native choice results, numbered fallback replies, and every natural-language reply must be
183
- interpreted by you against the current task and stored target before calling
184
- `confirm-transition` explicitly.
185
- On Other feedback, cancel the pending edge before revising work or requesting a different
186
- legal target. Never interpret silence, enthusiasm, or topic changes as confirmation.
187
- - **State before action.** Every confirmation-required stage advance is a two-step protocol: first
188
- consume the pending edge through `confirm-transition`, then run that stage's real work. The
189
- automatic edges use `auto-transition` instead. Do not start
190
- analysis, implementation, review, verification, memory writing, or closeout while
191
- `task.json.status` still names the previous stage. After every state API call, treat the
192
- returned snapshot/read-after-write state as authoritative for the next action and status line.
193
- - **ANALYSIS entry gate.** When entering ANALYSIS, your FIRST TWO tool calls must be:
194
- (1) Read `.easy-coding/templates/dev-spec-skeleton.md`, then (2) Write its exact content
195
- to the task's dev-spec.md. This is a mechanical copy, not a generation task. Do not read
196
- code, load memory, or analyze before the skeleton is on disk. This is ec-analysis
197
- HARD RULE 1 — violating it means the analysis has failed. After the skeleton is written,
198
- inspect the required evidence without editing it. Ask and resolve every user decision during
199
- ANALYSIS before filling any section; the final report must not contain a `待用户决策` section
200
- or `[阶段:ANALYSIS]`. Once decisions are resolved, your plan reply must be the complete
201
- dev-spec.md content, not a summary or custom format.
202
- Additionally, ANALYSIS must stay faithful to the user's delivery form — it may NOT downgrade
203
- a code task to a report-only task — and the 改动范围 table must list only real project code,
204
- never `.easy-coding/` harness artifacts (ec-analysis HARD RULES 5 and 6).
205
- - **At confirmation-required stage completion** request the legal target immediately:
206
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py request-transition --session-file <P> --stage <STAGE> --agent <agent-id> --reason "<why this edge is ready>"`.
207
- This writes only `pending_transition`; it does not change the stage.
208
- - **No-code IMPLEMENT delivery:** before completing the task, ec-implementing must
209
- have output the successful unit's complete non-empty `deliverable` verbatim to the user.
210
- A summary or execution.jsonl record is not a substitute; missing user-visible delivery keeps
211
- the task in IMPLEMENT. The execution log must contain a matching `dispatch` immediately before
212
- the accepted result for that unit. After delivery, use `request-transition` in approve mode
213
- or `auto-transition` in guard/lite/auto mode for COMPLETE; do not enter REVIEW, VERIFICATION, or
214
- MEMORY and do not write memory.
215
- - **On an automatic edge** call:
216
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py auto-transition --session-file <P> --stage <TARGET> --agent <agent-id>`.
217
- The state API validates both the legal edge and the effective confirm mode before changing
218
- the stage.
219
- - **On user confirmation** read the current task's pending edge and call:
220
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py confirm-transition --session-file <P> --stage <STAGE> --agent <agent-id>`.
221
- Only after the read-after-write status names the target stage may its action start.
222
- - **On Other feedback or a changed outcome** call:
223
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py cancel-transition --session-file <P> --agent <agent-id>`
224
- before revising the current stage or requesting a different target.
225
- Do not hand-edit `status`, `stage_history`, `last_agent`, `current_task`, or session files.
226
- The command returns `status_line` and `status_context`; after any state-changing command,
227
- discard older hook-injected status text and use this returned context as the authoritative
228
- status source for the rest of the current turn.
229
- - **Hook enforcement.** The `inject-workflow-state` hook validates every stage transition
230
- against the state machine. If you see `[ILLEGAL-TRANSITION:...]` in the injected context,
231
- you MUST revert the task's status to the previous valid stage and explain why the
232
- transition was rejected. Do not proceed with an illegal stage.
233
- - **Repair loop sizing** (after VERIFICATION): a trivial tweak may be fixed inside
234
- VERIFICATION and re-verified without a status change; a logic or structure change selects
235
- VERIFICATION -> IMPLEMENT and follows the effective mode. After repair, approve mode presents
236
- the IMPLEMENT choice again; guard/auto follow the default REVIEW path, while lite returns
237
- directly to VERIFICATION.
238
- - **Scope guard** (repair loop): if the user's fix request falls outside the dev-spec scope
239
- (features or files absent from the change-scope table), say so explicitly and propose a
240
- new task with `spawned_from` set to the current task id. Never silently absorb scope creep.
241
- - **Task switching is allowed at any stage.** The suspended task retains its stage in
242
- task.json. Do not run memory flows for suspended tasks — only completed tasks get archived.
243
- - **Archive only after the configured acceptance gate.** VERIFICATION passing does not complete
244
- the task. A green gate requests VERIFICATION -> MEMORY in approve/guard/lite, or advances
245
- automatically in auto. After entry, MEMORY writes one short entry first, records it through `memory-short-complete`,
246
- then asks the state API for the authoritative `memory` instruction. `action == "no-op"`
247
- skips long-memory reads/writes; `action == "distill"` processes exactly `trim_count` older
248
- entries. After `memory-complete`, ec-memory automatically advances MEMORY -> COMPLETE.
249
- - **COMPLETE closeout:** COMPLETE is automatic after successful memory processing, or directly
250
- after a validated read-only deliverable. The state API clears session `current_task`, so the
251
- next hook injection returns to Ready. Then output a summary; for read-only tasks, the full
252
- report must already have appeared before this closeout.
253
-
254
- ## Resume and handoff
255
-
256
- Hook breadcrumbs you may receive: `[workflow-state:X]`, `[current-task:Y]`,
257
- `[easy-coding:session-file:P]`, `[easy-coding:confirm-mode:M]`,
258
- `[easy-coding:handoff-from:Z]`,
259
- `[easy-coding:lite-review-bypass-required:IMPLEMENT->REVIEW]`,
260
- `[easy-coding:init-required]`.
261
-
262
- Resuming an active task (whether from session restart, claim, handoff, or task switch):
263
- 1. Read `task.json` and the dev-spec sections relevant to the current stage.
264
- 2. Read the tail of `execution.jsonl` — the latest `plan` / `result` / `verify` / `handoff`
265
- records tell you exactly where work stopped.
266
- 3. If the task was claimed from another agent, read the latest `handoff` record first for the
267
- fast summary and tell the user which previous agent handed it off.
268
- 4. If `pending_transition` exists, do not rerun the completed stage action. Handle
269
- `[easy-coding:lite-review-bypass-required:IMPLEMENT->REVIEW]` before the generic pending-edge
270
- rule: call `cancel-transition`, then `auto-transition --stage VERIFICATION`. Otherwise compare
271
- the stored edge with `effective_confirm_mode`. If the edge is now automatic, call
272
- `auto-transition` for its stored target. Before re-presenting any manual gate, consume a
273
- matching numbered fallback reply from the current user prompt against the stored target:
274
- ordinary `1` confirms, `2` hands off, and `3` selects Other; the approve-mode code IMPLEMENT
275
- gate maps `1` to REVIEW, `2` to VERIFICATION, `3` to handoff, and `4` to Other. A bare Other
276
- number asks for the missing revision text with the pending edge intact; Other plus details
277
- cancels the edge before revision. Only an unmatched prompt re-presents the complete gate.
278
- For a read-only task in IMPLEMENT, cancel any stale REVIEW/VERIFICATION edge before
279
- the terminal check below. At an approve-mode IMPLEMENT boundary for a code task, re-present
280
- the special REVIEW / skip to VERIFICATION / handoff choices.
281
- 5. If a read-only task resumes in IMPLEMENT with a valid successful result, output its complete
282
- deliverable again and follow the effective mode to COMPLETE. Otherwise tell the user what is
283
- being resumed and from which stage, then continue.
284
-
285
- After a task switch, the same resume flow applies — the only difference is that `current_task`
286
- was just changed by the switching procedure rather than being loaded from a prior session.
287
-
288
- Offering handoff — every confirmation-required pending edge includes the handoff option. On that
289
- option, call:
290
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py handoff-task --session-file <P> --agent <agent-id> --summary "<dense context: plan shape, key decisions, user emphases>"`.
291
-
292
- The handoff record is target-less:
293
- `{"type":"handoff","from":"<agent>","stage":"<stage>","summary":"<dense context>","timestamp":"<ISO>"}`.
294
- It records who handed the task off, not who will take it next. Do not ask the user to name
295
- the next agent, and do not invent or store a next-agent field. After writing handoff, stop
296
- owning the task; another agent can use ec-task-management or ec-workflow to claim it.
297
-
298
- Handoff preserves `pending_transition`, so the next agent resumes the same completed boundary
299
- without rerunning stage work. The harness never switches agents by itself; the next agent
300
- claims the task explicitly.
18
+ read-only doc/analysis/report: IMPLEMENT -> COMPLETE
19
+ any active stage --explicit user abort--> CLOSED
20
+ ```
301
21
 
302
- ## Status line
22
+ New code tasks never skip REVIEW. `workflow_mode` changes execution depth inside stages, not
23
+ the stage graph. Pre-0.9 in-flight tasks may carry `workflow_mode_legacy:true` for proposal or
24
+ review-evidence compatibility. Only `workflow_mode_legacy_direct_edge:true`, created from old
25
+ lite semantics or an already-persisted edge, permits one IMPLEMENT -> VERIFICATION transition.
26
+
27
+ ## Two independent controls
28
+
29
+ - `approval_mode = approve|guard|confirm|auto` controls whether a legal transition waits for a
30
+ user. `confirm` waits only at ANALYSIS -> IMPLEMENT; after that, green REVIEW, VERIFICATION,
31
+ MEMORY, and COMPLETE transitions advance automatically.
32
+ - `workflow_mode = adaptive|fast|standard|strict` controls execution cost and assurance depth.
33
+
34
+ Resolution order for each configured value is session override, then project config, then
35
+ defaults (`guard`, `adaptive`). ANALYSIS resolves `adaptive` to a concrete mode, presents the
36
+ selection and reasons, allows the user to change it within the risk floor, and freezes it when
37
+ ANALYSIS -> IMPLEMENT is applied.
38
+
39
+ `confirm` and `auto` do not hide the proposal: show it in the plan. Confirm waits for that one
40
+ plan decision; Auto continues immediately. Both remove later waiting, not quality gates.
41
+
42
+ ## Startup
43
+
44
+ 1. Read the injected state breadcrumbs or call:
45
+
46
+ ```bash
47
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py snapshot --agent <agent-id> --session-file <P>
48
+ ```
49
+
50
+ 2. Check `.easy-coding/tasks/project-init/task.json` before routing work.
51
+ - Missing: tell the user to run `easy-coding init` to install or repair the harness, then stop.
52
+ - Present with `status != "COMPLETE"`: invoke `{{skill_trigger}}ec-init`, then stop.
53
+ - `[easy-coding:upgrade-init-pending:X]`: recommend `{{skill_trigger}}ec-init` for vX
54
+ adaptation, but allow the user to continue; this reminder is not a workflow block.
55
+ 3. Match the user's intent against `current_task` and the active task list before resuming.
56
+ If the user names or clearly matches another task, confirm the switch and call
57
+ `claim-task --task-id <id> --agent <agent-id> --session-file <P>`. Do not execute task A
58
+ under task B's request.
59
+ - With no concrete task request, show resumable tasks or report readiness; never create an
60
+ empty task from a bare workflow invocation.
61
+ - For concrete unrelated work while another task is current, confirm creating the new task
62
+ and suspending the current pointer before changing ownership.
63
+ - Create a new task only after routing is settled, using a safe unique ID and a type faithful
64
+ to the requested deliverable. Feature, bugfix, refactor, performance, and workflow changes
65
+ are code tasks. Use `doc`, `analysis`, or `report` only when the user explicitly requested
66
+ a no-code deliverable; never downgrade a code request to the read-only completion path.
67
+ 4. Resume the matched/current task, then load only state-relevant assets. Do not read five full
68
+ memories at every startup; ANALYSIS searches memory metadata and opens relevant entries on
69
+ demand.
70
+ 5. If another Agent last owned the task, summarize the stored handoff before continuing.
71
+
72
+ ## Stage dispatch
73
+
74
+ - `INIT`: call `auto-transition --stage ANALYSIS`.
75
+ - `ANALYSIS`: dispatch `ec-analysis`; it produces artifacts and a workflow proposal.
76
+ - `IMPLEMENT`: dispatch `ec-implementing` using the frozen concrete mode.
77
+ - `REVIEW`: dispatch `ec-reviewing`; the transition requires current fingerprint evidence.
78
+ - `VERIFICATION`: dispatch `ec-verification`; archive requires current green evidence.
79
+ - `MEMORY`: dispatch `ec-memory`.
80
+ - `COMPLETE` / `CLOSED`: report terminal status and clear stale session ownership.
81
+
82
+ ## Boundary handling
83
+
84
+ Use `request-transition` for a boundary that requires approval, then present the complete
85
+ choice set before invoking the platform's native choice UI:
86
+
87
+ 1. Confirm the target transition.
88
+ 2. Hand off to another Agent.
89
+ 3. Other / revise.
90
+
91
+ Preserve `pending_transition` on cancellation, timeout, or invalid UI output. A later ordinary
92
+ reply may consume it. Use `confirm-transition` only for a matching stored edge.
93
+
94
+ Use `auto-transition` only when the state API says the edge is automatic. Mechanical gates
95
+ (analysis artifacts and proposal, review fingerprint, verification fingerprint, memory
96
+ completion) apply in every approval mode.
97
+
98
+ For a migrated pre-0.9 Lite task, the breadcrumb
99
+ `[easy-coding:lite-review-bypass-required:IMPLEMENT->REVIEW]` means the stored REVIEW edge is
100
+ stale. Call `cancel-transition`, then immediately call `auto-transition --stage VERIFICATION`.
101
+ Do not consume, confirm, or recreate the REVIEW edge; the state API will consume the task's
102
+ one-time `workflow_mode_legacy_direct_edge` compatibility marker on the direct transition.
103
+
104
+ ## Mode escalation
105
+
106
+ When implementation reveals a higher risk, call:
107
+
108
+ ```bash
109
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py raise-workflow-mode \
110
+ --mode standard|strict --reason "<new risk>" \
111
+ --agent <agent-id> --session-file <P>
112
+ ```
303
113
 
304
- Start every reply with the single Markdown blockquote status line injected by the hook,
305
- then a blank line. Do not render machine breadcrumbs such as `[workflow-state:...]` to the
306
- user. If no status line is injected (harness inactive), do not invent one. Status display is
307
- script-owned; skills must never construct or "fix" the status line manually.
114
+ Only upward changes are legal after ANALYSIS. During VERIFICATION, return to IMPLEMENT before
115
+ raising the mode so the task re-enters REVIEW with fresh evidence. Scope or design changes return
116
+ to ANALYSIS.
308
117
 
309
- ## Boundaries
118
+ ## Handoff and closure
310
119
 
311
- - Do not perform project knowledge initialization (ec-init owns it).
312
- - Do not write business code from this skill (IMPLEMENT delegates to ec-implementing).
313
- - Do not run git commit/push flows (ec-git owns git discipline).
314
- - Do not generate memories outside the archive flow — an unaccepted task's memory is dirty data.
315
- - Do not edit files under `.easy-coding/spec/` (read-only input here).
120
+ Handoff writes a concise execution record and releases session ownership without changing
121
+ the task stage. Closing is destructive to the active workflow and always requires an explicit
122
+ user action, regardless of approval mode.
@@ -11,13 +11,13 @@ user in the user's language.
11
11
  Start every work reply with the single Markdown blockquote status line injected by the hook,
12
12
  then a blank line. Do not render the machine breadcrumbs to the user.
13
13
 
14
- `{confirm-mode}` is the capitalized effective mode (`Approve`, `Guard`, `Lite`, or `Auto`); a session
15
- override takes precedence over the project mode.
14
+ `{approval-mode}` is the effective approval mode and `{workflow-mode}` is the configured or
15
+ task-frozen execution mode; session overrides take precedence over project settings.
16
16
 
17
- - Ready: > **Easy Coding** · **{confirm-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm, or `ec-task-management` to manage tasks or session settings
18
- - Waiting init: > **Easy Coding** · **{confirm-mode}** · Waiting init · Use `ec-init` to initialize
19
- - Active task: > **Easy Coding** · **{confirm-mode}** · `{current-task}` · `{workflow-state}`
20
- - Handoff: > **Easy Coding** · **{confirm-mode}** · `{current-task}` · `{workflow-state}` · Handoff -> `{source-agent}`
17
+ - Ready: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm, or `ec-task-management` to manage tasks or session settings
18
+ - Waiting init: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Waiting init · Use `ec-init` to initialize
19
+ - Active task: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}`
20
+ - Handoff: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}` · Handoff -> `{source-agent}`
21
21
 
22
22
  Skill names in the status line are bare names (`ec-init`, `ec-workflow`) and never include
23
23
  platform prefixes such as `/` or `$`. If no status line is injected, do not invent one.
@@ -31,7 +31,7 @@ Trigger Easy Coding skills with your platform prefix — Codex: `$ec-*`, Qoder:
31
31
  - `ec-brainstorming` — design exploration before building (hard design gate)
32
32
  - `ec-analysis` `ec-implementing` `ec-reviewing` `ec-verification` — workflow stages
33
33
  - `ec-memory` — short/long memory archive
34
- - `ec-task-management` — task/session panel: list/create tasks and view/change the session confirm mode · `ec-task-close` — interrupt a task
34
+ - `ec-task-management` — task/session panel and approval/workflow mode settings · `ec-task-close` — interrupt a task
35
35
  - `ec-no-harness` — bypass only Easy Coding for the current session
36
36
  - `ec-git` — git discipline · `ec-meta` — understand/customize the harness
37
37
 
@@ -39,11 +39,12 @@ First run `ec-init`; daily work goes through `ec-workflow`.
39
39
 
40
40
  ## Workflow discipline
41
41
 
42
- - Effective confirm mode is session override > project `behavior.confirm_mode` > `guard`.
43
- `approve` confirms every legal edge except INIT -> ANALYSIS and MEMORY -> COMPLETE; `guard`
44
- and `lite` confirm only ANALYSIS -> IMPLEMENT and VERIFICATION -> MEMORY; `auto` confirms none.
45
- Guard/auto code flow chooses IMPLEMENT -> REVIEW; lite chooses IMPLEMENT -> VERIFICATION and
46
- never runs REVIEW. Confirmation mode never changes scope, delivery form, or evidence gates.
42
+ - Approval mode is session override > project `behavior.approval_mode` > `guard`; workflow mode
43
+ is session override > project `behavior.workflow_mode` > `adaptive`. Approval controls waiting;
44
+ workflow controls execution depth. ANALYSIS shows and freezes adaptive to fast/standard/strict.
45
+ Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
46
+ automatically. Every new code task runs REVIEW; no mode changes scope, delivery form, or
47
+ evidence gates.
47
48
  - Confirmation-required edges use `pending_transition`; automatic edges use the restricted
48
49
  `auto-transition` API. A read-only task creates no test-strategy.md, never enters REVIEW,
49
50
  VERIFICATION, or MEMORY, and writes no task memory.
@@ -51,8 +52,8 @@ First run `ec-init`; daily work goes through `ec-workflow`.
51
52
  business branches. When a native user-choice tool is available, invoke it in the same turn with
52
53
  the complete gate. An ordinary gate offers "confirm entering/returning to the target stage"
53
54
  (recommended) and "hand off to another agent", with free-form Other for revisions. The special
54
- approve-mode code IMPLEMENT gate must instead preserve enter REVIEW, skip to VERIFICATION, and
55
- handoff, with free-form Other. Use a native choice without a text pre-fallback only when the tool
55
+ code IMPLEMENT gate must preserve enter REVIEW and handoff, with free-form Other. Use a native
56
+ choice without a text pre-fallback only when the tool
56
57
  explicitly guarantees an indefinite wait; disable or omit automatic timeout/resolution in that
57
58
  case. Otherwise pre-render the matching numbered fallback before invoking native choice once,
58
59
  so timeout cannot remove the user's path forward. Empty, dismissed, timed-out, or unparseable
@@ -68,8 +69,9 @@ First run `ec-init`; daily work goes through `ec-workflow`.
68
69
  without editing the skeleton, ask every unresolved decision during analysis, and wait. Only
69
70
  after all decisions are resolved may the agent fill the complete dev-spec.md. The final report
70
71
  contains neither `[阶段:ANALYSIS]` nor a `待用户决策` section.
71
- - For code tasks, VERIFICATION is a hard gate: lint + typecheck + test must pass on fresh
72
- evidence, and coverage must match the test strategy, before completion.
72
+ - REVIEW and VERIFICATION are fingerprinted hard gates. Review evidence must match the final
73
+ implementation; verification evidence must match final implementation and config. The frozen
74
+ workflow mode selects targeted, impacted, or full commands without weakening the green gate.
73
75
  - MEMORY combines short-memory creation and the conditional long-memory gate. Entry follows the
74
76
  effective confirmation mode; once memory processing completes, COMPLETE is automatic.
75
77
  - NO CODE-TASK COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
@@ -82,7 +84,7 @@ First run `ec-init`; daily work goes through `ec-workflow`.
82
84
 
83
85
  - Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
84
86
  do not hand-edit session files, `current_task`, task `status`, `stage_history`,
85
- `pending_transition`, `memory_progress`, or `last_agent`.
87
+ `pending_transition`, workflow mode proposal/freeze fields, `memory_progress`, or `last_agent`.
86
88
  - The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
87
89
  `--session-file <P>` when changing the current task or stage.
88
90
  - Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
@@ -11,13 +11,13 @@ user in the user's language.
11
11
  Start every work reply with the single Markdown blockquote status line injected by the hook,
12
12
  then a blank line. Do not render the machine breadcrumbs to the user.
13
13
 
14
- `{confirm-mode}` is the capitalized effective mode (`Approve`, `Guard`, `Lite`, or `Auto`); a session
15
- override takes precedence over the project mode.
14
+ `{approval-mode}` is the effective approval mode and `{workflow-mode}` is the configured or
15
+ task-frozen execution mode; session overrides take precedence over project settings.
16
16
 
17
- - Ready: > **Easy Coding** · **{confirm-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm, or `ec-task-management` to manage tasks or session settings
18
- - Waiting init: > **Easy Coding** · **{confirm-mode}** · Waiting init · Use `ec-init` to initialize
19
- - Active task: > **Easy Coding** · **{confirm-mode}** · `{current-task}` · `{workflow-state}`
20
- - Handoff: > **Easy Coding** · **{confirm-mode}** · `{current-task}` · `{workflow-state}` · Handoff -> `{source-agent}`
17
+ - Ready: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm, or `ec-task-management` to manage tasks or session settings
18
+ - Waiting init: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Waiting init · Use `ec-init` to initialize
19
+ - Active task: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}`
20
+ - Handoff: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}` · Handoff -> `{source-agent}`
21
21
 
22
22
  Skill names in the status line are bare names (`ec-init`, `ec-workflow`) and never include
23
23
  platform prefixes such as `/` or `$`. If no status line is injected, do not invent one.
@@ -29,7 +29,7 @@ platform prefixes such as `/` or `$`. If no status line is injected, do not inve
29
29
  - `/ec-brainstorming` — design exploration before building (hard design gate)
30
30
  - `/ec-analysis` `/ec-implementing` `/ec-reviewing` `/ec-verification` — workflow stages
31
31
  - `/ec-memory` — short/long memory archive
32
- - `/ec-task-management` — task/session panel: list/create tasks and view/change the session confirm mode · `/ec-task-close` — interrupt a task
32
+ - `/ec-task-management` — task/session panel and approval/workflow mode settings · `/ec-task-close` — interrupt a task
33
33
  - `/ec-no-harness` — bypass only Easy Coding for the current session
34
34
  - `/ec-git` — git discipline · `/ec-meta` — understand/customize the harness
35
35
 
@@ -37,11 +37,12 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
37
37
 
38
38
  ## Workflow discipline
39
39
 
40
- - Effective confirm mode is session override > project `behavior.confirm_mode` > `guard`.
41
- `approve` confirms every legal edge except INIT -> ANALYSIS and MEMORY -> COMPLETE; `guard`
42
- and `lite` confirm only ANALYSIS -> IMPLEMENT and VERIFICATION -> MEMORY; `auto` confirms none.
43
- Guard/auto code flow chooses IMPLEMENT -> REVIEW; lite chooses IMPLEMENT -> VERIFICATION and
44
- never runs REVIEW. Confirmation mode never changes scope, delivery form, or evidence gates.
40
+ - Approval mode is session override > project `behavior.approval_mode` > `guard`; workflow mode
41
+ is session override > project `behavior.workflow_mode` > `adaptive`. Approval controls waiting;
42
+ workflow controls execution depth. ANALYSIS shows and freezes adaptive to fast/standard/strict.
43
+ Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
44
+ automatically. Every new code task runs REVIEW; no mode changes scope, delivery form, or
45
+ evidence gates.
45
46
  - Confirmation-required edges use `pending_transition`; automatic edges use the restricted
46
47
  `auto-transition` API. A read-only task creates no test-strategy.md, never enters REVIEW,
47
48
  VERIFICATION, or MEMORY, and writes no task memory.
@@ -49,8 +50,8 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
49
50
  business branches. When a native user-choice tool is available, invoke it in the same turn with
50
51
  the complete gate. An ordinary gate offers "confirm entering/returning to the target stage"
51
52
  (recommended) and "hand off to another agent", with free-form Other for revisions. The special
52
- approve-mode code IMPLEMENT gate must instead preserve enter REVIEW, skip to VERIFICATION, and
53
- handoff, with free-form Other. Use a native choice without a text pre-fallback only when the tool
53
+ code IMPLEMENT gate must preserve enter REVIEW and handoff, with free-form Other. Use a native
54
+ choice without a text pre-fallback only when the tool
54
55
  explicitly guarantees an indefinite wait; disable or omit automatic timeout/resolution in that
55
56
  case. Otherwise pre-render the matching numbered fallback before invoking native choice once,
56
57
  so timeout cannot remove the user's path forward. Empty, dismissed, timed-out, or unparseable
@@ -66,8 +67,9 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
66
67
  without editing the skeleton, ask every unresolved decision during analysis, and wait. Only
67
68
  after all decisions are resolved may the agent fill the complete dev-spec.md. The final report
68
69
  contains neither `[阶段:ANALYSIS]` nor a `待用户决策` section.
69
- - For code tasks, VERIFICATION is a hard gate: lint + typecheck + test must pass on fresh
70
- evidence, and coverage must match the test strategy, before completion.
70
+ - REVIEW and VERIFICATION are fingerprinted hard gates. Review evidence must match the final
71
+ implementation; verification evidence must match final implementation and config. The frozen
72
+ workflow mode selects targeted, impacted, or full commands without weakening the green gate.
71
73
  - MEMORY combines short-memory creation and the conditional long-memory gate. Entry follows the
72
74
  effective confirmation mode; once memory processing completes, COMPLETE is automatic.
73
75
  - NO CODE-TASK COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
@@ -80,7 +82,7 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
80
82
 
81
83
  - Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
82
84
  do not hand-edit session files, `current_task`, task `status`, `stage_history`,
83
- `pending_transition`, `memory_progress`, or `last_agent`.
85
+ `pending_transition`, workflow mode proposal/freeze fields, `memory_progress`, or `last_agent`.
84
86
  - The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
85
87
  `--session-file <P>` when changing the current task or stage.
86
88
  - Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
@@ -4,13 +4,14 @@ model: sonnet
4
4
  description: Easy Coding fix sub-agent. Applies targeted fixes to specific issues identified during review. Returns structured results with changed files.
5
5
  ---
6
6
 
7
- You are an Easy Coding fix sub-agent. You receive a fix card listing specific issues
7
+ You are an Easy Coding fix sub-agent. You receive one semantic-unit fix card listing related issues
8
8
  (with file:line locations) and apply the fixes. Your reply content IS the return value,
9
9
  not a message to a human.
10
10
 
11
11
  ## Hard constraints
12
12
 
13
- - Fix ONLY the issues listed in the fix card. Do not refactor or "improve" surrounding code.
13
+ - Fix ONLY the related issues listed in the semantic-unit card. Do not refactor unrelated code.
14
+ - Preserve acceptance criteria and cross-unit contracts; report if the fix would change them.
14
15
  - Modify ONLY the files listed in the fix card's scope.
15
16
  - Do not call any Skill tool.
16
17
  - Do not read `.qoder/skills/`, `.agents/skills/`, or any `.easy-coding/` file.