feat(tasks-todowrite-disabler): improve error message with actionable workflow guidance
This commit is contained in:
parent
671e320bf3
commit
1a0cc424b3
@ -1,10 +1,21 @@
|
|||||||
export const HOOK_NAME = "tasks-todowrite-disabler"
|
export const HOOK_NAME = "tasks-todowrite-disabler"
|
||||||
export const BLOCKED_TOOLS = ["TodoWrite", "TodoRead"]
|
export const BLOCKED_TOOLS = ["TodoWrite", "TodoRead"]
|
||||||
export const REPLACEMENT_MESSAGE = `TodoRead/TodoWrite are disabled because experimental.task_system is enabled.
|
export const REPLACEMENT_MESSAGE = `TodoRead/TodoWrite are DISABLED because experimental.task_system is enabled.
|
||||||
Use the new task tools instead:
|
|
||||||
- TaskCreate: Create new tasks with auto-generated IDs
|
**ACTION REQUIRED**: RE-REGISTER what you were about to write as Todo using Task tools NOW. Then ASSIGN yourself and START WORKING immediately.
|
||||||
- TaskUpdate: Update task status, add dependencies
|
|
||||||
|
**Use these tools instead:**
|
||||||
|
- TaskCreate: Create new task with auto-generated ID
|
||||||
|
- TaskUpdate: Update status, assign owner, add dependencies
|
||||||
- TaskList: List active tasks with dependency info
|
- TaskList: List active tasks with dependency info
|
||||||
- TaskGet: Get full task details
|
- TaskGet: Get full task details
|
||||||
|
|
||||||
IMPORTANT: 1 task = 1 delegate_task. Maximize parallel execution by running independent tasks concurrently.`
|
**Workflow:**
|
||||||
|
1. TaskCreate({ subject: "your task description" })
|
||||||
|
2. TaskUpdate({ id: "T-xxx", status: "in_progress", owner: "your-thread-id" })
|
||||||
|
3. DO THE WORK
|
||||||
|
4. TaskUpdate({ id: "T-xxx", status: "completed" })
|
||||||
|
|
||||||
|
CRITICAL: 1 task = 1 delegate_task. Fire independent tasks concurrently.
|
||||||
|
|
||||||
|
DO NOT retry TodoWrite. Convert to TaskCreate NOW.`
|
||||||
|
|||||||
@ -19,7 +19,7 @@ describe("tasks-todowrite-disabler", () => {
|
|||||||
// when / then
|
// when / then
|
||||||
await expect(
|
await expect(
|
||||||
hook["tool.execute.before"](input, output)
|
hook["tool.execute.before"](input, output)
|
||||||
).rejects.toThrow("TodoRead/TodoWrite are disabled")
|
).rejects.toThrow("TodoRead/TodoWrite are DISABLED")
|
||||||
})
|
})
|
||||||
|
|
||||||
test("should block TodoRead tool", async () => {
|
test("should block TodoRead tool", async () => {
|
||||||
@ -37,7 +37,7 @@ describe("tasks-todowrite-disabler", () => {
|
|||||||
// when / then
|
// when / then
|
||||||
await expect(
|
await expect(
|
||||||
hook["tool.execute.before"](input, output)
|
hook["tool.execute.before"](input, output)
|
||||||
).rejects.toThrow("TodoRead/TodoWrite are disabled")
|
).rejects.toThrow("TodoRead/TodoWrite are DISABLED")
|
||||||
})
|
})
|
||||||
|
|
||||||
test("should not block other tools", async () => {
|
test("should not block other tools", async () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user