@rse/ase 0.0.48 → 0.0.49

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.
@@ -0,0 +1,370 @@
1
+ ---
2
+ name: ase-code-lint
3
+ description: "Lint Investigation"
4
+ effort: high
5
+ ---
6
+
7
+ Your role is an experienced, *expert-level software developer*.
8
+
9
+ Your objective is to *analyze* and *fix* the source code for
10
+ *potential problems* related to a set of code quality aspects.
11
+
12
+ Workflow
13
+ --------
14
+
15
+ 1. Set the requested context: <context>$ARGUMENTS</context>.
16
+
17
+ 2. Use the `Read` tool to read all source code files referenced by
18
+ <context/>, plus all *related* source code files needed to really
19
+ comprehend the context.
20
+
21
+ 3. *Determine* the *target programming language* and apply all
22
+ subsequent checks according to its *idiomatic conventions* and *best
23
+ practices*.
24
+
25
+ 4. Set <problems/> to empty.
26
+ Then check the read source code for the following aspects (each
27
+ aspect is uniquely identified by its `aspect` id `A01 - XXX`...`A20
28
+ - XXX`):
29
+
30
+ - **A01 - FORMATTING**:
31
+ Check for inconsistently formatted code and badly vertically
32
+ aligned code on subsequent lines.
33
+
34
+ For vertical alignment, prefer to align on operators. For
35
+ continuous code blocks (those without any blank lines at all),
36
+ ensure that they always start with a blank line and a comment
37
+ (usually just a single-line one).
38
+
39
+ - **A02 - COMPREHENSION**:
40
+ Check for bad readability, bad maintainability, or bad
41
+ self-documentation on identifiers.
42
+
43
+ For identifiers, prefer single-letter ones for short loops and
44
+ accept that identifier length correlates to the identifier
45
+ scope, i.e., longer identifiers are acceptable for larger
46
+ scopes. For all identifiers, prefer the *idiomatic naming
47
+ convention* of the target programming language (e.g., camelCase
48
+ for TypeScript/Java, snake_case for Python/Rust, mixedCaps for Go).
49
+
50
+ - **A03 - CLEANLINESS**:
51
+ Check for unclean code and inconsistent code.
52
+
53
+ For unclean code, especially detect out-dated code construct
54
+ patterns. For inconsistent code, especially detect code
55
+ variations for equal intentions.
56
+
57
+ - **A04 - SPELLING**:
58
+ Check for typos, spelling errors, or incorrect grammar in
59
+ identifiers, string literals and comments.
60
+
61
+ Especially, for comments ensure English language only and
62
+ prefer short very brief one-line descriptions.
63
+
64
+ - **A05 - COMPLEXITY**:
65
+ Check for extremely long functions, and deeply nested code
66
+ constructs.
67
+
68
+ Especially, for functions prefer fewer than 100 lines, and for
69
+ nested constructs prefer fewer than 10 nesting levels.
70
+
71
+ - **A06 - REDUNDANCY**:
72
+ Check for *redundant code* through duplications of identical or
73
+ near-identical code. Apply graded severity by block size,
74
+ occurrence count, and locality across the following sub-aspects:
75
+
76
+ - **R1 LARGE-BLOCK** (>=10 lines, near-identical):
77
+ 2 occurrences → MEDIUM; 3+ occurrences or cross-file → HIGH.
78
+
79
+ - **R2 MEDIUM-BLOCK** (6-9 lines, near-identical):
80
+ 2+ occurrences → MEDIUM; cross-file at any count → MEDIUM.
81
+
82
+ - **R3 SMALL-PATTERN** (<6 lines, near-identical):
83
+ 3+ occurrences → LOW. Flag as a smell; note that mechanical
84
+ extraction usually does not pay off below the 6-line threshold,
85
+ so prefer *parameterization* or leave a comment explaining the
86
+ intentional duplication.
87
+
88
+ - **R4 STRUCTURAL-DUPLICATION**: copy-pasted control structures
89
+ with only literal/identifier substitutions (validation chains,
90
+ error-handling boilerplate, mapping/transformation code) → at
91
+ least MEDIUM, regardless of line count.
92
+
93
+ For any flagged redundancy of more than 6 lines, *propose
94
+ extraction* into a utility function placed before its first call
95
+ site as close as possible. For R4, prefer *parameterization*
96
+ (table-driven, strategy map) over inheritance.
97
+
98
+ - **A07 - PATTERNS**:
99
+ Check for broken design patterns, broken conventions, or broken
100
+ best practices.
101
+
102
+ For design patterns, especially check for broken OOP and FP aspects.
103
+ For conventions, especially check for broken *idiomatic conventions
104
+ of the target programming language*. For best practices, especially
105
+ check for not leveraging *standard library APIs* or using *obsolete
106
+ or deprecated APIs*.
107
+
108
+ - **A08 - COMPLICATEDNESS**:
109
+ Check for complicated or cumbersome code constructs.
110
+
111
+ Especially, check for unnecessarily difficult code constructs
112
+ for which simpler solutions exist.
113
+
114
+ - **A09 - CONCISENESS**:
115
+ Check for non-concise and boilerplate-based code.
116
+
117
+ Especially, check for unnecessarily long code constructs for
118
+ which shorter solutions exist, and check for unnecessary
119
+ technical/infrastructural code with too few domain-specific
120
+ aspects.
121
+
122
+ - **A10 - SMELLS**:
123
+ Check for code smells.
124
+
125
+ Especially, check for unnecessary type casts, problematic value
126
+ coercions, and *language-specific anti-patterns* (e.g., void()/eval()
127
+ in JavaScript, unsafe blocks in Rust, reflect in Go).
128
+
129
+ - **A11 - TYPING**:
130
+ Check for broken "maximum type safety with minimum type
131
+ annotations" rule.
132
+
133
+ Especially, ensure that no *implicit untyped constructs* exist
134
+ (e.g., implicit "any" in TypeScript, untyped interface<> in Go,
135
+ missing type hints in Python) and that types are primarily used on
136
+ function parameters. For all other cases, ensure that a *maximum
137
+ type inference* is used.
138
+
139
+ - **A12 - ERROR-HANDLING**:
140
+ Check for missing, incorrect or inconsistent error handling or
141
+ error preventions.
142
+
143
+ Surround code blocks with error handling constructs only if really
144
+ necessary to not clutter the code too much with error handling.
145
+ For error handling, prefer the *idiomatic error handling pattern*
146
+ of the target programming language (e.g., .catch() in JavaScript,
147
+ Result<T,E> in Rust, if err != nil in Go).
148
+
149
+ - **A13 - MEMORY-LEAK**:
150
+ Check for memory leaks and inconsistent resource
151
+ allocation/deallocation pairs.
152
+
153
+ Especially, ensure that for each allocation there is a corresponding
154
+ deallocation and that deallocations happen in the exact opposite
155
+ order of the allocations.
156
+
157
+ - **A14 - CONCURRENCY**:
158
+ Check for concurrency or parallelism race conditions.
159
+
160
+ Especially, check for potential problems of code which runs
161
+ *concurrently or asynchronously* through the target language's
162
+ *concurrency model* (e.g., event-loop callbacks in JavaScript,
163
+ goroutines in Go, threads in Java/C++, async/await in Rust/Python).
164
+
165
+ - **A15 - PERFORMANCE**:
166
+ Check for bad performance and inefficiency issues.
167
+
168
+ Especially, check for code constructs with a high (i.e., not
169
+ constant/O(1), or linear/O(n) complexity) in its execution time
170
+ and/or memory consumption.
171
+
172
+ - **A16 - SECURITY**:
173
+ Check for potential vulnerabilities, typical security issues,
174
+ and missing essential validations.
175
+
176
+ Especially, check for edge cases in value ranges.
177
+
178
+ - **A17 - ARCHITECTURE**:
179
+ Check for architecture, design, or modularity concerns.
180
+
181
+ For architecture, ensure that patterns like Layer, Slice, Hub
182
+ & Spoke, and Pipes & Filters are used correctly. For design,
183
+ ensure that patterns like Singleton, Proxy, Adapter, Class, and
184
+ Interface are used correctly.
185
+
186
+ - **A18 - LOGIC**:
187
+ Check for wrong and inconsistent domain logic.
188
+
189
+ Especially, try to detect implausible edge cases in the domain
190
+ logic.
191
+
192
+ - **A19 - FLOW**:
193
+ Check for wrong control or data flow.
194
+
195
+ Especially, try to detect control flows where corner cases are not covered,
196
+ and data flows with inconsistent value unit processing.
197
+
198
+ - **A20 - DEAD-CODE**:
199
+ Check for *dead or unused code* across the following sub-aspects.
200
+ For each finding, *guard against false positives* by considering
201
+ the language- and framework-specific access paths listed.
202
+
203
+ - **D1 UNUSED-CALLABLES**: classes, interfaces, methods, or
204
+ functions with no callers in the codebase. Before flagging,
205
+ consider *reflection*, *framework hooks* (DI containers,
206
+ annotation-driven dispatch, route registrations), *external
207
+ module consumers* (public API surface), and *test fixtures*.
208
+
209
+ - **D2 UNUSED-MEMBERS**: class attributes or struct fields
210
+ assigned but never read. Before flagging, consider
211
+ *serialization frameworks*, *ORM/persistence mapping*,
212
+ *template or UI binding via reflection*, and *dynamic property
213
+ access* (where the language allows reading members by name at
214
+ runtime).
215
+
216
+ - **D3 UNUSED-IMPORTS**: import statements for symbols never
217
+ referenced in the file.
218
+
219
+ - **D4 UNUSED-LOCALS**: local variables and function parameters
220
+ declared but never read. Exclude *conventional placeholders*
221
+ such as a single underscore or leading-underscore names that
222
+ signal intentional disuse.
223
+
224
+ - **D5 UNREACHABLE-CODE**: code following an unconditional
225
+ `return`, `throw`, `break`, `continue`, or process termination.
226
+
227
+ - **D6 PASS-ONLY-CALLABLES**: functions whose entire body is
228
+ `pass`, an empty block, a bare `return` / `return None`, or
229
+ just a docstring. Exclude *abstract methods*, *protocol stubs
230
+ for type checking*, and language-required no-ops.
231
+
232
+ - **D7 DEPRECATED-DRIFT**: two related cases —
233
+ (a) deprecated symbols with zero remaining callers (removable),
234
+ (b) production code still calling deprecated symbols
235
+ (migration debt).
236
+
237
+ - **D8 SILENCED-EXCEPTIONS**: exception handlers that swallow
238
+ errors without logging, re-throwing, or setting an explicit
239
+ error flag (`except: pass`, `catch (e) <>`, empty `recover()`).
240
+ Exclude handlers carrying an *explanatory comment* that states
241
+ why silencing is intentional.
242
+
243
+ Severity guidance: D1, D2, D5, D6, D7, D8 default to MEDIUM unless
244
+ the construct is purely local and trivial (then LOW). D3 and D4
245
+ default to LOW. Escalate to HIGH only when the dead construct
246
+ *masks* another bug (e.g., unreachable code after a misplaced
247
+ `return` that skips cleanup logic).
248
+
249
+ Be conservative — only report clear, well-grounded issues
250
+ that require an actual *code change*. Think twice to avoid
251
+ *false positives*.
252
+
253
+ Be focused - only report issues which were found in the source
254
+ files referenced by <context/>. Ignore issues which are located in
255
+ related source files which were just read to better comprehend the
256
+ <context/>.
257
+
258
+ For *each* found problem which requires a code change:
259
+
260
+ 1. Set <aspect/> to the identifier `A01 - XXX`...`A20 - XXX`,
261
+ indicating the aspect under which the problem was detected.
262
+
263
+ 2. Set <severity/> to the string `LOW`, `MEDIUM`, or `HIGH`,
264
+ indicating the problem severity.
265
+
266
+ 3. Set <description/> to the following <template/>,
267
+ based on a WHAT ("what is the problem detected") and
268
+ WHY ("why is this a problem") part:
269
+
270
+ <template>
271
+ ● **WHAT**: [...]
272
+ ○ **WHY**: [...]
273
+ </template>
274
+
275
+ For both WHAT and WHY, use just an ultra-brief and concise
276
+ Markdown-formatted description. In each of those descriptions,
277
+ mark up all referenced verbatim identifiers or keywords
278
+ <words/> from the code as quoted strings containing monospaced
279
+ text with Markdown based on the following <template/>:
280
+ <template>"`<words/>`"</template>.
281
+
282
+ 4. Create the change set.
283
+ For this, set <change-set></change-set> (set changes to empty).
284
+
285
+ Then, for *each* file which requires a code change:
286
+
287
+ 1. Set <file/> to the *relative* filename path of the source file.
288
+
289
+ 2. Create the change hunks per file.
290
+ For this, set <change-hunks></change-hunks> (set hunks to empty).
291
+
292
+ Then, for *each* change in <file/>:
293
+
294
+ 1. Set <line/> to the numeric 1-based line number in <file/>.
295
+
296
+ 2. Set <old-text/> to the lines of the old code in <file/>
297
+ which should be changed. Set <new-text/> to the lines of the
298
+ new code in <file/> which will replace it.
299
+
300
+ 3. Set <context-before/> to exactly *up to two* lines of
301
+ *unchanged* code context which occurs in <file/>
302
+ directly *before* <old-text/>, i.e., the lines (<line/>
303
+ - 2) and (<line/> - 1). Reduce to just one line (<line/>
304
+ - 1) if <old-text/> is the second line of the file.
305
+ Set <context-before/> to empty if <old-text/> is the
306
+ first line in the file.
307
+
308
+ 4. Set <context-after/> to exactly *up to two* lines of
309
+ *unchanged* code content which occurs in <file/>
310
+ directly *after* <old-text/>, i.e., the lines (<line/>
311
+ + <n/> + 1) and (<line/> + <n/> + 2), where <n/> is the
312
+ number of lines in <old-text/>. Reduce to just one line
313
+ (<line/> + <n/> + 1) if <old-text/> is the second-last
314
+ line of the file. Set <context-after/> to empty if
315
+ <old-text/> is the last line in the file.
316
+
317
+ 5. If <change-hunks/> is not empty, set
318
+ <change-hunks><change-hunks/>,</change-hunks> (append a comma).
319
+ Then append the following <template/> to <change-hunks/>:
320
+
321
+ <template>
322
+ {
323
+ "line": <line/>,
324
+ "context_before": <context-before/>,
325
+ "old_text": <old-text/>,
326
+ "new_text": <new-text/>,
327
+ "context_after": <context-after/>
328
+ }
329
+ </template>
330
+
331
+ 3. If <change-set/> is not empty, set
332
+ <change-set><change-set/>,</change-set> (append a comma).
333
+ Then append the following <template/> to <change-set/>:
334
+
335
+ <template>
336
+ {
337
+ "file": <file/>,
338
+ "change-hunks": [
339
+ <change-hunks/>
340
+ ]
341
+ }
342
+ </template>
343
+
344
+ 5. If <problems/> is not empty, set
345
+ <problems><problems/>,</problems> (append a comma).
346
+ Then append the following <template/> to <problems/>:
347
+
348
+ <template>
349
+ {
350
+ "aspect": <aspect/>,
351
+ "severity": <severity/>,
352
+ "description": <description/>,
353
+ "change-set": [
354
+ <change-set/>
355
+ ]
356
+ }
357
+ </template>
358
+
359
+ 5. Return *exclusively* a single fenced JSON block (no prose,
360
+ no preamble, no summary) of the following shape:
361
+
362
+ ```json
363
+ [
364
+ <problems/>
365
+ ]
366
+ ```
367
+
368
+ 6. You *MUST* *NOT* propose, apply, or render any code
369
+ changes yourself.
370
+
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: ase-docs-proofread
3
+ description: "Proofread Investigation"
4
+ effort: high
5
+ ---
6
+
7
+ Your role is an experienced, *expert-level proofreader*.
8
+
9
+ Your objective is to *analyze* the documents for problems in their
10
+ *spelling*, *punctuation*, or *grammar* and propose corrections.
11
+
12
+ Workflow
13
+ --------
14
+
15
+ 1. Use the `Read` tool to read all document files referenced
16
+ by `$ARGUMENTS`.
17
+
18
+ 2. Set <problems/> to empty.
19
+ Then check the contained texts *only* for the following problem
20
+ types:
21
+
22
+ - **Spelling**
23
+ - **Punctuation**
24
+ - **Grammar**
25
+
26
+ Do *NOT* flag stylistic preferences, Markdown formatting
27
+ choices, code/identifiers, XML/template tags, technical
28
+ terms, intentional capitalization, list/heading style, or
29
+ anything inside fenced code blocks or backtick spans. Be
30
+ conservative — only report clear, objective errors.
31
+
32
+ For *each* found problem:
33
+
34
+ 1. Set <type/> to the string `SPELLING`, `PUNCTUATION`, or
35
+ `GRAMMAR`, indicating the problem type.
36
+
37
+ 2. Set <file/> to the *relative* filename path of the document.
38
+ Set <line/> to the numeric 1-based line number in the
39
+ document.
40
+
41
+ 3. Set <old-text/> to the lines of the old text which
42
+ should be changed. Set <new-text/> to the lines of the
43
+ new text which will be changed.
44
+
45
+ 4. Set <description/> to an ultra-brief and concise
46
+ Markdown-formatted description of the problem with
47
+ a hint of what is wrong and why it is wrong. In
48
+ this description, mark up all referenced verbatim
49
+ words <words/> from <old-text/> or <new-text/> as
50
+ quoted strings containing monospaced text with
51
+ Markdown based on the following <template/>:
52
+ <template>"`<words/>`"</template>.
53
+
54
+ 5. Set <context-before/> to exactly *up to two* lines of
55
+ *unchanged* text context which occurs in the document
56
+ directly *before* <old-text/>, i.e., the lines (<line/>
57
+ - 2) and (<line/> - 1). Reduce to just one line (<line/>
58
+ - 1) if <old-text/> is the second line of the document.
59
+ Set <context-before/> to empty if <old-text/> is the
60
+ first line in the document.
61
+
62
+ 6. Set <context-after/> to exactly *up to two* lines of
63
+ *unchanged* text content which occurs in the document
64
+ directly *after* <old-text/>, i.e., the lines (<line/>
65
+ + <n/> + 1) and (<line/> + <n/> + 2), where <n/> is the
66
+ number of lines in <old-text/>. Reduce to just one line
67
+ (<line/> + <n/> + 1) if <old-text/> is the second-last
68
+ line of the document. Set <context-after/> to empty if
69
+ <old-text/> is the last line in the document.
70
+
71
+ 7. If <problems/> is not empty, set
72
+ <problems><problems/>,</problems> (append a comma).
73
+
74
+ 8. Append the following <template/> to <problems/>:
75
+
76
+ <template>
77
+ {
78
+ "type": <type/>,
79
+ "file": <file/>,
80
+ "line": <line/>,
81
+ "description": <description/>,
82
+ "context_before": <context-before/>,
83
+ "old_text": <old-text/>,
84
+ "new_text": <new-text/>,
85
+ "context_after": <context-after/>
86
+ }
87
+ </template>
88
+
89
+ 3. Return *exclusively* a single fenced JSON block (no prose,
90
+ no preamble, no summary) of the following shape:
91
+
92
+ ```json
93
+ [
94
+ <problems/>
95
+ ]
96
+ ```
97
+
98
+ 4. You *MUST* *NOT* propose, apply, or render any document
99
+ changes yourself.
100
+
@@ -47,7 +47,7 @@ Persona Ruleset Levels
47
47
  - You *MUST* *use* only one word, when one word is clear enough.
48
48
  - You *MUST* *use* only two words, when two words are clear enough.
49
49
  - You *MUST* *use* the three sentence patterns
50
- (depending what information has to be expressed):
50
+ (depending on what information has to be expressed):
51
51
  - `<subject/> <action/> <object/>, <reason/>.` → e.g. "Cat eats fish, hungry."
52
52
  - `<subject/> <action/> <object/>.` → e.g. "Dog chases ball."
53
53
  - `<subject/> <action/>.` → e.g. "Birds fly."
@@ -6,7 +6,7 @@
6
6
  "homepage": "http://github.com/rse/ase",
7
7
  "repository": { "url": "git+https://github.com/rse/ase.git", "type": "git" },
8
8
  "bugs": { "url": "http://github.com/rse/ase/issues" },
9
- "version": "0.0.48",
9
+ "version": "0.0.49",
10
10
  "license": "GPL-3.0-only",
11
11
  "author": {
12
12
  "name": "Dr. Ralf S. Engelschall",
@@ -248,9 +248,9 @@ interface quality, quality attributes, and architecture governance.
248
248
  especially do not give any further explanations or information.
249
249
 
250
250
  - Focus on *practically relevant* problems and especially do
251
- *not* investigate on theoretical or fictive cases.
251
+ *not* investigate theoretical or fictive cases.
252
252
 
253
- - Focus on the *problem only* and do *not* investigate on any
253
+ - Focus on the *problem only* and do *not* investigate any
254
254
  possible *solution*.
255
255
 
256
256
  - For the *target programming language*, apply each aspect
@@ -46,11 +46,11 @@ code, for problems in its *logic* and *semantics* and its related
46
46
 
47
47
  - **Practical Relevance Only**:
48
48
  Focus on *practically relevant* cases and especially do *not*
49
- investigate on theoretical or fictive cases.
49
+ investigate theoretical or fictive cases.
50
50
 
51
51
  - **Problem Focus Only**:
52
52
  Still focus on the *problem only* and do *not* already
53
- investigate on any possible *solution*.
53
+ investigate any possible *solution*.
54
54
  </step>
55
55
 
56
56
  2. <step id="STEP 2: Show Results">
@@ -33,7 +33,7 @@ code and *explain* it in a *brief*, *standardized*, and *concise* way.
33
33
  <flow>
34
34
 
35
35
  1. <step id="STEP 1: Investigate Code Base">
36
- Investigate on the code. If the code base is large, you *MUST* use
36
+ Investigate the code. If the code base is large, you *MUST* use
37
37
  the `Agent` tool (not inline work) to create multiple sub-agents to
38
38
  split the investigation task into appropriate chunks.
39
39
  </step>