feat(tasks): teach agents when to use the task tools
The task tools were registered but had only mechanical descriptions and no standing policy, so agents knew the tools existed but not when to reach for them. Lead each of the five descriptions with its trigger (when to use, when not to) and add a task-tracking convention to .correx/project.toml, which is rendered into every stage's L0 context. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -25,8 +25,9 @@ class TaskContextTool(private val assembler: TaskContextAssembler) : Tool, ToolE
|
||||
|
||||
override val name: String = "task_context"
|
||||
override val description: String =
|
||||
"Fetch a task's context bundle (goal, acceptance criteria, resolved dependencies, " +
|
||||
"related links, relevant files, notes) in one call. Use before working a task."
|
||||
"Call this first, before working a task you've claimed or been pointed at, so you don't " +
|
||||
"re-derive context: it returns the task's goal, acceptance criteria, resolved " +
|
||||
"dependencies, related links, relevant files, and notes in one bundle."
|
||||
override val parametersSchema: JsonObject = buildJsonObject {
|
||||
put("type", "object")
|
||||
putJsonObject("properties") {
|
||||
|
||||
+4
-1
@@ -22,7 +22,10 @@ class TaskCreateTool(private val service: TaskService) : Tool, ToolExecutor {
|
||||
|
||||
override val name: String = "task_create"
|
||||
override val description: String =
|
||||
"Create a task in a project's work graph and return its id (e.g. 'auth-142')."
|
||||
"Open a task when work spans multiple sessions, needs handoff between runs, or the " +
|
||||
"operator asks to track it. Search first (task_search) to avoid duplicates. Don't " +
|
||||
"create one for a single self-contained edit you finish now. Returns the new id " +
|
||||
"(e.g. 'auth-142')."
|
||||
override val parametersSchema: JsonObject = buildJsonObject {
|
||||
put("type", "object")
|
||||
putJsonObject("properties") {
|
||||
|
||||
+3
-2
@@ -26,8 +26,9 @@ class TaskDeleteTool(private val service: TaskService) : Tool, ToolExecutor {
|
||||
|
||||
override val name: String = "task_delete"
|
||||
override val description: String =
|
||||
"Soft-delete a task (removes it from active views; history is kept). " +
|
||||
"For an abandoned-but-visible task, use task_update action=cancel instead."
|
||||
"Use only to remove a task opened by mistake or a duplicate: soft-deletes it (drops " +
|
||||
"from active views; history is kept). For real work that's been abandoned, use " +
|
||||
"task_update action=cancel instead so it stays visible."
|
||||
override val parametersSchema: JsonObject = buildJsonObject {
|
||||
put("type", "object")
|
||||
putJsonObject("properties") {
|
||||
|
||||
+4
-2
@@ -28,8 +28,10 @@ class TaskSearchTool(private val service: TaskService) : Tool, ToolExecutor {
|
||||
|
||||
override val name: String = "task_search"
|
||||
override val description: String =
|
||||
"Search tasks by text (matches id/title/goal/acceptance criteria/notes), ranked by " +
|
||||
"relevance. Returns 'id [STATUS] title' lines. Use to find a task id, then task_context."
|
||||
"Search tasks before opening a new one (avoid duplicates) and to find related or " +
|
||||
"blocking work, or to look up a task id by text. Matches id/title/goal/acceptance " +
|
||||
"criteria/notes, ranked by relevance; returns 'id [STATUS] title' lines. Pair with " +
|
||||
"task_context to load a hit."
|
||||
override val parametersSchema: JsonObject = buildJsonObject {
|
||||
put("type", "object")
|
||||
putJsonObject("properties") {
|
||||
|
||||
+4
-3
@@ -29,9 +29,10 @@ class TaskUpdateTool(private val service: TaskService) : Tool, ToolExecutor {
|
||||
|
||||
override val name: String = "task_update"
|
||||
override val description: String =
|
||||
"Update a task: edit title/goal/criteria/paths, change status via 'action' " +
|
||||
"(claim, release, block, unblock, submit_for_review, complete, reopen, cancel), " +
|
||||
"add a link, or add a note."
|
||||
"Keep a task's state current as you work it: claim before starting, submit_for_review " +
|
||||
"when ready, complete after review, block/unblock when waiting on something. Also " +
|
||||
"edits title/goal/criteria/paths, adds a work-graph link, or attaches a note. " +
|
||||
"Actions: claim, release, block, unblock, submit_for_review, complete, reopen, cancel."
|
||||
override val parametersSchema: JsonObject = buildJsonObject {
|
||||
put("type", "object")
|
||||
putJsonObject("properties") {
|
||||
|
||||
Reference in New Issue
Block a user