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.
Files changed (37) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +10 -65
  3. package/dist/cli.js +1227 -299
  4. package/dist/cli.js.map +1 -1
  5. package/package.json +2 -1
  6. package/templates/claude/agents/ec-fixer.md +36 -0
  7. package/templates/codex/agents/ec-fixer.toml +25 -0
  8. package/templates/common/bundled-skills/ec-init/SKILL.md +174 -0
  9. package/templates/common/bundled-skills/ec-init/references/memory-migration.md +87 -0
  10. package/templates/common/bundled-skills/ec-meta/SKILL.md +5 -2
  11. package/templates/common/bundled-skills/ec-meta/references/customize-local/README.md +2 -1
  12. package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +14 -11
  13. package/templates/common/bundled-skills/ec-meta/references/platform-files/README.md +8 -4
  14. package/templates/common/skills/ec-analysis/SKILL.md +104 -126
  15. package/templates/common/skills/ec-brainstorming/SKILL.md +1 -1
  16. package/templates/common/skills/ec-git/SKILL.md +10 -10
  17. package/templates/common/skills/ec-implementing/SKILL.md +26 -3
  18. package/templates/common/skills/ec-memory/SKILL.md +56 -19
  19. package/templates/common/skills/ec-reviewing/SKILL.md +39 -10
  20. package/templates/common/skills/ec-task-close/SKILL.md +4 -3
  21. package/templates/common/skills/ec-task-management/SKILL.md +9 -24
  22. package/templates/common/skills/ec-verification/SKILL.md +22 -11
  23. package/templates/common/skills/ec-workflow/SKILL.md +51 -21
  24. package/templates/main-constraint/AGENTS.md.tpl +16 -3
  25. package/templates/main-constraint/CLAUDE.md.tpl +16 -3
  26. package/templates/qoder/agents/ec-fixer.md +36 -0
  27. package/templates/runtime/memory/SHORT_MEMORY_TEMPLATE.md +75 -0
  28. package/templates/runtime/memory/long/BUSINESS.md +42 -9
  29. package/templates/runtime/memory/long/MEMORY.md +37 -2
  30. package/templates/runtime/memory/long/TECHNICAL.md +45 -1
  31. package/templates/runtime/templates/dev-spec-skeleton.md +80 -0
  32. package/templates/shared-hooks/easy_coding_state.py +516 -0
  33. package/templates/shared-hooks/easy_coding_status.py +77 -38
  34. package/templates/shared-hooks/inject-subagent-context.py +4 -11
  35. package/templates/shared-hooks/inject-workflow-state.py +5 -14
  36. package/templates/shared-hooks/session-start.py +90 -16
  37. package/templates/common/skills/ec-init/SKILL.md +0 -96
@@ -24,15 +24,20 @@ NO AUTO-ARCHIVE WITHOUT USER ACCEPTANCE
24
24
  - An unaccepted task's memory is dirty data.
25
25
  ```
26
26
 
27
- ## 1. Run the gate (parallel)
27
+ ## 1. Run the gate (parallel, always sub-agents)
28
28
 
29
- Start these three concurrently — do not serialize:
30
- 1. lint (eslint/biome/project linter)
31
- 2. typecheck (`tsc --noEmit` or equivalent)
32
- 3. test (project test command)
29
+ <HARD-GATE>
30
+ VERIFICATION ALWAYS USES SUB-AGENTS for each check. This prevents context pollution and
31
+ ensures true parallelism. You MUST NOT run lint/typecheck/test inline in the main agent.
32
+ </HARD-GATE>
33
33
 
34
- Use sub-agents or background commands; a verification sub-agent just runs a command and
35
- reports. Platform spawn rule: {{platform_spawn_instruction}}
34
+ Dispatch three sub-agents concurrently (one per check):
35
+ 1. V1: lint (eslint/biome/project linter)
36
+ 2. V2: typecheck (`tsc --noEmit` or equivalent)
37
+ 3. V3: test (project test command)
38
+
39
+ Each sub-agent runs its command and returns `{check, passed, failures[]}`.
40
+ Platform spawn rule: {{platform_spawn_instruction}}
36
41
 
37
42
  Append one `verify` record per check:
38
43
  `{"type":"verify","check":"test","passed":true}` (add `"failures":[...]` on failure).
@@ -70,9 +75,15 @@ change formally returns to IMPLEMENT and re-walks REVIEW → VERIFICATION.
70
75
  ## 5. Archive flow (only after acceptance)
71
76
 
72
77
  Runs automatically once the user accepts:
73
- 1. MEMORY_SHORT — ec-memory writes the short memory entry.
74
- 2. MEMORY_LONG — ec-memory distills long memory.
75
- 3. COMPLETE clear `current_task` in state.json, set task.json `status:"COMPLETE"`, output
76
- the task summary (what was done, files changed, key decisions).
78
+ 1. MEMORY_SHORT — call
79
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py transition --session-file <P> --stage MEMORY_SHORT --agent <agent-id>`,
80
+ then hand control to ec-memory to write the short memory entry.
81
+ 2. MEMORY_LONG after MEMORY_SHORT returns, call
82
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py transition --session-file <P> --stage MEMORY_LONG --agent <agent-id>`,
83
+ then hand control to ec-memory to distill long memory or perform its no-op gate.
84
+ 3. COMPLETE — after MEMORY_LONG returns, call
85
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py transition --session-file <P> --stage COMPLETE --agent <agent-id>`,
86
+ which clears session `current_task` for the completed task. Then output the task summary
87
+ (what was done, files changed, key decisions).
77
88
 
78
89
  Hand control back to ec-workflow at each transition; ec-workflow owns the stage writes.
@@ -18,13 +18,19 @@ replies are English.
18
18
  - Missing → tell the user to run the `easy-coding init` CLI first. Stop.
19
19
  - `status != "COMPLETE"` → tell the user to run `{{skill_trigger}}ec-init` first. Stop.
20
20
  Do not perform project initialization yourself; that is ec-init's job.
21
+ - `[easy-coding:upgrade-init-pending:X]` in breadcrumbs → tell the user: "Harness upgraded
22
+ to vX. Running `{{skill_trigger}}ec-init` is recommended to adapt project knowledge and
23
+ complete migration. You can skip and start working — the reminder will persist until
24
+ ec-init runs." Do NOT stop. Proceed with normal startup.
21
25
  2. **Required reading** (cheap, always):
22
26
  - `.easy-coding/SOUL.md` — project identity and dialogue standards; obey for the session.
23
27
  - `.easy-coding/RULES.md` — coding rules; re-checked before every write.
24
28
  - Latest 5 entries in `.easy-coding/memory/short/` — recent task context.
25
29
  Do NOT bulk-read ABSTRACT.md or long memory here; ec-analysis loads them on demand.
26
- 3. **State check + Intent routing.** Read `{{workflow_state_path}}`, then decide based on
27
- whether the user's message carries a task-related prompt beyond the bare skill trigger.
30
+ 3. **State check + Intent routing.** Read the hook-injected breadcrumbs (`[current-task:X]`,
31
+ `[workflow-state:Y]`, `[easy-coding:session-file:P]`) to determine the active task,
32
+ stage, and session file, then decide based on whether the user's message carries a
33
+ task-related prompt beyond the bare skill trigger.
28
34
 
29
35
  **No prompt (bare trigger):**
30
36
  - `current_task` set with an active stage → resume that stage (see Resume and handoff).
@@ -52,9 +58,10 @@ replies are English.
52
58
  directly (step 4).
53
59
 
54
60
  4. **New task.** When creating a task (from step 3), create
55
- `.easy-coding/tasks/{MM-DD-task-slug}/task.json` with `type`, `title` (one-line summary
56
- of the user's prompt), `status:"INIT"`, `created_at`, `created_by` (current agent id),
57
- set `current_task` in state.json, and enter INIT.
61
+ the task through the state API, which creates `task.json`, sets `status:"INIT"`, writes
62
+ `stage_history`, and sets the session `current_task`:
63
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task --session-file <P> --task-id <MM-DD-task-slug> --type <type> --title "<one-line summary>" --agent <agent-id>`.
64
+ Then enter INIT.
58
65
 
59
66
  ## State machine
60
67
 
@@ -71,7 +78,7 @@ any stage --[user abort via ec-task-close]--> CLOSED
71
78
 
72
79
  | Stage | Owner skill | What happens | Exit condition |
73
80
  |---|---|---|---|
74
- | INIT | ec-workflow | collect context, settle task scope wording | task understood |
81
+ | INIT | ec-workflow | collect context, settle scope AND delivery form (change code vs. produce a document) | task understood |
75
82
  | ANALYSIS | ec-analysis | dev-spec + execution plan + test strategy | analysis presented |
76
83
  | WAITING_CONFIRM | ec-workflow | blocking gate; user reviews the plan | explicit user confirmation |
77
84
  | IMPLEMENT | ec-implementing | code changes per confirmed plan | all units done |
@@ -82,15 +89,19 @@ any stage --[user abort via ec-task-close]--> CLOSED
82
89
  | COMPLETE | ec-workflow | clear current_task, set task status, summary | terminal |
83
90
  | CLOSED | ec-task-close | user abort; no memory flow | terminal |
84
91
 
92
+ > **INIT delivery-form rule.** When creating the task, `type` and `title` must faithfully
93
+ > reflect the delivery form implied by the user's request. A refactor/fix/feature is a CODE
94
+ > task; do not record it as an analysis/report task. Do not let ANALYSIS later re-interpret a
95
+ > code task into a documentation-only task — that is a downgrade (see ec-analysis HARD RULE 5).
96
+
85
97
  ## Task switching
86
98
 
87
99
  When the user confirms switching from task A to task B:
88
100
  1. Task A's status is already persisted in its `task.json` — nothing extra to save.
89
- 2. Set `current_task` to task B's id in state.json.
90
- 3. Set `current_stage` to task B's `status` (from task B's `task.json`).
91
- 4. Append a `{stage, agent, entered_at}` entry to `stage_history`.
92
- 5. Set `last_agent` to the current agent id.
93
- 6. Resume task B's stage via the appropriate stage skill.
101
+ 2. Set the current task through the state API:
102
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-current --session-file <P> --task-id <task-b-id> --agent <agent-id>`.
103
+ 3. Read task B's `task.json` to determine its current stage.
104
+ 4. Resume task B's stage via the appropriate stage skill.
94
105
 
95
106
  No data is lost — task A's dev-spec, execution.jsonl, and test-strategy.md stay intact on
96
107
  disk. To return to task A later, the same intent routing applies: the user mentions it,
@@ -101,13 +112,28 @@ routing matches, and switching happens again.
101
112
  - **Never skip a stage.** ANALYSIS cannot jump to VERIFICATION; IMPLEMENT cannot start before
102
113
  WAITING_CONFIRM passes. No exception for "simple" tasks — simple tasks have short analyses,
103
114
  not skipped ones.
115
+ - **ANALYSIS entry gate.** When entering ANALYSIS, your FIRST TWO tool calls must be:
116
+ (1) Read `.easy-coding/templates/dev-spec-skeleton.md`, then (2) Write its exact content
117
+ to the task's dev-spec.md. This is a mechanical copy, not a generation task. Do not read
118
+ code, load memory, or analyze before the skeleton is on disk. This is ec-analysis
119
+ HARD RULE 1 — violating it means the analysis has failed. Your reply to the user must
120
+ be the complete dev-spec.md content, not a summary or custom format.
121
+ Additionally, ANALYSIS must stay faithful to the user's delivery form — it may NOT downgrade
122
+ a code task to a report-only task — and the 改动范围 table must list only real project code,
123
+ never `.easy-coding/` harness artifacts (ec-analysis HARD RULES 5 and 6).
104
124
  - **WAITING_CONFIRM is a real gate.** Proceed only on explicit user confirmation of BOTH the
105
125
  analysis conclusion and the test strategy. Silence, enthusiasm, or a topic change is not
106
126
  confirmation. Sole exception: `behavior.auto_mode: true` in `.easy-coding/config.yaml`
107
- AND the user asked for autonomous execution.
108
- - **On every transition** update `{{workflow_state_path}}` immediately (not at turn end):
109
- set `current_stage`, append `{stage, agent, entered_at}` to `stage_history`, set
110
- `last_agent` to the current agent id (`claude-code` / `codex` / `qoder`).
127
+ AND the user asked for autonomous execution. `auto_mode` ONLY waives this confirmation step;
128
+ it carries NO scope or delivery-form decision. Never cite `auto_mode` (or "the user already
129
+ decided in INIT") to justify narrowing scope or downgrading a code task to a report.
130
+ - **On every transition** call the state API immediately (not at turn end):
131
+ `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py transition --session-file <P> --stage <STAGE> --agent <agent-id>`.
132
+ Do not hand-edit `status`, `stage_history`, `last_agent`, `current_task`, or session files.
133
+ - **Hook enforcement.** The `inject-workflow-state` hook validates every stage transition
134
+ against the state machine. If you see `[ILLEGAL-TRANSITION:...]` in the injected context,
135
+ you MUST revert the task's status to the previous valid stage and explain why the
136
+ transition was rejected. Do not proceed with an illegal stage.
111
137
  - **Repair loop sizing** (user acceptance window after VERIFICATION): a trivial tweak
112
138
  (one-line style fix, copy text) is fixed inside VERIFICATION and re-verified; a logic or
113
139
  structure change formally returns to IMPLEMENT and re-walks REVIEW → VERIFICATION.
@@ -117,14 +143,17 @@ routing matches, and switching happens again.
117
143
  - **Task switching is allowed at any stage.** The suspended task retains its stage in
118
144
  task.json. Do not run memory flows for suspended tasks — only completed tasks get archived.
119
145
  - **Archive only after user acceptance.** VERIFICATION passing does not complete the task.
120
- After the user accepts, MEMORY_SHORT MEMORY_LONG COMPLETE run automatically.
121
- - **COMPLETE closeout:** set task.json `status:"COMPLETE"`, clear `current_task` in
122
- state.json, output a summary (what was done, files changed, key decisions).
146
+ After the user accepts, call state API transitions in order:
147
+ MEMORY_SHORT MEMORY_LONG COMPLETE. Do not jump directly from VERIFICATION to COMPLETE.
148
+ - **COMPLETE closeout:** call the state API with `--stage COMPLETE`. The state API clears
149
+ session `current_task` for terminal tasks, so the next hook injection returns to Ready.
150
+ Then output a summary (what was done, files changed, key decisions).
123
151
 
124
152
  ## Resume and handoff
125
153
 
126
154
  Hook breadcrumbs you may receive: `[workflow-state:X]`, `[current-task:Y]`,
127
- `[easy-coding:handoff-from:Z]`, `[easy-coding:init-required]`.
155
+ `[easy-coding:session-file:P]`, `[easy-coding:handoff-from:Z]`,
156
+ `[easy-coding:init-required]`.
128
157
 
129
158
  Resuming an active task (whether from session restart, handoff, or task switch):
130
159
  1. Read `task.json` and the dev-spec sections relevant to the current stage.
@@ -143,7 +172,7 @@ Offering handoff — at WAITING_CONFIRM, after presenting the plan, offer exactl
143
172
  3. Revise the plan
144
173
  On option 2: append a `handoff` record to `execution.jsonl` —
145
174
  `{"type":"handoff","from":"<agent>","stage":"<stage>","summary":"<dense context: plan shape, key decisions, user emphases>","timestamp":"<ISO>"}` —
146
- update state.json, then tell the user to open the target agent and run ec-workflow there.
175
+ update the task's `last_agent` in task.json, then tell the user to open the target agent and run ec-workflow there.
147
176
  Handoff is also legal at any other stage boundary on user request. The harness never
148
177
  switches agents by itself.
149
178
 
@@ -151,7 +180,8 @@ switches agents by itself.
151
180
 
152
181
  Start every reply with the single Markdown blockquote status line injected by the hook,
153
182
  then a blank line. Do not render machine breadcrumbs such as `[workflow-state:...]` to the
154
- user. If no status line is injected (harness inactive), do not invent one.
183
+ user. If no status line is injected (harness inactive), do not invent one. Status display is
184
+ script-owned; skills must never construct or "fix" the status line manually.
155
185
 
156
186
  ## Boundaries
157
187
 
@@ -37,18 +37,31 @@ First run `ec-init`; daily work goes through `ec-workflow`.
37
37
 
38
38
  - Stages do not skip. WAITING_CONFIRM is a real gate — implement only after the user confirms
39
39
  the plan and test strategy (unless `behavior.auto_mode` is on and the user asked for it).
40
+ - 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, then fill sections
42
+ incrementally via edits. Reply to the user with the complete dev-spec.md content — never a
43
+ summary table or custom format.
40
44
  - VERIFICATION is a hard gate: lint + typecheck + test must pass on fresh evidence, and
41
45
  coverage must match the test strategy, before a task can complete.
42
46
  - Archive (memory flow) runs only after explicit user acceptance — an unaccepted task's
43
47
  memory is dirty data.
44
48
  - NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
49
+ - All cross-platform modules (skills, hooks, references) must use universal agent protocols.
50
+ Do not rely on any specific agent's proprietary conventions unless the module is explicitly
51
+ a platform-specific compatibility layer. Reference files use descriptive filenames (e.g.,
52
+ `memory-migration.md`), not platform convention names.
45
53
 
46
54
  ## Runtime contract
47
55
 
48
- - Workflow state lives at `{{workflow_state_path}}`; the CLI only installs files and creates
49
- the project-init task agent skills perform all project analysis.
56
+ - 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`, or
58
+ `last_agent`.
59
+ - The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
60
+ `--session-file <P>` when changing the current task or stage.
61
+ - Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
62
+ creates the project-init task — agent skills perform all project analysis.
50
63
  - Cross-repo references in git-tracked task artifacts use repo NAMES, never local paths.
51
- Cache local paths only in `.easy-coding/state.json.repo_paths`.
64
+ Cache local paths only through the state script so they land on the current task.
52
65
 
53
66
  <!-- ═══ end easy-coding-harness generated ═══ -->
54
67
 
@@ -35,18 +35,31 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
35
35
 
36
36
  - Stages do not skip. WAITING_CONFIRM is a real gate — implement only after the user confirms
37
37
  the plan and test strategy (unless `behavior.auto_mode` is on and the user asked for it).
38
+ - 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, then fill sections
40
+ incrementally via edits. Reply to the user with the complete dev-spec.md content — never a
41
+ summary table or custom format.
38
42
  - VERIFICATION is a hard gate: lint + typecheck + test must pass on fresh evidence, and
39
43
  coverage must match the test strategy, before a task can complete.
40
44
  - Archive (memory flow) runs only after explicit user acceptance — an unaccepted task's
41
45
  memory is dirty data.
42
46
  - NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
47
+ - All cross-platform modules (skills, hooks, references) must use universal agent protocols.
48
+ Do not rely on any specific agent's proprietary conventions unless the module is explicitly
49
+ a platform-specific compatibility layer. Reference files use descriptive filenames (e.g.,
50
+ `memory-migration.md`), not platform convention names.
43
51
 
44
52
  ## Runtime contract
45
53
 
46
- - Workflow state lives at `{{workflow_state_path}}`; the CLI only installs files and creates
47
- the project-init task agent skills perform all project analysis.
54
+ - 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`, or
56
+ `last_agent`.
57
+ - The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
58
+ `--session-file <P>` when changing the current task or stage.
59
+ - Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
60
+ creates the project-init task — agent skills perform all project analysis.
48
61
  - Cross-repo references in git-tracked task artifacts use repo NAMES, never local paths.
49
- Cache local paths only in `.easy-coding/state.json.repo_paths`.
62
+ Cache local paths only through the state script so they land on the current task.
50
63
 
51
64
  <!-- ═══ end easy-coding-harness generated ═══ -->
52
65
 
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: ec-fixer
3
+ model: sonnet
4
+ description: Easy Coding fix sub-agent. Applies targeted fixes to specific issues identified during review. Returns structured results with changed files.
5
+ ---
6
+
7
+ You are an Easy Coding fix sub-agent. You receive a fix card listing specific issues
8
+ (with file:line locations) and apply the fixes. Your reply content IS the return value,
9
+ not a message to a human.
10
+
11
+ ## Hard constraints
12
+
13
+ - Fix ONLY the issues listed in the fix card. Do not refactor or "improve" surrounding code.
14
+ - Modify ONLY the files listed in the fix card's scope.
15
+ - Do not call any Skill tool.
16
+ - Do not read `.qoder/skills/`, `.agents/skills/`, or any `.easy-coding/` file.
17
+ - Make no workflow stage-transition decisions.
18
+ - Preserve file encoding.
19
+
20
+ ## Output (return exactly this structure)
21
+
22
+ ```json
23
+ {
24
+ "changed_files": ["file1.ts", "file2.ts"],
25
+ "fixes_applied": [
26
+ {"file": "file1.ts", "line": 42, "original_issue": "...", "fix_description": "..."}
27
+ ],
28
+ "issues": [],
29
+ "needs_attention": []
30
+ }
31
+ ```
32
+
33
+ - `changed_files`: files you actually modified
34
+ - `fixes_applied`: what you fixed with file:line reference
35
+ - `issues`: problems you hit that prevented a fix (empty if none)
36
+ - `needs_attention`: anything requiring a design decision that should escalate to the user
@@ -0,0 +1,75 @@
1
+ ---
2
+ memory_schema: 2
3
+ id: SM-YYYYMMDD-001
4
+ date: YYYY-MM-DD
5
+ task_type: feature | bugfix | refactor | perf | doc | workflow
6
+ project_mode: startup | iteration
7
+ domain:
8
+ - "{business domain or module}"
9
+ tags:
10
+ - "{keyword}"
11
+ related_files:
12
+ - "{key file or module}"
13
+ commit: none
14
+ verification: passed | partial | not_run
15
+ memory_value: business | technical | both | none
16
+ target_long: BUSINESS | TECHNICAL | BOTH | NONE
17
+ ---
18
+
19
+ # Short Memory Template
20
+
21
+ > This template defines the format for files under `.easy-coding/memory/short/`.
22
+ > File naming convention: `{NNN}_{YYYYMMDD}_{smart_name}.md`
23
+ > Short memories are immutable after creation — they serve as a sliding window of recent
24
+ > details and a buffer for long-term distillation candidates.
25
+ > When short memories reach the threshold (default 10), the newest 5 are kept as recent
26
+ > context; older entries are distillation candidates for long-term memory.
27
+ > Sorting: by frontmatter `date` ascending; if date is missing or tied, by filename prefix
28
+ > number ascending; then by filename ascending.
29
+
30
+ ## Task Summary
31
+
32
+ - Goal: {the actual problem solved}
33
+ - Scope: {modules, pages, interfaces, or files involved}
34
+ - Result: {completed / partially completed / not completed, with reasons}
35
+ - Key Constraints: {encoding, compatibility, interface, spec, or user-specified constraints; "none" if none}
36
+
37
+ ## Execution Evidence
38
+
39
+ | Type | Content |
40
+ |---|---|
41
+ | Key Files | {file or module list; "none" if none} |
42
+ | Verification Commands | {test / build / lint commands and results; explain if not run} |
43
+ | Manual Acceptance | {key behaviors checked; "none" if none} |
44
+ | Commit Info | {commit hash; "none" if not committed} |
45
+
46
+ ## Business Memory Candidates
47
+
48
+ > Only record business facts with future reuse value. Write "none" if none.
49
+
50
+ - Concepts / Field Semantics: {concepts, fields, enums, state meanings}
51
+ - Workflows / State Transitions: {chain steps, pre/post conditions, exception branches}
52
+ - Business Rules / Compatibility: {admission criteria, decision basis, grayscale or legacy reasons}
53
+ - Upstream/Downstream Contracts: {producers, consumers, interface or message fields}
54
+ - Business Troubleshooting: {common misdiagnosis, priority check paths}
55
+
56
+ ## Technical Memory Candidates
57
+
58
+ > Only record engineering facts with future reuse value. Write "none" if none.
59
+
60
+ - Architecture / Interface Decisions: {module boundaries, dependency direction, interface contracts}
61
+ - Engineering Rules / Workflows: {coding, commit, release, installation, directory boundaries}
62
+ - Implementation Patterns / Reusable Approaches: {recommended approaches, fallback strategies, compatibility patterns}
63
+ - Pitfalls / Fix Strategies: {root cause, fix approach, verification method}
64
+ - Verification Experience: {test commands, environment constraints, acceptance paths}
65
+
66
+ ## Non-Distillation Content
67
+
68
+ > Content that should NOT enter long-term memory, with reasons — prevents accidental absorption of noise.
69
+
70
+ - {routine file lists / temp logs / one-time data / non-reusable implementation details; "none" if none}
71
+
72
+ ## Related Memories
73
+
74
+ - Predecessor: {related short memory id, long-term topic, or "none"}
75
+ - Successor: {follow-up task; "none" if none}
@@ -1,14 +1,47 @@
1
+ ---
2
+ memory_schema: 2
3
+ memory_file: BUSINESS
4
+ last_updated: YYYY-MM-DD
5
+ ---
6
+
1
7
  # Business Memory
2
8
 
3
- Durable business rules, product decisions, and domain context. Maintained by ec-memory
4
- during MEMORY_LONG; entries are distilled from short memories whose `target_long` is
5
- `business` or `both`.
9
+ > Durable facts about "what the business is, why it works this way, and how upstream/downstream systems interact."
10
+
11
+ ## Core Concepts & Field Semantics
12
+
13
+ | Concept / Field | Meaning | Applicable Scenario | Source | Status |
14
+ |---|---|---|---|---|
15
+ | (none) | — | — | — | — |
16
+
17
+ ## Business Workflows & State Transitions
18
+
19
+ | Workflow / State | Trigger | Key Steps | Exception Branches | Source | Status |
20
+ |---|---|---|---|---|---|
21
+ | (none) | — | — | — | — | — |
22
+
23
+ ## Business Rules & Compatibility Background
24
+
25
+ | Rule | Applicable Scenario | Decision Basis | Impact Scope | Source | Status |
26
+ |---|---|---|---|---|---|
27
+ | (none) | — | — | — | — | — |
28
+
29
+ ## Upstream/Downstream Contracts
30
+
31
+ | Contract | Producer | Consumer | Fields / Interface | Notes | Source |
32
+ |---|---|---|---|---|---|
33
+ | (none) | — | — | — | — | — |
34
+
35
+ ## Business Troubleshooting Experience
36
+
37
+ | Problem | Common Misdiagnosis | Priority Checks | Fix / Handling | Source |
38
+ |---|---|---|---|---|
39
+ | (none) | — | — | — | — |
6
40
 
7
- Entry format — one `##` section per entry:
41
+ ## Deprecated Records
8
42
 
9
- - Heading: `## BM-{NNN} {short title}`
10
- - First line: `status: active` (active | deprecated | superseded | deleted)
11
- - Body: the rule or decision, why it holds, and which tasks/files evidence it.
43
+ > Audit zone short summaries only. Not loaded into ANALYSIS context by default.
12
44
 
13
- Conflict priority when distilling: current code > latest user confirmation > this round's
14
- candidate > existing entries. Index every entry in MEMORY.md.
45
+ | Deprecated Date | Original Summary | Reason | Replacement / Source |
46
+ |---|---|---|---|
47
+ | (none) | — | — | — |
@@ -1,3 +1,38 @@
1
- # Easy Coding Memory Index
1
+ ---
2
+ memory_schema: 2
3
+ memory_file: MEMORY
4
+ last_updated: YYYY-MM-DD
5
+ ---
2
6
 
3
- Long-term memory entries are indexed here by ec-memory.
7
+ # Long-Term Memory Index
8
+
9
+ > This file is an index and navigation aid only — it does not hold detailed content.
10
+ > Business facts go in `BUSINESS.md`; technical/architecture/engineering facts go in `TECHNICAL.md`.
11
+ > Status values: `active / deprecated / superseded`. Default analysis reads only `active` topics.
12
+
13
+ ## Quick Navigation
14
+
15
+ | Topic | Type | Keywords | Detail File | Status | Last Updated | Source |
16
+ |---|---|---|---|---|---|---|
17
+ | (none) | — | — | — | — | — | — |
18
+
19
+ ## Current Priority Business Domains
20
+
21
+ - (none)
22
+
23
+ ## Current Priority Technical Domains
24
+
25
+ - (none)
26
+
27
+ ## Reading Strategy
28
+
29
+ - For business concepts, field semantics, workflows, rules, contracts, or troubleshooting → read `BUSINESS.md`.
30
+ - For architecture decisions, interface decisions, engineering rules, patterns, pitfalls, or verification experience → read `TECHNICAL.md`.
31
+ - Default: read only `active` topics. Read `deprecated` / `superseded` only during migration, conflict investigation, or user-requested history tracing.
32
+ - If long-term memory conflicts with current code or the user's latest statement, trust current code and user — update memory status during the next distillation.
33
+
34
+ ## Migration Audit
35
+
36
+ | Date | Source | Result |
37
+ |---|---|---|
38
+ | (none) | — | — |
@@ -1,3 +1,47 @@
1
+ ---
2
+ memory_schema: 2
3
+ memory_file: TECHNICAL
4
+ last_updated: YYYY-MM-DD
5
+ ---
6
+
1
7
  # Technical Memory
2
8
 
3
- Durable architecture decisions, implementation patterns, and verification lessons live here.
9
+ > Durable facts about "how code is organized, how engineering works, and how to avoid past pitfalls."
10
+
11
+ ## Architecture & Interface Decisions
12
+
13
+ | Decision | Reason | Impact Scope | Source | Status |
14
+ |---|---|---|---|---|
15
+ | (none) | — | — | — | — |
16
+
17
+ ## Engineering Rules & Workflows
18
+
19
+ | Rule | Applicable Scenario | Enforcement | Source | Status |
20
+ |---|---|---|---|---|
21
+ | (none) | — | — | — | — |
22
+
23
+ ## Implementation Patterns & Reusable Approaches
24
+
25
+ | Pattern | Applicable Scenario | Recommended Approach | Anti-pattern / Caveats | Source |
26
+ |---|---|---|---|---|
27
+ | (none) | — | — | — | — |
28
+
29
+ ## Pitfalls & Fix Strategies
30
+
31
+ | Problem | Root Cause | Fix | Verification | Source |
32
+ |---|---|---|---|---|
33
+ | (none) | — | — | — | — |
34
+
35
+ ## Verification, Release & Installation Experience
36
+
37
+ | Scenario | Recommended Command / Path | Notes | Source |
38
+ |---|---|---|---|
39
+ | (none) | — | — | — |
40
+
41
+ ## Deprecated Records
42
+
43
+ > Audit zone — short summaries only. Not loaded into ANALYSIS context by default.
44
+
45
+ | Deprecated Date | Original Summary | Reason | Replacement / Source |
46
+ |---|---|---|---|
47
+ | (none) | — | — | — |
@@ -0,0 +1,80 @@
1
+ [阶段:ANALYSIS]
2
+
3
+ ## 技术方案:{任务标题}
4
+
5
+ ### 项目模式
6
+ {初创项目/迭代项目}
7
+
8
+ ### 任务类型
9
+ {新功能 / Bug 修复 / 重构 / 性能优化 / 前端设计实现}
10
+
11
+ ### 需求解析
12
+ - **目标**:{待填写 — 真正要解决的问题}
13
+ - **输入**:{待填写 — 用户输入 / 系统输入 / 触发条件}
14
+ - **输出**:{待填写 — 先声明交付形态(改代码 / 出文档),再写最终交付结果。交付形态须忠于用户原始需求,不得擅自降级}
15
+ - **边界**:{待填写 — 明确不做什么}
16
+
17
+ ### 现状
18
+ - **相关代码 / 页面 / 接口 / 模块**:{待填写 — 基于实际文件与代码的现状说明}
19
+ - **当前实现方式**:{待填写 — 现在是如何工作的}
20
+ - **现有问题 / 缺口**:{待填写 — 为什么需要改}
21
+ - **证据**:{待填写 — 引用的关键文件、类、页面、接口,含 file:line}
22
+
23
+ ### 冲突摘要
24
+ - 需求 vs RULES:{待填写 或 "无冲突"}
25
+ - 需求 vs ABSTRACT:{待填写 或 "无冲突"}
26
+ - 需求 vs 现有代码:{待填写 或 "无冲突"}
27
+ - Dev-Spec vs 现有代码:{待填写 或 "无冲突"}
28
+
29
+ ### 待用户决策
30
+ - {待填写 — 影响技术路线、接口、改动范围的问题逐条列出;任何"本次不做全部 / 分批落地 / 范围或交付形态收窄"必须列入此处交由用户拍板,不得自行决定并假托既定;若无则写"无"}
31
+
32
+ ### 影响面分析
33
+ - **涉及模块**:{待填写}
34
+ - **核心类 / 页面 / 接口**:{待填写}
35
+ - **数据库变更**:{有/无}
36
+ - **接口变更**:{有/无}
37
+ - **关联历史任务**:{待填写 — 相关短期记忆序号;无则"无"}
38
+
39
+ ### 改动范围
40
+ > 只列真实项目源码/配置文件的改动。禁止把 `.easy-coding/` 下的 harness 产物(dev-spec / execution.jsonl / test-strategy / 记忆 / 报告等)当作改动对象。本表为空仅允许用于"用户明确要求的无代码交付形态";代码类任务(重构/修复/功能)若此表为空,即为自我降级。
41
+
42
+ | 改动文件 | 改动类型 | 文件编码 | 改动核心内容 |
43
+ |----------|---------|---------|-------------|
44
+ | `{文件路径}` | 新增 | 项目编码 {X},依据:{xxx} | {核心改动} |
45
+ | `{文件路径}` | 修改 | 保持原编码 {X} | {核心改动} |
46
+ | `{文件路径}` | 删除 | — | {删除原因} |
47
+
48
+ ### 修改方案
49
+ - **总体改法**:{待填写 — 一句话说清改哪里、怎么改}
50
+ - **后端改动**:{待填写;不涉及则写"不涉及"}
51
+ - **前端改动**:{待填写;不涉及则写"不涉及"}
52
+ - **兼容处理**:{待填写 — 旧逻辑如何迁移、保留或替换}
53
+ - **风险点**:{待填写 — 最容易出问题的位置}
54
+
55
+ ### 实施拆解
56
+
57
+ | 单元 | 说明 | 类型 | 涉及文件 | 依赖 |
58
+ |------|------|------|---------|------|
59
+ | U1 | {title} | {backend/frontend/test/...} | {files} | — |
60
+ | U2 | {title} | {type} | {files} | — |
61
+ | U3 | {title} | {type} | {files} | U1, U2 |
62
+
63
+ **执行策略**:{parallel / sequential / single}
64
+ - 第一批(并行):U1 {title} | U2 {title}
65
+ - 第二批(等待第一批):U3 {title}
66
+ (若 single:单一实施单元,主 agent 直接执行)
67
+
68
+ ### 测试策略
69
+
70
+ | 测试点 | 级别 | 归属单元 | 方式 | 验证命令 |
71
+ |--------|------|---------|------|---------|
72
+ | {描述} | 必测 | U1 | 单测 | `npm test -- --filter=xxx` |
73
+ | {描述} | 应测 | U2 | 快照 | `npm test -- --snapshot` |
74
+
75
+ - **人工验收**:{待填写 — 用户需要检查的关键行为}
76
+ - **无法验证项**:{待填写 — 无 / 说明缺失环境、数据或权限}
77
+
78
+ ### 风险与注意事项
79
+ - {风险 1}
80
+ - {风险 2}