Skip to content

Commit 630c22b

Browse files
committed
streamline tool schema and improve LLM workflow instructions
- Remove the `goal` field from the TODO state and `plan` operation, as discrete tasks often do not share a single high-level objective. - Unify the JSON tool parameter schema to use `snake_case` (e.g., `active_summary`) to match existing fields like `blocked_by`. - Restrict the `active_summary` parameter exclusively to the `start` operation, where it semantically belongs. - Update agent prompts (`todo.md`, `code_agent.md`) to explicitly forbid batch-starting tasks unless performing genuinely parallel work (e.g., dispatching subagents). - Update all corresponding tool tests to reflect the new state shape and validation logic.
1 parent 3024074 commit 630c22b

5 files changed

Lines changed: 256 additions & 230 deletions

File tree

resources/prompts/code_agent.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ You have tools at your disposal to solve the coding task. Follow these rules reg
3434
You have access to a `eca__todo` tool for tracking multi-step work within this chat.
3535

3636
### Workflow:
37-
1. Use `plan` to create TODO with goal and tasks
38-
2. Use `start` before working on a task (marks it as in_progress)
39-
3. Use `complete` only for tasks that are actually finished; for each targeted task that has `done_when`, verify it first.
37+
1. Use `plan` to create TODO with initial tasks
38+
2. Use `start` before working on a task (marks it as in_progress and requires an `active_summary`)
39+
3. Use `complete` only for tasks that are actually finished; for each targeted task, verify its acceptance criteria first.
4040
4. Use `add` if you discover additional work
41-
5. When a plan is fully completed and no further work is needed for the current goal, always use the `clear` operation to clean up the workspace.
42-
6. Delegate focused work to subagents when helpful. Work sequentially by default; batch operations ONLY for tasks executing simultaneously.
41+
5. When a plan is fully completed and no further work is needed, always use the `clear` operation to clean up the workspace.
42+
6. When helpful, delegate focused work to subagents. You MAY start multiple independent tasks in parallel (keep the number of in_progress tasks small), then update/complete the TODO based on subagent outputs. Prefer that only the main agent updates the TODO; subagents should focus on producing outputs.
4343

44-
### done_when guidance:
45-
- `done_when` is optional.
46-
- Prefer setting it for non-trivial tasks where completion should be objectively verifiable.
47-
- For trivial tasks, you may omit it to keep tracking lightweight.
44+
### Task tracking guidance:
45+
- Make sure to add acceptance criteria inside your task `description`.
46+
- Objective verification of acceptance criteria is required for completion.
4847
{% endif %}

resources/prompts/tools/todo.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,28 @@ When NOT to Use:
1313

1414
Operations:
1515
- read: View current TODO state
16-
- plan: Create/replace TODO with goal and tasks (required: goal, tasks)
16+
- plan: Create/replace TODO with initial tasks (required: tasks)
1717
- add: Append task(s) to existing TODO
18-
- update: Modify a single task metadata by `id` (content, priority, done_when, blocked_by) — cannot change status
19-
- start: Begin work on tasks by `ids` (sets to in_progress; rejects blocked or done tasks)
20-
- complete: Mark tasks by `ids` as done (verify done_when criteria first)
18+
- update: Modify a single task metadata by `id` (subject, description, priority, blocked_by) — cannot change status
19+
- start: Begin work on tasks by `ids` (sets to in_progress; rejects blocked or done tasks). Requires `active_summary` to summarize what you are about to do.
20+
- complete: Mark tasks by `ids` as done (verify acceptance criteria in description first)
2121
- delete: Remove tasks by `ids`
22-
- clear: Reset entire TODO (removes goal and all tasks)
22+
- clear: Reset entire TODO (removes all tasks)
2323

2424
Workflow:
25-
1. Use 'plan' to create TODO with goal and initial tasks
26-
2. Use 'start' before working on a task — marks it as in_progress
25+
1. Use 'plan' to create TODO with initial tasks
26+
2. Use 'start' before working on a task — marks it as in_progress and requires an `active_summary`
2727
3. Work sequentially by default. Batch 'start' or 'complete' operations (using multiple 'ids') ONLY for independent tasks being executed simultaneously (e.g., via subagents).
28-
4. Use 'complete' only for tasks that are actually finished; for each targeted task that has `done_when`, verify it first — the response tells you which tasks got unblocked
28+
4. Use 'complete' only for tasks that are actually finished; verify acceptance criteria first — the response tells you which tasks got unblocked
2929
5. Use 'add' if you discover additional work during execution
30-
6. When a plan is fully completed and no further work is needed for the current goal, always use the 'clear' operation to clean up the workspace.
30+
6. When a plan is fully completed and no further work is needed, always use the 'clear' operation to clean up the workspace.
3131

32-
How to use done_when:
33-
- `done_when` is optional.
34-
- Use it for non-trivial tasks where completion must be verifiable (tests passing, behavior implemented, specific file changes, etc.).
35-
- For trivial/obvious tasks, you may omit `done_when` to avoid overhead.
32+
Task Schema:
33+
- `subject`: A brief, actionable title in imperative form (e.g. "Fix login bug")
34+
- `description`: Detailed description of what needs to be done, including context and acceptance criteria
3635

3736
Task Completion Integrity:
3837
- Mark tasks complete as soon as they are finished.
39-
- If a task has `done_when`, ONLY mark it as completed when ALL `done_when` criteria are actually met (for each task in a batch).
38+
- ONLY mark it as completed when ALL acceptance criteria from the `description` are actually met (for each task in a batch).
4039
- Do NOT complete if: tests failing, implementation partial, or errors unresolved.
4140
- When completing reveals follow-up work, use 'add' to append new tasks.

src/eca/db.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@
6060
:messages [{:role (or "user" "assistant" "tool_call" "tool_call_output" "reason")
6161
:content (or :string [::any-map]) ;; string for simple text, map/vector for structured content
6262
:content-id :string}]
63-
:todo {:goal :string
64-
:next-id :number
63+
:todo {:next-id :number
64+
:active-summary (or :string nil)
6565
:tasks [{:id :number
66-
:content :string
66+
:subject :string
67+
:description :string
6768
:status (or :pending :in-progress :done)
6869
:priority (or :high :medium :low)
69-
:done-when (or :string nil)
7070
:blocked-by #{:number}}]}
7171
:tool-calls {"<tool-call-id>"
7272
{:status (or :initial :preparing :check-approval :waiting-approval

0 commit comments

Comments
 (0)