1---2name: ase-task-dissect3description: Dissect the current or given task plan, treated as an epic, domain-wise and logically into cohesive parts and materialize each part as its own separate task plan. Use when the user calls to "dissect", "split", "break up", or "decompose" a large "task" or "plan".4---5
6@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
7@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
8@${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
9
10<purpose name="ase-task-dissect">
11Dissect a Task Plan
12</purpose>
13
14<expand name="getopt"
15 arg1="ase-task-dissect"
16 arg2="--max-parts|-m=8 --dry|-d --force|-f --int-reuse-task">
17 $ARGUMENTS
18</expand>
19
20<objective>
21*Dissect* a task plan, treated as an *epic*, domain-wise and logically
22into *cohesive parts*, and materialize every part as its own separate
23*task plan*.
24</objective>
25
26@${CLAUDE_SKILL_DIR}/../../meta/ase-format-task.md
27@${CLAUDE_SKILL_DIR}/../../meta/ase-common-task.md
28@${CLAUDE_SKILL_DIR}/../../meta/ase-common-dissect.md
29
30Procedure
31---------
32
331. **Determine Task and Hint:**
34
35 1. Set <instruction><getopt-arguments/></instruction> initially,
36 with any leading and trailing whitespace stripped. Inherit the
37 always existing <ase-task-id/> from the current context. Inherit
38 the always existing <ase-session-id/> from the current context.
39 Do not output anything.
40
41 2. React on the task id:
42
43 <if condition="
44 <instruction/> matches the regexp `^[a-zA-Z][a-zA-Z0-9_-]*:?$`
45 ">
46 The lone token is the *task id* (with an optional and ignored
47 trailing `:`), never a hint. Set
48 <ase-task-id><instruction/></ase-task-id> (set task id to
49 instruction, with any trailing `:` stripped) and
50 <instruction></instruction> (set instruction empty), call the
51 `ase_task_id(id: "<ase-task-id/>", session: "<ase-session-id/>")`
52 tool from the `ase` MCP server to switch the task, and then only
53 output the following <template/>:
54
55 <template>
56 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **task given**
57 </template>
58 </if>
59
60 <elseif condition="
61 <instruction/> has the format `<id/>: <text/>` where
62 <id/> matches the regexp `^[a-zA-Z][a-zA-Z0-9_-]*$`
63 ">
64 Set <instruction><text/></instruction> (set instruction to
65 text) and <ase-task-id><id/></ase-task-id> (set task id to
66 id), call the `ase_task_id(id: "<ase-task-id/>", session:
67 "<ase-session-id/>")` tool from the `ase` MCP server to switch
68 the task, and then only output the following <template/>:
69
70 <template>
71 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **task given**
72 </template>
73 </elseif>
74
75 3. React on the dissection hint:
76
77 Set <dissect-hint><instruction/></dissect-hint> (set the
78 dissection hint to the *remaining* instruction), with any
79 leading and trailing whitespace stripped.
80
81 <if condition="<dissect-hint/> is not empty">
82 Only output the following <template/>:
83
84 <template>
85 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ⇌ hint: **<dissect-hint/>**
86 </template>
87 </if>
88 <else>
89 No dissection hint was given, so the parts are derived from the
90 plan alone. Do not output anything.
91 </else>
92
932. **Determine Operation:**
94
95 1. Determine the current task plan content:
96
97 <expand name="task-load-content"></expand>
98
99 2. If the <task-content/> is still empty, complain and tell
100 the user to use the `ase-code-resolve`, `ase-code-refactor`,
101 `ase-code-craft`, or `ase-task-edit` skills first to create a
102 task plan. Then immediately stop processing this skill.
103
1043. **Dissect Task Plan:**
105
106 1. *Derive the parts* of the epic:
107
108 <expand
109 name="dissect-derive"
110 arg1="ase-task-dissect"
111 arg2="<dissect-hint/>"
112 arg3="<ase-task-id/>"
113 >
114 the individual bullet points of the `## CHANGES` and
115 `## VERIFICATION` sections of the loaded plan <task-content/>
116 </expand>
117
118 Each `## VERIFICATION` bullet point *MUST* land in the very part
119 which carries the `## CHANGES` bullet points it verifies.
120
121 A *single* bullet point is *not* the smallest unit here: a bullet
122 point which itself covers *multiple* domains or concerns *MAY* be
123 *split* per rule 3 into two or more *bullet point fragments*,
124 each of which is a complete bullet point of its own, is formed
125 *exclusively* from the wording of the original bullet point, and
126 is then assigned to a part like an ordinary bullet point. A split
127 `## VERIFICATION` bullet point follows the `## CHANGES` bullet
128 points its fragments verify, so its fragments *MAY* land in
129 *different* parts.
130
131 2. *Report the parts*:
132
133 <expand name="dissect-report" arg1="<ase-task-id/>"></expand>
134
1354. **Materialize Sub-Task Plans:**
136
137 You *MUST* *NOT* modify, re-save, or delete the epic plan
138 <task-content/> of <ase-task-id/> itself -- it always stays
139 *untouched*.
140
141 1. <if condition="<getopt-option-dry/> is equal `true`">
142 The dissection is *reported only*, so no artifacts are created at
143 all. Only output the following <template/> and then *SKIP* the
144 remaining sub-steps 4.2 to 4.4 and continue with step 5:
145
146 <template>
147 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ dissection: **<n/>** parts, ▶ status: **dry-run -- no sub-task plans created**
148 </template>
149 </if>
150
151 2. *Detect target collisions*, strictly *before* writing anything:
152
153 Call the `ase_task_list(verbose: false)` tool of the `ase` MCP
154 server and set <existing/> to the `id` fields of the returned
155 `tasks` array. Do not output anything related to this MCP tool
156 call. Set <collisions/> to all <part-id/> of <parts/> which are
157 already present in <existing/>.
158
159 <if condition="<collisions/> is not empty AND <getopt-option-force/> is not equal `true`">
160 Only output the following <template/> -- with <collisions/>
161 rendered as a comma-separated list of code spans -- and then
162 immediately *STOP* processing the entire current skill, leaving
163 *all* existing task plans untouched:
164
165 <template>
166 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ⊘ collisions: <collisions/>
167 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ dissection: **<n/>** parts, ▶ status: **targets exist**
168 </template>
169
170 Directly *after* this <template/>, and *before* stopping, give
171 the corrective hint by expanding the following (which, depending
172 on the configured <ase-guidance-level/>, may expand into nothing
173 and hence emit no output at all):
174
175 <ase-tpl-hint level="minimal">
176 Re-run `/ase-task-dissect --force` to overwrite the colliding sub-task plans.
177 </ase-tpl-hint>
178 </if>
179
180 <if condition="<collisions/> is not empty AND <getopt-option-force/> is equal `true`">
181 The colliding sub-task plans are *overwritten* in sub-step 4.3
182 below. Do not output anything.
183 </if>
184
185 3. *Compose and persist one sub-task plan per part*:
186
187 Call the `ase_timestamp(format: "yyyy-LL-dd HH:mm")` tool of the
188 `ase` MCP server *once* and use the `text` field of its response
189 for both the <timestamp-created/> and <timestamp-modified/>
190 information of *all* parts.
191
192 Then, for *every* part in <parts/>, in their derived order:
193
194 1. Compose a *complete* task plan <part-content/> by closely
195 following the plan <format/>, where:
196
197 - the <task-id/> is <part-id/>,
198 - the <title/> is derived from the part's <scope/>,
199 - the `## CONTEXT` section carries a part-local
200 <summary-what/> and <summary-why/>, derived from the
201 part's own input elements plus the `## CONTEXT` section
202 of the epic,
203 - the `## CHANGES` section carries *exactly* the
204 `## CHANGES` bullet points assigned to this part,
205 keeping their original wording, and
206 - the `## VERIFICATION` section carries *exactly* the
207 `## VERIFICATION` bullet points assigned to this part,
208 keeping their original wording.
209
210 For a bullet point which was *split* into fragments, the part
211 carries *only* its own fragment: the <specification/> keeps
212 the *original* wording of the portion this fragment covers,
213 with *no* re-interpretation and *no* added scope, and the
214 `**<aspect/>**` label is *narrowed* to exactly that portion.
215 Across all parts, the fragments of a split bullet point
216 *MUST* still reproduce the original bullet point *completely*
217 and *without* duplication.
218
219 The loaded <task-content/> is the *rendering-prepared*
220 variant of the epic, so it carries artifacts which *MUST NOT*
221 leak into the persisted <part-content/>. While copying, you
222 *MUST* *normalize* every taken-over bullet point back into
223 the authoring form of the plan <format/>:
224
225 - *Restore the bullet markers*: a bullet point rendered as
226 `◯ ` is written back as `- ` -- <part-content/>
227 *MUST NOT* contain a single `◯` marker.
228
229 - *Re-join split code spans*: an inline code span which the
230 rendering split across two physical lines into two spans
231 (`` `<head/>` `` at a line end and `` `<tail/>` `` at the
232 next line start) is written back as the *one* original
233 span `` `<head/> <tail/>` ``, and the line is then broken
234 *before* its opening backtick, per the line-breaking
235 rules of the plan <format/>.
236
237 <if condition="<task-content/> does NOT contain a `## VERIFICATION` section heading">
238 The epic itself deliberately *omits* the `## VERIFICATION`
239 section, so you *MUST* omit this section (including its
240 heading) from <part-content/>, too.
241 </if>
242 <elseif condition="no `## VERIFICATION` bullet point was assigned to this part">
243 This part carries *no* verification of its own, so you *MUST*
244 omit the `## VERIFICATION` section (including its heading)
245 from <part-content/>, too -- an *empty* section would violate
246 the plan <format/>, and rule 5 forbids inventing a bullet
247 point.
248 </elseif>
249
250 2. Call the `ase_task_save(id: "<part-id/>", text:
251 "<part-content/>")` tool of the `ase` MCP server to persist
252 the sub-task plan, and calculate the number of words
253 <part-words/> of <part-content/>. Do not output anything
254 related to this MCP tool call except the following
255 <template/>:
256
257 <template>
258 ⧉ **ASE**: ◉ task: **<part-id/>**, ✪ plan: **<part-words/>** words, ▶ status: **sub-task plan created**
259 </template>
260
261 4. *Report the overall result* with the following <template/>:
262
263 <template>
264 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ dissection: **<n/>** parts, ▶ status: **epic dissected**
265 </template>
266
2675. **Give Final Hints:**
268
269 Finally, give the closing hints by expanding the following (which,
270 depending on the configured <ase-guidance-level/>, may each expand
271 into nothing and hence emit no output at all):
272
273 <if condition="<getopt-option-dry/> is not equal `true`">
274 <ase-tpl-hint level="minimal">
275 Use `/ase-task-id <id>` to switch to one of the created sub-task plans and `/ase-task-implement` to implement it.
276 </ase-tpl-hint>
277 </if>
278 <else>
279 <ase-tpl-hint level="minimal">
280 Re-run `/ase-task-dissect` without `--dry` to actually create the reported sub-task plans, optionally with a `<dissect-hint>` argument if the reported split is not the intended one.
281 </ase-tpl-hint>
282 </else>
283
284 <ase-tpl-hint level="normal">
285 Use `/ase-task-list` to see the epic plan and all of its sub-task plans side by side.
286 </ase-tpl-hint>
287
288 <ase-tpl-hint level="verbose">
289 Use `/ase-task-dissect --max-parts <count>` to bound the number of parts, `/ase-task-dissect --force` to overwrite already existing sub-task plans, and `/ase-task-dissect <task-id>: <dissect-hint>` to address another task and steer its split.
290 </ase-tpl-hint>