easy-coding-harness 0.8.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +16 -10
  3. package/dist/cli.js +256 -47
  4. package/dist/cli.js.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/claude/agents/ec-fixer.md +3 -2
  7. package/templates/claude/agents/ec-implementer.md +4 -1
  8. package/templates/claude/agents/ec-reviewer.md +4 -2
  9. package/templates/claude/agents/ec-verifier.md +6 -3
  10. package/templates/codex/agents/ec-fixer.toml +3 -2
  11. package/templates/codex/agents/ec-implementer.toml +4 -1
  12. package/templates/codex/agents/ec-reviewer.toml +4 -2
  13. package/templates/codex/agents/ec-verifier.toml +6 -3
  14. package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +9 -7
  15. package/templates/common/skills/ec-analysis/SKILL.md +92 -266
  16. package/templates/common/skills/ec-implementing/SKILL.md +82 -131
  17. package/templates/common/skills/ec-memory/SKILL.md +23 -149
  18. package/templates/common/skills/ec-reviewing/SKILL.md +54 -73
  19. package/templates/common/skills/ec-task-management/SKILL.md +34 -94
  20. package/templates/common/skills/ec-verification/SKILL.md +54 -79
  21. package/templates/common/skills/ec-workflow/SKILL.md +109 -302
  22. package/templates/main-constraint/AGENTS.md.tpl +19 -17
  23. package/templates/main-constraint/CLAUDE.md.tpl +19 -17
  24. package/templates/qoder/agents/ec-fixer.md +3 -2
  25. package/templates/qoder/agents/ec-implementer.md +4 -1
  26. package/templates/qoder/agents/ec-reviewer.md +4 -2
  27. package/templates/qoder/agents/ec-verifier.md +6 -3
  28. package/templates/runtime/memory/SHORT_MEMORY_TEMPLATE.md +2 -0
  29. package/templates/runtime/templates/dev-spec-skeleton.md +14 -6
  30. package/templates/shared-hooks/easy_coding_state.py +1240 -89
  31. package/templates/shared-hooks/inject-subagent-context.py +3 -0
@@ -1,112 +1,52 @@
1
1
  ---
2
2
  name: ec-task-management
3
- description: Task and session panel for Easy Coding. Use when the user runs {{skill_trigger}}ec-task-management, asks to see/create/continue/take over tasks, or asks to view or change the current session confirm mode.
3
+ description: View and manage Easy Coding tasks plus project/session approval and workflow-mode settings.
4
4
  ---
5
5
 
6
- # ec-task-management — the task and session panel
6
+ # ec-task-management — tasks and session modes
7
7
 
8
- A combined task and session panel: list unfinished tasks, create tasks, let the user choose one
9
- task to continue or take over, and manage the current session's confirm mode. Stage progression
10
- still belongs to ec-workflow; closure belongs to ec-task-close.
8
+ Communicate with the user in the user's language. A bare invocation is read-only: show the
9
+ panel and available actions, but do not mutate a session without an explicit choice.
11
10
 
12
- Communicate with the user in the user's language.
11
+ ## Default panel
13
12
 
14
- ## Default panel contract
13
+ Call the state API snapshot and show:
15
14
 
16
- A bare `{{skill_trigger}}ec-task-management` invocation means "show the full task and session
17
- panel", not just the unfinished task list. On every invocation:
15
+ - current task, stage, last Agent, and pending transition;
16
+ - `project_approval_mode`, `session_approval_mode`, `effective_approval_mode`;
17
+ - `project_workflow_mode`, `session_workflow_mode`, `configured_workflow_mode`;
18
+ - task `concrete_workflow_mode` or ANALYSIS proposal when present;
19
+ - harness enabled/disabled state;
20
+ - active and resumable tasks.
18
21
 
19
- 1. Call `list-tasks --agent <agent-id>`.
20
- 2. Call `snapshot --session-file <P>`.
21
- 3. Show the unfinished tasks and a separate "Session confirm mode" section containing:
22
- - `project_confirm_mode`
23
- - `session_confirm_mode` (`project default` when null)
24
- - `effective_confirm_mode`
25
- 4. Show the supported conversational changes in the user's language: set this session to
26
- `approve`, `guard`, `lite`, or `auto`, and restore the project default.
22
+ Explain precedence:
27
23
 
28
- Never omit the confirm-mode section, even when the unfinished task list is empty. A bare panel
29
- invocation is read-only: do not set or clear the session override until the user explicitly asks
30
- for a change.
24
+ `session override > project config > approval:guard / workflow:adaptive`
31
25
 
32
- ## Capabilities
26
+ ## Session settings
33
27
 
34
- ### List unfinished tasks
28
+ After explicit user selection:
35
29
 
36
- Call the state API with the current agent id:
37
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py list-tasks --agent <agent-id>`.
30
+ ```bash
31
+ # approval
32
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-approval-mode --mode approve|guard|confirm|auto --agent <agent-id> --session-file <P>
33
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-approval-mode --agent <agent-id> --session-file <P>
38
34
 
39
- Show only tasks whose `active` is true. For each task show:
40
- - id
41
- - title
42
- - status
43
- - created_at
44
- - action label:
45
- - `continue` when `action == "continue"`
46
- - `take over` when `action == "takeover"`
47
- - previous agent when `previous_agent` is present
48
- - latest handoff summary when `latest_handoff.summary` is present
35
+ # workflow
36
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-workflow-mode --mode adaptive|fast|standard|strict --agent <agent-id> --session-file <P>
37
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-workflow-mode --agent <agent-id> --session-file <P>
38
+ ```
49
39
 
50
- Use wording in the user's language. The important distinction is:
51
- - Continue: the current agent was already the last agent.
52
- - Take over: another agent was the last agent; show that previous agent.
40
+ Changing a session setting affects future ANALYSIS proposals. It does not silently rewrite a
41
+ mode already frozen on an active task. During ANALYSIS, regenerate and show the proposal. During
42
+ IMPLEMENT or REVIEW, use `raise-workflow-mode` for a justified increase; lowering is forbidden.
43
+ From VERIFICATION, return to IMPLEMENT first so the raised mode receives fresh REVIEW evidence.
53
44
 
54
- ### Continue or take over a selected task
45
+ Project settings are changed with `easy-coding config`, which edits both dimensions in one
46
+ confirmed interaction.
55
47
 
56
- When the user chooses a listed task, call:
57
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py claim-task --session-file <P> --task-id <task-id> --agent <agent-id>`.
48
+ ## Task actions
58
49
 
59
- Use the returned `status_context` as the authoritative status source for the rest of the
60
- current turn. Then report:
61
- - whether this was `continue` or `takeover`
62
- - the previous agent if returned
63
- - the latest handoff summary if returned
64
- - the current stage
65
-
66
- After claiming, hand control to ec-workflow semantics: read the task metadata and latest
67
- execution records, then resume from the current stage. Do not advance stages from this skill
68
- unless ec-workflow is explicitly invoked or the agent environment routes into it.
69
-
70
- ### Create a task
71
-
72
- Create through the state API, never by hand-editing `task.json` or session files:
73
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task --session-file <P> --task-id <MM-DD-short-name> --type <feature|bugfix|refactor|perf|doc|analysis|report|workflow> --title "<one-line summary>" --agent <agent-id> --no-set-current`.
74
-
75
- If the user explicitly wants to start the task now, omit `--no-set-current`; otherwise leave
76
- the current workflow pointer untouched and tell them to run `{{skill_trigger}}ec-workflow`
77
- when ready.
78
-
79
- The command returns `status_line` and `status_context`. If the command sets or changes
80
- `current_task`, use the returned context as the authoritative status source for the rest of
81
- the current turn instead of older hook-injected status text.
82
-
83
- ### View or change this session's confirm mode
84
-
85
- Use the snapshot already required by the default panel and show:
86
- - `project_confirm_mode`
87
- - `session_confirm_mode` (`project default` when null)
88
- - `effective_confirm_mode`
89
-
90
- When the user asks to change the current session, use native choice UI when available. When the
91
- UI is limited to three choices, offer `guard` (recommended default), `lite`, and `auto`; accept
92
- `approve` or `restore project default` through the native free-form Other input. A text fallback
93
- must list all four modes and the restore action.
94
-
95
- Set an override through the state API, never by editing the session JSON:
96
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-confirm-mode --session-file <P> --mode <approve|guard|lite|auto> --agent <agent-id>`.
97
-
98
- Restore project configuration through:
99
- `{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-confirm-mode --session-file <P> --agent <agent-id>`.
100
-
101
- Use the returned snapshot as authoritative and report the effective mode. Preserve any existing
102
- `pending_transition`; when it becomes automatic, ec-workflow consumes its original target via
103
- `auto-transition` instead of losing the completed stage outcome. The exception is an existing
104
- IMPLEMENT -> REVIEW edge after switching to lite: ec-workflow must cancel it and automatically
105
- enter VERIFICATION because lite never runs REVIEW.
106
-
107
- ## Boundaries
108
-
109
- - Do not close or cancel tasks — that is ec-task-close.
110
- - Do not advance stages directly from this skill.
111
- - Do not ask who the next agent will be. A takeover is decided by the agent that claims the
112
- task, not by the agent that last handed it off.
50
+ Support listing, creating, selecting, claiming, handing off, and closing tasks through the
51
+ state API. Preserve pending transitions when merely changing approval mode. Never infer user
52
+ acceptance from opening this panel.
@@ -1,93 +1,68 @@
1
1
  ---
2
2
  name: ec-verification
3
- description: VERIFICATION-stage skill the hard evidence gate between implementation/review and archive. Runs lint/typecheck/test in parallel, verifies coverage against test-strategy, then follows the effective confirm mode for archive or repair.
3
+ description: VERIFICATION-stage skill. Runs the minimum sufficient final gate for the frozen workflow mode and binds green evidence to implementation and config fingerprints.
4
4
  ---
5
5
 
6
- # ec-verification — the hard gate
6
+ # ec-verification — fingerprinted final evidence
7
7
 
8
- ec-workflow dispatches you when REVIEW returns `accept` or the user explicitly skips REVIEW
9
- after code IMPLEMENT. Read-only tasks auto-complete from IMPLEMENT and never enter this stage.
10
- You are the last gate before code-task archive. Nothing passes on assumption.
8
+ Read-only tasks never enter this stage. Obtain fresh fingerprints before running checks:
11
9
 
12
- Communicate with the user in the user's language.
10
+ ```bash
11
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py evidence-fingerprints --agent <agent-id> --session-file <P>
12
+ ```
13
13
 
14
- ## Two iron laws
14
+ ## Iron laws
15
15
 
16
- ```
17
- NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
18
- - A command you did not run this round did not pass.
19
- - A previous round's result does not count.
20
- - "should pass" / "looks correct" is not evidence.
21
-
22
- NO ARCHIVE WITHOUT A GREEN GATE
23
- - Verification passing evidence is mandatory in every confirm mode.
24
- - approve/guard/lite require user acceptance before MEMORY; auto advances after the green gate.
25
- - Confirmation mode never turns failed or missing evidence into acceptance.
16
+ - No completion claim without executed verification evidence.
17
+ - Evidence is reusable only while both returned fingerprints remain unchanged.
18
+ - Relevant code or config changes invalidate old evidence automatically.
19
+ - Failed or missing evidence never becomes acceptance because of approval mode.
20
+
21
+ ## Verification depth
22
+
23
+ - `fast`: run the smallest command(s) that directly cover changed behavior plus required
24
+ regression tests.
25
+ - `standard`: run impacted lint/typecheck/test scopes and every must-test item.
26
+ - `strict`: run the project's full applicable lint, typecheck, test, and build gates.
27
+
28
+ The main Agent may run commands inline. Dispatch verifier sub-agents only when checks are
29
+ independent and parallel execution materially saves time or isolates specialist environments.
30
+ Platform spawn rule: {{platform_spawn_instruction}}
31
+
32
+ ## Evidence
33
+
34
+ Append one record per executed check:
35
+
36
+ ```json
37
+ {
38
+ "type": "verify",
39
+ "check": "test",
40
+ "check_type": "test",
41
+ "command": "npm test",
42
+ "passed": true,
43
+ "implementation_fingerprint": "<state-api value>",
44
+ "config_fingerprint": "<state-api value>",
45
+ "timestamp": "<ISO-8601>"
46
+ }
26
47
  ```
27
48
 
28
- ## 1. Run the gate (parallel, always sub-agents)
49
+ `check_type` is one of `lint`, `typecheck`, `test`, or `build`. In `strict`, append current
50
+ evidence for all four types. When a type genuinely does not apply, record `applicable: false`
51
+ and a non-empty `not_applicable_reason`; it does not count as the required applicable executed
52
+ check, and must not be represented by an invented successful command.
29
53
 
30
- <HARD-GATE>
31
- VERIFICATION ALWAYS USES SUB-AGENTS for each check. This prevents context pollution and
32
- ensures true parallelism. You MUST NOT run lint/typecheck/test inline in the main agent.
33
- </HARD-GATE>
54
+ Record failures in `failures[]`. If any current-fingerprint record fails, return to IMPLEMENT;
55
+ do not append a later synthetic pass without rerunning the failed command.
34
56
 
35
- Dispatch three sub-agents concurrently (one per check):
36
- 1. V1: lint (eslint/biome/project linter)
37
- 2. V2: typecheck (`tsc --noEmit` or equivalent)
38
- 3. V3: test (project test command)
57
+ ## Coverage and acceptance
39
58
 
40
- Each sub-agent runs its command and returns `{check, passed, failures[]}`.
41
- Platform spawn rule: {{platform_spawn_instruction}}
59
+ - Every must-test item has an executed check.
60
+ - Bug fixes include a regression test when project infrastructure exists.
61
+ - Present changed scope, commands, results, and unverified items.
62
+ - `approve` and `guard` request VERIFICATION -> MEMORY after acceptance.
63
+ - `confirm` and `auto` advance after the green gate without introducing another mandatory
64
+ user wait.
65
+ - A reported in-scope problem returns to IMPLEMENT; out-of-scope work becomes a separate task.
42
66
 
43
- Append one `verify` record per check:
44
- `{"type":"verify","check":"test","passed":true}` (add `"failures":[...]` on failure).
45
-
46
- ## 2. Coverage check (against test-strategy.md)
47
-
48
- - Every [must-test] item → must have a corresponding test case.
49
- - Every [should-test] item → must have a corresponding test case.
50
- - A [depends] item the user confirmed as must-test → must have one.
51
- - Bug fix → must have a regression test.
52
- - Missing coverage → blocked: return to IMPLEMENT to add tests.
53
-
54
- ## 3. Gate decision
55
-
56
- - All three pass AND coverage satisfied → present the verification result; approve/guard/lite wait
57
- for user acceptance, while auto hands the green result to ec-workflow for automatic MEMORY.
58
- - Any failure → append the failing `verify` record, summarize failures, select
59
- VERIFICATION -> IMPLEMENT, and follow the effective confirm mode.
60
-
61
- ## 4. User acceptance and repair loop
62
-
63
- After a green gate, present an acceptance summary: what changed (files + summaries), the
64
- verification results (lint/type/test), and the coverage status. Then the user takes time to
65
- test manually. Their response routes:
66
-
67
- - **"accepted"** (approve/guard/lite) → request VERIFICATION -> MEMORY and present the standard boundary gate.
68
- - **"problem here"** → scope judgment against the dev-spec:
69
- - in scope → select VERIFICATION -> IMPLEMENT and follow the effective confirm mode; after
70
- repair, approve presents the IMPLEMENT choice, guard/auto default to REVIEW, and lite
71
- returns directly to VERIFICATION.
72
- - out of scope → propose a new task (`spawned_from` = current task id); the current task
73
- may archive now (if already satisfactory) or stay suspended.
74
- - **"cancel"** → ec-task-close.
75
-
76
- Repair sizing: a trivial tweak is fixed and re-verified inside VERIFICATION; a logic/structure
77
- change formally returns to IMPLEMENT. After repair, approve presents the standard IMPLEMENT
78
- completion choice again; guard/auto enter REVIEW, while lite returns directly to VERIFICATION
79
- without offering REVIEW.
80
-
81
- ## 5. Archive entry
82
-
83
- In approve/guard/lite, acceptance does not mutate the stage directly. Hand control to ec-workflow
84
- to call `request-transition --stage MEMORY`, then present:
85
- 1. Confirm entering MEMORY
86
- 2. Hand off to another agent
87
- 3. Other (native free-form Other, or the third text option)
88
-
89
- Only after confirmation may ec-workflow consume the pending edge and dispatch ec-memory.
90
- In auto, hand the green gate directly to ec-workflow for `auto-transition --stage MEMORY`.
91
- ec-memory owns both short-memory creation and the conditional long-memory gate inside the
92
- single MEMORY stage. After memory processing completes, MEMORY -> COMPLETE advances
93
- automatically without another confirmation or handoff gate.
67
+ The state API rejects VERIFICATION -> MEMORY unless all evidence for the current implementation
68
+ and config fingerprints is green.