easy-coding-harness 0.1.7 → 0.2.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 +110 -0
- package/README.md +10 -65
- package/dist/cli.js +1227 -299
- package/dist/cli.js.map +1 -1
- package/package.json +2 -1
- package/templates/claude/agents/ec-fixer.md +36 -0
- package/templates/codex/agents/ec-fixer.toml +25 -0
- package/templates/common/bundled-skills/ec-init/SKILL.md +174 -0
- package/templates/common/bundled-skills/ec-init/references/memory-migration.md +87 -0
- package/templates/common/bundled-skills/ec-meta/SKILL.md +5 -2
- package/templates/common/bundled-skills/ec-meta/references/customize-local/README.md +2 -1
- package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +14 -11
- package/templates/common/bundled-skills/ec-meta/references/platform-files/README.md +8 -4
- package/templates/common/skills/ec-analysis/SKILL.md +104 -126
- package/templates/common/skills/ec-brainstorming/SKILL.md +1 -1
- package/templates/common/skills/ec-git/SKILL.md +10 -10
- package/templates/common/skills/ec-implementing/SKILL.md +26 -3
- package/templates/common/skills/ec-memory/SKILL.md +56 -19
- package/templates/common/skills/ec-reviewing/SKILL.md +39 -10
- package/templates/common/skills/ec-task-close/SKILL.md +4 -3
- package/templates/common/skills/ec-task-management/SKILL.md +9 -24
- package/templates/common/skills/ec-verification/SKILL.md +22 -11
- package/templates/common/skills/ec-workflow/SKILL.md +51 -21
- package/templates/main-constraint/AGENTS.md.tpl +16 -3
- package/templates/main-constraint/CLAUDE.md.tpl +16 -3
- package/templates/qoder/agents/ec-fixer.md +36 -0
- package/templates/runtime/memory/SHORT_MEMORY_TEMPLATE.md +75 -0
- package/templates/runtime/memory/long/BUSINESS.md +42 -9
- package/templates/runtime/memory/long/MEMORY.md +37 -2
- package/templates/runtime/memory/long/TECHNICAL.md +45 -1
- package/templates/runtime/templates/dev-spec-skeleton.md +80 -0
- package/templates/shared-hooks/easy_coding_state.py +516 -0
- package/templates/shared-hooks/easy_coding_status.py +77 -38
- package/templates/shared-hooks/inject-subagent-context.py +4 -11
- package/templates/shared-hooks/inject-workflow-state.py +5 -14
- package/templates/shared-hooks/session-start.py +90 -16
- package/templates/common/skills/ec-init/SKILL.md +0 -96
|
@@ -3,6 +3,8 @@ name: ec-analysis
|
|
|
3
3
|
description: ANALYSIS-stage skill. Use when ec-workflow enters ANALYSIS. Creates the dev-spec skeleton FIRST (template-first), then fills incrementally — producing the narrative plan, execution plan (execution.jsonl), and test strategy. Ends in WAITING_CONFIRM. Grounds every conclusion in real code, never restates the requirement.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
> **SKELETON FIRST — your first two tool calls MUST be: (1) Read `.easy-coding/templates/dev-spec-skeleton.md`, (2) Write its EXACT content to the task's dev-spec.md. No exceptions. Do not analyze or think before the skeleton file exists on disk.**
|
|
7
|
+
|
|
6
8
|
# ec-analysis — turn a requirement into a confirmable plan
|
|
7
9
|
|
|
8
10
|
ec-workflow dispatches you when a task enters ANALYSIS. You read the codebase, decide *how*
|
|
@@ -12,20 +14,44 @@ Communicate with the user in the user's language.
|
|
|
12
14
|
|
|
13
15
|
## HARD RULES (non-negotiable, violations = failed analysis)
|
|
14
16
|
|
|
15
|
-
1. **Your FIRST tool
|
|
16
|
-
`.easy-coding/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
1. **Your FIRST TWO tool calls** in this skill MUST be:
|
|
18
|
+
- **Call 1 (Read):** Read `.easy-coding/templates/dev-spec-skeleton.md`.
|
|
19
|
+
- **Call 2 (Write):** Write the EXACT content you just read to
|
|
20
|
+
`.easy-coding/tasks/{task-id}/dev-spec.md`. This is a mechanical copy — do not rephrase
|
|
21
|
+
headers, omit sections, rearrange content, or substitute placeholders with your own text.
|
|
22
|
+
The file content must be identical to the template you just read.
|
|
23
|
+
If dev-spec.md does not exist with the correct template after your second tool call,
|
|
24
|
+
you have already failed. Do not read code, think aloud, or analyze before the skeleton
|
|
25
|
+
is on disk.
|
|
20
26
|
2. **All subsequent analysis** fills sections of this file via edits. You do NOT hold analysis
|
|
21
27
|
in your head and dump it at the end — you write each section into the file as you go.
|
|
22
|
-
3. **Your chat output to the user
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
3. **Your chat output to the user IS dev-spec.md, verbatim.** After dev-spec.md is complete,
|
|
29
|
+
use the Read tool to read it back, then output exactly what you read as your reply — this
|
|
30
|
+
is a copy operation, not a re-narration. Do NOT reconstruct it from memory, do NOT
|
|
31
|
+
abbreviate, do NOT invent a different format. No "执行计划" summary tables, no bullet-point
|
|
32
|
+
plans, no freestyle answers. The template IS the format. If your reply does not contain
|
|
33
|
+
every mandatory section header from the template, you have failed.
|
|
27
34
|
4. **Three files must exist** in `.easy-coding/tasks/{task-id}/` when you finish:
|
|
28
35
|
`dev-spec.md`, `execution.jsonl` (plan record), `test-strategy.md`. Missing any one = failed.
|
|
36
|
+
5. **Stay faithful to the user's delivery form (anti-downgrade).** The delivery form —
|
|
37
|
+
change real code vs. produce a document — is set by the user's original request, NOT by
|
|
38
|
+
you. If the user asked to refactor / fix / add a feature (a CODE task), you MUST plan real
|
|
39
|
+
code changes. You may NOT downgrade it to "produce a report / audit / inventory only" or
|
|
40
|
+
"defer all changes to follow-up sub-tasks." A large change surface is NOT a reason to
|
|
41
|
+
downgrade: decompose it into batches/units in 实施拆解, and surface "split into batches? /
|
|
42
|
+
which subset this round?" as an explicit item in 待用户决策 for the user to decide. Never
|
|
43
|
+
make a scope-narrowing decision yourself and present it as settled. Never fabricate a
|
|
44
|
+
premise such as "the user already fixed scope X in INIT" or "auto_mode already selected Y"
|
|
45
|
+
to justify narrowing — `auto_mode` only waives the WAITING_CONFIRM confirmation step and
|
|
46
|
+
carries NO scope or delivery-form decision whatsoever.
|
|
47
|
+
6. **改动范围 lists ONLY real project code.** The 改动范围 table carries only changes to real
|
|
48
|
+
project source/config files. Any harness artifact under `.easy-coding/` (dev-spec.md,
|
|
49
|
+
execution.jsonl, test-strategy.md, memory files, generated reports, etc.) is FORBIDDEN in
|
|
50
|
+
this table — those are process outputs, not "changes." The table MAY be empty, but ONLY
|
|
51
|
+
when the user explicitly asked for a no-code delivery form (e.g. a pure documentation
|
|
52
|
+
request); in that case declare the deliverable in 需求解析 > 输出. If the task type is a
|
|
53
|
+
code task (重构 / Bug 修复 / 新功能 / 性能优化) yet 改动范围 is empty, you have downgraded
|
|
54
|
+
the task — this is a failed analysis.
|
|
29
55
|
|
|
30
56
|
## Inputs to load (in this order)
|
|
31
57
|
|
|
@@ -44,16 +70,19 @@ Communicate with the user in the user's language.
|
|
|
44
70
|
|
|
45
71
|
If the task spans repositories: declare them in the dev-spec (trigger repo + involved repos
|
|
46
72
|
by **name**, never local paths). For each involved repo, read its ABSTRACT to understand the
|
|
47
|
-
interface. Cache any local path the user provides
|
|
48
|
-
|
|
73
|
+
interface. Cache any local path the user provides through the state API only:
|
|
74
|
+
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-repo-path --session-file <P> --repo <repo-name> --path <local-path>`.
|
|
75
|
+
If a repo name cannot be located locally, ask the user for the path before proceeding.
|
|
49
76
|
|
|
50
77
|
## Analysis procedure (mandatory sequence)
|
|
51
78
|
|
|
52
79
|
You MUST execute these steps in exact order. Do not rearrange, skip, or combine steps.
|
|
53
80
|
|
|
54
|
-
1. **Write skeleton** — FIRST tool
|
|
55
|
-
|
|
56
|
-
|
|
81
|
+
1. **Write skeleton** — FIRST TWO tool calls:
|
|
82
|
+
- Read `.easy-coding/templates/dev-spec-skeleton.md` (the template file).
|
|
83
|
+
- Write its exact content to `.easy-coding/tasks/{task-id}/dev-spec.md`.
|
|
84
|
+
This is a copy operation, not a generation task. Every section header and every `{待填写}`
|
|
85
|
+
placeholder in the template must appear in the written file unchanged.
|
|
57
86
|
2. **Fill 项目模式 + 任务类型** — edit dev-spec.md in place.
|
|
58
87
|
3. **Fill 需求解析** — edit dev-spec.md: 目标 / 输入 / 输出 / 边界.
|
|
59
88
|
4. **Read source code, fill 现状** — read the actual files, then edit dev-spec.md with
|
|
@@ -67,113 +96,55 @@ You MUST execute these steps in exact order. Do not rearrange, skip, or combine
|
|
|
67
96
|
10. **Write execution.jsonl** — append the plan record (see section below).
|
|
68
97
|
11. **Write test-strategy.md** — write the testability table (see section below).
|
|
69
98
|
12. **Self-check** — run the gates below. Fix any failure in the files.
|
|
70
|
-
13. **Present to user** —
|
|
71
|
-
Do not summarize, abbreviate, or
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
### 改动范围
|
|
120
|
-
| 改动文件 | 改动类型 | 文件编码 | 改动核心内容 |
|
|
121
|
-
|----------|---------|---------|-------------|
|
|
122
|
-
| `{文件路径}` | 新增 | 项目编码 {X},依据:{xxx} | {核心改动} |
|
|
123
|
-
| `{文件路径}` | 修改 | 保持原编码 {X} | {核心改动} |
|
|
124
|
-
| `{文件路径}` | 删除 | — | {删除原因} |
|
|
125
|
-
|
|
126
|
-
### 修改方案
|
|
127
|
-
- **总体改法**:{待填写 — 一句话说清改哪里、怎么改}
|
|
128
|
-
- **后端改动**:{待填写;不涉及则写"不涉及"}
|
|
129
|
-
- **前端改动**:{待填写;不涉及则写"不涉及"}
|
|
130
|
-
- **兼容处理**:{待填写 — 旧逻辑如何迁移、保留或替换}
|
|
131
|
-
- **风险点**:{待填写 — 最容易出问题的位置}
|
|
132
|
-
|
|
133
|
-
### 实施拆解
|
|
134
|
-
|
|
135
|
-
| 单元 | 说明 | 类型 | 涉及文件 | 依赖 |
|
|
136
|
-
|------|------|------|---------|------|
|
|
137
|
-
| U1 | {title} | {backend/frontend/test/...} | {files} | — |
|
|
138
|
-
| U2 | {title} | {type} | {files} | — |
|
|
139
|
-
| U3 | {title} | {type} | {files} | U1, U2 |
|
|
140
|
-
|
|
141
|
-
**执行策略**:{parallel / sequential / single}
|
|
142
|
-
- 第一批(并行):U1 {title} | U2 {title}
|
|
143
|
-
- 第二批(等待第一批):U3 {title}
|
|
144
|
-
(若 single:单一实施单元,主 agent 直接执行)
|
|
145
|
-
|
|
146
|
-
### 测试策略
|
|
147
|
-
|
|
148
|
-
| 测试点 | 级别 | 归属单元 | 方式 | 验证命令 |
|
|
149
|
-
|--------|------|---------|------|---------|
|
|
150
|
-
| {描述} | 必测 | U1 | 单测 | `npm test -- --filter=xxx` |
|
|
151
|
-
| {描述} | 应测 | U2 | 快照 | `npm test -- --snapshot` |
|
|
152
|
-
|
|
153
|
-
- **人工验收**:{待填写 — 用户需要检查的关键行为}
|
|
154
|
-
- **无法验证项**:{待填写 — 无 / 说明缺失环境、数据或权限}
|
|
155
|
-
|
|
156
|
-
### 风险与注意事项
|
|
157
|
-
- {风险 1}
|
|
158
|
-
- {风险 2}
|
|
159
|
-
````
|
|
160
|
-
|
|
161
|
-
> **编码规则**:修改已有文件必须保持原始编码;新文件声明项目编码并附证据;证据冲突或
|
|
162
|
-
> 未知时标记"需用户确认"。用户可在确认前覆盖任何编码单元格。
|
|
163
|
-
|
|
164
|
-
**条件展开章节**(仅在满足条件时添加,否则完全不出现):
|
|
165
|
-
|
|
166
|
-
- `### 背景数据应用` — 命中项目知识资产(ABSTRACT.md、BUSINESS.md、TECHNICAL.md、RULES.md)
|
|
167
|
-
且其内容影响本次方案时展开。含架构参考、业务记忆、技术记忆、记忆冲突、规范约束。
|
|
168
|
-
- `### 核心改动明细` — 多模块且改动范围表不足以表达当前逻辑和目标逻辑时展开。
|
|
169
|
-
逐文件列出"当前逻辑 → 准备怎么改"。
|
|
170
|
-
- `### 前端实现映射` — 涉及前端页面、组件、交互时展开。含页面/模块映射、组件映射、
|
|
171
|
-
数据来源、Mock 使用计划。
|
|
172
|
-
|
|
173
|
-
**禁止输出**:
|
|
174
|
-
- 仅复述需求、几乎不引用代码现状的空泛方案。
|
|
175
|
-
- 只列"已加载哪些信息"但不给出具体可实施改法。
|
|
176
|
-
- 为了凑格式输出与本次任务无关的条件章节。
|
|
99
|
+
13. **Present to user** — Read dev-spec.md back from disk and output exactly what you read as
|
|
100
|
+
your reply. Do not summarize, abbreviate, reformat, or reconstruct from memory. The
|
|
101
|
+
dev-spec.md content on disk IS your reply.
|
|
102
|
+
|
|
103
|
+
## Required output: dev-spec.md structure
|
|
104
|
+
|
|
105
|
+
The template lives at `.easy-coding/templates/dev-spec-skeleton.md`. You MUST read it with
|
|
106
|
+
the Read tool and write its exact content to the task's dev-spec.md as step 1. Do NOT generate
|
|
107
|
+
the skeleton from memory or from this instruction — READ the file and WRITE what you read.
|
|
108
|
+
|
|
109
|
+
If `.easy-coding/templates/dev-spec-skeleton.md` does not exist, tell the user to run
|
|
110
|
+
`easy-coding upgrade` in the terminal to restore it. Do not generate the skeleton from memory.
|
|
111
|
+
|
|
112
|
+
If the hook injects `[easy-coding:analysis-template-drift:missing:...]`, you have deviated
|
|
113
|
+
from the template. Re-read the template file, compare it against your dev-spec.md, and fix
|
|
114
|
+
any missing or renamed section headers immediately.
|
|
115
|
+
|
|
116
|
+
**Mandatory section headers** (all 13 must be present in the skeleton — the hook validates these):
|
|
117
|
+
|
|
118
|
+
1. `## 技术方案`
|
|
119
|
+
2. `### 项目模式`
|
|
120
|
+
3. `### 任务类型`
|
|
121
|
+
4. `### 需求解析`
|
|
122
|
+
5. `### 现状`
|
|
123
|
+
6. `### 冲突摘要`
|
|
124
|
+
7. `### 待用户决策`
|
|
125
|
+
8. `### 影响面分析`
|
|
126
|
+
9. `### 改动范围`
|
|
127
|
+
10. `### 修改方案`
|
|
128
|
+
11. `### 实施拆解`
|
|
129
|
+
12. `### 测试策略`
|
|
130
|
+
13. `### 风险与注意事项`
|
|
131
|
+
|
|
132
|
+
> **Encoding rule**: modified files keep their original encoding; new files declare the
|
|
133
|
+
> project encoding with evidence; conflicting or unknown encoding → mark "需用户确认".
|
|
134
|
+
> Users can override any encoding cell at confirmation.
|
|
135
|
+
|
|
136
|
+
**Conditional sections** (add only when applicable, otherwise omit entirely):
|
|
137
|
+
|
|
138
|
+
- `### 背景数据应用` — project knowledge assets (ABSTRACT.md, BUSINESS.md, TECHNICAL.md,
|
|
139
|
+
RULES.md) are relevant and influence the plan.
|
|
140
|
+
- `### 核心改动明细` — multi-module change where the scope table is insufficient to express
|
|
141
|
+
current logic and target logic.
|
|
142
|
+
- `### 前端实现映射` — frontend pages, components, or interactions are involved.
|
|
143
|
+
|
|
144
|
+
**Forbidden output:**
|
|
145
|
+
- Restating requirements without citing code evidence.
|
|
146
|
+
- Listing "loaded information" without a concrete implementation approach.
|
|
147
|
+
- Including conditional sections that are irrelevant to the current task.
|
|
177
148
|
|
|
178
149
|
## Implementation units → execution.jsonl
|
|
179
150
|
|
|
@@ -226,7 +197,7 @@ VERIFICATION baseline).
|
|
|
226
197
|
- [ ] `dev-spec.md` 文件是否已写入 `.easy-coding/tasks/{task-id}/`?
|
|
227
198
|
- [ ] `execution.jsonl` 文件是否已写入?
|
|
228
199
|
- [ ] `test-strategy.md` 文件是否已写入?
|
|
229
|
-
- [ ] dev-spec.md 是否包含全部
|
|
200
|
+
- [ ] dev-spec.md 是否包含全部 13 个必填章节标题(参见上方清单)?
|
|
230
201
|
- [ ] 每个"现状"断言是否引用了真实文件/类/行号?
|
|
231
202
|
- [ ] 是否有具体的修改方案,而非仅罗列"已加载的文件"?
|
|
232
203
|
- [ ] 不适用的条件章节是否已完全省略(而非留空)?
|
|
@@ -234,9 +205,15 @@ VERIFICATION baseline).
|
|
|
234
205
|
- [ ] 改动范围表中每行是否填写了文件编码及证据?
|
|
235
206
|
- [ ] 所有 `{待填写}` 占位符是否已替换为实际内容?
|
|
236
207
|
- [ ] 回复给用户的内容是否是 dev-spec.md 的完整内容(而非自创的缩略格式)?
|
|
208
|
+
- [ ] 交付形态是否忠于用户原始需求?代码类任务(重构/修复/功能)是否规划了真实代码改动,而非降级为"仅出报告/分析清单/留作后续子任务"?
|
|
209
|
+
- [ ] 「改动范围」是否只含真实项目源码/配置,且不含任何 `.easy-coding/` 下的 harness 产物(dev-spec/execution/test-strategy/记忆/报告)?
|
|
210
|
+
- [ ] 若「改动范围」为空,是否确为用户明确要求的无代码交付形态,而非 AI 自行降级的结果?
|
|
211
|
+
- [ ] 任何"本次不做全部 / 分批落地 / 范围收窄"的决定,是否已列入「待用户决策」交由用户拍板,而非自行拍板并假托既定?
|
|
237
212
|
|
|
238
213
|
## Revision handling
|
|
239
214
|
|
|
215
|
+
> 修订同样受 HARD RULE 5/6 约束:用户的修订诉求若是扩大或细化代码改动,不得借机把任务降级为"出报告";范围收窄仍须作为 待用户决策 项由用户确认。
|
|
216
|
+
|
|
240
217
|
On user revision request at WAITING_CONFIRM, do NOT reply with only a change summary.
|
|
241
218
|
Re-output the COMPLETE revised dev-spec.md:
|
|
242
219
|
|
|
@@ -250,6 +227,7 @@ Re-output the COMPLETE revised dev-spec.md:
|
|
|
250
227
|
|
|
251
228
|
## End state
|
|
252
229
|
|
|
253
|
-
|
|
254
|
-
different format, not a table you invented. Then set stage to
|
|
255
|
-
control back to ec-workflow. Never start implementing from this
|
|
230
|
+
Read dev-spec.md back from disk and output the COMPLETE content as your reply to the user —
|
|
231
|
+
not a summary, not a different format, not a table you invented. Then set stage to
|
|
232
|
+
WAITING_CONFIRM and hand control back to ec-workflow. Never start implementing from this
|
|
233
|
+
skill.
|
|
@@ -78,5 +78,5 @@ be suspended (ec-workflow's intent routing handles the rest).
|
|
|
78
78
|
|
|
79
79
|
- Write no implementation code, scaffold nothing, take no implementation action.
|
|
80
80
|
- The only ec-* skill you may invoke is `ec-workflow` (on user confirmation after approval).
|
|
81
|
-
Do not touch
|
|
81
|
+
Do not touch session files, task status fields, or the state machine directly.
|
|
82
82
|
- One question per message — never overwhelm.
|
|
@@ -6,8 +6,8 @@ description: Git discipline skill for Easy Coding projects. Use when the task in
|
|
|
6
6
|
# ec-git — git discipline
|
|
7
7
|
|
|
8
8
|
Activate for any git operation inside an Easy Coding project: pull, merge, rebase, commit,
|
|
9
|
-
push, PR. You manage git hygiene only — you never change
|
|
10
|
-
stage transitions.
|
|
9
|
+
push, PR. You manage git hygiene only — you never change session files, task status fields,
|
|
10
|
+
or trigger stage transitions.
|
|
11
11
|
|
|
12
12
|
Communicate with the user in the user's language.
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ Communicate with the user in the user's language.
|
|
|
15
15
|
|
|
16
16
|
| Path | In commit set? | Why |
|
|
17
17
|
|---|---|---|
|
|
18
|
-
| `
|
|
18
|
+
| `sessions/` | **never** | personal runtime state, differs per developer |
|
|
19
19
|
| `config.yaml` | yes | shared team config |
|
|
20
20
|
| `tasks/*/task.json` `dev-spec.md` `execution.jsonl` `test-strategy.md` | yes | per-task folders, no merge conflicts; team-readable decision record |
|
|
21
21
|
| `SOUL.md` `RULES.md` `ABSTRACT.md` `TEST_STRATEGY.md` `CHANGELOG.md` | yes | shared project knowledge |
|
|
@@ -24,7 +24,7 @@ Communicate with the user in the user's language.
|
|
|
24
24
|
| `spec/dev/` | only if user explicitly asks | dev-spec candidates for the *current* requirement, default out of commit |
|
|
25
25
|
|
|
26
26
|
`.easy-coding/` changes are part of the commit set by default (treated like code changes),
|
|
27
|
-
with
|
|
27
|
+
with `.easy-coding/sessions/` always excluded. The CLI already added it to `.gitignore`.
|
|
28
28
|
|
|
29
29
|
## Rules
|
|
30
30
|
|
|
@@ -33,15 +33,15 @@ with `state.json` always excluded. The CLI already added `state.json` to `.gitig
|
|
|
33
33
|
2. **Conflict handling for `.easy-coding/`** (mostly `memory/`): first explain the conflict
|
|
34
34
|
details to the user, get confirmation, then do an inductive semantic merge — never blindly
|
|
35
35
|
pick ours/theirs. This requirement applies only to conflicts inside `.easy-coding/`.
|
|
36
|
-
3. **Cross-repo commit sets.** When a task spans repos (per the dev-spec /
|
|
37
|
-
`repo_paths`), the commit/push covers every involved repo. Read `repo_paths`
|
|
38
|
-
each
|
|
39
|
-
sub-repo behind.
|
|
36
|
+
3. **Cross-repo commit sets.** When a task spans repos (per the dev-spec / current task
|
|
37
|
+
`repo_paths`), the commit/push covers every involved repo. Read `repo_paths` from the
|
|
38
|
+
current task state to locate each checkout, check changes, and commit/push them as one
|
|
39
|
+
coherent change set — do not leave a sub-repo behind.
|
|
40
40
|
4. **No false success.** Never claim a commit or push succeeded without reading the command
|
|
41
41
|
output. A failed push reported as success is a serious error.
|
|
42
42
|
|
|
43
43
|
## Boundaries
|
|
44
44
|
|
|
45
|
-
- Do not touch
|
|
46
|
-
- Do not commit
|
|
45
|
+
- Do not touch session files, task status fields, or run stage transitions — git only.
|
|
46
|
+
- Do not commit `.easy-coding/sessions/`.
|
|
47
47
|
- Do not commit `spec/dev/` unless the user explicitly asks.
|
|
@@ -31,13 +31,28 @@ Communicate with the user in the user's language.
|
|
|
31
31
|
7. **Tests (soft rule).** Write tests for [must-test]/[should-test] items per
|
|
32
32
|
test-strategy.md. Soft means: no project test infra → not forced; infra exists → required.
|
|
33
33
|
|
|
34
|
-
## Sub-agent dispatch
|
|
34
|
+
## Sub-agent dispatch
|
|
35
35
|
|
|
36
|
-
Read the `plan` record. Then:
|
|
36
|
+
Read the `plan` record's `strategy` field. Then:
|
|
37
37
|
|
|
38
38
|
- `single` → main agent implements directly, no sub-agents.
|
|
39
39
|
- `sequential` → main agent implements units one by one in dependency order.
|
|
40
|
-
- `parallel` →
|
|
40
|
+
- `parallel` → sub-agents are MANDATORY (see gate below).
|
|
41
|
+
|
|
42
|
+
<HARD-GATE>
|
|
43
|
+
PARALLEL STRATEGY = MANDATORY SUB-AGENT DISPATCH. NO EXCEPTIONS.
|
|
44
|
+
|
|
45
|
+
If the plan record says `"strategy":"parallel"`, you MUST dispatch sub-agents using
|
|
46
|
+
{{sub_agent_dispatch}}. You are FORBIDDEN from implementing parallel units yourself.
|
|
47
|
+
Doing the work inline instead of dispatching is a protocol violation equivalent to
|
|
48
|
+
skipping WAITING_CONFIRM.
|
|
49
|
+
|
|
50
|
+
Self-check before writing ANY implementation code:
|
|
51
|
+
- Is strategy "parallel"? → Did I dispatch via {{sub_agent_dispatch}}? If no → STOP.
|
|
52
|
+
- Am I working on a unit in a parallel level without dispatching? → STOP.
|
|
53
|
+
|
|
54
|
+
The ONLY case where you implement code directly is strategy "single" or "sequential".
|
|
55
|
+
</HARD-GATE>
|
|
41
56
|
|
|
42
57
|
Parallel dispatch loop:
|
|
43
58
|
1. Sort `parallel_groups` by level.
|
|
@@ -87,3 +102,11 @@ let sub-agents re-dispatch each other.
|
|
|
87
102
|
|
|
88
103
|
All units done and self-audited → hand back to ec-workflow to advance to REVIEW. If you
|
|
89
104
|
hit something that invalidates the plan, return to ANALYSIS instead of improvising.
|
|
105
|
+
|
|
106
|
+
## Self-check gates (before handing back)
|
|
107
|
+
|
|
108
|
+
- [ ] Strategy was "parallel" → ALL units dispatched via sub-agents? (VIOLATION if no)
|
|
109
|
+
- [ ] Strategy was "sequential" → units implemented in dependency order?
|
|
110
|
+
- [ ] Each dispatched unit has a `dispatch` record in execution.jsonl?
|
|
111
|
+
- [ ] Each returned unit has a `result` record?
|
|
112
|
+
- [ ] No files modified outside the change-scope table?
|
|
@@ -14,45 +14,82 @@ recorded comment/doc language.
|
|
|
14
14
|
|
|
15
15
|
## MEMORY_SHORT — write one short memory entry
|
|
16
16
|
|
|
17
|
-
Create one file under `.easy-coding/memory/short/`
|
|
17
|
+
Create one file under `.easy-coding/memory/short/` following the format in
|
|
18
|
+
`.easy-coding/memory/SHORT_MEMORY_TEMPLATE.md`. File naming convention:
|
|
19
|
+
`{NNN}_{YYYYMMDD}_{smart_name}.md`. The entry is immutable after creation.
|
|
20
|
+
Frontmatter (all fields required):
|
|
18
21
|
|
|
19
22
|
```yaml
|
|
20
23
|
---
|
|
24
|
+
memory_schema: 2
|
|
21
25
|
id: SM-{YYYYMMDD}-{NN}
|
|
22
26
|
date: {YYYY-MM-DD}
|
|
23
|
-
task_type: {feature | bugfix | refactor | perf}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
task_type: {feature | bugfix | refactor | perf | doc | workflow}
|
|
28
|
+
project_mode: {startup | iteration}
|
|
29
|
+
domain:
|
|
30
|
+
- {business domain or module}
|
|
31
|
+
tags:
|
|
32
|
+
- {keyword}
|
|
33
|
+
related_files:
|
|
34
|
+
- {key file or module}
|
|
35
|
+
commit: {hash | none}
|
|
36
|
+
verification: {passed | partial | not_run}
|
|
37
|
+
memory_value: {business | technical | both | none}
|
|
38
|
+
target_long: {BUSINESS | TECHNICAL | BOTH | NONE}
|
|
28
39
|
---
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
The body follows the template structure: Task Summary, Execution Evidence, Business Memory
|
|
41
|
+
Candidates, Technical Memory Candidates, Non-Distillation Content, and Related Memories.
|
|
42
|
+
Pull facts from execution.jsonl result/verify records, not from a fuzzy memory of the
|
|
43
|
+
conversation. Refer to SHORT_MEMORY_TEMPLATE.md for the complete section format.
|
|
31
44
|
```
|
|
32
45
|
|
|
33
46
|
If the task was cross-repo, record the repo names involved and the collaboration reason.
|
|
34
47
|
|
|
35
|
-
**
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
**Immutability:** Short memories are write-once. Never edit an existing short memory file —
|
|
49
|
+
create a new one instead. Short memories serve as both a recent-detail sliding window and a
|
|
50
|
+
distillation buffer for long-term memory.
|
|
38
51
|
|
|
39
|
-
|
|
52
|
+
**Sliding window (informational):** The short memory directory has a soft cap defined by
|
|
53
|
+
`memory.short_term_max` (default 10). MEMORY_SHORT only WRITES one entry per completed task
|
|
54
|
+
— it never counts, trims, or triggers distillation. Trimming is exclusively MEMORY_LONG's
|
|
55
|
+
responsibility and only runs when the threshold is exceeded.
|
|
56
|
+
|
|
57
|
+
## MEMORY_LONG — distill durable knowledge (CONDITIONAL)
|
|
58
|
+
|
|
59
|
+
<HARD-GATE>
|
|
60
|
+
MEMORY_LONG IS A NO-OP WHEN SHORT MEMORY COUNT <= threshold.
|
|
61
|
+
|
|
62
|
+
Before performing ANY distillation work:
|
|
63
|
+
1. Count `.md` files in `.easy-coding/memory/short/` (only files with schema-v2 frontmatter).
|
|
64
|
+
2. Read `memory.short_term_max` from `.easy-coding/config.yaml` (default: 10).
|
|
65
|
+
3. If count <= short_term_max: output "MEMORY_LONG: no-op (short memory count = {N},
|
|
66
|
+
threshold = {short_term_max})" and immediately hand back to ec-workflow to advance to
|
|
67
|
+
COMPLETE. Do NOT read long memory files, do NOT attempt distillation, do NOT modify any file.
|
|
68
|
+
4. If count > short_term_max: proceed with distillation below.
|
|
69
|
+
|
|
70
|
+
This gate is absolute. Even a single short memory entry below threshold does NOT trigger
|
|
71
|
+
long-term compression regardless of any other signal.
|
|
72
|
+
</HARD-GATE>
|
|
73
|
+
|
|
74
|
+
### When count > threshold: distillation flow
|
|
40
75
|
|
|
41
76
|
Three-file long memory:
|
|
42
77
|
- `MEMORY.md` — index of all entries with status (active | deprecated | superseded | deleted).
|
|
43
78
|
- `BUSINESS.md` — business rules, domain knowledge, product decisions.
|
|
44
79
|
- `TECHNICAL.md` — architecture decisions, implementation patterns, gotchas.
|
|
45
80
|
|
|
46
|
-
Distillation
|
|
47
|
-
1. Read
|
|
48
|
-
|
|
81
|
+
Distillation steps:
|
|
82
|
+
1. Read `memory.short_term_keep` from config (default: 5). Keep the latest N entries;
|
|
83
|
+
the older entries become distillation candidates.
|
|
84
|
+
2. Read the `target_long` of candidate short memories; route to business/technical.
|
|
85
|
+
3. **Progressive loading** — read only the existing long entries matching this round's
|
|
49
86
|
domain/tags/related_files. No unbounded whole-repo memory scan.
|
|
50
|
-
|
|
87
|
+
4. **Conflict resolution** by priority: current code > latest user confirmation > this
|
|
51
88
|
round's candidate > older long memory. On conflict, explain it before consolidating —
|
|
52
89
|
never silently pick a side.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
90
|
+
5. **Retirement check**: for older entries decide delete (no value) / merge (semantic
|
|
91
|
+
duplicate) / deprecate (was valid, now superseded).
|
|
92
|
+
6. Update the `MEMORY.md` index to reflect every change.
|
|
56
93
|
|
|
57
94
|
## ABSTRACT backfill / update
|
|
58
95
|
|
|
@@ -31,28 +31,57 @@ result. No finding without a location.
|
|
|
31
31
|
## Verdict (exactly one)
|
|
32
32
|
|
|
33
33
|
- `accept` — all dimensions pass. Advance to VERIFICATION.
|
|
34
|
-
- `fix` — problems found, fixable within the current plan.
|
|
35
|
-
to IMPLEMENT against that list.
|
|
34
|
+
- `fix` — problems found, fixable within the current plan. Auto-fix via sub-agents (see below).
|
|
36
35
|
- `replan` — the plan itself is flawed (wrong approach, missing design). Return to ANALYSIS.
|
|
37
36
|
- `blocked` — external blocker (missing dependency, environment). Pause and report.
|
|
38
37
|
|
|
38
|
+
## Auto-fix flow (on `fix` verdict)
|
|
39
|
+
|
|
40
|
+
<HARD-GATE>
|
|
41
|
+
Bug-level issues (correctness errors, compliance violations, missing edge-case handling)
|
|
42
|
+
are fixed DIRECTLY by dispatching fix sub-agents. Do NOT ask the user for permission to
|
|
43
|
+
fix bugs. The user confirmed the plan — bugs in that plan's execution are implementation
|
|
44
|
+
defects, not design decisions.
|
|
45
|
+
|
|
46
|
+
ONLY escalate to the user when:
|
|
47
|
+
- The fix requires a DESIGN CHOICE (two equally valid approaches, ambiguous requirement)
|
|
48
|
+
- The fix would change the public API contract beyond what the dev-spec specifies
|
|
49
|
+
- The finding contradicts something the user explicitly stated during WAITING_CONFIRM
|
|
50
|
+
</HARD-GATE>
|
|
51
|
+
|
|
52
|
+
Fix dispatch flow:
|
|
53
|
+
1. Collect all `fix`-worthy findings from review sub-agents.
|
|
54
|
+
2. Group findings by file. For each group, build a fix task card:
|
|
55
|
+
- Files to fix (from the findings)
|
|
56
|
+
- The specific issues with file:line citations
|
|
57
|
+
- The suggested fix direction from the reviewer
|
|
58
|
+
- Relevant RULES sections
|
|
59
|
+
3. Dispatch fix sub-agents (ec-fixer, one per file group) via {{sub_agent_dispatch}}.
|
|
60
|
+
Platform spawn rule: {{platform_spawn_instruction}}
|
|
61
|
+
4. On return: merge results, append `result` records to execution.jsonl.
|
|
62
|
+
5. Re-enter REVIEW (counts toward the fix-loop ceiling of 3).
|
|
63
|
+
|
|
39
64
|
## Fix-loop ceiling
|
|
40
65
|
|
|
41
|
-
A `fix` verdict carries a concrete checklist; IMPLEMENT addresses it and re-enters REVIEW.
|
|
42
66
|
Maximum 3 fix rounds. A 4th would mean the approach is wrong → auto-escalate to `replan`.
|
|
43
67
|
|
|
44
|
-
## Sub-agent dispatch (
|
|
68
|
+
## Sub-agent dispatch (ALWAYS)
|
|
69
|
+
|
|
70
|
+
<HARD-GATE>
|
|
71
|
+
REVIEW ALWAYS USES SUB-AGENTS regardless of the number of changed files. This prevents
|
|
72
|
+
context pollution in the main agent's window. You MUST NOT review code inline — dispatch
|
|
73
|
+
sub-agents for every review.
|
|
74
|
+
</HARD-GATE>
|
|
45
75
|
|
|
46
|
-
|
|
47
|
-
review in parallel sub-agents:
|
|
76
|
+
Dispatch two parallel review sub-agents:
|
|
48
77
|
- R1: correctness — does the implementation match the dev-spec requirement?
|
|
49
78
|
- R2: compliance — does the code obey RULES?
|
|
50
79
|
|
|
51
|
-
Each sub-agent returns `{dimension, findings[], severity, suggestion}`. The MAIN agent
|
|
52
|
-
and dedups findings and decides the verdict — sub-agents cannot trigger stage
|
|
53
|
-
|
|
80
|
+
Each sub-agent returns `{dimension, findings[], severity, suggestion}`. The MAIN agent
|
|
81
|
+
merges and dedups findings and decides the verdict — sub-agents cannot trigger stage
|
|
82
|
+
transitions.
|
|
54
83
|
|
|
55
|
-
|
|
84
|
+
Platform spawn rule: {{platform_spawn_instruction}}
|
|
56
85
|
|
|
57
86
|
## Output
|
|
58
87
|
|
|
@@ -18,9 +18,10 @@ when you recognize abandonment intent in the user's message.
|
|
|
18
18
|
Require an explicit yes. (Skip the confirm only if the task is already COMPLETE and the
|
|
19
19
|
user just wants it tidied.)
|
|
20
20
|
2. **Record the reason.** Capture the user's reason in one line.
|
|
21
|
-
3. **
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
3. **Close through the state API:** run
|
|
22
|
+
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py close-current --session-file <P> --reason "<reason>" --agent <agent-id>`.
|
|
23
|
+
This sets `task.json.status` to `CLOSED`, records `closed_reason`, updates history, and
|
|
24
|
+
clears session `current_task` so the next hook injection returns to Ready.
|
|
24
25
|
4. **No memory flow.** Do not run MEMORY_SHORT/LONG. An incomplete task's memory is dirty data.
|
|
25
26
|
5. **Linked tasks.** If the task has `spawned_from` or `spawned_tasks`, note the closure fact
|
|
26
27
|
on the relation so a future agent understands the chain.
|
|
@@ -13,32 +13,17 @@ Communicate with the user in the user's language.
|
|
|
13
13
|
## Capabilities
|
|
14
14
|
|
|
15
15
|
### List tasks
|
|
16
|
-
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
nothing.
|
|
16
|
+
Call the state API:
|
|
17
|
+
`{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py list-tasks`.
|
|
18
|
+
Show each task's id, title, status, created_at, and whether it is active. This is read-only.
|
|
20
19
|
|
|
21
20
|
### Create a task
|
|
22
|
-
Create
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"status": "INIT",
|
|
29
|
-
"created_at": "<ISO 8601>",
|
|
30
|
-
"created_by": "<agent id>",
|
|
31
|
-
"context": {},
|
|
32
|
-
"spawned_from": null,
|
|
33
|
-
"spawned_tasks": [],
|
|
34
|
-
"closed_reason": null,
|
|
35
|
-
"repos": []
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Only set `current_task`/`current_stage` in state.json if the user explicitly wants to start
|
|
40
|
-
the task now — otherwise leave the workflow state untouched and tell them to run
|
|
41
|
-
`{{skill_trigger}}ec-workflow` when ready.
|
|
21
|
+
Create through the state API, never by hand-editing `task.json` or session files:
|
|
22
|
+
`{{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`.
|
|
23
|
+
|
|
24
|
+
If the user explicitly wants to start the task now, omit `--no-set-current`; otherwise leave
|
|
25
|
+
the current workflow pointer untouched and tell them to run `{{skill_trigger}}ec-workflow`
|
|
26
|
+
when ready.
|
|
42
27
|
|
|
43
28
|
## Boundaries
|
|
44
29
|
|