@rse/ase 0.0.30 → 0.0.31

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 (48) hide show
  1. package/dst/ase-hello.js +22 -0
  2. package/dst/ase-hook.js +3 -1
  3. package/dst/ase-setup.js +10 -7
  4. package/package.json +2 -1
  5. package/plugin/.claude/settings.local.json +7 -0
  6. package/plugin/.claude-plugin/plugin.json +20 -0
  7. package/plugin/.github/plugin/plugin.json +21 -0
  8. package/plugin/agents/ase-meta-chat.md +10 -0
  9. package/plugin/agents/ase-meta-search.md +16 -0
  10. package/plugin/commands/ase-code-lint/complete.md +9 -0
  11. package/plugin/commands/ase-code-lint/explain.md +9 -0
  12. package/plugin/commands/ase-code-lint/nope.md +11 -0
  13. package/plugin/commands/ase-code-lint/reassess.md +15 -0
  14. package/plugin/commands/ase-code-lint/recheck.md +9 -0
  15. package/plugin/commands/ase-code-lint/refine.md +9 -0
  16. package/plugin/hooks/hooks-copilot.json +23 -0
  17. package/plugin/hooks/hooks.json +40 -0
  18. package/plugin/meta/ase-constitution.md +114 -0
  19. package/plugin/meta/ase-dialog.md +122 -0
  20. package/plugin/meta/ase-persona.md +63 -0
  21. package/plugin/meta/ase-plan.md +69 -0
  22. package/plugin/meta/ase-skill.md +238 -0
  23. package/plugin/skills/ase-arch-analyze/SKILL.md +442 -0
  24. package/plugin/skills/ase-arch-discover/SKILL.md +160 -0
  25. package/plugin/skills/ase-code-analyze/SKILL.md +108 -0
  26. package/plugin/skills/ase-code-craft/SKILL.md +237 -0
  27. package/plugin/skills/ase-code-explain/SKILL.md +115 -0
  28. package/plugin/skills/ase-code-insight/SKILL.md +96 -0
  29. package/plugin/skills/ase-code-lint/SKILL.md +382 -0
  30. package/plugin/skills/ase-code-refactor/SKILL.md +241 -0
  31. package/plugin/skills/ase-code-resolve/SKILL.md +299 -0
  32. package/plugin/skills/ase-meta-changes/SKILL.md +95 -0
  33. package/plugin/skills/ase-meta-chat/SKILL.md +58 -0
  34. package/plugin/skills/ase-meta-commit/SKILL.md +64 -0
  35. package/plugin/skills/ase-meta-diagram/SKILL.md +101 -0
  36. package/plugin/skills/ase-meta-evaluate/SKILL.md +247 -0
  37. package/plugin/skills/ase-meta-persona/SKILL.md +52 -0
  38. package/plugin/skills/ase-meta-quorum/SKILL.md +122 -0
  39. package/plugin/skills/ase-meta-search/SKILL.md +48 -0
  40. package/plugin/skills/ase-meta-why/SKILL.md +69 -0
  41. package/plugin/skills/ase-task-delete/SKILL.md +76 -0
  42. package/plugin/skills/ase-task-edit/SKILL.md +390 -0
  43. package/plugin/skills/ase-task-id/SKILL.md +46 -0
  44. package/plugin/skills/ase-task-implement/SKILL.md +146 -0
  45. package/plugin/skills/ase-task-list/SKILL.md +44 -0
  46. package/plugin/skills/ase-task-preflight/SKILL.md +181 -0
  47. package/plugin/skills/ase-task-reboot/SKILL.md +161 -0
  48. package/plugin/skills/ase-task-view/SKILL.md +81 -0
@@ -0,0 +1,382 @@
1
+ ---
2
+ name: ase-code-lint
3
+ argument-hint: "<source-reference>"
4
+ description: >
5
+ Lint Source Code.
6
+ user-invocable: true
7
+ disable-model-invocation: false
8
+ effort: medium
9
+ ---
10
+
11
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-persona.md
12
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
13
+
14
+ Lint Source Code
15
+ ================
16
+
17
+ Your role is an experienced, *expert-level software developer*,
18
+ specialized in *analyzing source code*.
19
+
20
+ <objective>
21
+ *Analyze* the code of $ARGUMENTS for *potential problems*
22
+ related to a set of code quality aspects.
23
+ </objective>
24
+
25
+ <define name="linter">
26
+ Your current *sub-objective* is:
27
+ <content/>
28
+
29
+ For this, first output the following <template/> to inform the user:
30
+
31
+ <template>
32
+ **<arg1/>**: <content/>
33
+ </template>
34
+
35
+ Then decide whether you detected *potential problems* which
36
+ *requires* a *code change* and *think* about this decision to be
37
+ sure it is *not* a false positive. Then choose one of the following
38
+ cases:
39
+
40
+ - **CASE 1**: **NEGATIVE**
41
+ In case of *no* necessary code changes,
42
+ display the following output <template/>:
43
+
44
+ <template>
45
+
46
+ &#x26AA; **RESULT**: No issues found, no code changes necessary.
47
+
48
+ </template>
49
+
50
+ Especially, do *not* output any further explanations.
51
+
52
+ - **CASE 2**: **POSITIVE**
53
+
54
+ In case of necessary code changes, display a *brief explanation*
55
+ *what* the *problem* is and *how* the proposed *solution* fixes
56
+ it. Emphasize important keywords in your explanation texts and
57
+ use the following <template/> for those outputs:
58
+
59
+ <template>
60
+
61
+ &#x1F7E0; **PROBLEM**: [...]
62
+
63
+ &#x1F535; **SOLUTION**: [...]
64
+
65
+ </template>
66
+
67
+ Especially, do *not* output any further explanations.
68
+
69
+ After this, immediately propose a corresponding *complete source
70
+ code change set*. For this, keep all source code changes as
71
+ *surgical and small* as possible.
72
+ </define>
73
+
74
+ <flow>
75
+ 1. <step id="Preparation">
76
+ *Find* and *read* all the corresponding source code files
77
+ and all *related* source code files.
78
+ *Determine* the *target programming language* and apply all
79
+ subsequent checks according to its *idiomatic conventions*
80
+ and *best practices*.
81
+ </step>
82
+
83
+ 2. <step id="A01 - FORMATTING">
84
+ <expand name="linter" arg1="A01 - FORMATTING">
85
+ Check for inconsistently formatted code and badly vertically
86
+ aligned code on sub-sequent lines.
87
+
88
+ For vertical alignment, prefer to align on operators. For
89
+ continuous code blocks (those without any blank lines at all),
90
+ ensure that they always start with a blank line and a comment
91
+ (usually just a single-line one).
92
+ </expand>
93
+ </step>
94
+
95
+ 3. <step id="A02 - COMPREHENSION">
96
+ <expand name="linter" arg1="A02 - COMPREHENSION">
97
+ Check for bad readability, bad maintainability, or bad
98
+ self-documentation on identifiers.
99
+
100
+ For identifiers, prefer single-letter ones for short loops and
101
+ accept that identifier length correlates to the identifier
102
+ scope, i.e., longer identifiers are acceptable for larger
103
+ scopes. For all identifiers, prefer the *idiomatic naming
104
+ convention* of the target programming language (e.g., camelCase
105
+ for TypeScript/Java, snake_case for Python/Rust, mixedCaps for Go).
106
+ </expand>
107
+ </step>
108
+
109
+ 4. <step id="A03 - CLEANLINESS">
110
+ <expand name="linter" arg1="A03 - CLEANLINESS">
111
+ Check for unclean code and inconsistent code.
112
+
113
+ For unclean code, especially detect out-dated code construct
114
+ patterns. For inconsistent code, especially detect code
115
+ variations for equal intentions.
116
+ </expand>
117
+ </step>
118
+
119
+ 5. <step id="A04 - SPELLING">
120
+ <expand name="linter" arg1="A04 - SPELLING">
121
+ Check for typos, spelling errors, or incorrect grammar in
122
+ identifiers, string literals and comments.
123
+
124
+ Especially, for comments ensure English language only and
125
+ prefer short very brief one-line descriptions.
126
+ </expand>
127
+ </step>
128
+
129
+ 6. <step id="A05 - COMPLEXITY">
130
+ <expand name="linter" arg1="A05 - COMPLEXITY">
131
+ Check for extremely long functions, and deeply nested code
132
+ constructs.
133
+
134
+ Especially, for functions prefer fewer then 100 lines, and for
135
+ nested constructs prefer fewer than 10 nesting levels.
136
+ </expand>
137
+ </step>
138
+
139
+ 7. <step id="A06 - REDUNDANCY">
140
+ <expand name="linter" arg1="A06 - REDUNDANCY">
141
+ Check for *redundant code* through duplications of identical or
142
+ near-identical code. Apply graded severity by block size,
143
+ occurrence count, and locality across the following sub-aspects:
144
+
145
+ - **R1 LARGE-BLOCK** (>=10 lines, near-identical):
146
+ 2 occurrences → MEDIUM; 3+ occurrences or cross-file → HIGH.
147
+
148
+ - **R2 MEDIUM-BLOCK** (6-9 lines, near-identical):
149
+ 2+ occurrences → MEDIUM; cross-file at any count → MEDIUM.
150
+
151
+ - **R3 SMALL-PATTERN** (<6 lines, near-identical):
152
+ 3+ occurrences → LOW. Flag as a smell; note that mechanical
153
+ extraction usually does not pay off below the 6-line threshold,
154
+ so prefer *parameterization* or leave a comment explaining the
155
+ intentional duplication.
156
+
157
+ - **R4 STRUCTURAL-DUPLICATION**: copy-pasted control structures
158
+ with only literal/identifier substitutions (validation chains,
159
+ error-handling boilerplate, mapping/transformation code) → at
160
+ least MEDIUM, regardless of line count.
161
+
162
+ For any flagged redundancy of more than 6 lines, *propose
163
+ extraction* into a utility function placed before its first call
164
+ site as close as possible. For R4, prefer *parameterization*
165
+ (table-driven, strategy map) over inheritance.
166
+ </expand>
167
+ </step>
168
+
169
+ 8. <step id="A07 - PATTERNS">
170
+ <expand name="linter" arg1="A07 - PATTERNS">
171
+ Check for broken design patterns, broken conventions, or broken
172
+ best practices.
173
+
174
+ For design patterns, especially check for broken OOP and FP aspects.
175
+ For conventions, especially check for broken *idiomatic conventions
176
+ of the target programming language*. For best practices, especially
177
+ check for not leveraging *standard library APIs* or using *obsolete
178
+ or deprecated APIs*.
179
+ </expand>
180
+ </step>
181
+
182
+ 9. <step id="A08 - COMPLICATENESS">
183
+ <expand name="linter" arg1="A08 - COMPLICATENESS">
184
+ Check for complicated or cumbersome code constructs.
185
+
186
+ Especially, check for unnecessary difficult code constructs
187
+ for which simpler solutions exist.
188
+ </expand>
189
+ </step>
190
+
191
+ 10. <step id="A09 - CONCISENESS">
192
+ <expand name="linter" arg1="A09 - CONCISENESS">
193
+ Check for non-concise and boilerplate-based code.
194
+
195
+ Especially, check for unnecessary long code constructs for
196
+ which shorter solutions exist, and check for unnecessary
197
+ technical/infrastructural code with too less domain-specific
198
+ aspects.
199
+ </expand>
200
+ </step>
201
+
202
+ 11. <step id="A10 - SMELLS">
203
+ <expand name="linter" arg1="A10 - SMELLS">
204
+ Check for code smells.
205
+
206
+ Especially, check for unnecessary type casts, problematic value
207
+ coercions, and *language-specific anti-patterns* (e.g., void()/eval()
208
+ in JavaScript, unsafe blocks in Rust, reflect in Go).
209
+ </expand>
210
+ </step>
211
+
212
+ 12. <step id="A11 - TYPING">
213
+ <expand name="linter" arg1="A11 - TYPING">
214
+ Check for broken "maximum type safety with minimum type
215
+ annotations" rule.
216
+
217
+ Especially, ensure that no *implicit untyped constructs* exist
218
+ (e.g., implicit "any" in TypeScript, untyped interface{} in Go,
219
+ missing type hints in Python) and that types are primarily used on
220
+ function parameters. For all other cases, ensure that a *maximum
221
+ type inference* is used.
222
+ </expand>
223
+ </step>
224
+
225
+ 13. <step id="A12 - ERROR-HANDLING">
226
+ <expand name="linter" arg1="A12 - ERROR-HANDLING">
227
+ Check for missing, incorrect or inconsistent error handling or
228
+ error preventions.
229
+
230
+ Surround code blocks with error handling constructs only if really
231
+ necessary to not clutter the code too much with error handling.
232
+ For error handling, prefer the *idiomatic error handling pattern*
233
+ of the target programming language (e.g., .catch() in JavaScript,
234
+ Result<T,E> in Rust, if err != nil in Go).
235
+ </expand>
236
+ </step>
237
+
238
+ 14. <step id="A13 - MEMORY-LEAK">
239
+ <expand name="linter" arg1="A13 - MEMORY-LEAK">
240
+ Check for memory leaks and inconsistent resource
241
+ allocation/deallocation pairs.
242
+
243
+ Especially, ensure that for each allocation there is a corresponding
244
+ deallocation and that deallocations happen in the exact opposite
245
+ order of the allocations.
246
+ </expand>
247
+ </step>
248
+
249
+ 15. <step id="A14 - CONCURRENCY">
250
+ <expand name="linter" arg1="A14 - CONCURRENCY">
251
+ Check for concurrency or parallelism race conditions.
252
+
253
+ Especially, check for potential problems of code which runs
254
+ *concurrently or asynchronously* through the target language's
255
+ *concurrency model* (e.g., event-loop callbacks in JavaScript,
256
+ goroutines in Go, threads in Java/C++, async/await in Rust/Python).
257
+ </expand>
258
+ </step>
259
+
260
+ 16. <step id="A15 - PERFORMANCE">
261
+ <expand name="linter" arg1="A15 - PERFORMANCE">
262
+ Check for bad performance and inefficiency issues.
263
+
264
+ Especially, check for code constructs with a high (i.e., not
265
+ constant/O(1), or linear/O(n) complexity) in its execution time
266
+ and/or memory consumption.
267
+ </expand>
268
+ </step>
269
+
270
+ 17. <step id="A16 - SECURITY">
271
+ <expand name="linter" arg1="A16 - SECURITY">
272
+ Check for potential vulnerabilities, typical security issues,
273
+ and missing essential validations.
274
+
275
+ Especially, check for edge cases in value ranges.
276
+ </expand>
277
+ </step>
278
+
279
+ 18. <step id="A17 - ARCHITECTURE">
280
+ <expand name="linter" arg1="A17 - ARCHITECTURE">
281
+ Check for architecture, design, or modularity concerns.
282
+
283
+ For architecture, ensure that patterns like Layer, Slice, Hub
284
+ & Spoke, and Pipes & Filters are used correctly. For design,
285
+ ensure that patterns like Singleton, Proxy, Adapter, Class, and
286
+ Interface are used correctly.
287
+ </expand>
288
+ </step>
289
+
290
+ 19. <step id="A18 - LOGIC">
291
+ <expand name="linter" arg1="A18 - LOGIC">
292
+ Check for wrong and inconsistent domain logic.
293
+
294
+ Especially, try to detect implausible edge cases in the domain
295
+ logic.
296
+ </expand>
297
+ </step>
298
+
299
+ 20. <step id="A19 - FLOW">
300
+ <expand name="linter" arg1="A19 - FLOW">
301
+ Check for wrong control or data flow.
302
+
303
+ Especially, try to detect control flows where corner cases are not covered,
304
+ and data flows with inconsistent value unit processing.
305
+ </expand>
306
+ </step>
307
+
308
+ 21. <step id="A20 - DEAD-CODE">
309
+ <expand name="linter" arg1="A20 - DEAD-CODE">
310
+ Check for *dead or unused code* across the following sub-aspects.
311
+ For each finding, *guard against false positives* by considering
312
+ the language- and framework-specific access paths listed.
313
+
314
+ - **D1 UNUSED-CALLABLES**: classes, interfaces, methods, or
315
+ functions with no callers in the codebase. Before flagging,
316
+ consider *reflection*, *framework hooks* (DI containers,
317
+ annotation-driven dispatch, route registrations), *external
318
+ module consumers* (public API surface), and *test fixtures*.
319
+
320
+ - **D2 UNUSED-MEMBERS**: class attributes or struct fields
321
+ assigned but never read. Before flagging, consider
322
+ *serialization frameworks*, *ORM/persistence mapping*,
323
+ *template or UI binding via reflection*, and *dynamic property
324
+ access* (where the language allows reading members by name at
325
+ runtime).
326
+
327
+ - **D3 UNUSED-IMPORTS**: import statements for symbols never
328
+ referenced in the file.
329
+
330
+ - **D4 UNUSED-LOCALS**: local variables and function parameters
331
+ declared but never read. Exclude *conventional placeholders*
332
+ such as a single underscore or leading-underscore names that
333
+ signal intentional disuse.
334
+
335
+ - **D5 UNREACHABLE-CODE**: code following an unconditional
336
+ `return`, `throw`, `break`, `continue`, or process termination.
337
+
338
+ - **D6 PASS-ONLY-CALLABLES**: functions whose entire body is
339
+ `pass`, an empty block, a bare `return` / `return None`, or
340
+ just a docstring. Exclude *abstract methods*, *protocol stubs
341
+ for type checking*, and language-required no-ops.
342
+
343
+ - **D7 DEPRECATED-DRIFT**: two related cases —
344
+ (a) deprecated symbols with zero remaining callers (removable),
345
+ (b) production code still calling deprecated symbols
346
+ (migration debt).
347
+
348
+ - **D8 SILENCED-EXCEPTIONS**: exception handlers that swallow
349
+ errors without logging, re-throwing, or setting an explicit
350
+ error flag (`except: pass`, `catch (e) {}`, empty `recover()`).
351
+ Exclude handlers carrying an *explanatory comment* that states
352
+ why silencing is intentional.
353
+
354
+ Severity guidance: D1, D2, D5, D6, D7, D8 default to MEDIUM unless
355
+ the construct is purely local and trivial (then LOW). D3 and D4
356
+ default to LOW. Escalate to HIGH only when the dead construct
357
+ *masks* another bug (e.g., unreachable code after a misplaced
358
+ `return` that skips cleanup logic).
359
+ </expand>
360
+ </step>
361
+
362
+ 22. <step id="Summary">
363
+ At the end, do not give any more explanations, except for
364
+ a summary of all accepted and rejected code
365
+ changes. For this, according to the original step ordering,
366
+ use the following output <template/>, where
367
+ `&#x1F7E0; **AX - XXX**: N issues` is used for aspects
368
+ with N issues and `&#x26AA; **AX - XXX**: no issues`
369
+ for aspects without any issues:
370
+
371
+ <template>
372
+ **SUMMARY**:
373
+
374
+ &#x1F7E0; **AX - XXX**: N issues
375
+
376
+ &#x26AA; **AX - XXX**: no issues
377
+
378
+ [...]
379
+ </template>
380
+ </step>
381
+ </flow>
382
+
@@ -0,0 +1,241 @@
1
+ ---
2
+ name: ase-code-refactor
3
+ argument-hint: "[<task-id>:] <request>"
4
+ description: >
5
+ Refactor Code Base:
6
+ Use when user wants to refactor the code base.
7
+ user-invocable: true
8
+ disable-model-invocation: false
9
+ effort: high
10
+ allowed-tools:
11
+ - "Skill"
12
+ ---
13
+
14
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-persona.md
15
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
16
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md
17
+
18
+ Refactor Artifacts
19
+ ==================
20
+
21
+ <skill name="ase-code-refactor">
22
+ Refactor Artifacts
23
+ </skill>
24
+
25
+ <role>
26
+ Your role is an experienced, *expert-level software developer*.
27
+ </role>
28
+
29
+ <objective>
30
+ *Refactor* existing artifacts the following way:
31
+ <request>$ARGUMENTS</request>
32
+ </objective>
33
+
34
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-plan.md
35
+
36
+ Procedure
37
+ ---------
38
+
39
+ You *MUST* follow the following numbered items *strictly* *sequentially*!
40
+ You *MUST* not skip any numbered item during processing!
41
+
42
+ You *MUST* *NOT* output anything in this entire procedure, *except* when
43
+ explicitly requested by this procedure via outputs based on a <template/>!
44
+
45
+ 1. **Reason About Refactoring**:
46
+
47
+ 1. <if condition="
48
+ <request/> matches the regexp `^[a-zA-Z][a-zA-Z0-9_-]*$`
49
+ ">
50
+ Set <ase-task-id><request/></ase-task-id> (set task id to request)
51
+ and <request></request> (set request empty), call the
52
+ `task_id(id: <ase-task-id/>, session: <ase-session-id/>)` tool
53
+ from the `ase` MCP service to switch the task, and then only
54
+ output the following <template/>:
55
+
56
+ <template>
57
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ▶ status: **task given**
58
+ </template>
59
+ </if>
60
+
61
+ 2. If <request/> has the format `<id/>: <text/>` where <id/> matches
62
+ the regexp `^[a-zA-Z][a-zA-Z0-9_-]*$`, then set
63
+ <request><text/></request> and <ase-task-id><id/></ase-task-id>
64
+ and call the `task_id(id: <ase-task-id/>, session:
65
+ <ase-session-id/>)` tool from the `ase` MCP service to
66
+ implicitly switch the task.
67
+
68
+ 3. If <request/> is empty,
69
+ ask the user interactively, without a special tool, for the
70
+ initial request with a single question:
71
+
72
+ `**No refactoring details known yet. What is the refactoring you want to request?**`
73
+
74
+ Then set <request/> to the response of the user.
75
+
76
+ 4. Report the task and request with the following <template/>:
77
+
78
+ <template>
79
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**
80
+ ⧉ **ASE**: ⇌ request: **<request/>**
81
+ </template>
82
+
83
+ 5. Figure out what the artifact refactoring <request/> is about.
84
+
85
+ 6. Ask the user for clarification if the goal of this refactoring is
86
+ too unclear.
87
+
88
+ 7. Do not output anything in this step, except you asked the user.
89
+
90
+ 2. **Investigate Code Base**:
91
+
92
+ 1. Check the existing source files for all code which is related to the
93
+ refactoring <request/>.
94
+
95
+ 2. Check the architecture of the existing code base to understand the
96
+ overall structures and dynamics.
97
+
98
+ 3. Do not output anything in this step.
99
+
100
+ 3. **Find Refactoring Approaches**:
101
+
102
+ 1. *Propose* corresponding *refactoring approach*, including
103
+ optionally, some *alternative* refactoring approaches.
104
+
105
+ 2. Annotate the approach you recommend with an <annotation/> of
106
+ ` ⚝ **RECOMMENDATION** ⚝`.
107
+
108
+ 3. Report each approach with the following <template/>
109
+ and do not output anything else in this step:
110
+
111
+ <template>
112
+ &#x1F535; **APPROACH A<n/>**<annotation/>: *<summary/>*
113
+ - [...]
114
+ - [...]
115
+ - [...]
116
+ <optional-diagram/>
117
+ </template>
118
+
119
+ Hints:
120
+
121
+ - Give a short one-sentence <summary/> of the refactoring approach plus
122
+ *precise* and *brief* refactoring information. Try to keep the
123
+ number of bullet points in the range of 1-4.
124
+
125
+ - In case of a *complex refactoring situation* only, visualize it with
126
+ an optional diagram <optional-diagram/> by invoking the
127
+ `ase-meta-diagram` skill via the `Skill` tool. For *current vs.
128
+ proposed* comparisons, render each side as a *separate*
129
+ `ase-meta-diagram` invocation and stack the rendered blocks
130
+ *vertically* (labels `**Before:**` / `**After:**`); never
131
+ side-by-side. Omit <optional-diagram/> entirely for simple or
132
+ purely local situation.
133
+
134
+ *Recommended* Tenets (generic):
135
+
136
+ - **Surgical Changes**:
137
+ Keep source code changes always as small as possible.
138
+
139
+ - **Separation of Concerns**:
140
+ Clearly separate all individual concerns as good as possible.
141
+
142
+ - **Single Responsibility Principle**:
143
+ Every module, class, or function should have only one reason to change.
144
+
145
+ - **Behavior Preservation**:
146
+ Refactoring changes only re-structure, never change any observable behavior.
147
+
148
+ - **Align with Code Base**:
149
+ Strictly align with the existing code base by exactly following its
150
+ coding style, its structure, its naming conventions, etc.
151
+
152
+ *Essential* Tenets (specific):
153
+
154
+ - **Boy Scout Rule**:
155
+ After the refactoring, leave the code base cleaner than you found it.
156
+
157
+ - **High Cohesion, Low Coupling**:
158
+ Strike for a set of small, focused parts (high cohesion) connected by
159
+ thin, explicit wires (low coupling).
160
+
161
+ 4. **Choose Refactoring Approach**:
162
+
163
+ 1. Let the *user interactively choose* the preferred refactoring approach A<n/>
164
+ with the help of the <user-dialog-tool/> tool. Use *single-selection* only
165
+ and provide small *code change previews*. Mark your recommended
166
+ refactoring approach with ` ⚝ **RECOMMENDATION** ⚝` here again.
167
+ Except for the interactive selection, do not output anything in this step.
168
+
169
+ 5. **Write Refactoring Plan**:
170
+
171
+ 1. *Write a refactoring plan* for the chosen refactoring A<n/> by
172
+ closely aligning to the existing architecture and the existing
173
+ code base. Use the <format/> defined for a task plan and inject
174
+ the information from refactoring A<n/> and all derived realization
175
+ decisions into it. Store the resulting task plan in <content/>.
176
+
177
+ 2. Call the `timestamp(format: "yyyy-LL-dd HH:mm")` tool of the
178
+ `ase` MCP service and use the `text` field of its response for
179
+ <timestamp-created/> and <timestamp-modified/> information. Then
180
+ insert the current <ase-task-id/>, <timestamp-created/>, and
181
+ <timestamp-modified/> information and calculate the number of
182
+ words <words/> of <content/>.
183
+
184
+ 3. You then *MUST* *save* the resulting plan content with the
185
+ `task_save(id: <ase-task-id/>, text: <content/>)`.
186
+
187
+ 4. Output a hint with the following <template/>:
188
+
189
+ <template>
190
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan created**
191
+ </template>
192
+
193
+ 5. *Ask user*: Let the *user interactively choose*
194
+ what to do as the next step.
195
+
196
+ <expand name="user-dialog>
197
+ Next Step: How would you like to proceed with the plan?
198
+ DONE: Stop processing.
199
+ EDIT: Hand processing off to editing.
200
+ PREFLIGHT: Hand processing off to preflighting.
201
+ IMPLEMENT: Hand processing off to implementation.
202
+ </expand>
203
+
204
+ 6. Check the tool <result/> and dispatch accordingly:
205
+
206
+ - If <result/> is `DONE` or `CANCEL`:
207
+ Only output the following <template/> and then *STOP*.
208
+
209
+ <template>
210
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **done**
211
+ </template>
212
+
213
+ - If <result/> is `EDIT`:
214
+ Only output the following <template/> and then use the
215
+ `Skill` tool to invoke the `ase:ase-task-edit` skill in
216
+ order to edit the plan. Immediately stop processing the
217
+ current skill once the `Skill` tool was used.
218
+
219
+ <template>
220
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **hand off to edit**
221
+ </template>
222
+
223
+ - If <result/> is `PREFLIGHT`:
224
+ Only output the following <template/> and then use the
225
+ `Skill` tool to invoke the `ase:ase-task-preflight` skill in
226
+ order to preflight the plan. Immediately stop processing the
227
+ current skill once the `Skill` tool was used.
228
+
229
+ <template>
230
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **hand off to preflight**
231
+ </template>
232
+
233
+ - If <result/> is `IMPLEMENT`:
234
+ Only output the following <template/> and then use the
235
+ `Skill` tool to invoke the `ase:ase-task-implement` skill in
236
+ order to implement the plan. Immediately stop processing the
237
+ current skill once the `Skill` tool was used.
238
+
239
+ <template>
240
+ ⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **hand off to implement**
241
+ </template>