@rse/ase 0.9.65 → 0.9.67

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 +133 -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,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
+
@@ -0,0 +1,120 @@
1
+
2
+ ## NAME
3
+
4
+ `ase-docs-shorten` - Shorten a Document to a Target Length
5
+
6
+ ## SYNOPSIS
7
+
8
+ `ase-docs-shorten`
9
+ [`--help`|`-h`]
10
+ [`--auto`|`-a`]
11
+ (`--chars`|`-c` *N* | `--words`|`-w` *N*)
12
+ *docs-reference*
13
+
14
+ ## DESCRIPTION
15
+
16
+ The `ase-docs-shorten` skill reduces the length of a *single* document
17
+ until it reaches a requested *target length*. The investigation is
18
+ dispatched to a sub-agent (`ase:ase-docs-shorten`) so that scanning
19
+ details do not leak into the user-visible transcript.
20
+
21
+ The target length is stated either as `--chars` *N* or as `--words` *N*.
22
+ The two options are *mutually exclusive*, exactly *one* of them is
23
+ *mandatory*, and neither carries a default, because the target length is
24
+ the very quantity the shortening optimizes for. A document reference
25
+ which expands to *more than one* document is rejected, as it would leave
26
+ open whether the target bounds each document or their sum.
27
+
28
+ The shortening runs as a *three-stage cascade*, and a stage is entered
29
+ *only* while the target is still not met:
30
+
31
+ 1. *Tighten*: shorten individual sentences without losing any content -
32
+ filler words struck, nominal constructions turned into verbs,
33
+ redundant restatements within a sentence cut.
34
+
35
+ 2. *Drop*: remove low-value content - redundant restatements,
36
+ illustrative examples, asides, parentheticals, and the whole
37
+ sentences or list items which carry the least value for the reader.
38
+ Content is genuinely lost in this stage.
39
+
40
+ 3. *Compress*: merge and rewrite the remaining content into shorter
41
+ expressions and sentences - related sentences fused, prose
42
+ enumerations turned into compact lists, multi-sentence passages
43
+ re-expressed as single sentences.
44
+
45
+ The skill never shortens *beyond* the target: it stops at the first
46
+ change which reaches it. What *survives* the shortening stays exact -
47
+ every surviving fact, number, technical term, qualifier, and negation is
48
+ preserved verbatim, nothing is invented, the order of the surviving
49
+ argument is kept, and fenced code blocks, inline code spans, link
50
+ targets, Markdown frontmatter, and the heading structure are never
51
+ touched.
52
+
53
+ Each proposed change is cut as a *whole block* - a paragraph, a list
54
+ item, a blockquote, or a heading with its following paragraph - because
55
+ a shortening is only judgeable in the context of the whole block it
56
+ rewrites. It is rendered as a *unified diff* with up to two lines of
57
+ context, annotated with the length it saves, exactly as in
58
+ [`ase-docs-refine`](../ase-docs-refine/help.md) and
59
+ [`ase-docs-proofread`](../ase-docs-proofread/help.md). The user
60
+ either accepts or rejects each block interactively (or refines it via a
61
+ free-text hint, which re-proposes the block without limit) or - with
62
+ `--auto` - applies all of them automatically. A closing *LENGTH REPORT*
63
+ states the achieved length against the target, so rejected blocks stay
64
+ visible in the outcome.
65
+
66
+ `ase-docs-shorten` is the length-reducing member of the document triple.
67
+ The recommended order over one document is `ase-docs-shorten` first (cut
68
+ the bulk), then [`ase-docs-refine`](../ase-docs-refine/help.md) (polish
69
+ what survives), then
70
+ [`ase-docs-proofread`](../ase-docs-proofread/help.md) (final correctness
71
+ pass), so no polishing effort is spent on text which is later dropped.
72
+
73
+ ## OPTIONS
74
+
75
+ - `--chars`|`-c` *N*:
76
+ Shorten the document to at most *N* characters, counted over the
77
+ entire document content including whitespace and newlines.
78
+ Mutually exclusive with `--words`.
79
+
80
+ - `--words`|`-w` *N*:
81
+ Shorten the document to at most *N* whitespace-separated words,
82
+ counted over the entire document content.
83
+ Mutually exclusive with `--chars`.
84
+
85
+ - `--auto`|`-a`:
86
+ Automatically apply every proposed shortening without asking the
87
+ user via the interactive dialog.
88
+
89
+ ## ARGUMENTS
90
+
91
+ - *docs-reference*:
92
+ A reference to the *single* document to shorten. A reference
93
+ expanding to more than one document is rejected.
94
+
95
+ ## SCENARIOS
96
+
97
+ - You want a README section cut down to a hard character budget
98
+ - You want an abstract brought under a word limit for a submission
99
+ - You want the least valuable examples and asides dropped first
100
+ - You want to see what a shortening costs before accepting it
101
+ - You want a whole document shortened unattended in one pass
102
+ - You want the achieved length reported against the target
103
+
104
+ ## EXAMPLES
105
+
106
+ Shorten a document to at most 4000 characters interactively:
107
+
108
+ ```text
109
+ ❯ /ase-docs-shorten --chars 4000 README.md
110
+ ```
111
+
112
+ Shorten a document to at most 250 words unattended:
113
+
114
+ ```text
115
+ ❯ /ase-docs-shorten --auto --words 250 docs/abstract.md
116
+ ```
117
+
118
+ ## SEE ALSO
119
+
120
+ [`ase-docs-refine`](../ase-docs-refine/help.md), [`ase-docs-proofread`](../ase-docs-proofread/help.md), [`ase-docs-distill`](../ase-docs-distill/help.md).
@@ -36,7 +36,7 @@ entirely through the intent argument and the interactive dialog.
36
36
 
37
37
  ## ARGUMENTS
38
38
 
39
- *intent*:
39
+ - *intent*:
40
40
  The free-text intent to be realized. It describes *what* the user
41
41
  wants to achieve; the skill determines *which* ASE skills and *which*
42
42
  options and arguments realize it.
@@ -37,8 +37,10 @@
37
37
  ○ `ase-sync-export`: Export Artifact Set to Side-by-Side Files
38
38
 
39
39
  ⎈ **DOCUMENTATION**
40
- ○ `ase-docs-distill`: Distill Document Key Points
40
+ ○ `ase-docs-shorten`: Shorten a Document to a Target Length
41
+ ○ `ase-docs-refine`: Refine Document Wording
41
42
  ○ `ase-docs-proofread`: Proofread Documents
43
+ ○ `ase-docs-distill`: Distill Document Key Points
42
44
 
43
45
  ⎈ **VERSION CONTROL**
44
46
  ○ `ase-meta-changelog`: Update ChangeLog Entries
@@ -63,6 +65,7 @@
63
65
 
64
66
  ⎈ **OTHER SKILLS**
65
67
  ○ `ase-meta-workflow`: Generate a Workflow Skill
68
+ ○ `ase-meta-mint`: Mint an Identifier or Name
66
69
  ○ `ase-meta-config`: Configuration Management
67
70
  ○ `ase-meta-compat`: Self-Test ASE Compatibility
68
71
 
@@ -41,7 +41,7 @@ The skill exposes *no* option flags beyond `--help`/`-h`.
41
41
 
42
42
  ## ARGUMENTS
43
43
 
44
- *skill-name*:
44
+ - *skill-name*:
45
45
  The full name of the ASE skill, any abbreviation of it, or a
46
46
  description of its purpose. If omitted, the entire skill catalog is
47
47
  listed.