@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
@@ -54,11 +54,11 @@ the code, and comments contradicting the code.
54
54
 
55
55
  ## OPTIONS
56
56
 
57
- `--auto`|`-a`:
57
+ - `--auto`|`-a`:
58
58
  Automatically apply every proposed correction without asking the
59
59
  user via the interactive dialog.
60
60
 
61
- `--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`):
61
+ - `--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`):
62
62
  Set the *severity floor* (default `LOW`): findings below the chosen
63
63
  threshold are silently suppressed, ordered `LOW` < `MEDIUM` <
64
64
  `HIGH`. The default `LOW` keeps all findings; `ACCEPTED` findings are
@@ -66,19 +66,19 @@ the code, and comments contradicting the code.
66
66
  severity* order `HIGH`, `MEDIUM`, `LOW`, `ACCEPTED`, keeping the
67
67
  `file`/`line` order within the same severity.
68
68
 
69
- `--include`|`-i`=*aspect*[`,`...]:
69
+ - `--include`|`-i`=*aspect*[`,`...]:
70
70
  Restrict the checked code quality aspects to the given
71
71
  comma-separated list of aspect ids (e.g. `A01,A04`). Without this
72
72
  option, all twenty-one aspects are checked.
73
73
 
74
- `--exclude`|`-e`=*aspect*[`,`...]:
74
+ - `--exclude`|`-e`=*aspect*[`,`...]:
75
75
  Remove the given comma-separated list of aspect ids from the checked
76
76
  code quality aspects. Applied *after* `--include`, so
77
77
  `-i A01,A02 -e A02` checks `A01` only.
78
78
 
79
79
  ## ARGUMENTS
80
80
 
81
- *source-reference*:
81
+ - *source-reference*:
82
82
  A file, directory, or other reference to the source code to lint.
83
83
 
84
84
  ## SCENARIOS
@@ -31,18 +31,18 @@ entirely and applies the change set to the affected artifacts itself.
31
31
 
32
32
  ## OPTIONS
33
33
 
34
- `--auto`|`-a`:
34
+ - `--auto`|`-a`:
35
35
  Automatically pick the recommended refactoring approach without
36
36
  asking the user via the interactive dialog.
37
37
 
38
- `--dry`|`-d`:
38
+ - `--dry`|`-d`:
39
39
  Compose the plan *without* the `## VERIFICATION` section. When
40
40
  `ase-task-implement` later applies such a plan, it strictly skips
41
41
  the entire verification phase (no build, tests, linter,
42
42
  type-checker, or program execution) once the source files have
43
43
  been modified.
44
44
 
45
- `--direct`|`-D`:
45
+ - `--direct`|`-D`:
46
46
  Apply the refactoring *immediately* and *in place*: skip the
47
47
  refactoring approaches, the interactive dialog, and the entire task
48
48
  plan ceremony, and directly apply the complete change set to the
@@ -51,14 +51,14 @@ entirely and applies the change set to the affected artifacts itself.
51
51
  `--next` have no effect, as neither approaches are proposed nor a
52
52
  plan is composed.
53
53
 
54
- `--quick`|`-Q`:
54
+ - `--quick`|`-Q`:
55
55
  Shorthand alias for `-a -d -n IMPLEMENT,DELETE`: automatically pick
56
56
  the recommended refactoring approach, compose the plan *without* the
57
57
  `## VERIFICATION` section, immediately hand off to `ase-task-implement`,
58
58
  and finally `ase-task-delete` the now-consumed plan. This gives a
59
59
  single, fast *one-shot* refactoring mode.
60
60
 
61
- `--next`|`-n` *option*[,...]:
61
+ - `--next`|`-n` *option*[,...]:
62
62
  Automatically choose the next step after composing the plan.
63
63
  *option* is a single token or a *comma-separated chronological
64
64
  list* of tokens; an `IMPLEMENT`, `PREFLIGHT`, or `GRILL` head token
@@ -77,7 +77,7 @@ entirely and applies the change set to the affected artifacts itself.
77
77
 
78
78
  ## ARGUMENTS
79
79
 
80
- [*task-id*:] *request*:
80
+ - [*task-id*:] *request*:
81
81
  Description of the refactoring *request*. Optionally prefixed
82
82
  with a *task-id* followed by a colon to bind the resulting plan
83
83
  to a specific task id.
@@ -36,18 +36,18 @@ entirely and applies the change set to the affected artifacts itself.
36
36
 
37
37
  ## OPTIONS
38
38
 
39
- `--auto`|`-a`:
39
+ - `--auto`|`-a`:
40
40
  Automatically pick the recommended resolution approach without
41
41
  asking the user via the interactive dialog.
42
42
 
43
- `--dry`|`-d`:
43
+ - `--dry`|`-d`:
44
44
  Compose the plan *without* the `## VERIFICATION` section. When
45
45
  `ase-task-implement` later applies such a plan, it strictly skips
46
46
  the entire verification phase (no build, tests, linter,
47
47
  type-checker, or program execution) once the source files have
48
48
  been modified.
49
49
 
50
- `--direct`|`-D`:
50
+ - `--direct`|`-D`:
51
51
  Resolve the problem *immediately* and *in place*: skip the
52
52
  resolution approaches, the interactive dialog, and the entire task
53
53
  plan ceremony, and directly apply the complete change set to the
@@ -56,14 +56,14 @@ entirely and applies the change set to the affected artifacts itself.
56
56
  `--next` have no effect, as neither approaches are proposed nor a
57
57
  plan is composed.
58
58
 
59
- `--quick`|`-Q`:
59
+ - `--quick`|`-Q`:
60
60
  Shorthand alias for `-a -d -n IMPLEMENT,DELETE`: automatically pick
61
61
  the recommended resolution approach, compose the plan *without* the
62
62
  `## VERIFICATION` section, immediately hand off to `ase-task-implement`,
63
63
  and finally `ase-task-delete` the now-consumed plan. This gives a
64
64
  single, fast *one-shot* resolution mode.
65
65
 
66
- `--next`|`-n` *option*[,...]:
66
+ - `--next`|`-n` *option*[,...]:
67
67
  Automatically choose the next step after composing the plan.
68
68
  *option* is a single token or a *comma-separated chronological
69
69
  list* of tokens; an `IMPLEMENT`, `PREFLIGHT`, or `GRILL` head token
@@ -82,7 +82,7 @@ entirely and applies the change set to the affected artifacts itself.
82
82
 
83
83
  ## ARGUMENTS
84
84
 
85
- [*task-id*:] *problem*:
85
+ - [*task-id*:] *problem*:
86
86
  Description of the *problem* to resolve, or a bare issue
87
87
  identifier like `P1` or `T1` previously produced by an analyzer
88
88
  skill. Optionally prefixed with a *task-id* followed by a colon
@@ -39,7 +39,7 @@ non-numeric value falls back to the default *5*.
39
39
 
40
40
  ## OPTIONS
41
41
 
42
- `--top`|`-t` *N*:
42
+ - `--top`|`-t` *N*:
43
43
  Bound the ranked list to at most *N* key points (default *5*). The
44
44
  bound is a *cap*, never a *quota* - fewer points are emitted when the
45
45
  document does not contain *N* salient ones, and an invalid or
@@ -47,7 +47,7 @@ non-numeric value falls back to the default *5*.
47
47
 
48
48
  ## ARGUMENTS
49
49
 
50
- *document-reference*:
50
+ - *document-reference*:
51
51
  The document to distill - either a *path* to a readable file or the
52
52
  *text* itself pasted inline. If it resolves to a readable file the
53
53
  file is read; otherwise it is treated verbatim as pasted text.
@@ -2,7 +2,7 @@
2
2
  name: ase-docs-proofread
3
3
  argument-hint: "[--help|-h] [--auto|-a] <docs-reference>"
4
4
  description: >
5
- Analyze the documents for spelling, punctuation, or grammar errors.
5
+ Analyze the documents for spelling, capitalization, punctuation, word break, or grammar errors.
6
6
  Use when the user wants to "proofread" or "spellcheck" a document.
7
7
  user-invocable: true
8
8
  disable-model-invocation: false
@@ -15,7 +15,7 @@ effort: high
15
15
  @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
16
16
 
17
17
  <purpose name="ase-docs-proofread">
18
- Analyze documents for spelling, punctuation, or grammar errors
18
+ Analyze documents for spelling, capitalization, punctuation, word break, or grammar errors
19
19
  </purpose>
20
20
 
21
21
  <expand name="getopt"
@@ -26,7 +26,7 @@ Analyze documents for spelling, punctuation, or grammar errors
26
26
 
27
27
  <objective>
28
28
  *Proofread* the documents of `<getopt-arguments/>` for problems in their
29
- *spelling*, *punctuation*, or *grammar* and propose corrections.
29
+ *spelling*, *capitalization*, *punctuation*, *word break*, or *grammar* and propose corrections.
30
30
  </objective>
31
31
 
32
32
  <flow>
@@ -100,19 +100,23 @@ Analyze documents for spelling, punctuation, or grammar errors
100
100
  <template>
101
101
  <ase-tpl-bullet-secondary/> **PROOFREADING SUMMARY**:
102
102
 
103
- | *Proofread Type* | *Proofread Result* |
104
- | ---------------- | ----------------------- |
105
- | **SPELLING**: | **<n/>** problems found |
106
- | **PUNCTUATION**: | **<m/>** problems found |
107
- | **GRAMMAR**: | **<k/>** problems found |
103
+ | *Proofread Type* | *Proofread Result* |
104
+ | ------------------- | ----------------------- |
105
+ | **SPELLING**: | **<n/>** problems found |
106
+ | **CAPITALIZATION**: | **<c/>** problems found |
107
+ | **PUNCTUATION**: | **<m/>** problems found |
108
+ | **WORD-BREAK**: | **<w/>** problems found |
109
+ | **GRAMMAR**: | **<k/>** problems found |
108
110
 
109
111
  </template>
110
112
 
111
113
  Hints:
112
114
 
113
- - <n/> is the number of problems with `type` equal to `SPELLING` in <problems/>
114
- - <m/> is the number of problems with `type` equal to `PUNCTUATION` in <problems/>
115
- - <k/> is the number of problems with `type` equal to `GRAMMAR` in <problems/>
115
+ - <n/> is the number of problems with `type` equal to `SPELLING` in <problems/>
116
+ - <c/> is the number of problems with `type` equal to `CAPITALIZATION` in <problems/>
117
+ - <m/> is the number of problems with `type` equal to `PUNCTUATION` in <problems/>
118
+ - <w/> is the number of problems with `type` equal to `WORD-BREAK` in <problems/>
119
+ - <k/> is the number of problems with `type` equal to `GRAMMAR` in <problems/>
116
120
 
117
121
  </step>
118
122
 
@@ -238,7 +242,7 @@ Analyze documents for spelling, punctuation, or grammar errors
238
242
 
239
243
  Set <old-start/> to the 1-based line number of the *first*
240
244
  old-side hunk line: if <context-before/> is non-empty, that is
241
- the line of its *first* context line, i.e. <line/> minus the
245
+ the line of its *first* context line, i.e., <line/> minus the
242
246
  number of lines in <context-before/>; otherwise it is <line/> itself
243
247
  (the first line of <old-text/>). For a hunk that *only inserts*
244
248
  new lines (empty <old-text/> *and* empty context), set it to the
@@ -13,10 +13,10 @@
13
13
  ## DESCRIPTION
14
14
 
15
15
  The `ase-docs-proofread` skill analyzes the referenced documents for
16
- *spelling*, *punctuation*, and *grammar* errors and proposes
17
- corrections. The investigation is dispatched to a sub-agent
18
- (`ase:ase-docs-proofread`) so that scanning details do not leak into
19
- the user-visible transcript.
16
+ *spelling*, *capitalization*, *punctuation*, *word break*, and *grammar*
17
+ errors and proposes corrections. The investigation is dispatched to a
18
+ sub-agent (`ase:ase-docs-proofread`) so that scanning details do not
19
+ leak into the user-visible transcript.
20
20
 
21
21
  For each detected problem, the skill renders a unified-diff
22
22
  *CORRECTION* preview and either asks the user to `ACCEPT` or `REJECT`
@@ -24,21 +24,31 @@ the proposed correction interactively (or refine it via a free-text
24
24
  hint, which re-proposes the correction without limit) or - with
25
25
  `--auto` - applies all corrections automatically.
26
26
 
27
+ `ase-docs-proofread` is the correctness-fixing member of the document
28
+ triple. The recommended order over one document is
29
+ [`ase-docs-shorten`](../ase-docs-shorten/help.md) first (cut the bulk),
30
+ then [`ase-docs-refine`](../ase-docs-refine/help.md) (polish what
31
+ survives), then `ase-docs-proofread` (final correctness pass), so no
32
+ correction effort is spent on text which is later dropped.
33
+
27
34
  ## OPTIONS
28
35
 
29
- `--auto`|`-a`:
36
+ - `--auto`|`-a`:
30
37
  Automatically apply every proposed correction without asking the
31
38
  user via the interactive dialog.
32
39
 
33
40
  ## ARGUMENTS
34
41
 
35
- *docs-reference*:
42
+ - *docs-reference*:
36
43
  A file, directory, or other reference to the documents to
37
44
  proofread.
38
45
 
39
46
  ## SCENARIOS
40
47
 
41
- - You want documents checked for spelling, punctuation, and grammar
48
+ - You want documents checked for spelling, capitalization,
49
+ punctuation, word break, and grammar
50
+ - You want inconsistent capitalization of terms and headings unified
51
+ - You want wrong word breaks like "data base" or "check-list" repaired
42
52
  - You want corrections proposed which you accept or reject one by one
43
53
  - You want a whole documentation directory corrected automatically
44
54
  - You want a final language pass over a text before publishing
@@ -59,4 +69,4 @@ Proofread an entire documentation directory automatically:
59
69
 
60
70
  ## SEE ALSO
61
71
 
62
- [`ase-code-lint`](../ase-code-lint/help.md), [`ase-meta-changelog`](../ase-meta-changelog/help.md).
72
+ [`ase-docs-shorten`](../ase-docs-shorten/help.md), [`ase-docs-refine`](../ase-docs-refine/help.md), [`ase-docs-distill`](../ase-docs-distill/help.md), [`ase-code-lint`](../ase-code-lint/help.md), [`ase-meta-changelog`](../ase-meta-changelog/help.md).
@@ -0,0 +1,396 @@
1
+ ---
2
+ name: ase-docs-refine
3
+ argument-hint: "[--help|-h] [--auto|-a] <docs-reference>"
4
+ description: >
5
+ Refine the sentence structure and style of the documents: shorten long sentences, replace
6
+ cumbersome nominal constructions with verbs, make enumerations parallel, strike filler words and
7
+ redundancy, fix awkward transitions, and adjust voice, while content, numbers, and technical terms
8
+ stay exactly as they are. Use when the user wants to "refine", "tighten", or "polish" the wording
9
+ of a document.
10
+ user-invocable: true
11
+ disable-model-invocation: false
12
+ effort: high
13
+ ---
14
+
15
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
16
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
17
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md
18
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
19
+
20
+ <purpose name="ase-docs-refine">
21
+ Refine the sentence structure and style of documents
22
+ </purpose>
23
+
24
+ <expand name="getopt"
25
+ arg1="ase-docs-refine"
26
+ arg2="--auto|-a">
27
+ $ARGUMENTS
28
+ </expand>
29
+
30
+ <objective>
31
+ *Refine* the documents of `<getopt-arguments/>` in their *sentence
32
+ structure*, *nominal style*, *parallelism*, *filler and redundancy*,
33
+ *transitions*, and *voice* and propose light rewritings: make long
34
+ sentences shorter, replace cumbersome nominal constructions with verbs,
35
+ bring enumerations into one grammatical shape, and strike filler words.
36
+ *Content, numbers, and technical terms stay exactly as they are.*
37
+ </objective>
38
+
39
+ Ground Rule
40
+ -----------
41
+
42
+ This skill performs *light rewriting* of awkward or unclear sentences,
43
+ *without reshaping the argument*. Every proposed change *MUST* preserve
44
+ the statement of the original text *exactly*: same facts, same numbers,
45
+ same technical terms, same qualifiers, same negations, same order of
46
+ the argument -- only the *wording* changes. A rewriting which shifts
47
+ the meaning even slightly is *not* a refinement and is *never* applied.
48
+
49
+ The rewriting stays *within* a sentence. Dropping a whole sentence,
50
+ paragraph, example, or list item for the sake of brevity is *length
51
+ reduction*, not refinement, and belongs to the `ase-docs-shorten` skill.
52
+
53
+ <flow>
54
+
55
+ 1. <step id="STEP 1: Investigation">
56
+
57
+ <if condition="<ase-project-boxing/> is equal `black`">
58
+
59
+ The project source artifacts are classified as a *black box*, so
60
+ the user does *not* want them inspected or their problems surfaced.
61
+ *Skip* the entire investigation and reporting: do *not* invoke any
62
+ `Glob` or `Agent` tool and do *not* read any document, only output
63
+ the following <template/> and then *SKIP* the remaining steps STEP 2
64
+ and STEP 3:
65
+
66
+ <template>
67
+ <ase-tpl-bullet-normal/> **REFINE**: *suppressed* (`project.boxing` is `black`)
68
+ </template>
69
+
70
+ </if>
71
+
72
+ First, use the following <template/> to give a hint on this step:
73
+
74
+ <template>
75
+ <ase-tpl-bullet-secondary/> **REFINEMENT INVESTIGATION**
76
+ </template>
77
+
78
+ Dispatch the investigation to *sub-agents* via the `Agent`
79
+ tool so that *no* investigation details leak into the user-visible
80
+ transcript. The sub-agents perform the silent reading and checking;
81
+ only their final structured return values are consumed here.
82
+
83
+ For this, first *silently* resolve `<getopt-arguments/>` to the
84
+ list <documents/> of individual document files, expanding any
85
+ directory or wildcard references with the `Glob` tool. Then
86
+ partition <documents/>, preserving order, into at most *eight*
87
+ batches of roughly equal size (a single document yields a single
88
+ batch), and invoke the following tool once per batch, emitting
89
+ *all* invocations *in one single message* so they run in
90
+ *parallel*:
91
+
92
+ ```text
93
+ Agent(
94
+ description: "Refine Investigation (<batch-index/>/<batch-count/>)",
95
+ subagent_type: "ase:ase-docs-refine",
96
+ prompt: <batch/>,
97
+ run_in_background: false
98
+ )
99
+ ```
100
+
101
+ Here <batch/> is the space-separated list of the document file
102
+ paths of the corresponding batch, <batch-index/> is the 1-based
103
+ index of that batch, and <batch-count/> is the total number of
104
+ batches, so that each parallel invocation is distinguishable in
105
+ the progress display.
106
+
107
+ Parse the result message of each `Agent` tool invocation as a JSON
108
+ array, concatenate all those arrays, sort the combined list by
109
+ `file` and then numerically by `line`, and set <problems/> to that
110
+ list.
111
+
112
+ You *MUST* *NOT* output anything at all in this STEP 1 beyond the
113
+ above hint template and the `Glob` and `Agent` tool invocations.
114
+ </step>
115
+
116
+ 2. <step id="STEP 2: Summary">
117
+
118
+ Use the following <template/> to give a summary of the detected
119
+ problems in <problems/>:
120
+
121
+ <template>
122
+ <ase-tpl-bullet-secondary/> **REFINEMENT SUMMARY**:
123
+
124
+ | *Refinement Type* | *Refinement Result* |
125
+ | ------------------- | ----------------------- |
126
+ | **STRUCTURE**: | **<s/>** problems found |
127
+ | **NOMINALIZATION**: | **<n/>** problems found |
128
+ | **PARALLELISM**: | **<p/>** problems found |
129
+ | **FILLER**: | **<f/>** problems found |
130
+ | **TRANSITION**: | **<t/>** problems found |
131
+ | **VOICE**: | **<v/>** problems found |
132
+
133
+ </template>
134
+
135
+ Hints:
136
+
137
+ - <s/> is the number of problems with `type` equal to `STRUCTURE` in <problems/>
138
+ - <n/> is the number of problems with `type` equal to `NOMINALIZATION` in <problems/>
139
+ - <p/> is the number of problems with `type` equal to `PARALLELISM` in <problems/>
140
+ - <f/> is the number of problems with `type` equal to `FILLER` in <problems/>
141
+ - <t/> is the number of problems with `type` equal to `TRANSITION` in <problems/>
142
+ - <v/> is the number of problems with `type` equal to `VOICE` in <problems/>
143
+
144
+ </step>
145
+
146
+ 3. <step id="STEP 3: Refinement">
147
+
148
+ 1. *Mark this skill as the active edit-capable skill* so that the
149
+ ASE `pre-tool-use` hook auto-approves the subsequent `Edit`
150
+ invocations on *any* invocation path (slash command *or* `Skill`
151
+ tool). Call the `ase_config_set(key: "agent.skill", val:
152
+ "ase-docs-refine", scope: "session:<ase-session-id/>")` tool
153
+ from the `ase` MCP server. Do not output anything in this substep.
154
+
155
+ *Critical safety invariant*: the marker set here grants `Edit`
156
+ auto-approval and *MUST* be cleared again (substep 3 below)
157
+ *before* this skill yields control, *regardless* of how the
158
+ iteration in substep 2 ends - whether it completes normally,
159
+ is aborted early (e.g. an `Edit` failure, an unparseable value,
160
+ or any other unexpected condition), or is otherwise interrupted.
161
+ If you ever stop or bail out of substep 2 early, you *MUST*
162
+ still perform substep 3 first. Never leave this marker active
163
+ for a later, unrelated `Edit`.
164
+
165
+ 2. Set <total/> to the number of problems in <problems/> and
166
+ <index/> to `0`. Then iterate over all problems:
167
+
168
+ <for items="<problems/>">
169
+
170
+ 1. Increment <index/> by one (the 1-based position of the
171
+ current <item/> within <problems/>).
172
+ Set <type/> to the `type` field of <item/>.
173
+ Set <file/> to the `file` field of <item/>.
174
+ Set <line/> to the `line` field of <item/>.
175
+ Set <description/> to the `description` field of <item/>.
176
+ Set <context-before/> to the `context_before` field of <item/>.
177
+ Set <old-text/> to the `old_text` field of <item/>.
178
+ Set <new-text/> to the `new_text` field of <item/>.
179
+ Set <context-after/> to the `context_after` field of <item/>.
180
+
181
+ Then *verify the Ground Rule* for this <item/>: compare
182
+ <new-text/> against <old-text/> and *drop* the <item/>
183
+ entirely -- continuing with the next <item/> without any
184
+ output -- whenever the rewriting shifts the meaning even
185
+ slightly, i.e., drops, adds, or alters a fact, a number, a
186
+ technical term, a qualifier, a negation, or a condition.
187
+
188
+ Then *normalize* the change to its *minimal* form, so
189
+ that the proposed diff shows exactly the lines the later
190
+ `Edit` will actually change: while the *first* line of
191
+ <old-text/> is identical to the *first* line of
192
+ <new-text/>, *move* that line from both to the end of
193
+ <context-before/> and increment <line/> by one; likewise,
194
+ while the *last* line of <old-text/> is identical to the
195
+ *last* line of <new-text/>, *move* that line from both to
196
+ the front of <context-after/>. Finally, *trim*
197
+ <context-before/> to its *last* two lines and
198
+ <context-after/> to its *first* two lines.
199
+
200
+ Then, unless <ase-project-boxing/> is equal `grey` (where
201
+ the full unified diff is suppressed and no context lines are
202
+ rendered at all), *silently* read the current content of
203
+ <file/> with the `Read` tool - reusing the content read for
204
+ the same <file/> earlier in this iteration, unless an `Edit`
205
+ was applied to it in between - and set <file-lines/> to its
206
+ lines, *stripped* of the line-number prefixes the tool adds.
207
+ Set <file-lines/> to empty if the file cannot be read.
208
+
209
+ Whenever <file-lines/> is non-empty, *re-derive* both
210
+ context parts from it, *overriding* the sub-agent supplied
211
+ values, so the rendered diff shows real context even when a
212
+ sub-agent supplied none: set <context-before/> to the *up to
213
+ two* lines of <file-lines/> directly *before* line <line/>
214
+ (empty if <line/> is `1`) and <context-after/> to the *up
215
+ to two* lines of <file-lines/> starting at line (<line/> +
216
+ <n/>), where <n/> is the number of lines in <old-text/>
217
+ (empty if that line is beyond the end of the document).
218
+ Keep the sub-agent supplied values only when <file-lines/>
219
+ is empty.
220
+
221
+ 2. Report the problem with the following <template/>:
222
+
223
+ <template>
224
+ <ase-tpl-bullet-signal/> [<index/>/<total/>]: **<type/> PROBLEM**: `<file/>`:<line/>:
225
+
226
+ <description/>
227
+ </template>
228
+
229
+ 3. <if condition="<getopt-option-auto/> is not equal `true` and <ase-project-boxing/> is equal `grey`">
230
+
231
+ The project source artifacts are classified as a *grey box*, so
232
+ the user does *not* want the full artifact internals surfaced:
233
+ *suppress* the full unified diff and instead show only a
234
+ *condensed* one-line representation. Determine <old-snippet/>
235
+ as the *single-line* collapse of <old-text/> (join its lines
236
+ with ` ⏎ `, or `∅` when <old-text/> is empty for a pure
237
+ insertion) and <new-snippet/> as the same collapse of
238
+ <new-text/> (or `∅` when empty for a pure deletion). Then
239
+ report the refinement with the following <template/>:
240
+
241
+ <template>
242
+
243
+ <ase-tpl-bullet-normal/> **<type/> REFINEMENT**: `<old-snippet/>` → `<new-snippet/>`
244
+
245
+ </template>
246
+
247
+ </if>
248
+ <elseif condition="<getopt-option-auto/> is not equal `true`">
249
+
250
+ Determine the hunk *body* as an ordered list of lines, each
251
+ carrying a one-character prefix (` ` for context, `-` for
252
+ old-side, `+` for new-side). Build it by concatenating, in
253
+ order and *skipping any part that is empty*:
254
+
255
+ - one ` `-prefixed line for *each* line of <context-before/>
256
+ (if non-empty),
257
+ - one `-`-prefixed line for *each* line of <old-text/>
258
+ (if non-empty; split <old-text/> on newlines),
259
+ - one `+`-prefixed line for *each* line of <new-text/>
260
+ (if non-empty; split <new-text/> on newlines),
261
+ - one ` `-prefixed line for *each* line of <context-after/>
262
+ (if non-empty).
263
+
264
+ Set <hunk-body/> to those prefixed lines joined by newlines.
265
+
266
+ Set <old-count/> to the number of old-side hunk lines, i.e.,
267
+ the combined line count of <context-before/>, <old-text/>, and
268
+ <context-after/> (each empty part counts as `0`).
269
+ Set <new-count/> to the number of new-side hunk lines, i.e.,
270
+ the combined line count of <context-before/>, <new-text/>, and
271
+ <context-after/> (each empty part counts as `0`).
272
+
273
+ Set <old-start/> to the 1-based line number of the *first*
274
+ old-side hunk line: if <context-before/> is non-empty, that is
275
+ the line of its *first* context line, i.e., <line/> minus the
276
+ number of lines in <context-before/>; otherwise it is <line/> itself
277
+ (the first line of <old-text/>). For a hunk that *only inserts*
278
+ new lines (empty <old-text/> *and* empty context), set it to the
279
+ line *before* which the insertion happens, clamped to a minimum
280
+ of `0`, so a top-of-file insertion yields `@@ -0,0 ... @@`.
281
+ Set <new-start/> to the same value as <old-start/>, but clamped
282
+ to a minimum of `1` whenever <new-count/> is greater than `0`
283
+ (the refined side then has a real first line).
284
+
285
+ Render the proposed refinement as a *unified diff* with *up to
286
+ two* lines of context in a fenced block based on the following
287
+ <template/>, emitting <hunk-body/> verbatim (one already-prefixed
288
+ line per line, with no extra blank or space-only lines):
289
+
290
+ <template>
291
+
292
+ <ase-tpl-bullet-normal/> **<type/> REFINEMENT**:
293
+
294
+ ```diff
295
+ --- <file/> (original)
296
+ +++ <file/> (refined)
297
+ @@ -<old-start/>,<old-count/> +<new-start/>,<new-count/> @@
298
+ <hunk-body/>
299
+ ```
300
+
301
+ </template>
302
+
303
+ </elseif>
304
+
305
+ 4. <if condition="<getopt-option-auto/> is not equal `true`">
306
+
307
+ In the following, you *MUST* *NOT* use your built-in
308
+ <user-dialog-tool/> tool! Instead, you *MUST* just show a
309
+ custom dialog according to the expanded `custom-dialog`
310
+ definition. You *MUST* closely follow this definition:
311
+
312
+ <expand name="custom-dialog" arg1="--other">
313
+ REFINEMENT: How would you like to proceed with this proposed refinement?
314
+ ACCEPT: Apply this proposed refinement.
315
+ REJECT: Skip this proposed refinement.
316
+ </expand>
317
+
318
+ </if>
319
+
320
+ <else>
321
+
322
+ Set <result>ACCEPT</result>.
323
+
324
+ </else>
325
+
326
+ 5. Check <result/> and dispatch accordingly:
327
+
328
+ - <if condition="<result/> is 'ACCEPT'">
329
+
330
+ Invoke the `Edit` tool to apply the change by replacing
331
+ <old-text/> with <new-text/> at <file/>:<line/>. The operation
332
+ will be auto-approved by the ASE `pre-tool-use` hook (which
333
+ tracks the active skill), so *no* interactive permission
334
+ prompt will appear. Then continue with the next <item/>.
335
+
336
+ </if>
337
+
338
+ - <if condition="<result/> starts with 'OTHER'">
339
+
340
+ Generate a *new* proposal for the *same* <item/>,
341
+ incorporating the user's free-text hint from <result/>
342
+ after the "OTHER:" prefix. *Reassign* <description/>,
343
+ <old-text/>, and <new-text/> to reflect this refined
344
+ proposal (<old-text/> stays anchored to the existing text
345
+ at <file/>:<line/>; <new-text/> and <description/> carry the
346
+ refinement) so the subsequent rendering and any `Edit` use
347
+ the new proposal rather than the original. Then *re-apply*
348
+ the minimal-form normalization of substep 1 to the refined
349
+ <old-text/> and <new-text/> (so the re-rendered diff again
350
+ shows exactly the changed lines) and *go back* to substep 2
351
+ of this `for`-iteration. There is *no* cap on
352
+ refinement rounds - keep refining until the user picks
353
+ `ACCEPT` or `REJECT`.
354
+
355
+ </if>
356
+
357
+ - <if condition="
358
+ <result/> is 'REJECT' or
359
+ <result/> is 'CANCEL' or
360
+ <result/> starts with 'ERROR'
361
+ ">
362
+
363
+ Skip this <item/> without any `Edit` call and continue
364
+ with the next <item/>.
365
+
366
+ </if>
367
+
368
+ </for>
369
+
370
+ 3. *Clear the active edit-capable skill marker* now that all `Edit`
371
+ invocations are done, so a later unrelated `Edit` is *not*
372
+ auto-approved. Call the `ase_config_delete(key: "agent.skill",
373
+ scope: "session:<ase-session-id/>")` tool from the `ase` MCP
374
+ server. Do not output anything in this substep.
375
+
376
+ 4. You *MUST* *NOT* output any further additional explanations or
377
+ summaries at the end of this skill processing, except for the
378
+ following final <template/>:
379
+
380
+ <template>
381
+ <ase-tpl-bullet-secondary/> **REFINE FINISHED**
382
+ </template>
383
+
384
+ 5. Finally, give the closing hint by expanding the following
385
+ (which, depending on the configured <ase-guidance-level/>, may
386
+ expand into nothing and hence emit no output at all):
387
+
388
+ <if condition="<getopt-option-auto/> is not equal `true`">
389
+ <ase-tpl-hint level="verbose">
390
+ Use `/ase-docs-refine --auto` to apply all refinements unattended.
391
+ </ase-tpl-hint>
392
+ </if>
393
+
394
+ </step>
395
+
396
+ </flow>