1---2name: ase-task-reboot3description: Reboot the current or given task plan by re-creating it from scratch. Use when the user calls to "reboot", "recreate" or "refresh" the "task", "plan", "spec", or "specification".4---5
6@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
7@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
8@${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md
9@${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
10
11<skill name="ase-task-reboot">
12Reboot a Task Plan
13</skill>
14
15<expand name="getopt"
16 arg1="ase-task-reboot"
17 arg2="--next|-n=(none|DONE|EDIT|IMPLEMENT|PREFLIGHT)...">
18 $ARGUMENTS
19</expand>
20
21<objective>
22*Reboot* the task plan by crafting it from scratch,
23based on the existing *WHAT* and *WHY*.
24</objective>
25
26@${CLAUDE_SKILL_DIR}/../../meta/ase-format-task.md
27
28Procedure
29---------
30
311. **Determine Task:**
32
33 1. Set <instruction><getopt-arguments/></instruction> initially.
34 Inherit the always existing <ase-task-id/> from the current context.
35 Inherit the always existing <ase-session-id/> from the current context.
36 Do not output anything.
37
38 2. React on task id:
39
40 1. <if condition="
41 <instruction/> matches the regexp `^[a-zA-Z][a-zA-Z0-9_-]*$`
42 ">
43 Set <ase-task-id><instruction/></ase-task-id> (set task
44 id to instruction) and <instruction></instruction> (set
45 instruction empty), call the `ase_task_id(id: "<ase-task-id/>",
46 session: "<ase-session-id/>")` tool from the `ase` MCP
47 server to switch the task, and then only output the
48 following <template/>:
49
50 <template>
51 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **task given**
52 </template>
53 </if>
54
55 2. <elseif condition="<instruction/> is NOT empty">
56 The argument is neither empty nor a valid task id. As this
57 skill only accepts an optional `[<id>]` argument and *never*
58 a free-text instruction, only output the following <template/>
59 and then immediately *STOP* processing the entire current skill:
60
61 <template>
62 ⧉ **ASE**: ☻ skill: **ase-task-reboot**, ▶ ERROR: expected single `[<id>]` argument
63 </template>
64 </elseif>
65
662. **Determine Operation:**
67
68 1. Call the `ase_task_load(id: "<ase-task-id/>")` tool of the `ase` MCP
69 server to load the current task plan content and set <text/> to
70 the `text` output field of the `ase_task_load` tool call.
71
72 - If <text/> starts with `ERROR:` or `WARNING:`:
73 Set <content></content> (set content to empty).
74 Set <words/> to "0".
75
76 - If <text/> starts NOT with `ERROR:` and NOT with `WARNING:`:
77 Set <content><text/></content> (set content to text).
78 Calculate the number of words <words/> of <content/>.
79
80 Only output the following <template/>:
81
82 <template>
83 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan loaded**
84 </template>
85
86 2. <if condition="<content/> is empty">
87 Complain and tell the user to use the `ase-code-resolve`,
88 `ase-code-refactor`, `ase-code-craft`, or `ase-task-edit` skills
89 first to create a task plan. Then immediately stop processing
90 this skill.
91 </if>
92
933. **Reboot Task Plan:**
94
95 1. Start with <instruction></instruction> (set instruction to empty).
96
97 2. <if condition="<content/> contains neither '- **WHAT**:' nor '- **WHY**:'">
98 Set <instruction><content/></instruction> (set instruction to content).
99 </if>
100
101 3. <if condition="<content/> contains '- **WHAT**: <text/>'">
102 Set <instruction><text/></instruction> (set instruction to extracted text).
103 </if>
104
105 4. <if condition="<content/> contains '- **WHY**: <text/>' and <instruction/> is empty">
106 Set <instruction><text/></instruction> (set instruction to extracted text).
107 </if>
108
109 5. <if condition="<content/> contains '- **WHY**: <text/>' and <instruction/> is NOT empty">
110 Set <instruction><instruction/>, BECAUSE <text/></instruction>
111 (append extracted text to instruction).
112 </if>
113
114 6. <if condition="<content/> contains '⎈ Created: <text/>'">
115 Set <timestamp-created><text/></timestamp-created> (set
116 timestamp-created to extracted text)
117 </if>
118
119 7. <if condition="<instruction/> is empty or contains only whitespace">
120 The WHAT/WHY extraction yielded no usable text (e.g. a
121 `- **WHAT**:` line existed but captured empty text, so the
122 whole-content fallback above did not fire). Fall back to the
123 full previous plan content: set <instruction><content/></instruction>
124 (set instruction to content).
125 <if condition="<instruction/> is still empty or contains only whitespace">
126 There is nothing to reboot from. Only output the following
127 <template/> and then immediately *STOP* processing the entire
128 current skill:
129
130 <template>
131 ⧉ **ASE**: ☻ skill: **ase-task-reboot**, ▶ ERROR: empty instruction -- nothing to reboot from
132 </template>
133 </if>
134 </if>
135
136 8. Create a new plan from scratch and store the result as
137 <content/> by closely following the defined plan format
138 <format/> and injecting into it all the information from
139 the <instruction/> and all decisions you derived from the
140 <instruction/>.
141
142 9. Call the `ase_timestamp(format: "yyyy-LL-dd HH:mm")` tool of the
143 `ase` MCP server and use the `text` field of its response for
144 <timestamp-modified/> information. If <timestamp-created/> is
145 still unset (because the previous <content/> had no `Created:`
146 line), set <timestamp-created><timestamp-modified/></timestamp-created>
147 (fall back to the modified timestamp). Then insert the current
148 <ase-task-id/>, previous <timestamp-created/>, and refreshed
149 <timestamp-modified/> information and calculate the number of
150 words <words/> of <content/>.
151
152 10. Call the `ase_task_save(id: "<ase-task-id/>",
153 text: "<content/>")` of the `ase` MCP server to save the updated
154 task plan content. Do not output anything related to this MCP
155 call.
156
157 11. Only output the following <template/> and continue processing:
158
159 <template>
160 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan rebooted**
161 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ⇌ instruction: **<instruction/>**, ▶ status: **instruction given**
162 </template>
163
1644. **Decide Next Step:**
165
166 1. *Determine next step*:
167
168 - If <getopt-option-next/> is not equal to `none`:
169 Treat <getopt-option-next/> as a comma-separated chronological
170 list of pre-selected next-step tokens. *Split* it on `,`,
171 take the *first* token as <head/>, and store the remaining
172 tokens (joined back with `,`, or `none` if empty) into
173 <getopt-option-next/> so downstream skills can consume the tail.
174
175 - If <head/> matches the regex `^(DONE|EDIT|IMPLEMENT|PREFLIGHT)$`:
176 Honor the pre-selected token.
177 Set <result><head/></result>.
178
179 - else:
180 Only output the following <template/> and then immediately
181 *STOP* processing the entire current skill:
182
183 <template>
184 ⧉ **ASE**: ☻ skill: **ase-task-reboot**, ▶ ERROR: invalid `--next` token: **<head/>**
185 </template>
186
187 - If <getopt-option-next/> is equal to `none`:
188
189 In the following, you *MUST* *NOT* use your built-in
190 <user-dialog-tool/> tool! Instead, you *MUST* just show a
191 custom dialog according to the expanded `custom-dialog`
192 definition. You *MUST* closely follow this definition:
193
194 <expand name="custom-dialog" arg1="--no-other">
195 Next Step: How would you like to proceed with the plan?
196 DONE: Stop processing.
197 EDIT: Hand off plan to editing.
198 IMPLEMENT: Hand off plan to implementation.
199 PREFLIGHT: Hand off plan to pre-flighting.
200 </expand>
201
202 2. Check the tool <result/> and dispatch accordingly:
203
204 - If <result/> is `DONE` or `CANCEL`:
205 Only output the following <template/> and then *STOP*.
206
207 <template>
208 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan updated -- done**
209 </template>
210
211 - If <result/> is `EDIT`:
212 Set <args>--int-reuse-task</args>.
213 <if condition="<getopt-option-next/> is not equal `none`">
214 Set <args><args/> --next <getopt-option-next/></args>
215 </if>
216 Only output the following <template/> and then call the
217 tool `Skill(skill: "ase:ase-task-edit", args: "<args/>")`
218 to invoke the `ase:ase-task-edit` skill in order to *edit*
219 the updated plan. Immediately stop processing the current
220 skill once the `Skill` tool was used.
221
222 <template>
223 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan updated -- hand-off to edit**
224 </template>
225
226 - If <result/> is `IMPLEMENT`:
227 Set <args>--int-reuse-task</args>.
228 <if condition="<getopt-option-next/> is not equal `none`">
229 Set <args><args/> --next <getopt-option-next/></args>
230 </if>
231 Only output the following <template/> and then call the
232 `Skill(skill: "ase:ase-task-implement", args: "<args/>")` tool
233 to *apply* the plan.
234
235 <template>
236 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan updated -- hand-off to implementation**
237 </template>
238
239 - If <result/> is `PREFLIGHT`:
240 Set <args>--int-reuse-task</args>.
241 <if condition="<getopt-option-next/> is not equal `none`">
242 Set <args><args/> --next <getopt-option-next/></args>
243 </if>
244 Only output the following <template/> and then call the
245 `Skill(skill: "ase:ase-task-preflight", args: "<args/>")` tool
246 to *apply* the plan.
247
248 <template>
249 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan updated -- hand-off to pre-flight**
250 </template>
251