1
1
import { ToolArgs } from "../types"
2
2
import { BaseToolSchema } from "./base-tool-schema"
3
3
4
+ /**
5
+ * Prompt when todos are NOT required (default)
6
+ */
7
+ const PROMPT_WITHOUT_TODOS = `## new_task
8
+ Description: This will let you create a new task instance in the chosen mode using your provided message.
9
+
10
+ Parameters:
11
+ - mode: (required) The slug of the mode to start the new task in (e.g., "code", "debug", "architect").
12
+ - message: (required) The initial user message or instructions for this new task.
13
+
14
+ Usage:
15
+ <new_task>
16
+ <mode>your-mode-slug-here</mode>
17
+ <message>Your initial instructions here</message>
18
+ </new_task>
19
+
20
+ Example:
21
+ <new_task>
22
+ <mode>code</mode>
23
+ <message>Implement a new feature for the application</message>
24
+ </new_task>
25
+ `
26
+
27
+ /**
28
+ * Prompt when todos ARE required
29
+ */
30
+ const PROMPT_WITH_TODOS = `## new_task
31
+ Description: This will let you create a new task instance in the chosen mode using your provided message and initial todo list.
32
+
33
+ Parameters:
34
+ - mode: (required) The slug of the mode to start the new task in (e.g., "code", "debug", "architect").
35
+ - message: (required) The initial user message or instructions for this new task.
36
+ - todos: (required) The initial todo list in markdown checklist format for the new task.
37
+
38
+ Usage:
39
+ <new_task>
40
+ <mode>your-mode-slug-here</mode>
41
+ <message>Your initial instructions here</message>
42
+ <todos>
43
+ [ ] First task to complete
44
+ [ ] Second task to complete
45
+ [ ] Third task to complete
46
+ </todos>
47
+ </new_task>
48
+
49
+ Example:
50
+ <new_task>
51
+ <mode>code</mode>
52
+ <message>Implement user authentication</message>
53
+ <todos>
54
+ [ ] Set up auth middleware
55
+ [ ] Create login endpoint
56
+ [ ] Add session management
57
+ [ ] Write tests
58
+ </todos>
59
+ </new_task>
60
+
61
+ `
62
+
4
63
export function generateNewTaskSchema ( args : ToolArgs ) : BaseToolSchema {
64
+ const todosRequired = args . settings ?. newTaskRequireTodos === true
5
65
const schema : BaseToolSchema = {
6
66
name : "new_task" ,
7
67
description : "This will let you create a new task instance in the chosen mode using your provided message." ,
@@ -19,24 +79,15 @@ export function generateNewTaskSchema(args: ToolArgs): BaseToolSchema {
19
79
required : true ,
20
80
} ,
21
81
] ,
22
- systemPrompt : `## new_task
23
- Description: This will let you create a new task instance in the chosen mode using your provided message.
24
-
25
- Parameters:
26
- - mode: (required) The slug of the mode to start the new task in (e.g., "code", "debug", "architect").
27
- - message: (required) The initial user message or instructions for this new task.
28
-
29
- Usage:
30
- <new_task>
31
- <mode>your-mode-slug-here</mode>
32
- <message>Your initial instructions here</message>
33
- </new_task>
34
-
35
- Example:
36
- <new_task>
37
- <mode>code</mode>
38
- <message>Implement a new feature for the application.</message>
39
- </new_task>` ,
82
+ systemPrompt : todosRequired ? PROMPT_WITH_TODOS : PROMPT_WITHOUT_TODOS ,
83
+ }
84
+ if ( todosRequired ) {
85
+ schema . parameters . push ( {
86
+ name : "todos" ,
87
+ type : "string" ,
88
+ description : "The initial todo list in markdown checklist format for the new task. Use '[ ]' for pending" ,
89
+ required : true ,
90
+ } )
40
91
}
41
92
42
93
return schema
0 commit comments