@rse/ase 0.9.65 → 0.9.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dst/ase-hook.js +1 -1
  2. package/dst/ase-metric.js +103 -0
  3. package/dst/ase-mint.js +106 -0
  4. package/dst/ase-service.js +4 -0
  5. package/dst/ase-setup.js +1 -1
  6. package/dst/ase-spec.js +104 -40
  7. package/dst/ase-statusline.js +11 -2
  8. package/dst/ase.js +4 -0
  9. package/package.json +13 -12
  10. package/plugin/.claude-plugin/plugin.json +1 -1
  11. package/plugin/.codex-plugin/plugin.json +1 -1
  12. package/plugin/.github/plugin/plugin.json +1 -1
  13. package/plugin/agents/ase-docs-proofread.md +13 -7
  14. package/plugin/agents/ase-docs-refine.md +165 -0
  15. package/plugin/agents/ase-docs-shorten.md +182 -0
  16. package/plugin/package.json +4 -4
  17. package/plugin/skills/ase-arch-analyze/help.md +1 -1
  18. package/plugin/skills/ase-arch-discover/help.md +4 -4
  19. package/plugin/skills/ase-code-analyze/help.md +1 -1
  20. package/plugin/skills/ase-code-craft/help.md +7 -7
  21. package/plugin/skills/ase-code-dissect/help.md +5 -5
  22. package/plugin/skills/ase-code-edit/help.md +7 -7
  23. package/plugin/skills/ase-code-explain/help.md +1 -1
  24. package/plugin/skills/ase-code-insight/help.md +1 -1
  25. package/plugin/skills/ase-code-lint/help.md +5 -5
  26. package/plugin/skills/ase-code-refactor/help.md +6 -6
  27. package/plugin/skills/ase-code-resolve/help.md +6 -6
  28. package/plugin/skills/ase-docs-distill/help.md +2 -2
  29. package/plugin/skills/ase-docs-proofread/SKILL.md +16 -12
  30. package/plugin/skills/ase-docs-proofread/help.md +18 -8
  31. package/plugin/skills/ase-docs-refine/SKILL.md +396 -0
  32. package/plugin/skills/ase-docs-refine/help.md +104 -0
  33. package/plugin/skills/ase-docs-shorten/SKILL.md +527 -0
  34. package/plugin/skills/ase-docs-shorten/help.md +120 -0
  35. package/plugin/skills/ase-help-intent/help.md +1 -1
  36. package/plugin/skills/ase-help-skill/catalog.md +4 -1
  37. package/plugin/skills/ase-help-skill/help.md +1 -1
  38. package/plugin/skills/ase-meta-brainstorm/help.md +5 -5
  39. package/plugin/skills/ase-meta-chat/help.md +2 -2
  40. package/plugin/skills/ase-meta-config/help.md +3 -3
  41. package/plugin/skills/ase-meta-diaboli/help.md +2 -2
  42. package/plugin/skills/ase-meta-diff/help.md +3 -3
  43. package/plugin/skills/ase-meta-eli5/help.md +2 -2
  44. package/plugin/skills/ase-meta-evaluate/help.md +1 -1
  45. package/plugin/skills/ase-meta-mint/SKILL.md +157 -0
  46. package/plugin/skills/ase-meta-mint/help.md +114 -0
  47. package/plugin/skills/ase-meta-proximity/help.md +3 -3
  48. package/plugin/skills/ase-meta-quorum/help.md +2 -2
  49. package/plugin/skills/ase-meta-quotes/help.md +4 -4
  50. package/plugin/skills/ase-meta-review/help.md +1 -1
  51. package/plugin/skills/ase-meta-search/help.md +2 -2
  52. package/plugin/skills/ase-meta-steelman/help.md +3 -3
  53. package/plugin/skills/ase-meta-why/help.md +3 -3
  54. package/plugin/skills/ase-meta-workflow/SKILL.md +3 -2
  55. package/plugin/skills/ase-meta-workflow/help.md +4 -4
  56. package/plugin/skills/ase-meta-workflow/workflow.txt +8 -2
  57. package/plugin/skills/ase-spec-edit/SKILL.md +1 -1
  58. package/plugin/skills/ase-spec-edit/help.md +6 -6
  59. package/plugin/skills/ase-sync-export/SKILL.md +3 -1
  60. package/plugin/skills/ase-sync-export/help.md +1 -1
  61. package/plugin/skills/ase-sync-import/SKILL.md +1 -1
  62. package/plugin/skills/ase-sync-import/help.md +2 -2
  63. package/plugin/skills/ase-sync-reconcile/SKILL.md +1 -1
  64. package/plugin/skills/ase-sync-reconcile/help.md +4 -4
  65. package/plugin/skills/ase-task-condense/SKILL.md +7 -4
  66. package/plugin/skills/ase-task-condense/help.md +2 -2
  67. package/plugin/skills/ase-task-delete/help.md +1 -1
  68. package/plugin/skills/ase-task-dissect/help.md +5 -5
  69. package/plugin/skills/ase-task-edit/help.md +4 -4
  70. package/plugin/skills/ase-task-grill/help.md +3 -3
  71. package/plugin/skills/ase-task-id/help.md +1 -1
  72. package/plugin/skills/ase-task-implement/help.md +3 -3
  73. package/plugin/skills/ase-task-list/help.md +3 -3
  74. package/plugin/skills/ase-task-preflight/help.md +2 -2
  75. package/plugin/skills/ase-task-reboot/help.md +2 -2
  76. package/plugin/skills/ase-task-rename/help.md +1 -1
  77. package/plugin/skills/ase-task-view/help.md +2 -2
@@ -0,0 +1,104 @@
1
+
2
+ ## NAME
3
+
4
+ `ase-docs-refine` - Refine Document Wording
5
+
6
+ ## SYNOPSIS
7
+
8
+ `ase-docs-refine`
9
+ [`--help`|`-h`]
10
+ [`--auto`|`-a`]
11
+ *docs-reference*
12
+
13
+ ## DESCRIPTION
14
+
15
+ The `ase-docs-refine` skill performs a *light rewriting* of awkward or
16
+ unclear sentences in the referenced documents, *without reshaping the
17
+ argument*: restructuring sentences for rhythm and clarity, making
18
+ enumerations parallel, cutting filler and redundancy, fixing awkward
19
+ transitions, and adjusting voice. *Content, numbers, and technical
20
+ terms stay exactly as they are.* The investigation is dispatched to a
21
+ sub-agent (`ase:ase-docs-refine`) so that scanning details do not leak
22
+ into the user-visible transcript.
23
+
24
+ The checked refinement types are:
25
+
26
+ 1. *Structure*: overlong, convoluted, or awkwardly built sentences,
27
+ split or restructured for rhythm and clarity.
28
+
29
+ 2. *Nominalization*: cumbersome nominal constructions, replaced with
30
+ plain verbs.
31
+
32
+ 3. *Parallelism*: non-parallel enumerations, brought into one
33
+ grammatical shape - a list whose items mix noun phrases,
34
+ imperatives, and full sentences, a heading set mixing gerunds and
35
+ nouns, or an inline series whose members do not share their form.
36
+
37
+ 4. *Filler*: filler words, empty intensifiers, and redundant
38
+ restatements, struck.
39
+
40
+ 5. *Transition*: abrupt or misleading transitions between sentences or
41
+ paragraphs, smoothed. An existing transition is only smoothed or
42
+ removed - a connective is *never* inserted where the original
43
+ asserted no such relation, as that would add a logical claim.
44
+
45
+ 6. *Voice*: needless passive voice turned active, needless hedging
46
+ struck, and shifts in grammatical person or mood aligned with the
47
+ rest of the document.
48
+
49
+ The rewriting always stays *within* a sentence. Dropping a whole
50
+ sentence, paragraph, example, or list item for the sake of brevity is
51
+ *length reduction*, not refinement, and belongs to
52
+ [`ase-docs-shorten`](../ase-docs-shorten/help.md). The recommended order
53
+ over one document is `ase-docs-shorten` first (cut the bulk), then
54
+ `ase-docs-refine` (polish what survives), then `ase-docs-proofread`
55
+ (final correctness pass), so no polishing effort is spent on text which
56
+ is later dropped.
57
+
58
+ For each detected problem, the skill renders a unified-diff
59
+ *REFINEMENT* preview and either asks the user to `ACCEPT` or `REJECT`
60
+ the proposed refinement interactively (or refine it via a free-text
61
+ hint, which re-proposes the refinement without limit) or - with
62
+ `--auto` - applies all refinements automatically. A proposal which
63
+ shifts the meaning even slightly - a lost negation, a changed
64
+ qualifier, a renamed technical term - is dropped instead of applied.
65
+
66
+ ## OPTIONS
67
+
68
+ - `--auto`|`-a`:
69
+ Automatically apply every proposed refinement without asking the
70
+ user via the interactive dialog.
71
+
72
+ ## ARGUMENTS
73
+
74
+ - *docs-reference*:
75
+ A file, directory, or other reference to the documents to
76
+ refine.
77
+
78
+ ## SCENARIOS
79
+
80
+ - You want long, convoluted sentences broken into readable ones
81
+ - You want nominal style like "perform a validation of" turned into verbs
82
+ - You want a bullet list of mixed noun phrases and sentences made parallel
83
+ - You want filler words and redundant restatements struck
84
+ - You want abrupt transitions between paragraphs smoothed
85
+ - You want needless passive voice or hedging adjusted
86
+ - You want the wording polished without touching facts or figures
87
+
88
+ ## EXAMPLES
89
+
90
+ Refine a single document interactively:
91
+
92
+ ```text
93
+ ❯ /ase-docs-refine README.md
94
+ ```
95
+
96
+ Refine an entire documentation directory automatically:
97
+
98
+ ```text
99
+ ❯ /ase-docs-refine --auto docs/
100
+ ```
101
+
102
+ ## SEE ALSO
103
+
104
+ [`ase-docs-shorten`](../ase-docs-shorten/help.md), [`ase-docs-proofread`](../ase-docs-proofread/help.md), [`ase-docs-distill`](../ase-docs-distill/help.md).
@@ -0,0 +1,527 @@
1
+ ---
2
+ name: ase-docs-shorten
3
+ argument-hint: "[--help|-h] [--auto|-a] (--chars|-c <N> | --words|-w <N>) <docs-reference>"
4
+ description: >
5
+ Shorten a document toward a target length, given as either `--chars <N>` or `--words <N>`: first
6
+ tighten the sentences, then drop low-value content, then compress the remaining content into
7
+ shorter expressions -- each stage entered only while the target is still not met. Use when the
8
+ user wants to "shorten", "cut down", or "reduce the length of" a document.
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ effort: high
12
+ ---
13
+
14
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
15
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
16
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md
17
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
18
+
19
+ <purpose name="ase-docs-shorten">
20
+ Shorten a Document to a Target Length
21
+ </purpose>
22
+
23
+ <expand name="getopt"
24
+ arg1="ase-docs-shorten"
25
+ arg2="--auto|-a --chars|-c=0 --words|-w=0">
26
+ $ARGUMENTS
27
+ </expand>
28
+
29
+ <objective>
30
+ *Shorten* the document of `<getopt-arguments/>` until it reaches the
31
+ requested *target length* by running three *stages* in order -- tighten
32
+ the sentences, drop low-value content, compress the remaining content
33
+ into shorter expressions -- and entering each stage *only* while the
34
+ target is still not met.
35
+ </objective>
36
+
37
+ Ground Rule
38
+ -----------
39
+
40
+ This skill *removes* text, so unlike `ase-docs-refine` it *MAY* lose
41
+ content. It still *MUST* *NOT* corrupt whatever survives: every fact,
42
+ number, technical term, qualifier, and negation which *survives* into
43
+ the shortened text stays *exactly* as it was, no content is invented,
44
+ the order of the surviving argument is kept, and fenced code blocks,
45
+ inline code spans, link targets, Markdown frontmatter, and the heading
46
+ structure are never touched.
47
+
48
+ The skill also *MUST* *NOT* shorten *beyond* the target: it stops at the
49
+ first change which reaches the target, so a document is never cut more
50
+ than the user asked for.
51
+
52
+ <flow>
53
+
54
+ 1. <step id="STEP 1: Resolve Target and Document">
55
+
56
+ 1. Determine the *target length* from the two mutually exclusive
57
+ options. Set <chars/> to <getopt-option-chars/> and <words/> to
58
+ <getopt-option-words/>, treating a *non-numeric* or *negative*
59
+ value as `0`. Then dispatch:
60
+
61
+ - <if condition="<chars/> is `0` and <words/> is `0`">
62
+
63
+ Only output the following <template/> and then *IMMEDIATELY*
64
+ *STOP* all further skill processing:
65
+
66
+ <template>
67
+ ⧉ **ASE**: ✪ skill: **ase-docs-shorten**, ▶ ERROR: a target length is required -- pass either `--chars <N>` or `--words <N>`
68
+ </template>
69
+
70
+ </if>
71
+
72
+ - <if condition="<chars/> is not `0` and <words/> is not `0`">
73
+
74
+ Only output the following <template/> and then *IMMEDIATELY*
75
+ *STOP* all further skill processing:
76
+
77
+ <template>
78
+ ⧉ **ASE**: ✪ skill: **ase-docs-shorten**, ▶ ERROR: `--chars` and `--words` are mutually exclusive -- pass only one of them
79
+ </template>
80
+
81
+ </if>
82
+
83
+ - <if condition="<chars/> is not `0`">
84
+ Set <unit>chars</unit> and <target><chars/></target>.
85
+ </if>
86
+ <else>
87
+ Set <unit>words</unit> and <target><words/></target>.
88
+ </else>
89
+
90
+ Do not output anything else in this substep.
91
+
92
+ 2. *Silently* resolve `<getopt-arguments/>` to the list
93
+ <documents/> of individual document files, expanding any
94
+ directory or wildcard reference with the `Glob` tool. Then
95
+ dispatch:
96
+
97
+ - <if condition="<documents/> is empty">
98
+
99
+ Only output the following <template/> and then *IMMEDIATELY*
100
+ *STOP* all further skill processing:
101
+
102
+ <template>
103
+ ⧉ **ASE**: ✪ skill: **ase-docs-shorten**, ▶ ERROR: no document to shorten
104
+ </template>
105
+
106
+ </if>
107
+
108
+ - <if condition="<documents/> carries more than one document">
109
+
110
+ A target length applies to *one* document, so a reference
111
+ which expands to several documents is *ambiguous*: it is
112
+ unclear whether the target bounds each document or their
113
+ sum. Set <count/> to the number of documents, then only
114
+ output the following <template/> and *IMMEDIATELY* *STOP*
115
+ all further skill processing:
116
+
117
+ <template>
118
+ ⧉ **ASE**: ✪ skill: **ase-docs-shorten**, ▶ ERROR: **<count/>** documents referenced -- a target length applies to exactly one document
119
+ </template>
120
+
121
+ </if>
122
+
123
+ Set <file/> to the single document of <documents/>.
124
+
125
+ 3. Do not output anything else in this STEP 1.
126
+
127
+ </step>
128
+
129
+ 2. <step id="STEP 2: Investigation">
130
+
131
+ <if condition="<ase-project-boxing/> is equal `black`">
132
+
133
+ The project source artifacts are classified as a *black box*, so
134
+ the user does *not* want them inspected or their problems surfaced.
135
+ *Skip* the entire investigation and reporting: do *not* invoke any
136
+ `Agent` tool and do *not* read any document, only output the
137
+ following <template/> and then *SKIP* the remaining steps STEP 3,
138
+ STEP 4, and STEP 5:
139
+
140
+ <template>
141
+ <ase-tpl-bullet-normal/> **SHORTEN**: *suppressed* (`project.boxing` is `black`)
142
+ </template>
143
+
144
+ </if>
145
+
146
+ First, use the following <template/> to give a hint on this step:
147
+
148
+ <template>
149
+ <ase-tpl-bullet-secondary/> **SHORTENING INVESTIGATION**: `<file/>` → **<target/>** <unit/>
150
+ </template>
151
+
152
+ Dispatch the investigation to a *sub-agent* via the `Agent` tool so
153
+ that *no* investigation details leak into the user-visible
154
+ transcript. The sub-agent performs the silent reading, measuring,
155
+ and shortening; only its final structured return value is consumed
156
+ here. As a target length applies to exactly *one* document, exactly
157
+ *one* sub-agent is invoked, which keeps the length budget coherent:
158
+
159
+ ```text
160
+ Agent(
161
+ description: "Shorten Investigation",
162
+ subagent_type: "ase:ase-docs-shorten",
163
+ prompt: "UNIT: <unit/>\nTARGET: <target/>\nFILE: <file/>",
164
+ run_in_background: false
165
+ )
166
+ ```
167
+
168
+ Parse the result message of the `Agent` tool invocation as a JSON
169
+ object. Set <length-before/> to its `length_before` field,
170
+ <length-projected/> to its `length_projected` field, and <blocks/>
171
+ to its `blocks` array, ordered by ascending `line`.
172
+
173
+ You *MUST* *NOT* output anything at all in this STEP 2 beyond the
174
+ above hint template and the `Agent` tool invocation.
175
+ </step>
176
+
177
+ 3. <step id="STEP 3: Summary">
178
+
179
+ <if condition="<blocks/> is empty">
180
+
181
+ The document already meets the target, so nothing is shortened.
182
+ Only output the following <template/> and then *SKIP* the remaining
183
+ steps STEP 4 and STEP 5:
184
+
185
+ <template>
186
+ <ase-tpl-bullet-normal/> **ALREADY SHORT ENOUGH**: **<length-before/>** <unit/> ≤ **<target/>** <unit/>
187
+ </template>
188
+
189
+ </if>
190
+
191
+ Use the following <template/> to give a summary of the proposed
192
+ shortenings in <blocks/>:
193
+
194
+ <template>
195
+ <ase-tpl-bullet-secondary/> **SHORTENING SUMMARY**:
196
+
197
+ | *Shortening Stage* | *Shortening Result* |
198
+ | ------------------ | ------------------------ |
199
+ | **TIGHTEN**: | **<t/>** blocks proposed |
200
+ | **DROP**: | **<d/>** blocks proposed |
201
+ | **COMPRESS**: | **<c/>** blocks proposed |
202
+
203
+ </template>
204
+
205
+ Hints:
206
+
207
+ - <t/> is the number of blocks with `stage` equal to `TIGHTEN` in <blocks/>
208
+ - <d/> is the number of blocks with `stage` equal to `DROP` in <blocks/>
209
+ - <c/> is the number of blocks with `stage` equal to `COMPRESS` in <blocks/>
210
+
211
+ </step>
212
+
213
+ 4. <step id="STEP 4: Shortening">
214
+
215
+ 1. *Mark this skill as the active edit-capable skill* so that the
216
+ ASE `pre-tool-use` hook auto-approves the subsequent `Edit`
217
+ invocations on *any* invocation path (slash command *or* `Skill`
218
+ tool). Call the `ase_config_set(key: "agent.skill", val:
219
+ "ase-docs-shorten", scope: "session:<ase-session-id/>")` tool
220
+ from the `ase` MCP server. Do not output anything in this substep.
221
+
222
+ *Critical safety invariant*: the marker set here grants `Edit`
223
+ auto-approval and *MUST* be cleared again (substep 3 below)
224
+ *before* this skill yields control, *regardless* of how the
225
+ iteration in substep 2 ends - whether it completes normally,
226
+ is aborted early (e.g. an `Edit` failure, an unparseable value,
227
+ or any other unexpected condition), or is otherwise interrupted.
228
+ If you ever stop or bail out of substep 2 early, you *MUST*
229
+ still perform substep 3 first. Never leave this marker active
230
+ for a later, unrelated `Edit`.
231
+
232
+ 2. Set <total/> to the number of blocks in <blocks/> and <index/>
233
+ to `0`. Then iterate over all blocks:
234
+
235
+ <for items="<blocks/>">
236
+
237
+ 1. Increment <index/> by one (the 1-based position of the
238
+ current <item/> within <blocks/>).
239
+ Set <stage/> to the `stage` field of <item/>.
240
+ Set <line/> to the `line` field of <item/>.
241
+ Set <description/> to the `description` field of <item/>.
242
+ Set <old-text/> to the `old_text` field of <item/>.
243
+ Set <new-text/> to the `new_text` field of <item/>.
244
+ Set <block-before/> to the `length_before` field of <item/>.
245
+ Set <block-after/> to the `length_after` field of <item/>.
246
+
247
+ Then *verify the Ground Rule* for this <item/>: compare
248
+ <new-text/> against <old-text/> and *drop* the <item/>
249
+ entirely -- continuing with the next <item/> without any
250
+ output -- whenever a fact, number, technical term,
251
+ qualifier, or negation which *survives* into <new-text/> was
252
+ altered, whenever <new-text/> states something <old-text/>
253
+ did not, or whenever a fenced code block, an inline code
254
+ span, a link target, or a heading was touched.
255
+
256
+ Then set <block-delta/> to (<block-before/> -
257
+ <block-after/>) and <block-percent/> to that difference
258
+ expressed as a *rounded* percentage of <block-before/>, so
259
+ the reviewer sees what the block actually saves.
260
+
261
+ Then set <context-before/> and <context-after/> to empty and
262
+ *normalize* the change to its *minimal* form, so that the
263
+ proposed diff shows exactly the lines the later `Edit` will
264
+ actually change: while the *first* line of <old-text/> is
265
+ identical to the *first* line of <new-text/>, *move* that
266
+ line from both to the end of <context-before/> and increment
267
+ <line/> by one; likewise, while the *last* line of
268
+ <old-text/> is identical to the *last* line of <new-text/>,
269
+ *move* that line from both to the front of <context-after/>.
270
+ Finally, *trim* <context-before/> to its *last* two lines and
271
+ <context-after/> to its *first* two lines.
272
+
273
+ Then, unless <ase-project-boxing/> is equal `grey` (where
274
+ the full unified diff is suppressed and no context lines are
275
+ rendered at all), *silently* read the current content of
276
+ <file/> with the `Read` tool - reusing the content read
277
+ earlier in this iteration, unless an `Edit` was applied in
278
+ between - and set <file-lines/> to its lines, *stripped* of
279
+ the line-number prefixes the tool adds. Set <file-lines/> to
280
+ empty if the file cannot be read.
281
+
282
+ Whenever <file-lines/> is non-empty, *re-derive* both
283
+ context parts from it, so the rendered diff shows real
284
+ context: set <context-before/> to the *up to two* lines of
285
+ <file-lines/> directly *before* line <line/> (empty if
286
+ <line/> is `1`) and <context-after/> to the *up to two*
287
+ lines of <file-lines/> starting at line (<line/> + <n/>),
288
+ where <n/> is the number of lines in <old-text/> (empty if
289
+ that line is beyond the end of the document).
290
+
291
+ 2. Report the proposed block with the following <template/>:
292
+
293
+ <template>
294
+ <ase-tpl-bullet-signal/> [<index/>/<total/>]: **<stage/> BLOCK**: `<file/>`:<line/>:
295
+
296
+ <description/>
297
+ </template>
298
+
299
+ 3. <if condition="<getopt-option-auto/> is not equal `true` and <ase-project-boxing/> is equal `grey`">
300
+
301
+ The project source artifacts are classified as a *grey box*,
302
+ so the user does *not* want the full artifact internals
303
+ surfaced: *suppress* the full unified diff and instead show
304
+ only a *condensed* two-line hunk. Unlike a proofreading
305
+ correction or a refinement, a shortening block spans whole
306
+ paragraphs, so both sides *MUST* be *normalized* and
307
+ *elided* onto *one* line each -- an unelided side-by-side
308
+ collapse exceeds the terminal width and wraps into an
309
+ unreadable run.
310
+
311
+ Determine <old-snippet/> from <old-text/> by replacing every
312
+ run of whitespace (line breaks included) with a *single*
313
+ space and trimming the result, then -- only if it is longer
314
+ than `100` characters -- keeping just its *first* `60` and
315
+ *last* `30` characters, joined by ` […] `. Determine
316
+ <new-snippet/> the same way from <new-text/>, or set it to
317
+ `∅` when <new-text/> is empty for a pure removal. Then
318
+ report the shortening with the following <template/>,
319
+ emitting both snippet lines verbatim (no wrapping, no extra
320
+ blank lines):
321
+
322
+ <template>
323
+
324
+ <ase-tpl-bullet-normal/> **<stage/> SHORTENING** (**<block-before/>** → **<block-after/>** <unit/>, **-<block-percent/>%**):
325
+
326
+ ```diff
327
+ - <old-snippet/>
328
+ + <new-snippet/>
329
+ ```
330
+
331
+ </template>
332
+
333
+ </if>
334
+ <elseif condition="<getopt-option-auto/> is not equal `true`">
335
+
336
+ Determine the hunk *body* as an ordered list of lines, each
337
+ carrying a one-character prefix (` ` for context, `-` for
338
+ old-side, `+` for new-side). Build it by concatenating, in
339
+ order and *skipping any part that is empty*:
340
+
341
+ - one ` `-prefixed line for *each* line of <context-before/>
342
+ (if non-empty),
343
+ - one `-`-prefixed line for *each* line of <old-text/>
344
+ (if non-empty; split <old-text/> on newlines),
345
+ - one `+`-prefixed line for *each* line of <new-text/>
346
+ (if non-empty; split <new-text/> on newlines),
347
+ - one ` `-prefixed line for *each* line of <context-after/>
348
+ (if non-empty).
349
+
350
+ Set <hunk-body/> to those prefixed lines joined by newlines.
351
+
352
+ Set <old-count/> to the number of old-side hunk lines, i.e.,
353
+ the combined line count of <context-before/>, <old-text/>, and
354
+ <context-after/> (each empty part counts as `0`).
355
+ Set <new-count/> to the number of new-side hunk lines, i.e.,
356
+ the combined line count of <context-before/>, <new-text/>, and
357
+ <context-after/> (each empty part counts as `0`).
358
+
359
+ Set <old-start/> to the 1-based line number of the *first*
360
+ old-side hunk line: if <context-before/> is non-empty, that is
361
+ the line of its *first* context line, i.e., <line/> minus the
362
+ number of lines in <context-before/>; otherwise it is <line/> itself
363
+ (the first line of <old-text/>).
364
+ Set <new-start/> to the same value as <old-start/>, but clamped
365
+ to a minimum of `1` whenever <new-count/> is greater than `0`
366
+ (the shortened side then has a real first line).
367
+
368
+ Render the proposed shortening as a *unified diff* with *up to
369
+ two* lines of context in a fenced block based on the following
370
+ <template/>, emitting <hunk-body/> verbatim (one already-prefixed
371
+ line per line, with no extra blank or space-only lines):
372
+
373
+ <template>
374
+
375
+ <ase-tpl-bullet-normal/> **<stage/> SHORTENING** (**<block-before/>** → **<block-after/>** <unit/>, **-<block-percent/>%**):
376
+
377
+ ```diff
378
+ --- <file/> (original)
379
+ +++ <file/> (shortened)
380
+ @@ -<old-start/>,<old-count/> +<new-start/>,<new-count/> @@
381
+ <hunk-body/>
382
+ ```
383
+
384
+ </template>
385
+
386
+ </elseif>
387
+
388
+ 4. <if condition="<getopt-option-auto/> is not equal `true`">
389
+
390
+ In the following, you *MUST* *NOT* use your built-in
391
+ <user-dialog-tool/> tool! Instead, you *MUST* just show a
392
+ custom dialog according to the expanded `custom-dialog`
393
+ definition. You *MUST* closely follow this definition:
394
+
395
+ <expand name="custom-dialog" arg1="--other">
396
+ SHORTENING: How would you like to proceed with this proposed shortening?
397
+ ACCEPT: Apply this proposed shortening.
398
+ REJECT: Skip this proposed shortening.
399
+ </expand>
400
+
401
+ </if>
402
+
403
+ <else>
404
+
405
+ Set <result>ACCEPT</result>.
406
+
407
+ </else>
408
+
409
+ 5. Check <result/> and dispatch accordingly:
410
+
411
+ - <if condition="<result/> is 'ACCEPT'">
412
+
413
+ Invoke the `Edit` tool to apply the change by replacing
414
+ <old-text/> with <new-text/> at <file/>:<line/>. The operation
415
+ will be auto-approved by the ASE `pre-tool-use` hook (which
416
+ tracks the active skill), so *no* interactive permission
417
+ prompt will appear. Then continue with the next <item/>.
418
+
419
+ </if>
420
+
421
+ - <if condition="<result/> starts with 'OTHER'">
422
+
423
+ Generate a *new* proposal for the *same* <item/>,
424
+ incorporating the user's free-text hint from <result/>
425
+ after the "OTHER:" prefix. *Reassign* <description/>,
426
+ <old-text/>, <new-text/>, <block-before/>, and
427
+ <block-after/> to reflect this refined proposal
428
+ (<old-text/> stays anchored to the existing text at
429
+ <file/>:<line/>; <new-text/> and <description/> carry the
430
+ new shortening) so the subsequent rendering and any `Edit`
431
+ use the new proposal rather than the original. Then
432
+ *re-apply* the minimal-form normalization and the context
433
+ re-derivation of substep 1 to the refined <old-text/> and
434
+ <new-text/> (so the re-rendered diff again shows exactly
435
+ the changed lines) and *go
436
+ back* to substep 2 of this `for`-iteration. There is *no*
437
+ cap on refinement rounds - keep refining until the user
438
+ picks `ACCEPT` or `REJECT`.
439
+
440
+ </if>
441
+
442
+ - <if condition="
443
+ <result/> is 'REJECT' or
444
+ <result/> is 'CANCEL' or
445
+ <result/> starts with 'ERROR'
446
+ ">
447
+
448
+ Skip this <item/> without any `Edit` call and continue
449
+ with the next <item/>.
450
+
451
+ </if>
452
+
453
+ </for>
454
+
455
+ 3. *Clear the active edit-capable skill marker* now that all `Edit`
456
+ invocations are done, so a later unrelated `Edit` is *not*
457
+ auto-approved. Call the `ase_config_delete(key: "agent.skill",
458
+ scope: "session:<ase-session-id/>")` tool from the `ase` MCP
459
+ server. Do not output anything in this substep.
460
+
461
+ </step>
462
+
463
+ 5. <step id="STEP 5: Length Report">
464
+
465
+ 1. *Silently* call the `ase_text_metric(file: "<file/>")` tool of
466
+ the `ase` MCP server and set <length-after/> to the <unit/>
467
+ field of its result, so the report states the *measured,
468
+ achieved* length rather than the projected one -- rejected
469
+ blocks otherwise falsify the numbers. Then set
470
+ <reduction/> to (<length-before/> - <length-after/>) and
471
+ <percent/> to that reduction expressed as a *rounded*
472
+ percentage of <length-before/>. Do not output anything in this
473
+ substep.
474
+
475
+ 2. Report the achieved length with the following <template/>:
476
+
477
+ <template>
478
+ <ase-tpl-bullet-secondary/> **LENGTH REPORT**: `<file/>`
479
+
480
+ | *Length Metric* | *Length Value* |
481
+ | --------------- | ------------------------------------------ |
482
+ | **BEFORE**: | **<length-before/>** <unit/> |
483
+ | **AFTER**: | **<length-after/>** <unit/> |
484
+ | **TARGET**: | **<target/>** <unit/> |
485
+ | **REDUCTION**: | **<reduction/>** <unit/> (**<percent/>%**) |
486
+
487
+ </template>
488
+
489
+ 3. <if condition="<length-after/> is less than or equal to <target/>">
490
+
491
+ <template>
492
+ <ase-tpl-bullet-normal/> **TARGET MET**
493
+ </template>
494
+
495
+ </if>
496
+ <else>
497
+
498
+ Set <missed/> to (<length-after/> - <target/>).
499
+
500
+ <template>
501
+ <ase-tpl-bullet-signal/> **TARGET MISSED** by **<missed/>** <unit/> (rejected shortenings)
502
+ </template>
503
+
504
+ </else>
505
+
506
+ 4. You *MUST* *NOT* output any further additional explanations or
507
+ summaries at the end of this skill processing, except for the
508
+ following final <template/>:
509
+
510
+ <template>
511
+ <ase-tpl-bullet-secondary/> **SHORTEN FINISHED**
512
+ </template>
513
+
514
+ 5. Finally, give the closing hint by expanding the following
515
+ (which, depending on the configured <ase-guidance-level/>, may
516
+ expand into nothing and hence emit no output at all):
517
+
518
+ <if condition="<getopt-option-auto/> is not equal `true`">
519
+ <ase-tpl-hint level="verbose">
520
+ Use `/ase-docs-shorten --auto` to apply all shortenings unattended.
521
+ </ase-tpl-hint>
522
+ </if>
523
+
524
+ </step>
525
+
526
+ </flow>
527
+