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.
- package/CHANGELOG.md +20 -0
- package/README.md +16 -10
- package/dist/cli.js +256 -47
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/claude/agents/ec-fixer.md +3 -2
- package/templates/claude/agents/ec-implementer.md +4 -1
- package/templates/claude/agents/ec-reviewer.md +4 -2
- package/templates/claude/agents/ec-verifier.md +6 -3
- package/templates/codex/agents/ec-fixer.toml +3 -2
- package/templates/codex/agents/ec-implementer.toml +4 -1
- package/templates/codex/agents/ec-reviewer.toml +4 -2
- package/templates/codex/agents/ec-verifier.toml +6 -3
- package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +9 -7
- package/templates/common/skills/ec-analysis/SKILL.md +92 -266
- package/templates/common/skills/ec-implementing/SKILL.md +82 -131
- package/templates/common/skills/ec-memory/SKILL.md +23 -149
- package/templates/common/skills/ec-reviewing/SKILL.md +54 -73
- package/templates/common/skills/ec-task-management/SKILL.md +34 -94
- package/templates/common/skills/ec-verification/SKILL.md +54 -79
- package/templates/common/skills/ec-workflow/SKILL.md +109 -302
- package/templates/main-constraint/AGENTS.md.tpl +19 -17
- package/templates/main-constraint/CLAUDE.md.tpl +19 -17
- package/templates/qoder/agents/ec-fixer.md +3 -2
- package/templates/qoder/agents/ec-implementer.md +4 -1
- package/templates/qoder/agents/ec-reviewer.md +4 -2
- package/templates/qoder/agents/ec-verifier.md +6 -3
- package/templates/runtime/memory/SHORT_MEMORY_TEMPLATE.md +2 -0
- package/templates/runtime/templates/dev-spec-skeleton.md +14 -6
- package/templates/shared-hooks/easy_coding_state.py +1240 -89
- package/templates/shared-hooks/inject-subagent-context.py +3 -0
|
@@ -1,149 +1,100 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ec-implementing
|
|
3
|
-
description: IMPLEMENT-stage skill.
|
|
3
|
+
description: IMPLEMENT-stage skill. Executes the confirmed plan with workflow-mode-aware orchestration, strict scope control, shift-left tests, and structured execution evidence.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ec-implementing — execute the confirmed plan
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
code tasks only. A read-only task has no test-strategy.md.
|
|
8
|
+
Use only after ANALYSIS has frozen `task.json.workflow_mode` to `fast`, `standard`, or
|
|
9
|
+
`strict`. Read `dev-spec.md`, the latest `plan` record in `execution.jsonl`, relevant RULES
|
|
10
|
+
and ABSTRACT sections, and `test-strategy.md` for code tasks.
|
|
12
11
|
|
|
13
12
|
Communicate with the user in the user's language.
|
|
14
13
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
1. **Scope is law.** Only modify files listed in the dev-spec change-scope table. If you
|
|
18
|
-
discover you need another file, STOP and return to ANALYSIS to amend the plan. No
|
|
19
|
-
"while I'm here" edits.
|
|
20
|
-
2. **RULES compliance.** Before each write, re-check the RULES sections relevant to that
|
|
21
|
-
file (use the unit's `rules_sections`). Violation → fix before writing, not after.
|
|
22
|
-
3. **Encoding preservation.** Modifying an existing file keeps its original encoding
|
|
23
|
-
(UTF-8 / GBK / ...); never silently convert. New files follow the encoding declared in
|
|
24
|
-
the dev-spec.
|
|
25
|
-
4. **Comment language.** Follow the project's existing comment language as recorded in RULES.
|
|
26
|
-
Do not decide it here.
|
|
27
|
-
5. **Step-wise reporting.** After each file/module, emit a one-line progress note (file +
|
|
28
|
-
what changed). Do not batch everything into one final dump.
|
|
29
|
-
6. **Self-audit gate.** When the unit is done, audit: are all edits within scope? any
|
|
30
|
-
undeclared dependency change? any leftover TODO/FIXME you introduced? Report failures;
|
|
31
|
-
never skip silently.
|
|
32
|
-
7. **Tests (code tasks only, soft rule).** Write tests for [must-test]/[should-test] items per
|
|
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.
|
|
39
|
-
|
|
40
|
-
## Sub-agent dispatch
|
|
41
|
-
|
|
42
|
-
Read the `plan` record's `strategy` field. EVERY strategy dispatches sub-agents — the field
|
|
43
|
-
only decides the orchestration shape, never whether the main agent writes code itself:
|
|
44
|
-
|
|
45
|
-
- `single` → dispatch ONE sub-agent for the single unit.
|
|
46
|
-
- `sequential` → dispatch sub-agents one at a time in dependency order (await each `result`
|
|
47
|
-
before dispatching the next).
|
|
48
|
-
- `parallel` → dispatch sub-agents per level concurrently (see gate below).
|
|
49
|
-
|
|
50
|
-
<HARD-GATE>
|
|
51
|
-
EVERY STRATEGY = MANDATORY SUB-AGENT DISPATCH. NO EXCEPTIONS.
|
|
52
|
-
|
|
53
|
-
You MUST dispatch sub-agents using {{sub_agent_dispatch}} for every unit, whatever the
|
|
54
|
-
strategy. You are FORBIDDEN from implementing any unit yourself in the main agent. Doing the
|
|
55
|
-
work inline instead of dispatching is a protocol violation equivalent to bypassing the
|
|
56
|
-
ANALYSIS -> IMPLEMENT gate selected by the effective confirm mode.
|
|
57
|
-
|
|
58
|
-
Self-check before writing ANY implementation code:
|
|
59
|
-
- Am I about to write implementation code in the main agent? → STOP. Dispatch a sub-agent.
|
|
60
|
-
- Did every unit get a dispatch (single=1, sequential=N serial, parallel=N concurrent)? If no → STOP.
|
|
61
|
-
|
|
62
|
-
There is NO case where the main agent writes implementation code itself. Even a single unit
|
|
63
|
-
goes through a sub-agent — this isolates implementation context from the main agent's window.
|
|
64
|
-
</HARD-GATE>
|
|
65
|
-
|
|
66
|
-
## Dispatch loop (all strategies)
|
|
67
|
-
|
|
68
|
-
1. Read RULES.md and ABSTRACT.md once — the main agent pre-digests context; sub-agents never
|
|
69
|
-
read them.
|
|
70
|
-
2. For each unit, build a **task card** (next section). Append a `dispatch` record before
|
|
71
|
-
dispatching and a `result` record per returned unit, to execution.jsonl.
|
|
72
|
-
3. Dispatch according to strategy, via {{sub_agent_dispatch}}:
|
|
73
|
-
- `single` → dispatch the one unit, await its `result`.
|
|
74
|
-
- `sequential` → sort units by `depends_on`; dispatch one, await its `result`, then the next.
|
|
75
|
-
- `parallel` → sort `parallel_groups` by level; dispatch all units in a level concurrently,
|
|
76
|
-
await the level, then advance.
|
|
77
|
-
Platform spawn rule: {{platform_spawn_instruction}}
|
|
78
|
-
4. After each unit/level returns: check for file conflicts (two units touched the same file),
|
|
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.
|
|
87
|
-
|
|
88
|
-
## Task card — the sub-agent contract
|
|
89
|
-
|
|
90
|
-
The main agent builds the card; the sub-agent never hunts for context itself. Card template:
|
|
14
|
+
## Non-negotiable gates
|
|
91
15
|
|
|
92
|
-
|
|
16
|
+
1. Modify only files in the confirmed change-scope table. A new file requirement returns the
|
|
17
|
+
task to ANALYSIS.
|
|
18
|
+
2. Preserve existing encoding and project comment conventions.
|
|
19
|
+
3. Each unit must carry `acceptance_criteria`, `test_points`, `contracts`, and `risks`.
|
|
20
|
+
Missing unit context is an analysis defect; do not make the implementer rediscover it.
|
|
21
|
+
4. Run the unit's cheapest meaningful test immediately after its implementation. Do not wait
|
|
22
|
+
until VERIFICATION to discover local contract mistakes.
|
|
23
|
+
5. Append `dispatch` and `result` records for every unit, including main-agent execution.
|
|
24
|
+
Main-agent execution uses `reason:"main-inline:<workflow_mode>"`.
|
|
25
|
+
6. A code task never transitions directly from IMPLEMENT to VERIFICATION. Every new code task
|
|
26
|
+
enters REVIEW.
|
|
27
|
+
7. Read-only `doc` / `analysis` / `report` tasks remain `single` with `files:[]`, make no writes,
|
|
28
|
+
return a non-empty `deliverable`, then follow the mode-aware IMPLEMENT -> COMPLETE edge.
|
|
29
|
+
|
|
30
|
+
## Choose the execution owner
|
|
31
|
+
|
|
32
|
+
`strategy` defines dependency shape; `workflow_mode` defines assurance depth.
|
|
33
|
+
|
|
34
|
+
### Fast
|
|
35
|
+
|
|
36
|
+
- A single low-risk unit may be implemented inline by the main Agent.
|
|
37
|
+
- Sequential units may stay inline when they share one small context and have no risky contract.
|
|
38
|
+
- Dispatch a sub-agent only for genuine parallelism, specialist context, or context isolation.
|
|
39
|
+
|
|
40
|
+
### Standard
|
|
41
|
+
|
|
42
|
+
- A single bounded unit may be implemented inline.
|
|
43
|
+
- Dispatch independent parallel units and units with distinct technical context.
|
|
44
|
+
- Keep dependent units sequential and pass the completed contract forward.
|
|
45
|
+
|
|
46
|
+
### Strict
|
|
47
|
+
|
|
48
|
+
- Dispatch multi-unit or high-risk implementation to sub-agents using {{sub_agent_dispatch}}.
|
|
49
|
+
- For a truly indivisible unit, the main Agent may implement only when dispatch adds no
|
|
50
|
+
independence; record why and require independent REVIEW later.
|
|
51
|
+
- Process dependency levels in order. Platform spawn rule: {{platform_spawn_instruction}}
|
|
52
|
+
|
|
53
|
+
The main Agent owns orchestration, conflict resolution, evidence writing, and stage decisions.
|
|
54
|
+
Sub-agents never dispatch other sub-agents or read `.easy-coding` workflow assets.
|
|
55
|
+
|
|
56
|
+
## Task card
|
|
57
|
+
|
|
58
|
+
```text
|
|
93
59
|
# Task Card
|
|
94
|
-
## Identity
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
##
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
##
|
|
103
|
-
##
|
|
104
|
-
##
|
|
105
|
-
|
|
106
|
-
## Architecture {ABSTRACT.md sections selected by unit.abstract_modules}
|
|
107
|
-
## Output format
|
|
108
|
-
Return: changed_files[], summary (one line), deliverable (full no-code result or null),
|
|
109
|
-
issues[], needs_attention[].
|
|
60
|
+
## Identity Easy Coding implementation unit
|
|
61
|
+
## Workflow Mode {fast|standard|strict}
|
|
62
|
+
## Task {unit description}
|
|
63
|
+
## Editable Scope {unit.files | NONE — read-only}
|
|
64
|
+
## Acceptance {unit.acceptance_criteria}
|
|
65
|
+
## Test Points {unit.test_points and exact targeted commands}
|
|
66
|
+
## Contracts {inputs, outputs, invariants shared with other units}
|
|
67
|
+
## Risks {known edge cases and compatibility risks}
|
|
68
|
+
## Coding Rules {pre-digested RULES sections}
|
|
69
|
+
## Architecture {pre-digested ABSTRACT sections}
|
|
70
|
+
## Output
|
|
71
|
+
changed_files[], summary, deliverable|null, issues[], needs_attention[]
|
|
110
72
|
```
|
|
111
73
|
|
|
112
|
-
|
|
113
|
-
(no knowledge of the state machine), output boundary (structured return only). The sub-agent
|
|
114
|
-
gets pre-digested context — it does not open RULES or ABSTRACT itself.
|
|
74
|
+
## Dispatch and result loop
|
|
115
75
|
|
|
116
|
-
|
|
76
|
+
1. Append a `dispatch` record before work begins.
|
|
77
|
+
2. Execute according to dependency order and selected owner.
|
|
78
|
+
3. Run targeted unit tests and self-audit scope, contracts, TODOs, and introduced warnings.
|
|
79
|
+
4. Append one `result` record. Include unresolved issues rather than hiding them.
|
|
80
|
+
5. If a result changes a cross-unit contract, stop dependent units and return to ANALYSIS.
|
|
81
|
+
6. For parallel units, detect overlapping writes before advancing.
|
|
117
82
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
let sub-agents re-dispatch each other.
|
|
83
|
+
Do not emit a progress message for every trivial edit. Report at unit boundaries to reduce
|
|
84
|
+
conversation overhead while keeping work observable.
|
|
121
85
|
|
|
122
86
|
## End state
|
|
123
87
|
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
the effective confirm mode instead of improvising.
|
|
138
|
-
|
|
139
|
-
## Self-check gates (before handing back)
|
|
140
|
-
|
|
141
|
-
- [ ] EVERY unit was dispatched to a sub-agent — no inline implementation by the main agent? (VIOLATION if no)
|
|
142
|
-
- [ ] Sequential units dispatched in dependency order; parallel units dispatched per level?
|
|
143
|
-
- [ ] Each dispatched unit has a `dispatch` record in execution.jsonl?
|
|
144
|
-
- [ ] Each returned unit has a `result` record?
|
|
145
|
-
- [ ] No files modified outside the change-scope table?
|
|
146
|
-
- [ ] For a no-code unit: changed_files is empty, deliverable is non-empty, and the full
|
|
147
|
-
deliverable was output verbatim to the user before completion?
|
|
148
|
-
- [ ] For a no-code task: IMPLEMENT -> COMPLETE followed the effective confirm mode, with no
|
|
149
|
-
REVIEW, VERIFICATION, MEMORY, or memory write?
|
|
88
|
+
- Code task: after all units and targeted checks pass, hand control to ec-workflow for
|
|
89
|
+
IMPLEMENT -> REVIEW.
|
|
90
|
+
- Read-only task: output the full deliverable, then request or auto-apply IMPLEMENT -> COMPLETE.
|
|
91
|
+
- New risk above the frozen mode: call `raise-workflow-mode`; modes may rise but never silently
|
|
92
|
+
fall after ANALYSIS.
|
|
93
|
+
|
|
94
|
+
## Self-check
|
|
95
|
+
|
|
96
|
+
- [ ] Every changed file is in scope and keeps its encoding.
|
|
97
|
+
- [ ] Every unit has a dispatch/result pair and satisfied its acceptance criteria.
|
|
98
|
+
- [ ] Targeted tests ran or a concrete blocker is recorded.
|
|
99
|
+
- [ ] Cross-unit contracts still match.
|
|
100
|
+
- [ ] Code tasks enter REVIEW, regardless of workflow mode.
|
|
@@ -1,162 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ec-memory
|
|
3
|
-
description: MEMORY-stage skill
|
|
3
|
+
description: MEMORY-stage skill. Creates a workflow-mode-aware schema-v2 checkpoint from existing task evidence and performs conditional long-memory distillation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# ec-memory —
|
|
6
|
+
# ec-memory — evidence-derived checkpoint
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
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.
|
|
8
|
+
MEMORY remains mandatory for code tasks. It must not re-analyze the repository or repeat the
|
|
9
|
+
entire conversation. Generate from `task.json`, `dev-spec.md`, and `execution.jsonl`.
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
recorded comment/doc language.
|
|
11
|
+
## Depth by workflow mode
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
- `fast`: mechanically produce a compact checkpoint: goal, scope, result, frozen mode,
|
|
14
|
+
commands/results, and only clearly reusable decisions.
|
|
15
|
+
- `standard`: add reusable contract, compatibility, and troubleshooting facts when present.
|
|
16
|
+
- `strict`: preserve architecture, migration, risk, verification, and cross-module decisions
|
|
17
|
+
needed for future high-risk work.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`{memory_id}_{YYYYMMDD}_{smart_name}.md`. Generate the id first with
|
|
22
|
-
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py memory-new-id --session-file <P> --agent <agent-id>`.
|
|
23
|
-
Use the returned `memory_id` unchanged as both the filename prefix and the frontmatter `id`.
|
|
24
|
-
It uses UUIDv7, so agents never scan the directory or calculate a shared numeric sequence.
|
|
25
|
-
Keep the readable `smart_name` suffix. The entry is immutable after creation.
|
|
26
|
-
Frontmatter (all fields required):
|
|
19
|
+
Every memory uses schema 2 and includes `workflow_mode` in frontmatter. Generate its UUIDv7 ID
|
|
20
|
+
through:
|
|
27
21
|
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
memory_schema: 2
|
|
31
|
-
id: {memory_id returned by memory-new-id, exact}
|
|
32
|
-
source_task: {current task id, exact}
|
|
33
|
-
date: {YYYY-MM-DD}
|
|
34
|
-
task_type: {feature | bugfix | refactor | perf | doc | workflow}
|
|
35
|
-
project_mode: {startup | iteration}
|
|
36
|
-
domain:
|
|
37
|
-
- {business domain or module}
|
|
38
|
-
tags:
|
|
39
|
-
- {keyword}
|
|
40
|
-
related_files:
|
|
41
|
-
- {key file or module}
|
|
42
|
-
commit: {hash | none}
|
|
43
|
-
verification: {passed | partial | not_run}
|
|
44
|
-
memory_value: {business | technical | both | none}
|
|
45
|
-
target_long: {BUSINESS | TECHNICAL | BOTH | NONE}
|
|
46
|
-
---
|
|
47
|
-
The body follows the template structure: Task Summary, Execution Evidence, Business Memory
|
|
48
|
-
Candidates, Technical Memory Candidates, Non-Distillation Content, and Related Memories.
|
|
49
|
-
Pull facts from execution.jsonl result/verify records, not from a fuzzy memory of the
|
|
50
|
-
conversation. Refer to SHORT_MEMORY_TEMPLATE.md for the complete section format.
|
|
22
|
+
```bash
|
|
23
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py memory-new-id --agent <agent-id>
|
|
51
24
|
```
|
|
52
25
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
`
|
|
57
|
-
Use the returned `status_context` as authoritative. On resume, if `memory_progress` already
|
|
58
|
-
shows `short_memory_written:true`, do not create a duplicate entry; continue from Step 2.
|
|
59
|
-
The state API validates `memory_schema: 2`, requires `source_task` to equal the current task id,
|
|
60
|
-
requires a UUIDv7 id that exactly matches the filename prefix, and fingerprints the file. Do not
|
|
61
|
-
reuse an older task's memory file as this checkpoint.
|
|
62
|
-
|
|
63
|
-
## Supermodule memory routing
|
|
64
|
-
|
|
65
|
-
If the current project config contains `supermodule.role: super-parent`, archive memory by
|
|
66
|
-
ownership:
|
|
67
|
-
|
|
68
|
-
- Cross-repo business context, parent orchestration decisions, and multi-repo contracts stay
|
|
69
|
-
in the parent `.easy-coding/memory`.
|
|
70
|
-
- Technical memory that belongs to one child repo must be written to that child's
|
|
71
|
-
`.easy-coding/memory`, not only to the parent. Use changed file paths and module ownership
|
|
72
|
-
to decide the child.
|
|
73
|
-
- Only write child memory files during this routing. Do not edit child task, session, state,
|
|
74
|
-
or dev-spec files from the parent workflow.
|
|
75
|
-
- If a touched child repo has no initialized `.easy-coding/memory` directory, keep the memory
|
|
76
|
-
in the parent and mark it as "original child: <path>; child not initialized".
|
|
77
|
-
- When child memory is written, the later git flow must commit and push the child repo before
|
|
78
|
-
the parent gitlink update.
|
|
79
|
-
|
|
80
|
-
**Immutability:** Short memories are write-once. Never edit an existing short memory file —
|
|
81
|
-
create a new one instead. Short memories serve as both a recent-detail sliding window and a
|
|
82
|
-
distillation buffer for long-term memory.
|
|
83
|
-
|
|
84
|
-
**Sliding window (informational):** The short memory directory has a soft cap defined by
|
|
85
|
-
`memory.short_term_max` (default 10). Step 1 only writes and checkpoints one entry per
|
|
86
|
-
completed task. It never decides whether to distill.
|
|
87
|
-
|
|
88
|
-
## Step 2 — run the long-memory gate (CONDITIONAL)
|
|
89
|
-
|
|
90
|
-
<HARD-GATE>
|
|
91
|
-
LONG-MEMORY WORK IS CONTROLLED BY THE STATE API `memory` INSTRUCTION.
|
|
92
|
-
|
|
93
|
-
Before performing ANY distillation work:
|
|
94
|
-
1. After Step 1 is checkpointed, call
|
|
95
|
-
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py memory-instruction --session-file <P>`.
|
|
96
|
-
This ordering is mandatory: the current task's short entry must be counted first.
|
|
97
|
-
The first successful call is frozen in `memory_progress.instruction`; resumed work reuses
|
|
98
|
-
the same action and trim count even after consumed short files are deleted.
|
|
99
|
-
2. Treat the returned `memory.action` as authoritative. Do NOT recount short memories yourself and
|
|
100
|
-
do NOT override the state API instruction with prompt reasoning.
|
|
101
|
-
3. If `action == "no-op"`: output "MEMORY: long-memory no-op (short memory count =
|
|
102
|
-
{short_count}, threshold = {short_term_max})". Do NOT read or modify long memory files.
|
|
103
|
-
4. If `action == "distill"`: treat `memory.candidate_files` and `memory.kept_files` as the
|
|
104
|
-
frozen authoritative sets. Distill and delete exactly `candidate_files`; preserve every
|
|
105
|
-
`kept_files` entry. Do not rebuild either set from the live directory.
|
|
106
|
-
|
|
107
|
-
This gate is absolute. Even a single short memory entry below threshold does NOT trigger
|
|
108
|
-
long-term compression regardless of any other signal.
|
|
109
|
-
</HARD-GATE>
|
|
110
|
-
|
|
111
|
-
### When action == "distill": distillation flow
|
|
112
|
-
|
|
113
|
-
Three-file long memory:
|
|
114
|
-
- `MEMORY.md` — index of all entries with status (active | deprecated | superseded | deleted).
|
|
115
|
-
- `BUSINESS.md` — business rules, domain knowledge, product decisions.
|
|
116
|
-
- `TECHNICAL.md` — architecture decisions, implementation patterns, gotchas.
|
|
117
|
-
|
|
118
|
-
Distillation steps:
|
|
119
|
-
1. Use `memory.candidate_files` and `memory.kept_files`; their sizes correspond to
|
|
120
|
-
`memory.trim_count` and the retained window calculated at instruction time.
|
|
121
|
-
2. Read the `target_long` of candidate short memories; route to business/technical.
|
|
122
|
-
3. **Progressive loading** — read only the existing long entries matching this round's
|
|
123
|
-
domain/tags/related_files. No unbounded whole-repo memory scan.
|
|
124
|
-
4. **Conflict resolution** by priority: current code > latest user confirmation > this
|
|
125
|
-
round's candidate > older long memory. On conflict, explain it before consolidating —
|
|
126
|
-
never silently pick a side.
|
|
127
|
-
5. **Retirement check**: for older entries decide delete (no value) / merge (semantic
|
|
128
|
-
duplicate) / deprecate (was valid, now superseded).
|
|
129
|
-
6. Update the `MEMORY.md` index to reflect every change.
|
|
130
|
-
7. After the long-memory files and index are successfully written, delete the consumed
|
|
131
|
-
short-memory candidate files. Leave only the latest `short_term_keep` short memories.
|
|
132
|
-
This is sliding-window consumption after successful distillation, not destructive
|
|
133
|
-
deletion of durable long-term knowledge.
|
|
134
|
-
|
|
135
|
-
After either branch succeeds, record completion with the same authoritative action:
|
|
136
|
-
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py memory-complete --session-file <P> --action <no-op|distill> --agent <agent-id>`.
|
|
137
|
-
The state API rejects an action that disagrees with the current threshold calculation.
|
|
138
|
-
For `distill`, it also rejects completion while any frozen candidate still exists or any
|
|
139
|
-
frozen retained file is missing. A candidate checkpoint may disappear only because it is
|
|
140
|
-
explicitly listed in `candidate_files`.
|
|
141
|
-
|
|
142
|
-
## Step 3 — automatically enter COMPLETE
|
|
143
|
-
|
|
144
|
-
Only after `memory_progress.completed:true`, hand control to ec-workflow to call:
|
|
145
|
-
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py auto-transition --session-file <P> --stage COMPLETE --agent <agent-id>`.
|
|
146
|
-
MEMORY -> COMPLETE is a mechanical edge: do not create `pending_transition`, present another
|
|
147
|
-
confirmation/handoff gate, or stop before closeout. Use the returned Ready status context and
|
|
148
|
-
emit the final task summary.
|
|
149
|
-
|
|
150
|
-
## ABSTRACT backfill / update
|
|
151
|
-
|
|
152
|
-
While distilling technical memory, if you detect an architecture change — module added or
|
|
153
|
-
removed, core flow changed, tech stack changed, or (startup projects) ABSTRACT.md does not
|
|
154
|
-
exist yet — update `.easy-coding/ABSTRACT.md` and append a CHANGELOG.md entry (what changed,
|
|
155
|
-
why). For startup projects this is where the first ABSTRACT gets generated from the now-real
|
|
156
|
-
code.
|
|
26
|
+
Name it `{memory_id}_{YYYYMMDD}_{smart_name}.md` and set
|
|
27
|
+
`source_task: {current task id, exact}`. Write one immutable short memory under
|
|
28
|
+
`.easy-coding/memory/short/`, then register it with
|
|
29
|
+
`memory-short-complete`. Never invent test results or commit hashes.
|
|
157
30
|
|
|
158
|
-
|
|
31
|
+
Ask the state API for `memory-instruction`. Distill only when it returns `action:distill`;
|
|
32
|
+
otherwise record `no-op`. Long memory receives reusable facts only, not file dumps, transient
|
|
33
|
+
logs, routine command output, or speculation.
|
|
159
34
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
- The main agent confirms and writes; a memory sub-agent may draft but not finalize.
|
|
35
|
+
Complete processing with `memory-complete`. When the state API reports
|
|
36
|
+
`memory_progress.completed:true`, call `auto-transition --stage COMPLETE`.
|
|
@@ -1,95 +1,76 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ec-reviewing
|
|
3
|
-
description: REVIEW-stage skill.
|
|
3
|
+
description: REVIEW-stage skill. Performs workflow-mode-aware review against the final implementation fingerprint, blocks only actionable acceptance risks, and records reusable evidence.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# ec-reviewing —
|
|
6
|
+
# ec-reviewing — proportional but mandatory review
|
|
7
7
|
|
|
8
|
-
|
|
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`.
|
|
12
|
-
Lite-mode code tasks never enter REVIEW; they proceed from IMPLEMENT to VERIFICATION.
|
|
8
|
+
Every new code task enters REVIEW. Read-only tasks do not. Obtain the current fingerprints:
|
|
13
9
|
|
|
14
|
-
|
|
10
|
+
```bash
|
|
11
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py evidence-fingerprints --agent <agent-id> --session-file <P>
|
|
12
|
+
```
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
Review the final diff against `dev-spec.md`, RULES, unit acceptance criteria, tests, contracts,
|
|
15
|
+
and obvious security risks. Every finding cites `file:line`.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
plan? Edge cases, null/empty handling, off-by-one, async races.
|
|
20
|
-
2. **Compliance** — RULES.md: naming, format, comment language, error handling.
|
|
21
|
-
3. **Completeness** — is every file in the change-scope table actually handled? No half-done
|
|
22
|
-
units.
|
|
23
|
-
4. **Tests** — do [must-test]/[should-test] items have real test cases? Bug fix has a
|
|
24
|
-
regression test?
|
|
25
|
-
5. **Security** — obvious risks only: hardcoded secrets, SQL string concatenation, unvalidated
|
|
26
|
-
external input, path traversal.
|
|
17
|
+
## Depth by workflow mode
|
|
27
18
|
|
|
28
|
-
|
|
19
|
+
- `fast`: main Agent performs one final-diff self-review across correctness, scope, tests, and
|
|
20
|
+
obvious security risks.
|
|
21
|
+
- `standard`: dispatch one independent focused reviewer covering correctness, contract
|
|
22
|
+
completeness, tests, and compliance.
|
|
23
|
+
- `strict`: dispatch at least two independent dimensions (correctness/contracts and
|
|
24
|
+
compliance/tests/security) in parallel via {{sub_agent_dispatch}}.
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
result. No finding without a location.
|
|
32
|
-
|
|
33
|
-
## Verdict (exactly one)
|
|
34
|
-
|
|
35
|
-
- `accept` — all dimensions pass. Request REVIEW -> VERIFICATION.
|
|
36
|
-
- `fix` — problems found, fixable within the current plan. Auto-fix via sub-agents (see below).
|
|
37
|
-
- `replan` — the plan itself is flawed (wrong approach, missing design). Request REVIEW -> ANALYSIS.
|
|
38
|
-
- `blocked` — external blocker (missing dependency, environment). Pause and report.
|
|
39
|
-
|
|
40
|
-
## Auto-fix flow (on `fix` verdict)
|
|
26
|
+
Platform spawn rule: {{platform_spawn_instruction}}
|
|
41
27
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
are fixed DIRECTLY by dispatching fix sub-agents. Do NOT ask the user for permission to
|
|
45
|
-
fix bugs. The user confirmed the plan — bugs in that plan's execution are implementation
|
|
46
|
-
defects, not design decisions.
|
|
28
|
+
Reducing reviewer count must not reduce checked dimensions; it only combines them into fewer
|
|
29
|
+
passes when the change is low risk.
|
|
47
30
|
|
|
48
|
-
|
|
49
|
-
- The fix requires a DESIGN CHOICE (two equally valid approaches, ambiguous requirement)
|
|
50
|
-
- The fix would change the public API contract beyond what the dev-spec specifies
|
|
51
|
-
- The finding contradicts something the user explicitly confirmed at a stage boundary
|
|
52
|
-
</HARD-GATE>
|
|
31
|
+
## Severity and verdict
|
|
53
32
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- The specific issues with file:line citations
|
|
59
|
-
- The suggested fix direction from the reviewer
|
|
60
|
-
- Relevant RULES sections
|
|
61
|
-
3. Dispatch fix sub-agents (ec-fixer, one per file group) via {{sub_agent_dispatch}}.
|
|
62
|
-
Platform spawn rule: {{platform_spawn_instruction}}
|
|
63
|
-
4. On return: merge results, append `result` records to execution.jsonl.
|
|
64
|
-
5. Re-enter REVIEW (counts toward the fix-loop ceiling of 3).
|
|
33
|
+
- `error`: demonstrably breaks an acceptance criterion, contract, security boundary, or build.
|
|
34
|
+
Blocks transition.
|
|
35
|
+
- `warning`: credible risk. Blocks only when it can affect a confirmed acceptance criterion.
|
|
36
|
+
- `info`: maintainability suggestion or optional improvement. Never blocks the current task.
|
|
65
37
|
|
|
66
|
-
|
|
38
|
+
Verdict:
|
|
67
39
|
|
|
68
|
-
|
|
40
|
+
- `accept`: no blocking finding.
|
|
41
|
+
- `fix`: in-scope implementation defect.
|
|
42
|
+
- `replan`: design/scope/contract is wrong.
|
|
43
|
+
- `blocked`: missing external input or environment.
|
|
69
44
|
|
|
70
|
-
##
|
|
45
|
+
## Fix loop
|
|
71
46
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
1. Merge findings by semantic unit, not by file or reviewer.
|
|
48
|
+
2. Prefer returning the bundle to the original implementation context.
|
|
49
|
+
3. Run targeted checks for the affected unit, then re-review only the affected dimensions.
|
|
50
|
+
4. Expand to full review only if the fix changes scope, public contracts, or shared behavior.
|
|
51
|
+
5. If the same issue class survives two consecutive rounds, stop blind repair and return
|
|
52
|
+
`replan` or `blocked` with evidence.
|
|
77
53
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- R2: compliance — does the code obey RULES?
|
|
54
|
+
In-scope defects are fixed automatically. Ask the user only for a new design choice, changed
|
|
55
|
+
public contract, or contradiction with a confirmed decision.
|
|
81
56
|
|
|
82
|
-
|
|
83
|
-
merges and dedups findings and decides the verdict — sub-agents cannot trigger stage
|
|
84
|
-
transitions.
|
|
57
|
+
## Evidence record
|
|
85
58
|
|
|
86
|
-
|
|
59
|
+
Append one final record per executed dimension for the current implementation fingerprint.
|
|
60
|
+
Fast and Standard normally use `combined`; Strict uses at least two distinct dimension names:
|
|
87
61
|
|
|
88
|
-
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"type": "review",
|
|
65
|
+
"dimension": "correctness-contracts",
|
|
66
|
+
"passed": true,
|
|
67
|
+
"reviewer": "main-or-independent-agent",
|
|
68
|
+
"implementation_fingerprint": "<state-api value>",
|
|
69
|
+
"timestamp": "<ISO-8601>",
|
|
70
|
+
"findings": []
|
|
71
|
+
}
|
|
72
|
+
```
|
|
89
73
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
For `accept` or `replan`, ec-workflow follows the effective confirm mode for the corresponding
|
|
94
|
-
transition. A `fix` round stays inside REVIEW and therefore
|
|
95
|
-
does not create a status transition unless the outcome changes.
|
|
74
|
+
The state API rejects REVIEW -> VERIFICATION when any latest dimension evidence is missing,
|
|
75
|
+
stale, failed, or contains an `error`. Strict also requires at least two passed dimensions. A
|
|
76
|
+
code change after review produces a new fingerprint and invalidates all prior dimensions.
|