1---2name: ase-task-condense3description: Condense the current or given task plan by compressing its wording. Use when the user calls to "condense", "compress", "shrink" or "shorten" 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-condense">
12Condense a Task Plan
13</skill>
14
15<expand name="getopt"
16 arg1="ase-task-condense"
17 arg2="--next|-n=(none|DONE|EDIT|IMPLEMENT|PREFLIGHT)...">
18 $ARGUMENTS
19</expand>
20
21<objective>
22*Condense* the task plan by removing fluff while preserving all
23semantics exactly.
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-condense**, ▶ 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 Set <words-before><words/></words-before> (remember the loaded
81 word count for the strictly-smaller check in step 3).
82
83 <if condition="<content/> contains '⎈ Created: <text/>'">
84 Set <timestamp-created><text/></timestamp-created> (extract the
85 original creation timestamp so it can be re-inserted unchanged
86 into the condensed <content/> in step 3).
87 </if>
88
89 Only output the following <template/>:
90
91 <template>
92 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan loaded**
93 </template>
94
95 2. <if condition="<content/> is empty">
96 Complain and tell the user to use the `ase-code-resolve`,
97 `ase-code-refactor`, `ase-code-craft`, or `ase-task-edit` skills
98 first to create a task plan. Then immediately stop processing
99 this skill.
100 </if>
101
1023. **Condense Task Plan:**
103
104 1. *Apply the condense ruleset* to <content/>, producing a shorter
105 <content/>. The goal is to make the plan require as *little
106 reading* as possible while all semantics remain *fully preserved
107 and unchanged*. Honor the following ruleset *strictly*:
108
109 1. *Preserve-exactly (never alter)*: the plan <format/>
110 structure (the headings `#`/`##`, all three `## CONTEXT`,
111 `## CHANGES`, and `## VERIFICATION` sections, the
112 `Created:`/`Modified:` lines, and
113 the `- **<aspect/>**:` bullet labels), all *code spans* and
114 code blocks, technical terms, file paths, identifiers,
115 numbers, severities (`LOW`/`MEDIUM`/`HIGH`/`ACCEPTED`), and
116 the `*<aspect/>*` emphasis highlighting convention.
117
118 2. *Compress free-text only* (the `**WHAT**`/`**WHY**` prose and
119 each bullet's `<specification/>` text):
120 - *Drop* filler ("just", "really", "basically", "simply"),
121 pleasantries, and hedging ("I think", "maybe", "perhaps").
122 - *Use* shorter synonyms and common abbreviations.
123 - *Use* `→` for causality and `-` for short subsequent facts.
124 - *Drop* articles ("a", "an", "the") and *replace*
125 conjunctions with short separate clauses where this
126 shortens the text without introducing ambiguity.
127 - *Re-wrap* the shortened free-text to the ~120-character-
128 per-line convention.
129 - *Merge* genuinely-redundant bullets (the same aspect
130 restated) and *drop* pure duplication - but *only* when
131 truly redundant; *never* lose a distinct aspect.
132
133 3. *Persona override*: this condense ruleset *always wins* for
134 the plan content. This ruleset-based compression is applied
135 *regardless* of the currently active session persona style.
136
137 4. *Hard guardrail - semantics preserved EXACTLY*: condensing
138 *only* shortens wording. It *MUST NOT* drop, merge (except
139 truly-redundant bullets per sub-item 2), reorder, or alter
140 *any* factual claim, requirement, file path, rule, or
141 example. If a shortening would change meaning, *keep the
142 longer wording*.
143
144 2. *Persist only if smaller*: calculate the number of words <words/>
145 of the condensed <content/>.
146
147 - <if condition="<words/> is strictly smaller than <words-before/>">
148 Update <timestamp-modified/> with the current time in
149 ISO-style format, which has to be determined by calling
150 the `ase_timestamp(format: "yyyy-LL-dd HH:mm")` tool
151 of the `ase` MCP server and use the `text` field of
152 its response. Keep the original <timestamp-created/>,
153 re-insert the current <ase-task-id/> and the refreshed
154 <timestamp-modified/> into <content/>.
155
156 Call the `ase_task_save(id: "<ase-task-id/>", text:
157 "<content/>")` tool of the `ase` MCP server to save the
158 condensed task plan content. Do not output anything related
159 to this MCP call except the following <template/>:
160
161 <template>
162 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan condensed**
163 </template>
164 </if>
165
166 - <if condition="<words/> is NOT strictly smaller than <words-before/>">
167 Do *not* save and do *not* bump the timestamp. Only output
168 the following <template/>:
169
170 <template>
171 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan already condensed**
172 </template>
173 </if>
174
1754. **Decide Next Step:**
176
177 1. *Determine next step*:
178
179 - If <getopt-option-next/> is not equal to `none`:
180 Treat <getopt-option-next/> as a comma-separated chronological
181 list of pre-selected next-step tokens. *Split* it on `,`,
182 take the *first* token as <head/>, and store the remaining
183 tokens (joined back with `,`, or `none` if empty) into
184 <getopt-option-next/> so downstream skills can consume the tail.
185
186 - If <head/> matches the regex `^(DONE|EDIT|IMPLEMENT|PREFLIGHT)$`:
187 Honor the pre-selected token.
188 Set <result><head/></result>.
189
190 - else:
191 Only output the following <template/> and then immediately
192 *STOP* processing the entire current skill:
193
194 <template>
195 ⧉ **ASE**: ☻ skill: **ase-task-condense**, ▶ ERROR: invalid `--next` token: **<head/>**
196 </template>
197
198 - If <getopt-option-next/> is equal to `none`:
199
200 In the following, you *MUST* *NOT* use your built-in
201 <user-dialog-tool/> tool! Instead, you *MUST* just show a
202 custom dialog according to the expanded `custom-dialog`
203 definition. You *MUST* closely follow this definition:
204
205 <expand name="custom-dialog" arg1="--no-other">
206 Next Step: How would you like to proceed with the plan?
207 DONE: Stop processing.
208 EDIT: Hand off plan to editing.
209 IMPLEMENT: Hand off plan to implementation.
210 PREFLIGHT: Hand off plan to pre-flighting.
211 </expand>
212
213 2. Check the tool <result/> and dispatch accordingly:
214
215 - If <result/> is `DONE` or `CANCEL`:
216 Only output the following <template/> and then *STOP*.
217
218 <template>
219 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan condensed -- done**
220 </template>
221
222 - If <result/> is `EDIT`:
223 Set <args></args> (set args to empty).
224 <if condition="the condensed plan was saved via `ase_task_save` in step 3">
225 Set <args>--int-reuse-task</args>.
226 </if>
227 <if condition="<getopt-option-next/> is not equal `none`">
228 Set <args><args/> --next <getopt-option-next/></args>
229 </if>
230 Only output the following <template/> and then call the
231 tool `Skill(skill: "ase:ase-task-edit", args: "<args/>")`
232 to invoke the `ase:ase-task-edit` skill in order to *edit*
233 the condensed plan. Immediately stop processing the current
234 skill once the `Skill` tool was used.
235
236 <template>
237 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan condensed -- hand-off to edit**
238 </template>
239
240 - If <result/> is `IMPLEMENT`:
241 Set <args></args> (set args to empty).
242 <if condition="the condensed plan was saved via `ase_task_save` in step 3">
243 Set <args>--int-reuse-task</args>.
244 </if>
245 <if condition="<getopt-option-next/> is not equal `none`">
246 Set <args><args/> --next <getopt-option-next/></args>
247 </if>
248 Only output the following <template/> and then call the
249 `Skill(skill: "ase:ase-task-implement", args: "<args/>")` tool
250 to *apply* the plan.
251
252 <template>
253 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan condensed -- hand-off to implementation**
254 </template>
255
256 - If <result/> is `PREFLIGHT`:
257 Set <args></args> (set args to empty).
258 <if condition="the condensed plan was saved via `ase_task_save` in step 3">
259 Set <args>--int-reuse-task</args>.
260 </if>
261 <if condition="<getopt-option-next/> is not equal `none`">
262 Set <args><args/> --next <getopt-option-next/></args>
263 </if>
264 Only output the following <template/> and then call the
265 `Skill(skill: "ase:ase-task-preflight", args: "<args/>")` tool
266 to *apply* the plan.
267
268 <template>
269 ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan condensed -- hand-off to pre-flight**
270 </template>