@rse/ase 0.9.57 → 0.9.59

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.
@@ -6,7 +6,7 @@
6
6
  "homepage": "https://ase.tools",
7
7
  "repository": { "url": "git+https://github.com/rse/ase.git", "type": "git" },
8
8
  "bugs": { "url": "https://github.com/rse/ase/issues" },
9
- "version": "0.9.57",
9
+ "version": "0.9.59",
10
10
  "license": "Apache-2.0",
11
11
  "author": {
12
12
  "name": "Dr. Ralf S. Engelschall",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ase-code-craft
3
- argument-hint: "[--help|-h] [--auto|-a] [--dry|-d] [--quick|-Q] [--next|-n <option>[,...]] [<task-id>:] <feature>"
3
+ argument-hint: "[--help|-h] [--auto|-a] [--dry|-d] [--direct|-D] [--quick|-Q] [--next|-n <option>[,...]] [<task-id>:] <feature>"
4
4
  description: >
5
5
  Craft Source Code:
6
6
  Use when user wants to "create", "add", or "craft" a new feature from scratch.
@@ -10,6 +10,7 @@ effort: xhigh
10
10
  allowed-tools:
11
11
  - "Skill"
12
12
  - "Agent"
13
+ - "Read"
13
14
  ---
14
15
 
15
16
  @${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
@@ -23,7 +24,7 @@ Craft Source Code
23
24
 
24
25
  <expand name="getopt"
25
26
  arg1="ase-code-craft"
26
- arg2="--auto|-a --dry|-d --quick|-Q --next|-n=(none|DONE|EDIT|GRILL|PREFLIGHT|IMPLEMENT)...">
27
+ arg2="--auto|-a --dry|-d --direct|-D --quick|-Q --next|-n=(none|DONE|EDIT|GRILL|PREFLIGHT|IMPLEMENT)...">
27
28
  $ARGUMENTS
28
29
  </expand>
29
30
 
@@ -45,9 +46,18 @@ From scratch *craft* the following feature:
45
46
  Procedure
46
47
  ---------
47
48
 
49
+ <if condition="<getopt-option-direct/> is not equal to 'true'">
48
50
  You *MUST* *NOT* call `Edit`, `Write`, `NotebookEdit`, or any
49
51
  filesystem-modifying tool during this entire skill. The *only*
50
52
  permitted way to persist artifacts is via `ase_task_save(...)`.
53
+ </if>
54
+ <else>
55
+ The `--direct`/`-D` mode applies the crafting *in place*, so STEP 4
56
+ below *requires* `Edit` and `Write` to modify the affected artifacts.
57
+ Every modification *MUST* still stay restricted to the artifacts the
58
+ crafting actually demands, and you *MUST* *NOT* call
59
+ `ase_task_save(...)`, as no task plan is composed at all.
60
+ </else>
51
61
 
52
62
  <flow>
53
63
 
@@ -136,13 +146,41 @@ permitted way to persist artifacts is via `ase_task_save(...)`.
136
146
 
137
147
  </step>
138
148
 
139
- 4. <step id="STEP 4: Choose Feature Crafting Approaches">
149
+ 4. <if condition="<getopt-option-direct/> is equal to 'true'">
150
+
151
+ <step id="STEP 4: Direct Feature Crafting">
152
+
153
+ 1. Directly craft the <feature/> by modifying the affected
154
+ *artifacts* with a corresponding, complete *change set*,
155
+ based on your gathered knowledge about the code base and your
156
+ internalized crafting tenets. Also, if a CHANGELOG.md
157
+ file exists, make an appropriate entry there, too.
158
+
159
+ 2. Output only the following <template/>:
160
+
161
+ <template>
162
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **changes directly applied**
163
+ </template>
164
+
165
+ 3. Then *IMMEDIATELY* *STOP* all further skill processing. You
166
+ *MUST* *NOT* output anything else in this STEP 4 or after it --
167
+ *independent* of <ase-project-boxing/>, whose exposure rules
168
+ are explicitly *overridden* here. Especially, do not output a
169
+ change summary, a list of modified artifacts, a rationale, or
170
+ a unified diff of the changes.
171
+
172
+ </step>
173
+
174
+ </if>
175
+ <else>
176
+
177
+ <step id="STEP 4: Choose Feature Crafting Approaches">
140
178
 
141
179
  <expand name="code-approaches" arg1="feature" arg2="crafting"></expand>
142
180
 
143
181
  </step>
144
182
 
145
- 5. <step id="STEP 5: Compose Feature Crafting Plan">
183
+ <step id="STEP 5: Compose Feature Crafting Plan">
146
184
 
147
185
  1. *Compose a feature plan* for the chosen feature A<n/> by
148
186
  closely aligning to the existing architecture and the existing
@@ -187,4 +225,6 @@ permitted way to persist artifacts is via `ase_task_save(...)`.
187
225
 
188
226
  </step>
189
227
 
228
+ </else>
229
+
190
230
  </flow>
@@ -9,6 +9,7 @@
9
9
  [`--help`|`-h`]
10
10
  [`--auto`|`-a`]
11
11
  [`--dry`|`-d`]
12
+ [`--direct`|`-D`]
12
13
  [`--quick`|`-Q`]
13
14
  [`--next`|`-n` *option*[,...]]
14
15
  [*task-id*:] *feature*
@@ -22,10 +23,11 @@ investigating the existing code base, internalizing crafting tenets
22
23
  preferred approach, and composing a corresponding *task plan* aligned
23
24
  with the existing architecture.
24
25
 
25
- The skill does *not* directly modify source files. It persists the
26
- plan via `ase_task_save` and then hands off to `ase-task-edit`,
27
- `ase-task-preflight`, or `ase-task-implement`, as selected by
28
- `--next`.
26
+ By default the skill does *not* directly modify source files. It
27
+ persists the plan via `ase_task_save` and then hands off to
28
+ `ase-task-edit`, `ase-task-preflight`, or `ase-task-implement`, as
29
+ selected by `--next`. Only under `--direct` it skips the plan
30
+ entirely and applies the change set to the affected artifacts itself.
29
31
 
30
32
  ## OPTIONS
31
33
 
@@ -40,6 +42,15 @@ plan via `ase_task_save` and then hands off to `ase-task-edit`,
40
42
  type-checker, or program execution) once the source files have
41
43
  been modified.
42
44
 
45
+ `--direct`|`-D`:
46
+ Craft the feature *immediately* and *in place*: skip the
47
+ feature approaches, the interactive dialog, and the entire task
48
+ plan ceremony, and directly apply the complete change set to the
49
+ affected artifacts, including a corresponding entry in an existing
50
+ `CHANGELOG.md` file. In this mode `--auto`, `--dry`, `--quick`, and
51
+ `--next` have no effect, as neither approaches are proposed nor a
52
+ plan is composed.
53
+
43
54
  `--quick`|`-Q`:
44
55
  Shorthand alias for `-a -d -n IMPLEMENT,DELETE`: automatically pick
45
56
  the recommended feature approach, compose the plan *without* the
@@ -169,7 +169,28 @@ Procedure
169
169
  3. <step id="STEP 3: Detect Target Collisions"
170
170
  condition="<getopt-option-dry/> is not equal `true`">
171
171
 
172
- 1. Determine the *existing worktrees* and *existing branches* by
172
+ 1. Determine the *worktree directory* of every part by calling the
173
+ `ase_worktree_path(id: "<part-id/>", create: true)` tool of the
174
+ `ase` MCP server once per <part-id/> of <parts/> and capturing
175
+ its output into the <part-dir/> of that part.
176
+
177
+ You *MUST* *NEVER* assemble such a path yourself, as only this
178
+ tool rejects a path leading through a symbolic link, through a
179
+ non-directory, or out of the repository -- a path both `git
180
+ worktree add` and `git worktree remove` would otherwise silently
181
+ follow and thereby write outside the repository.
182
+
183
+ <if condition="this tool call fails for any part">
184
+ Only output the following <template/> and then immediately *STOP*
185
+ processing the entire current skill, leaving the working copy and
186
+ *all* existing worktrees and branches untouched:
187
+
188
+ <template>
189
+ ⧉ **ASE**: ✪ skill: **ase-code-dissect**, ▶ ERROR: unsafe worktree directory -- cannot create worktrees
190
+ </template>
191
+ </if>
192
+
193
+ 2. Determine the *existing worktrees* and *existing branches* by
173
194
  running the corresponding commands (taken exactly as given) and
174
195
  capturing their outputs:
175
196
 
@@ -177,11 +198,11 @@ Procedure
177
198
 
178
199
  `git branch --list`
179
200
 
180
- 2. Set <collisions/> to all <part-id/> of <parts/> for which either
181
- a worktree directory `<repo-root/>/.ase/worktree/<part-id/>` or
182
- a branch `<part-id/>` already exists.
201
+ 3. Set <collisions/> to all <part-id/> of <parts/> for which either
202
+ the worktree directory <part-dir/> or a branch `<part-id/>`
203
+ already exists.
183
204
 
184
- 3. <if condition="<collisions/> is not empty AND <getopt-option-force/> is not equal `true`">
205
+ 4. <if condition="<collisions/> is not empty AND <getopt-option-force/> is not equal `true`">
185
206
  Only output the following <template/> -- with <collisions/>
186
207
  rendered as a comma-separated list of code spans -- and then
187
208
  immediately *STOP* processing the entire current skill, leaving
@@ -202,13 +223,13 @@ Procedure
202
223
  </ase-tpl-hint>
203
224
  </if>
204
225
 
205
- 4. <if condition="<collisions/> is not empty AND <getopt-option-force/> is equal `true`">
226
+ 5. <if condition="<collisions/> is not empty AND <getopt-option-force/> is equal `true`">
206
227
  *Remove* every colliding target by running the corresponding
207
228
  commands (taken exactly as given) per colliding <part-id/>, and
208
229
  silently ignore the failure of an individual command when the
209
230
  corresponding worktree or branch does not exist:
210
231
 
211
- `git worktree remove --force "<repo-root/>/.ase/worktree/<part-id/>"`
232
+ `git worktree remove --force "<part-dir/>"`
212
233
 
213
234
  `git worktree prune`
214
235
 
@@ -255,7 +276,7 @@ Procedure
255
276
  git-ignored, so the worktree itself never shows up as a
256
277
  change:
257
278
 
258
- `git worktree add "<repo-root/>/.ase/worktree/<part-id/>"`
279
+ `git worktree add "<part-dir/>"`
259
280
 
260
281
  <if condition="this command fails">
261
282
  Only output the following <template/>, then *continue* with
@@ -270,7 +291,7 @@ Procedure
270
291
  4. Apply the patch *inside* the freshly created worktree by
271
292
  running the corresponding command (taken exactly as given):
272
293
 
273
- `git -C "<repo-root/>/.ase/worktree/<part-id/>" apply --whitespace=nowarn "<tmp-dir/>/ase-dissect-<part-id/>.patch"`
294
+ `git -C "<part-dir/>" apply --whitespace=nowarn "<tmp-dir/>/ase-dissect-<part-id/>.patch"`
274
295
 
275
296
  <if condition="this command fails">
276
297
  Only output the following <template/>, then *continue* with
@@ -208,6 +208,20 @@ related to a set of code quality aspects.
208
208
  1. Set <file/> to the `file` field of <item/>.
209
209
  Set <change-hunks/> to the `change-hunks` field of <item/>.
210
210
 
211
+ Unless <ase-project-boxing/> is equal `grey` (where the
212
+ full unified diff is suppressed and no context lines are
213
+ rendered at all), *silently* read the current content of
214
+ <file/> with the `Read` tool - reusing the content read
215
+ for the same <file/> earlier in this iteration, unless
216
+ an `Edit` was applied to it in between - and set
217
+ <file-lines/> to its lines, *stripped* of the
218
+ line-number prefixes the tool adds. Set <file-lines/>
219
+ to empty if the file cannot be read.
220
+
221
+ This content is the *authoritative* source of the
222
+ context lines of substep 2 below, so the rendered diff
223
+ shows real context even when a sub-agent supplied none.
224
+
211
225
  Unless <ase-project-boxing/> is equal `grey` (where the
212
226
  full unified diff is suppressed and this per-file header is
213
227
  unused), set <diff-file/> to the following <template/>:
@@ -240,6 +254,18 @@ related to a set of code quality aspects.
240
254
  to its *last* two lines and <context-after/> to its
241
255
  *first* two lines.
242
256
 
257
+ Then, whenever <file-lines/> is non-empty,
258
+ *re-derive* both context parts from it, *overriding*
259
+ the sub-agent supplied values: set <context-before/>
260
+ to the *up to two* lines of <file-lines/> directly
261
+ *before* line <line/> (empty if <line/> is `1`) and
262
+ <context-after/> to the *up to two* lines of
263
+ <file-lines/> starting at line (<line/> + <n/>),
264
+ where <n/> is the number of lines in <old-text/>
265
+ (empty if that line is beyond the end of the file).
266
+ Keep the sub-agent supplied values only when
267
+ <file-lines/> is empty.
268
+
243
269
  2. *Skip* this substep entirely when <ase-project-boxing/>
244
270
  is equal `grey` - the full unified diff is suppressed
245
271
  there, so none of the <hunk-body/>, <old-count/>,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ase-code-refactor
3
- argument-hint: "[--help|-h] [--auto|-a] [--dry|-d] [--quick|-Q] [--next|-n <option>[,...]] [<task-id>:] <request>"
3
+ argument-hint: "[--help|-h] [--auto|-a] [--dry|-d] [--direct|-D] [--quick|-Q] [--next|-n <option>[,...]] [<task-id>:] <request>"
4
4
  description: >
5
5
  Refactor Code:
6
6
  Use when user wants to "refactor" or "change" the code base.
@@ -10,6 +10,7 @@ effort: xhigh
10
10
  allowed-tools:
11
11
  - "Skill"
12
12
  - "Agent"
13
+ - "Read"
13
14
  ---
14
15
 
15
16
  @${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
@@ -23,7 +24,7 @@ Refactor Source Code
23
24
 
24
25
  <expand name="getopt"
25
26
  arg1="ase-code-refactor"
26
- arg2="--auto|-a --dry|-d --quick|-Q --next|-n=(none|DONE|EDIT|GRILL|PREFLIGHT|IMPLEMENT)...">
27
+ arg2="--auto|-a --dry|-d --direct|-D --quick|-Q --next|-n=(none|DONE|EDIT|GRILL|PREFLIGHT|IMPLEMENT)...">
27
28
  $ARGUMENTS
28
29
  </expand>
29
30
 
@@ -45,9 +46,18 @@ to `true`, <getopt-option-dry/> to `true`, and <getopt-option-next/> to
45
46
  Procedure
46
47
  ---------
47
48
 
49
+ <if condition="<getopt-option-direct/> is not equal to 'true'">
48
50
  You *MUST* *NOT* call `Edit`, `Write`, `NotebookEdit`, or any
49
51
  filesystem-modifying tool during this entire skill. The *only*
50
52
  permitted way to persist artifacts is via `ase_task_save(...)`.
53
+ </if>
54
+ <else>
55
+ The `--direct`/`-D` mode applies the refactoring *in place*, so STEP 4
56
+ below *requires* `Edit` and `Write` to modify the affected artifacts.
57
+ Every modification *MUST* still stay restricted to the artifacts the
58
+ refactoring actually demands, and you *MUST* *NOT* call
59
+ `ase_task_save(...)`, as no task plan is composed at all.
60
+ </else>
51
61
 
52
62
  <flow>
53
63
 
@@ -136,13 +146,41 @@ permitted way to persist artifacts is via `ase_task_save(...)`.
136
146
 
137
147
  </step>
138
148
 
139
- 4. <step id="STEP 4: Choose Refactoring Approaches">
149
+ 4. <if condition="<getopt-option-direct/> is equal to 'true'">
150
+
151
+ <step id="STEP 4: Direct Refactoring">
152
+
153
+ 1. Directly apply the refactoring <request/> by modifying the
154
+ affected *artifacts* with a corresponding, complete *change set*,
155
+ based on your gathered knowledge about the code base and your
156
+ internalized refactoring tenets. Also, if a CHANGELOG.md
157
+ file exists, make an appropriate entry there, too.
158
+
159
+ 2. Output only the following <template/>:
160
+
161
+ <template>
162
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **changes directly applied**
163
+ </template>
164
+
165
+ 3. Then *IMMEDIATELY* *STOP* all further skill processing. You
166
+ *MUST* *NOT* output anything else in this STEP 4 or after it --
167
+ *independent* of <ase-project-boxing/>, whose exposure rules
168
+ are explicitly *overridden* here. Especially, do not output a
169
+ change summary, a list of modified artifacts, a rationale, or
170
+ a unified diff of the changes.
171
+
172
+ </step>
173
+
174
+ </if>
175
+ <else>
176
+
177
+ <step id="STEP 4: Choose Refactoring Approaches">
140
178
 
141
179
  <expand name="code-approaches" arg1="refactoring" arg2="refactoring"></expand>
142
180
 
143
181
  </step>
144
182
 
145
- 5. <step id="STEP 5: Compose Refactoring Plan">
183
+ <step id="STEP 5: Compose Refactoring Plan">
146
184
 
147
185
  1. *Compose a refactoring plan* for the chosen refactoring A<n/> by
148
186
  closely aligning to the existing architecture and the existing
@@ -187,5 +225,7 @@ permitted way to persist artifacts is via `ase_task_save(...)`.
187
225
 
188
226
  </step>
189
227
 
228
+ </else>
229
+
190
230
  </flow>
191
231
 
@@ -9,6 +9,7 @@
9
9
  [`--help`|`-h`]
10
10
  [`--auto`|`-a`]
11
11
  [`--dry`|`-d`]
12
+ [`--direct`|`-D`]
12
13
  [`--quick`|`-Q`]
13
14
  [`--next`|`-n` *option*[,...]]
14
15
  [*task-id*:] *request*
@@ -22,10 +23,11 @@ clear interfaces, ...), proposing one or more *refactoring approaches*
22
23
  with pros and cons, letting the user pick the preferred approach,
23
24
  and composing a corresponding *task plan*.
24
25
 
25
- The skill does *not* directly modify source files. It persists the
26
- plan via `ase_task_save` and then hands off to `ase-task-edit`,
27
- `ase-task-preflight`, or `ase-task-implement`, as selected by
28
- `--next`.
26
+ By default the skill does *not* directly modify source files. It
27
+ persists the plan via `ase_task_save` and then hands off to
28
+ `ase-task-edit`, `ase-task-preflight`, or `ase-task-implement`, as
29
+ selected by `--next`. Only under `--direct` it skips the plan
30
+ entirely and applies the change set to the affected artifacts itself.
29
31
 
30
32
  ## OPTIONS
31
33
 
@@ -40,6 +42,15 @@ plan via `ase_task_save` and then hands off to `ase-task-edit`,
40
42
  type-checker, or program execution) once the source files have
41
43
  been modified.
42
44
 
45
+ `--direct`|`-D`:
46
+ Apply the refactoring *immediately* and *in place*: skip the
47
+ refactoring approaches, the interactive dialog, and the entire task
48
+ plan ceremony, and directly apply the complete change set to the
49
+ affected artifacts, including a corresponding entry in an existing
50
+ `CHANGELOG.md` file. In this mode `--auto`, `--dry`, `--quick`, and
51
+ `--next` have no effect, as neither approaches are proposed nor a
52
+ plan is composed.
53
+
43
54
  `--quick`|`-Q`:
44
55
  Shorthand alias for `-a -d -n IMPLEMENT,DELETE`: automatically pick
45
56
  the recommended refactoring approach, compose the plan *without* the
@@ -206,8 +206,18 @@ resolution actually demands, and you *MUST* *NOT* call
206
206
  internalized problem resolution tenets. Also, if a CHANGELOG.md
207
207
  file exists, make an appropriate entry there, too.
208
208
 
209
- 2. Do not output anything else in this STEP 4. Especially, do not
210
- output a change summary or a unified diff of the changes.
209
+ 2. Output only the following <template/>:
210
+
211
+ <template>
212
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **changes directly applied**
213
+ </template>
214
+
215
+ 3. Then *IMMEDIATELY* *STOP* all further skill processing. You
216
+ *MUST* *NOT* output anything else in this STEP 4 or after it --
217
+ *independent* of <ase-project-boxing/>, whose exposure rules
218
+ are explicitly *overridden* here. Especially, do not output a
219
+ change summary, a list of modified artifacts, a rationale, or
220
+ a unified diff of the changes.
211
221
 
212
222
  </step>
213
223
 
@@ -163,6 +163,27 @@ Analyze documents for spelling, punctuation, or grammar errors
163
163
  <context-before/> to its *last* two lines and
164
164
  <context-after/> to its *first* two lines.
165
165
 
166
+ Then, unless <ase-project-boxing/> is equal `grey` (where
167
+ the full unified diff is suppressed and no context lines are
168
+ rendered at all), *silently* read the current content of
169
+ <file/> with the `Read` tool - reusing the content read for
170
+ the same <file/> earlier in this iteration, unless an `Edit`
171
+ was applied to it in between - and set <file-lines/> to its
172
+ lines, *stripped* of the line-number prefixes the tool adds.
173
+ Set <file-lines/> to empty if the file cannot be read.
174
+
175
+ Whenever <file-lines/> is non-empty, *re-derive* both
176
+ context parts from it, *overriding* the sub-agent supplied
177
+ values, so the rendered diff shows real context even when a
178
+ sub-agent supplied none: set <context-before/> to the *up to
179
+ two* lines of <file-lines/> directly *before* line <line/>
180
+ (empty if <line/> is `1`) and <context-after/> to the *up
181
+ to two* lines of <file-lines/> starting at line (<line/> +
182
+ <n/>), where <n/> is the number of lines in <old-text/>
183
+ (empty if that line is beyond the end of the document).
184
+ Keep the sub-agent supplied values only when <file-lines/>
185
+ is empty.
186
+
166
187
  2. Report the problem with the following <template/>:
167
188
 
168
189
  <template>
@@ -82,25 +82,29 @@ Procedure
82
82
  directly usable as both a directory and a branch name. Do not
83
83
  output anything.
84
84
 
85
- 2. Determine the *repository root* by running the corresponding
86
- command (taken exactly as given) and capturing its output into
87
- <repo-root/>:
88
-
89
- `git rev-parse --show-toplevel`
90
-
91
- <if condition="this command fails">
92
- The current directory is not a Git repository, so no worktree can be
93
- created. Only output the following <template/> and then
94
- immediately *STOP* processing the entire current skill, leaving
95
- the working copy *untouched*:
85
+ 2. Determine the *worktree directory* by calling the
86
+ `ase_worktree_path(id: "<worktree-name/>", create: true)` tool of
87
+ the `ase` MCP server and capturing its output into
88
+ <worktree-dir/>.
89
+
90
+ You *MUST* *NEVER* assemble this path yourself, as only this tool
91
+ rejects a path leading through a symbolic link, through a
92
+ non-directory, or out of the repository -- a path `git worktree
93
+ add` would otherwise silently follow and thereby write outside
94
+ the repository.
95
+
96
+ <if condition="this tool call fails">
97
+ Either the current directory is not a Git repository or the
98
+ worktree directory is unsafe, so no worktree can be created. Only
99
+ output the following <template/> and then immediately *STOP*
100
+ processing the entire current skill, leaving the working copy
101
+ *untouched*:
96
102
 
97
103
  <template>
98
- ⧉ **ASE**: ☻ skill: **ase-task-implement**, ▶ ERROR: no Git repository -- cannot create worktree
104
+ ⧉ **ASE**: ☻ skill: **ase-task-implement**, ▶ ERROR: no Git repository or unsafe worktree directory -- cannot create worktree
99
105
  </template>
100
106
  </if>
101
107
 
102
- Then set <worktree-dir><repo-root/>/.ase/worktree/<worktree-name/></worktree-dir>.
103
-
104
108
  3. Determine the *existing worktrees* and *existing branches* by
105
109
  running the corresponding commands (taken exactly as given) and
106
110
  capturing their outputs: