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.
- package/CHANGELOG.md +27 -0
- package/README.md +13 -11
- package/dist/cli.js +134 -2
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/claude/agents/ec-implementer.md +3 -0
- package/templates/codex/agents/ec-implementer.toml +3 -0
- package/templates/common/bundled-skills/ec-init/SKILL.md +1 -1
- package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +12 -5
- package/templates/common/skills/ec-analysis/SKILL.md +87 -51
- package/templates/common/skills/ec-brainstorming/SKILL.md +2 -1
- package/templates/common/skills/ec-git/SKILL.md +1 -1
- package/templates/common/skills/ec-implementing/SKILL.md +42 -13
- package/templates/common/skills/ec-memory/SKILL.md +46 -20
- package/templates/common/skills/ec-reviewing/SKILL.md +10 -6
- package/templates/common/skills/ec-task-close/SKILL.md +1 -1
- package/templates/common/skills/ec-task-management/SKILL.md +1 -1
- package/templates/common/skills/ec-verification/SKILL.md +25 -26
- package/templates/common/skills/ec-workflow/SKILL.md +119 -69
- package/templates/main-constraint/AGENTS.md.tpl +20 -12
- package/templates/main-constraint/CLAUDE.md.tpl +20 -12
- package/templates/qoder/agents/ec-implementer.md +3 -0
- package/templates/runtime/memory/SHORT_MEMORY_TEMPLATE.md +2 -0
- package/templates/runtime/templates/dev-spec-skeleton.md +41 -46
- package/templates/shared-hooks/easy_coding_state.py +1040 -39
- package/templates/shared-hooks/inject-workflow-state.py +1 -176
- package/templates/shared-hooks/session-start.py +2 -1
|
@@ -5,9 +5,10 @@ description: REVIEW-stage skill. Use when ec-workflow enters REVIEW. Reviews cha
|
|
|
5
5
|
|
|
6
6
|
# ec-reviewing — graded, evidence-backed review
|
|
7
7
|
|
|
8
|
-
ec-workflow dispatches you when IMPLEMENT finishes.
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
ec-workflow dispatches you when code IMPLEMENT finishes. Read-only `doc` / `analysis` / `report`
|
|
9
|
+
tasks auto-complete from IMPLEMENT and never enter REVIEW. You judge the code change set and
|
|
10
|
+
return a verdict that drives the next transition. Inputs: the changed files (from
|
|
11
|
+
execution.jsonl `result` records), `dev-spec.md`, `.easy-coding/RULES.md`, `test-strategy.md`.
|
|
11
12
|
|
|
12
13
|
Communicate with the user in the user's language.
|
|
13
14
|
|
|
@@ -30,9 +31,9 @@ result. No finding without a location.
|
|
|
30
31
|
|
|
31
32
|
## Verdict (exactly one)
|
|
32
33
|
|
|
33
|
-
- `accept` — all dimensions pass.
|
|
34
|
+
- `accept` — all dimensions pass. Request REVIEW -> VERIFICATION.
|
|
34
35
|
- `fix` — problems found, fixable within the current plan. Auto-fix via sub-agents (see below).
|
|
35
|
-
- `replan` — the plan itself is flawed (wrong approach, missing design).
|
|
36
|
+
- `replan` — the plan itself is flawed (wrong approach, missing design). Request REVIEW -> ANALYSIS.
|
|
36
37
|
- `blocked` — external blocker (missing dependency, environment). Pause and report.
|
|
37
38
|
|
|
38
39
|
## Auto-fix flow (on `fix` verdict)
|
|
@@ -46,7 +47,7 @@ defects, not design decisions.
|
|
|
46
47
|
ONLY escalate to the user when:
|
|
47
48
|
- The fix requires a DESIGN CHOICE (two equally valid approaches, ambiguous requirement)
|
|
48
49
|
- The fix would change the public API contract beyond what the dev-spec specifies
|
|
49
|
-
- The finding contradicts something the user explicitly
|
|
50
|
+
- The finding contradicts something the user explicitly confirmed at a stage boundary
|
|
50
51
|
</HARD-GATE>
|
|
51
52
|
|
|
52
53
|
Fix dispatch flow:
|
|
@@ -88,3 +89,6 @@ Platform spawn rule: {{platform_spawn_instruction}}
|
|
|
88
89
|
Append `review` records to execution.jsonl, one per dimension:
|
|
89
90
|
`{"type":"review","dimension":"correctness","findings":[{"file":"...","line":42,"issue":"...","severity":"warn"}]}`.
|
|
90
91
|
Then state the verdict and hand back to ec-workflow.
|
|
92
|
+
For `accept` or `replan`, ec-workflow records the corresponding pending transition and presents
|
|
93
|
+
the standard confirmation/handoff/Other gate. A `fix` round stays inside REVIEW and therefore
|
|
94
|
+
does not create a status transition unless the outcome changes.
|
|
@@ -24,7 +24,7 @@ when you recognize abandonment intent in the user's message.
|
|
|
24
24
|
clears session `current_task` so the next hook injection returns to Ready.
|
|
25
25
|
Use the returned `status_context` as the authoritative status source for the rest of the
|
|
26
26
|
current turn.
|
|
27
|
-
4. **No memory flow.** Do not run
|
|
27
|
+
4. **No memory flow.** Do not run MEMORY. An incomplete task's memory is dirty data.
|
|
28
28
|
5. **Linked tasks.** If the task has `spawned_from` or `spawned_tasks`, note the closure fact
|
|
29
29
|
on the relation so a future agent understands the chain.
|
|
30
30
|
6. Optionally append a closure note to `execution.jsonl` if there is context worth keeping for
|
|
@@ -52,7 +52,7 @@ unless ec-workflow is explicitly invoked or the agent environment routes into it
|
|
|
52
52
|
### Create a task
|
|
53
53
|
|
|
54
54
|
Create through the state API, never by hand-editing `task.json` or session files:
|
|
55
|
-
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task --session-file <P> --task-id <MM-DD-short-name> --type <feature|bugfix|refactor|perf> --title "<one-line summary>" --agent <agent-id> --no-set-current`.
|
|
55
|
+
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task --session-file <P> --task-id <MM-DD-short-name> --type <feature|bugfix|refactor|perf|doc|analysis|report|workflow> --title "<one-line summary>" --agent <agent-id> --no-set-current`.
|
|
56
56
|
|
|
57
57
|
If the user explicitly wants to start the task now, omit `--no-set-current`; otherwise leave
|
|
58
58
|
the current workflow pointer untouched and tell them to run `{{skill_trigger}}ec-workflow`
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ec-verification
|
|
3
|
-
description: VERIFICATION-stage skill — the hard gate between
|
|
3
|
+
description: VERIFICATION-stage skill — the hard gate between implementation/review and archive. Use when ec-workflow enters VERIFICATION. Runs lint/typecheck/test in parallel, verifies coverage against test-strategy, gates on fresh evidence, then drives the user-acceptance and repair loop. Archive never happens without explicit user acceptance.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ec-verification — the hard gate
|
|
7
7
|
|
|
8
|
-
ec-workflow dispatches you when REVIEW returns `accept
|
|
9
|
-
|
|
8
|
+
ec-workflow dispatches you when REVIEW returns `accept` or the user explicitly skips REVIEW
|
|
9
|
+
after code IMPLEMENT. Read-only tasks auto-complete from IMPLEMENT and never enter this stage.
|
|
10
|
+
You are the last gate before code-task archive. Nothing passes on assumption.
|
|
10
11
|
|
|
11
12
|
Communicate with the user in the user's language.
|
|
12
13
|
|
|
@@ -54,7 +55,8 @@ Append one `verify` record per check:
|
|
|
54
55
|
|
|
55
56
|
- All three pass AND coverage satisfied → present the verification result; wait for user
|
|
56
57
|
acceptance. Do NOT archive yet.
|
|
57
|
-
- Any failure → append the failing `verify` record, summarize failures,
|
|
58
|
+
- Any failure → append the failing `verify` record, summarize failures, request
|
|
59
|
+
VERIFICATION -> IMPLEMENT, and wait at the standard confirmation/handoff/Other gate.
|
|
58
60
|
|
|
59
61
|
## 4. User acceptance and repair loop
|
|
60
62
|
|
|
@@ -62,31 +64,28 @@ After a green gate, present an acceptance summary: what changed (files + summari
|
|
|
62
64
|
verification results (lint/type/test), and the coverage status. Then the user takes time to
|
|
63
65
|
test manually. Their response routes:
|
|
64
66
|
|
|
65
|
-
- **"accepted"** →
|
|
67
|
+
- **"accepted"** → request VERIFICATION -> MEMORY and present the standard boundary gate.
|
|
66
68
|
- **"problem here"** → scope judgment against the dev-spec:
|
|
67
|
-
- in scope →
|
|
69
|
+
- in scope → request VERIFICATION -> IMPLEMENT and wait for the user to confirm the return;
|
|
70
|
+
after repair, the IMPLEMENT completion choice decides whether REVIEW runs again or
|
|
71
|
+
VERIFICATION resumes directly.
|
|
68
72
|
- out of scope → propose a new task (`spawned_from` = current task id); the current task
|
|
69
73
|
may archive now (if already satisfactory) or stay suspended.
|
|
70
74
|
- **"cancel"** → ec-task-close.
|
|
71
75
|
|
|
72
76
|
Repair sizing: a trivial tweak is fixed and re-verified inside VERIFICATION; a logic/structure
|
|
73
|
-
change formally returns to IMPLEMENT
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
which clears session `current_task` for the completed task. Use the returned
|
|
89
|
-
`status_context`, then output the task summary (what was done, files changed, key
|
|
90
|
-
decisions).
|
|
91
|
-
|
|
92
|
-
Hand control back to ec-workflow at each transition; ec-workflow owns the stage writes.
|
|
77
|
+
change formally returns to IMPLEMENT. After repair, present the standard IMPLEMENT completion
|
|
78
|
+
choice again so the user may enter REVIEW or skip directly to VERIFICATION.
|
|
79
|
+
|
|
80
|
+
## 5. Archive entry (only after acceptance)
|
|
81
|
+
|
|
82
|
+
Acceptance does not mutate the stage directly. Hand control to ec-workflow to call
|
|
83
|
+
`request-transition --stage MEMORY`, then present:
|
|
84
|
+
1. Confirm entering MEMORY
|
|
85
|
+
2. Hand off to another agent
|
|
86
|
+
3. Other (native free-form Other, or the third text option)
|
|
87
|
+
|
|
88
|
+
Only after confirmation may ec-workflow consume the pending edge and dispatch ec-memory.
|
|
89
|
+
ec-memory owns both short-memory creation and the conditional long-memory gate inside the
|
|
90
|
+
single MEMORY stage. After memory processing completes, MEMORY -> COMPLETE advances
|
|
91
|
+
automatically without another confirmation or handoff gate.
|
|
@@ -59,39 +59,43 @@ replies are English.
|
|
|
59
59
|
4. **New task.** When creating a task (from step 3), create
|
|
60
60
|
the task through the state API, which creates `task.json`, sets `status:"INIT"`, writes
|
|
61
61
|
`stage_history`, and sets the session `current_task`:
|
|
62
|
-
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task --session-file <P> --task-id <MM-DD-task-slug> --type <
|
|
62
|
+
`{{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>`.
|
|
63
63
|
Use the returned `status_context` as the current status source. Then enter INIT.
|
|
64
64
|
|
|
65
65
|
## State machine
|
|
66
66
|
|
|
67
67
|
```
|
|
68
|
-
INIT
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
INIT --[auto]--> ANALYSIS -> IMPLEMENT -> REVIEW -> VERIFICATION -> MEMORY --[auto]--> COMPLETE
|
|
69
|
+
\----------------> VERIFICATION
|
|
70
|
+
\--[read-only auto]------------------------------> COMPLETE
|
|
71
|
+
^ ^ | |
|
|
72
|
+
+-- replan ---+ +--- fix -----+
|
|
73
|
+
^ |
|
|
74
|
+
+------- repair ----------+
|
|
75
|
+
user-decision edge --[explicit confirmation / handoff / Other]--> target stage
|
|
75
76
|
any stage --[user abort via ec-task-close]--> CLOSED
|
|
76
77
|
```
|
|
77
78
|
|
|
78
79
|
| Stage | Owner skill | What happens | Exit condition |
|
|
79
80
|
|---|---|---|---|
|
|
80
|
-
| INIT | ec-workflow | collect context, settle scope AND delivery form (change code vs. produce a document) |
|
|
81
|
-
| ANALYSIS | ec-analysis | dev-spec + execution plan
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
| MEMORY_LONG | ec-memory | archive: long memory distillation (conditional — no-op when short memory is under threshold) | state API `memory_long` instruction handled |
|
|
88
|
-
| COMPLETE | ec-workflow | clear current_task, set task status, summary | terminal |
|
|
81
|
+
| INIT | ec-workflow | collect context, settle scope AND delivery form (change code vs. produce a document) | work complete; auto-transition to ANALYSIS |
|
|
82
|
+
| ANALYSIS | ec-analysis | dev-spec + execution plan; code tasks also get test strategy | analysis presented; request IMPLEMENT |
|
|
83
|
+
| IMPLEMENT | ec-implementing | code changes or one read-only deliverable | code: choose REVIEW or VERIFICATION; read-only: auto-complete after delivery |
|
|
84
|
+
| REVIEW | ec-reviewing | multi-dimension code review | verdict selects a legal target; request it |
|
|
85
|
+
| VERIFICATION | ec-verification | hard gate: lint/typecheck/test + coverage | result selects MEMORY or IMPLEMENT; request it |
|
|
86
|
+
| MEMORY | ec-memory | write short memory, then run the conditional long-memory gate | memory work complete; auto-transition to COMPLETE |
|
|
87
|
+
| COMPLETE | ec-workflow | clear current_task, set task status, summary | automatic terminal after MEMORY or validated read-only IMPLEMENT |
|
|
89
88
|
| CLOSED | ec-task-close | user abort; no memory flow | terminal |
|
|
90
89
|
|
|
91
90
|
> **INIT delivery-form rule.** When creating the task, `type` and `title` must faithfully
|
|
92
91
|
> reflect the delivery form implied by the user's request. A refactor/fix/feature is a CODE
|
|
93
92
|
> task; do not record it as an analysis/report task. Do not let ANALYSIS later re-interpret a
|
|
94
93
|
> code task into a documentation-only task — that is a downgrade (see ec-analysis HARD RULE 5).
|
|
94
|
+
> Use `doc`, `analysis`, or `report` only when the user's original request explicitly asks for
|
|
95
|
+
> a no-code deliverable. Those task types may carry execution units with an empty file scope;
|
|
96
|
+
> code task types may not. A successful empty-scope task ends automatically from IMPLEMENT to
|
|
97
|
+
> COMPLETE after its full deliverable is shown; it never creates test-strategy.md or enters
|
|
98
|
+
> REVIEW, VERIFICATION, or MEMORY.
|
|
95
99
|
|
|
96
100
|
## Task switching
|
|
97
101
|
|
|
@@ -104,75 +108,114 @@ When the user confirms switching from task A to task B:
|
|
|
104
108
|
the user which previous agent owned the task.
|
|
105
109
|
4. Resume task B's stage via the appropriate stage skill.
|
|
106
110
|
|
|
107
|
-
No data is lost — task A's dev-spec
|
|
108
|
-
|
|
109
|
-
routing matches, and switching happens again.
|
|
111
|
+
No data is lost — task A's dev-spec and execution.jsonl stay intact, as does test-strategy.md
|
|
112
|
+
for a code task. To return to task A later, the same intent routing applies: the user mentions
|
|
113
|
+
it, routing matches, and switching happens again.
|
|
110
114
|
|
|
111
115
|
## Transition rules (hard)
|
|
112
116
|
|
|
113
|
-
- **
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
- **Code tasks may skip only REVIEW.** ANALYSIS cannot jump to VERIFICATION; IMPLEMENT cannot
|
|
118
|
+
start before the ANALYSIS -> IMPLEMENT confirmation gate passes. After code implementation,
|
|
119
|
+
the user may enter REVIEW or skip it and enter VERIFICATION; code tasks never skip
|
|
120
|
+
VERIFICATION. Explicit read-only tasks are the separate terminal exception below.
|
|
121
|
+
- **User-decision edges are confirmation gates.** Stage completion on those edges does NOT
|
|
122
|
+
change `task.json.status`. It records a `pending_transition` through the state API, presents
|
|
123
|
+
the choices below, and stops. This applies to forward edges, repair/replan edges, and the
|
|
124
|
+
IMPLEMENT review choice. Task creation entering INIT and the separately confirmed
|
|
125
|
+
ec-task-close flow do not add a redundant second prompt.
|
|
126
|
+
- **Mechanical edges are automatic.** After INIT work completes, call `auto-transition`
|
|
127
|
+
for ANALYSIS and dispatch ec-analysis in the same flow. After `memory-complete`, call
|
|
128
|
+
`auto-transition` for COMPLETE and emit the closeout summary. A successful explicit read-only
|
|
129
|
+
task also calls `auto-transition` from IMPLEMENT to COMPLETE immediately after displaying the
|
|
130
|
+
full deliverable. These edges do not create `pending_transition`, do not offer handoff, and
|
|
131
|
+
never wait for user confirmation.
|
|
132
|
+
- **Native choice first (hard requirement).** After `request-transition` succeeds, you MUST
|
|
133
|
+
prefer the agent/platform's native user-choice tool whenever one is available. Do not render
|
|
134
|
+
a plain-text numbered list on a platform that can present selectable options and a free-form
|
|
135
|
+
Other input. Offer exactly these business branches through that native UI:
|
|
136
|
+
1. Confirm entering/returning to `<target-stage>` (recommended)
|
|
137
|
+
2. Hand off to another agent
|
|
138
|
+
3. Other — use the native tool's built-in free-form Other input.
|
|
139
|
+
Code-task IMPLEMENT completion is the one special gate: offer (1) enter REVIEW (recommended),
|
|
140
|
+
(2) skip REVIEW and enter VERIFICATION, and (3) hand off; use the native free-form Other
|
|
141
|
+
input for revisions. Record REVIEW as the recommended pending edge first. If the user chooses
|
|
142
|
+
VERIFICATION, cancel that edge, request IMPLEMENT -> VERIFICATION, and immediately confirm it
|
|
143
|
+
because that selection is explicit confirmation of the alternate target.
|
|
144
|
+
Plain-text numbered choices are fallback only: use them only when no native user-choice tool
|
|
145
|
+
exists. The runtime hook never mutates workflow state from user-prompt text. Native choice
|
|
146
|
+
results, numbered fallback replies, and every natural-language reply must be interpreted by
|
|
147
|
+
you against the current task and stored target before calling `confirm-transition` explicitly.
|
|
148
|
+
On Other feedback, cancel the pending edge before revising work or requesting a different
|
|
149
|
+
legal target. Never interpret silence, enthusiasm, or topic changes as confirmation.
|
|
150
|
+
- **State before action.** Every user-confirmed stage advance is a two-step protocol: first
|
|
151
|
+
consume the pending edge through `confirm-transition`, then run that stage's real work. The
|
|
152
|
+
automatic edges use `auto-transition` instead. Do not start
|
|
153
|
+
analysis, implementation, review, verification, memory writing, or closeout while
|
|
119
154
|
`task.json.status` still names the previous stage. After every state API call, treat the
|
|
120
|
-
returned snapshot/read-after-write state as authoritative for the next action and
|
|
121
|
-
status line.
|
|
155
|
+
returned snapshot/read-after-write state as authoritative for the next action and status line.
|
|
122
156
|
- **ANALYSIS entry gate.** When entering ANALYSIS, your FIRST TWO tool calls must be:
|
|
123
157
|
(1) Read `.easy-coding/templates/dev-spec-skeleton.md`, then (2) Write its exact content
|
|
124
158
|
to the task's dev-spec.md. This is a mechanical copy, not a generation task. Do not read
|
|
125
159
|
code, load memory, or analyze before the skeleton is on disk. This is ec-analysis
|
|
126
|
-
HARD RULE 1 — violating it means the analysis has failed.
|
|
127
|
-
|
|
160
|
+
HARD RULE 1 — violating it means the analysis has failed. After the skeleton is written,
|
|
161
|
+
inspect the required evidence without editing it. Ask and resolve every user decision during
|
|
162
|
+
ANALYSIS before filling any section; the final report must not contain a `待用户决策` section
|
|
163
|
+
or `[阶段:ANALYSIS]`. Once decisions are resolved, your plan reply must be the complete
|
|
164
|
+
dev-spec.md content, not a summary or custom format.
|
|
128
165
|
Additionally, ANALYSIS must stay faithful to the user's delivery form — it may NOT downgrade
|
|
129
166
|
a code task to a report-only task — and the 改动范围 table must list only real project code,
|
|
130
167
|
never `.easy-coding/` harness artifacts (ec-analysis HARD RULES 5 and 6).
|
|
131
|
-
- **
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
168
|
+
- **Autonomous exception.** `behavior.auto_mode: true` in `.easy-coding/config.yaml` only
|
|
169
|
+
waives stage-boundary prompts when the user explicitly requested autonomous execution.
|
|
170
|
+
It carries NO scope or delivery-form decision. Never cite `auto_mode` to narrow scope,
|
|
171
|
+
downgrade a code task, or bypass a blocker that needs a real user decision.
|
|
172
|
+
- **At user-decision stage completion** request the legal target immediately (not at turn end):
|
|
173
|
+
`{{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>"`.
|
|
174
|
+
This writes only `pending_transition`; it does not change the stage.
|
|
175
|
+
- **No-code IMPLEMENT delivery:** before completing the task, ec-implementing must
|
|
176
|
+
have output the successful unit's complete non-empty `deliverable` verbatim to the user.
|
|
177
|
+
A summary or execution.jsonl record is not a substitute; missing user-visible delivery keeps
|
|
178
|
+
the task in IMPLEMENT. The execution log must contain a matching `dispatch` immediately before
|
|
179
|
+
the accepted result for that unit. After delivery, call `auto-transition --stage COMPLETE`;
|
|
180
|
+
do not enter REVIEW, VERIFICATION, or MEMORY and do not write memory.
|
|
181
|
+
- **On automatic completion** call:
|
|
182
|
+
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py auto-transition --session-file <P> --stage <ANALYSIS|COMPLETE> --agent <agent-id>`.
|
|
183
|
+
The state API accepts INIT -> ANALYSIS, completed MEMORY -> COMPLETE, and a validated
|
|
184
|
+
read-only IMPLEMENT -> COMPLETE through this command.
|
|
185
|
+
- **On user confirmation** read the current task's pending edge and call:
|
|
186
|
+
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py confirm-transition --session-file <P> --stage <STAGE> --agent <agent-id>`.
|
|
187
|
+
Only after the read-after-write status names the target stage may its action start.
|
|
188
|
+
- **On Other feedback or a changed outcome** call:
|
|
189
|
+
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py cancel-transition --session-file <P> --agent <agent-id>`
|
|
190
|
+
before revising the current stage or requesting a different target.
|
|
143
191
|
Do not hand-edit `status`, `stage_history`, `last_agent`, `current_task`, or session files.
|
|
144
192
|
The command returns `status_line` and `status_context`; after any state-changing command,
|
|
145
193
|
discard older hook-injected status text and use this returned context as the authoritative
|
|
146
194
|
status source for the rest of the current turn.
|
|
147
|
-
If the target stage is already present because a hook preflight completed it, do not issue a
|
|
148
|
-
duplicate transition; use the latest snapshot and continue with the target stage's action.
|
|
149
195
|
- **Hook enforcement.** The `inject-workflow-state` hook validates every stage transition
|
|
150
196
|
against the state machine. If you see `[ILLEGAL-TRANSITION:...]` in the injected context,
|
|
151
197
|
you MUST revert the task's status to the previous valid stage and explain why the
|
|
152
198
|
transition was rejected. Do not proceed with an illegal stage.
|
|
153
|
-
- **Repair loop sizing** (
|
|
154
|
-
|
|
155
|
-
|
|
199
|
+
- **Repair loop sizing** (after VERIFICATION): a trivial tweak may be fixed inside
|
|
200
|
+
VERIFICATION and re-verified without a status change; a logic or structure change requests
|
|
201
|
+
VERIFICATION -> IMPLEMENT and waits at the standard confirmation gate. After repair, present
|
|
202
|
+
the IMPLEMENT completion choice again so the user may enter REVIEW or skip directly to
|
|
203
|
+
VERIFICATION.
|
|
156
204
|
- **Scope guard** (repair loop): if the user's fix request falls outside the dev-spec scope
|
|
157
205
|
(features or files absent from the change-scope table), say so explicitly and propose a
|
|
158
206
|
new task with `spawned_from` set to the current task id. Never silently absorb scope creep.
|
|
159
207
|
- **Task switching is allowed at any stage.** The suspended task retains its stage in
|
|
160
208
|
task.json. Do not run memory flows for suspended tasks — only completed tasks get archived.
|
|
161
209
|
- **Archive only after user acceptance.** VERIFICATION passing does not complete the task.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
reading or writing long memory; `action == "distill"` runs distillation for `trim_count`
|
|
172
|
-
older short-memory entries.
|
|
173
|
-
- **COMPLETE closeout:** call the state API with `--stage COMPLETE`. The state API clears
|
|
174
|
-
session `current_task` for terminal tasks, so the next hook injection returns to Ready.
|
|
175
|
-
Then output a summary (what was done, files changed, key decisions).
|
|
210
|
+
A green gate requests VERIFICATION -> MEMORY and presents the standard choices. After the
|
|
211
|
+
user confirms, MEMORY writes one short entry first, records it through `memory-short-complete`,
|
|
212
|
+
then asks the state API for the authoritative `memory` instruction. `action == "no-op"`
|
|
213
|
+
skips long-memory reads/writes; `action == "distill"` processes exactly `trim_count` older
|
|
214
|
+
entries. After `memory-complete`, ec-memory automatically advances MEMORY -> COMPLETE.
|
|
215
|
+
- **COMPLETE closeout:** COMPLETE is automatic after successful memory processing, or directly
|
|
216
|
+
after a validated read-only deliverable. The state API clears session `current_task`, so the
|
|
217
|
+
next hook injection returns to Ready. Then output a summary; for read-only tasks, the full
|
|
218
|
+
report must already have appeared before this closeout.
|
|
176
219
|
|
|
177
220
|
## Resume and handoff
|
|
178
221
|
|
|
@@ -186,16 +229,22 @@ Resuming an active task (whether from session restart, claim, handoff, or task s
|
|
|
186
229
|
records tell you exactly where work stopped.
|
|
187
230
|
3. If the task was claimed from another agent, read the latest `handoff` record first for the
|
|
188
231
|
fast summary and tell the user which previous agent handed it off.
|
|
189
|
-
4.
|
|
232
|
+
4. If `pending_transition` exists, do not rerun the completed stage action. If its stored edge
|
|
233
|
+
is INIT -> ANALYSIS or MEMORY -> COMPLETE, treat it as an upgrade-era automatic edge: call
|
|
234
|
+
`auto-transition` for the stored target immediately, without confirmation or handoff. For
|
|
235
|
+
a read-only task in IMPLEMENT, cancel any stale pending REVIEW/VERIFICATION edge before the
|
|
236
|
+
terminal check below. For any other stored edge, re-present the standard
|
|
237
|
+
confirmation/handoff/Other choices. At an IMPLEMENT boundary for a code task, re-present the
|
|
238
|
+
special REVIEW / skip to VERIFICATION / handoff choices.
|
|
239
|
+
5. If a read-only task resumes in IMPLEMENT with a valid successful result, output its complete
|
|
240
|
+
deliverable again and immediately auto-transition to COMPLETE. Otherwise tell the user what
|
|
241
|
+
is being resumed and from which stage, then continue.
|
|
190
242
|
|
|
191
243
|
After a task switch, the same resume flow applies — the only difference is that `current_task`
|
|
192
244
|
was just changed by the switching procedure rather than being loaded from a prior session.
|
|
193
245
|
|
|
194
|
-
Offering handoff —
|
|
195
|
-
|
|
196
|
-
2. Write handoff and stop
|
|
197
|
-
3. Revise the plan
|
|
198
|
-
On option 2, call:
|
|
246
|
+
Offering handoff — every user-decision pending edge includes the handoff option. On that
|
|
247
|
+
option, call:
|
|
199
248
|
`{{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>"`.
|
|
200
249
|
|
|
201
250
|
The handoff record is target-less:
|
|
@@ -204,8 +253,9 @@ It records who handed the task off, not who will take it next. Do not ask the us
|
|
|
204
253
|
the next agent, and do not invent or store a next-agent field. After writing handoff, stop
|
|
205
254
|
owning the task; another agent can use ec-task-management or ec-workflow to claim it.
|
|
206
255
|
|
|
207
|
-
Handoff
|
|
208
|
-
agents by itself; the next agent
|
|
256
|
+
Handoff preserves `pending_transition`, so the next agent resumes the same completed boundary
|
|
257
|
+
without rerunning stage work. The harness never switches agents by itself; the next agent
|
|
258
|
+
claims the task explicitly.
|
|
209
259
|
|
|
210
260
|
## Status line
|
|
211
261
|
|
|
@@ -35,17 +35,25 @@ First run `ec-init`; daily work goes through `ec-workflow`.
|
|
|
35
35
|
|
|
36
36
|
## Workflow discipline
|
|
37
37
|
|
|
38
|
-
-
|
|
39
|
-
|
|
38
|
+
- Code tasks do not skip stages except when the user explicitly skips REVIEW after IMPLEMENT.
|
|
39
|
+
User-decision edges use `pending_transition`; offer the target and handoff, and offer
|
|
40
|
+
free-form Other through native UI when available. IMPLEMENT additionally offers direct entry
|
|
41
|
+
to VERIFICATION.
|
|
42
|
+
INIT -> ANALYSIS, completed MEMORY -> COMPLETE, and validated read-only
|
|
43
|
+
IMPLEMENT -> COMPLETE use restricted `auto-transition` without confirmation or handoff. A
|
|
44
|
+
read-only task creates no test-strategy.md, never enters REVIEW, VERIFICATION, or MEMORY, and
|
|
45
|
+
writes no task memory.
|
|
46
|
+
`auto_mode` only waives remaining prompts; it never changes scope or delivery form.
|
|
40
47
|
- ANALYSIS must follow template-first: read `.easy-coding/templates/dev-spec-skeleton.md` then
|
|
41
|
-
write its exact content to the task's dev-spec.md as the FIRST tool calls
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
write its exact content to the task's dev-spec.md as the FIRST tool calls. Next inspect evidence
|
|
49
|
+
without editing the skeleton, ask every unresolved decision during analysis, and wait. Only
|
|
50
|
+
after all decisions are resolved may the agent fill the complete dev-spec.md. The final report
|
|
51
|
+
contains neither `[阶段:ANALYSIS]` nor a `待用户决策` section.
|
|
52
|
+
- For code tasks, VERIFICATION is a hard gate: lint + typecheck + test must pass on fresh
|
|
53
|
+
evidence, and coverage must match the test strategy, before completion.
|
|
54
|
+
- MEMORY combines short-memory creation and the conditional long-memory gate. Archive starts
|
|
55
|
+
only after explicit user acceptance; once memory processing completes, COMPLETE is automatic.
|
|
56
|
+
- NO CODE-TASK COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
|
|
49
57
|
- All cross-platform modules (skills, hooks, references) must use universal agent protocols.
|
|
50
58
|
Do not rely on any specific agent's proprietary conventions unless the module is explicitly
|
|
51
59
|
a platform-specific compatibility layer. Reference files use descriptive filenames (e.g.,
|
|
@@ -54,8 +62,8 @@ First run `ec-init`; daily work goes through `ec-workflow`.
|
|
|
54
62
|
## Runtime contract
|
|
55
63
|
|
|
56
64
|
- Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
|
|
57
|
-
do not hand-edit session files, `current_task`, task `status`, `stage_history`,
|
|
58
|
-
`last_agent`.
|
|
65
|
+
do not hand-edit session files, `current_task`, task `status`, `stage_history`,
|
|
66
|
+
`pending_transition`, `memory_progress`, or `last_agent`.
|
|
59
67
|
- The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
|
|
60
68
|
`--session-file <P>` when changing the current task or stage.
|
|
61
69
|
- Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
|
|
@@ -33,17 +33,25 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
|
|
|
33
33
|
|
|
34
34
|
## Workflow discipline
|
|
35
35
|
|
|
36
|
-
-
|
|
37
|
-
|
|
36
|
+
- Code tasks do not skip stages except when the user explicitly skips REVIEW after IMPLEMENT.
|
|
37
|
+
User-decision edges use `pending_transition`; offer the target and handoff, and offer
|
|
38
|
+
free-form Other through native UI when available. IMPLEMENT additionally offers direct entry
|
|
39
|
+
to VERIFICATION.
|
|
40
|
+
INIT -> ANALYSIS, completed MEMORY -> COMPLETE, and validated read-only
|
|
41
|
+
IMPLEMENT -> COMPLETE use restricted `auto-transition` without confirmation or handoff. A
|
|
42
|
+
read-only task creates no test-strategy.md, never enters REVIEW, VERIFICATION, or MEMORY, and
|
|
43
|
+
writes no task memory.
|
|
44
|
+
`auto_mode` only waives remaining prompts; it never changes scope or delivery form.
|
|
38
45
|
- ANALYSIS must follow template-first: read `.easy-coding/templates/dev-spec-skeleton.md` then
|
|
39
|
-
write its exact content to the task's dev-spec.md as the FIRST tool calls
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
write its exact content to the task's dev-spec.md as the FIRST tool calls. Next inspect evidence
|
|
47
|
+
without editing the skeleton, ask every unresolved decision during analysis, and wait. Only
|
|
48
|
+
after all decisions are resolved may the agent fill the complete dev-spec.md. The final report
|
|
49
|
+
contains neither `[阶段:ANALYSIS]` nor a `待用户决策` section.
|
|
50
|
+
- For code tasks, VERIFICATION is a hard gate: lint + typecheck + test must pass on fresh
|
|
51
|
+
evidence, and coverage must match the test strategy, before completion.
|
|
52
|
+
- MEMORY combines short-memory creation and the conditional long-memory gate. Archive starts
|
|
53
|
+
only after explicit user acceptance; once memory processing completes, COMPLETE is automatic.
|
|
54
|
+
- NO CODE-TASK COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
|
|
47
55
|
- All cross-platform modules (skills, hooks, references) must use universal agent protocols.
|
|
48
56
|
Do not rely on any specific agent's proprietary conventions unless the module is explicitly
|
|
49
57
|
a platform-specific compatibility layer. Reference files use descriptive filenames (e.g.,
|
|
@@ -52,8 +60,8 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
|
|
|
52
60
|
## Runtime contract
|
|
53
61
|
|
|
54
62
|
- Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
|
|
55
|
-
do not hand-edit session files, `current_task`, task `status`, `stage_history`,
|
|
56
|
-
`last_agent`.
|
|
63
|
+
do not hand-edit session files, `current_task`, task `status`, `stage_history`,
|
|
64
|
+
`pending_transition`, `memory_progress`, or `last_agent`.
|
|
57
65
|
- The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
|
|
58
66
|
`--session-file <P>` when changing the current task or stage.
|
|
59
67
|
- Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
|
|
@@ -11,6 +11,8 @@ complete exactly that unit. Your reply IS the return value, not a message to a h
|
|
|
11
11
|
## Hard constraints
|
|
12
12
|
|
|
13
13
|
- Modify only the files listed in the task card's "Editable scope". Touch nothing else.
|
|
14
|
+
- If the editable scope is `NONE — read-only deliverable`, modify nothing and return the full
|
|
15
|
+
requested result in `deliverable`.
|
|
14
16
|
- Do not call any Skill tool.
|
|
15
17
|
- Do not read `.qoder/skills/`, `.agents/skills/`, or any `.easy-coding/` file. All needed
|
|
16
18
|
context is in the card.
|
|
@@ -22,6 +24,7 @@ complete exactly that unit. Your reply IS the return value, not a message to a h
|
|
|
22
24
|
|
|
23
25
|
- `changed_files`: the files you actually modified
|
|
24
26
|
- `summary`: one line describing what you did
|
|
27
|
+
- `deliverable`: full no-code result, or `null` for a code unit
|
|
25
28
|
- `issues`: problems you hit (empty array if none)
|
|
26
29
|
- `needs_attention`: anything the main agent must decide (empty array if none)
|
|
27
30
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
memory_schema: 2
|
|
3
3
|
id: SM-YYYYMMDD-001
|
|
4
|
+
source_task: MM-DD-task-slug
|
|
4
5
|
date: YYYY-MM-DD
|
|
5
6
|
task_type: feature | bugfix | refactor | perf | doc | workflow
|
|
6
7
|
project_mode: startup | iteration
|
|
@@ -20,6 +21,7 @@ target_long: BUSINESS | TECHNICAL | BOTH | NONE
|
|
|
20
21
|
|
|
21
22
|
> This template defines the format for files under `.easy-coding/memory/short/`.
|
|
22
23
|
> File naming convention: `{NNN}_{YYYYMMDD}_{smart_name}.md`
|
|
24
|
+
> `source_task` must exactly match the current workflow task id from `task.json`.
|
|
23
25
|
> Short memories are immutable after creation — they serve as a sliding window of recent
|
|
24
26
|
> details and a buffer for long-term distillation candidates.
|
|
25
27
|
> When short memories reach the threshold (default 10), the newest 5 are kept as recent
|