@rse/ase 0.9.2 → 0.9.4
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.
- package/dst/ase-hello.js +24 -0
- package/dst/ase-statusline.js +15 -5
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.github/plugin/plugin.json +1 -1
- package/plugin/agents/ase-meta-review.md +188 -0
- package/plugin/etc/eslint.mjs +25 -0
- package/plugin/etc/markdownlint.yaml +13 -11
- package/plugin/etc/stx.conf +2 -1
- package/plugin/meta/ase-control.md +7 -2
- package/plugin/meta/ase-dialog.md +2 -0
- package/plugin/meta/ase-format-arch.md +31 -31
- package/plugin/meta/ase-format-spec.md +3 -3
- package/plugin/meta/ase-getopt.md +1 -0
- package/plugin/meta/ase-persona.md +1 -1
- package/plugin/meta/ase-skill.md +6 -6
- package/plugin/package.json +5 -2
- package/plugin/skills/ase-arch-analyze/SKILL.md +33 -33
- package/plugin/skills/ase-code-analyze/SKILL.md +162 -18
- package/plugin/skills/ase-code-analyze/help.md +47 -7
- package/plugin/skills/ase-code-lint/SKILL.md +11 -3
- package/plugin/skills/ase-code-lint/help.md +14 -1
- package/plugin/skills/ase-docs-distill/SKILL.md +158 -0
- package/plugin/skills/ase-docs-distill/help.md +76 -0
- package/plugin/skills/ase-docs-proofread/SKILL.md +1 -1
- package/plugin/skills/ase-docs-proofread/help.md +1 -1
- package/plugin/skills/ase-meta-brainstorm/SKILL.md +29 -15
- package/plugin/skills/ase-meta-brainstorm/help.md +21 -7
- package/plugin/skills/ase-meta-diaboli/SKILL.md +36 -13
- package/plugin/skills/ase-meta-diaboli/help.md +22 -4
- package/plugin/skills/ase-meta-diff/SKILL.md +110 -64
- package/plugin/skills/ase-meta-diff/help.md +30 -6
- package/plugin/skills/ase-meta-review/SKILL.md +184 -0
- package/plugin/skills/ase-meta-review/help.md +88 -0
- package/plugin/skills/ase-meta-steelman/SKILL.md +210 -0
- package/plugin/skills/ase-meta-steelman/help.md +92 -0
- package/plugin/skills/ase-meta-why/SKILL.md +20 -7
- package/plugin/skills/ase-meta-why/help.md +18 -5
- package/plugin/skills/ase-task-condense/SKILL.md +3 -3
- package/plugin/skills/ase-task-grill/SKILL.md +1 -1
- package/plugin/skills/ase-task-implement/help.md +1 -1
|
@@ -122,46 +122,46 @@ interface quality, quality attributes, and architecture governance.
|
|
|
122
122
|
task into appropriate chunks.
|
|
123
123
|
|
|
124
124
|
*Determine* the *target programming language* and the *declared
|
|
125
|
-
architecture style* (if any)
|
|
125
|
+
architecture style* (if any) - e.g., Layered, Hexagonal
|
|
126
126
|
(Ports & Adapters), Onion, Clean, CQRS, Microservices,
|
|
127
|
-
Event-Driven, Modular Monolith
|
|
127
|
+
Event-Driven, Modular Monolith - from code, project documentation,
|
|
128
128
|
README files, or folder structure.
|
|
129
129
|
|
|
130
130
|
Investigate the following architecture quality aspects across
|
|
131
131
|
7 thematic blocks:
|
|
132
132
|
|
|
133
|
-
**Block 1
|
|
133
|
+
**Block 1 - Component Boundaries**:
|
|
134
134
|
|
|
135
135
|
- **SA01 COMPONENT-RESPONSIBILITY**: each component (module,
|
|
136
|
-
class, package) addresses exactly *one single concern*
|
|
136
|
+
class, package) addresses exactly *one single concern* -
|
|
137
137
|
i.e., has exactly *one reason to change*.
|
|
138
138
|
- **SA02 COMPONENT-GRANULARITY**: components have *appropriate
|
|
139
|
-
size*
|
|
139
|
+
size* - neither monolithic nor fragmented.
|
|
140
140
|
- **SA03 COMPONENT-HIERARCHY**: components placed at the *correct
|
|
141
141
|
level* of the component hierarchy (system / program / module /
|
|
142
142
|
class / function).
|
|
143
143
|
|
|
144
|
-
**Block 2
|
|
144
|
+
**Block 2 - Structural Organization**:
|
|
145
145
|
|
|
146
146
|
- **SA04 LAYERING**: *layers* (horizontal cuts) clearly
|
|
147
147
|
separated, named, and ranked; no upward dependencies.
|
|
148
|
-
- **SA05 SLICING**: *slices* (vertical cuts
|
|
148
|
+
- **SA05 SLICING**: *slices* (vertical cuts - e.g., feature
|
|
149
149
|
modules, bounded contexts) clearly separated and *cycle-free*.
|
|
150
150
|
- **SA06 DEPENDENCY-DIRECTION**: dependencies flow in exactly
|
|
151
151
|
*one direction*; no *circular dependencies*.
|
|
152
|
-
- **SA07 REFERENCE-ARCHITECTURE**: *declared-style conformance*
|
|
152
|
+
- **SA07 REFERENCE-ARCHITECTURE**: *declared-style conformance* -
|
|
153
153
|
the chosen architecture style (see STEP 1 intro for the
|
|
154
154
|
recognized style list) is applied *consistently* throughout
|
|
155
155
|
the codebase, without accidental mixing of styles.
|
|
156
156
|
|
|
157
|
-
**Block 3
|
|
157
|
+
**Block 3 - Architecture Principles**:
|
|
158
158
|
|
|
159
|
-
- **SA08 COUPLING**: *loose data coupling* between components
|
|
159
|
+
- **SA08 COUPLING**: *loose data coupling* between components -
|
|
160
160
|
no *concrete-type dependencies* where abstractions exist, no
|
|
161
161
|
shared data structures leaking across boundaries, communication
|
|
162
162
|
via defined ports / facades / DTOs. (Runtime coupling such as
|
|
163
163
|
races and shared mutable state is covered by SA17.)
|
|
164
|
-
- **SA09 COHESION**: *strong cohesion* within each component
|
|
164
|
+
- **SA09 COHESION**: *strong cohesion* within each component -
|
|
165
165
|
internal parts (functions, fields, methods) are *tightly
|
|
166
166
|
related*, *co-change*, and share data or behavior; scattered
|
|
167
167
|
helpers that merely coexist by accident are flagged.
|
|
@@ -175,7 +175,7 @@ interface quality, quality attributes, and architecture governance.
|
|
|
175
175
|
behind a simple interface that *shields* its implementation
|
|
176
176
|
details.
|
|
177
177
|
|
|
178
|
-
**Block 4
|
|
178
|
+
**Block 4 - Interface Quality**:
|
|
179
179
|
|
|
180
180
|
- **SA13 INTERFACE-SIZE**: each interface *proportional in size*
|
|
181
181
|
to its functionality.
|
|
@@ -186,20 +186,20 @@ interface quality, quality attributes, and architecture governance.
|
|
|
186
186
|
*syntactic* and *semantic* contracts (pre/post-conditions,
|
|
187
187
|
invariants, idempotency, thread-safety).
|
|
188
188
|
|
|
189
|
-
**Block 5
|
|
189
|
+
**Block 5 - Quality Attributes**:
|
|
190
190
|
|
|
191
191
|
- **SA16 TESTABILITY**: architectural *seams* enable testing in
|
|
192
|
-
isolation
|
|
192
|
+
isolation - dependency injection at component boundaries,
|
|
193
193
|
mockable interfaces, side effects (DB, filesystem, network,
|
|
194
194
|
time, randomness) hidden behind abstractions.
|
|
195
195
|
- **SA17 CONCURRENCY**: the *concurrency model* (event loop,
|
|
196
196
|
threads, goroutines, async/await, actors, ...) is *explicitly
|
|
197
|
-
chosen* and applied *consistently*. *Runtime coupling*
|
|
197
|
+
chosen* and applied *consistently*. *Runtime coupling* -
|
|
198
198
|
thread-safety boundaries, shared mutable state, races, lock
|
|
199
|
-
hold times, async/sync boundaries
|
|
199
|
+
hold times, async/sync boundaries - is explicit and localized;
|
|
200
200
|
shared mutable state is protected.
|
|
201
201
|
|
|
202
|
-
**Block 6
|
|
202
|
+
**Block 6 - Architecture Governance**:
|
|
203
203
|
|
|
204
204
|
- **SA18 DECISION-RECORDS**: non-trivial architectural decisions
|
|
205
205
|
are *documented* with rationale (Architecture Decision Records
|
|
@@ -207,10 +207,10 @@ interface quality, quality attributes, and architecture governance.
|
|
|
207
207
|
The chosen style, deviations from defaults, and trade-offs are
|
|
208
208
|
traceable.
|
|
209
209
|
|
|
210
|
-
**Block 7
|
|
210
|
+
**Block 7 - Package Cohesion**:
|
|
211
211
|
|
|
212
212
|
- **SA19 PACKAGE-COHESION**: each first-party package has a
|
|
213
|
-
coherent role *and* topical theme
|
|
213
|
+
coherent role *and* topical theme - its members serve a
|
|
214
214
|
common purpose, share a dominant noun-cluster, and have
|
|
215
215
|
non-trivial cross-package use. Flag:
|
|
216
216
|
- *grab-bag*: members split into ≥3 unrelated topical
|
|
@@ -223,16 +223,16 @@ interface quality, quality attributes, and architecture governance.
|
|
|
223
223
|
overlap with the package's dominant noun-cluster, or with
|
|
224
224
|
its `package-info` / `README` declaration when present
|
|
225
225
|
- **SA20 PACKAGE-CYCLE**: no *cyclic dependencies* between
|
|
226
|
-
first-party packages
|
|
226
|
+
first-party packages - neither direct (`A → B` and `B → A`)
|
|
227
227
|
nor transitive (via *Tarjan SCC* or pairwise scan). Each
|
|
228
228
|
cycle is reported with the exact import lines that close it.
|
|
229
229
|
- **SA21 PACKAGE-SIZE**: package size and coupling shape are
|
|
230
|
-
justified
|
|
231
|
-
- *god-package*: *incoming ≥ 5* and *outgoing ≥ 3*
|
|
230
|
+
justified - flag packages at either extreme:
|
|
231
|
+
- *god-package*: *incoming ≥ 5* and *outgoing ≥ 3* -
|
|
232
232
|
coordinator dumping ground that should be split along its
|
|
233
233
|
internal topical clusters
|
|
234
234
|
- *fragment*: 1–2 files under a sibling parent that share a
|
|
235
|
-
*name prefix* or *imported interface* with that sibling
|
|
235
|
+
*name prefix* or *imported interface* with that sibling -
|
|
236
236
|
consolidation candidate
|
|
237
237
|
|
|
238
238
|
Hints:
|
|
@@ -253,7 +253,7 @@ interface quality, quality attributes, and architecture governance.
|
|
|
253
253
|
any claim about *ordering*, *lock hold time*, *thread
|
|
254
254
|
boundary*, or *call from context X*, trace the actual
|
|
255
255
|
acquire/release and call order line-by-line. Do not
|
|
256
|
-
pattern-match on "loop inside method with lock"
|
|
256
|
+
pattern-match on "loop inside method with lock" - verify
|
|
257
257
|
which operations sit *between* the specific acquire and
|
|
258
258
|
release in source order.
|
|
259
259
|
|
|
@@ -264,7 +264,7 @@ interface quality, quality attributes, and architecture governance.
|
|
|
264
264
|
incoming/outgoing class-edge map (drives SA20, SA21) and
|
|
265
265
|
the per-package noun-token frequency table extracted from
|
|
266
266
|
class names in camelCase / snake_case (drives SA19 topical
|
|
267
|
-
analysis). No external NLP
|
|
267
|
+
analysis). No external NLP - pure tokens. Cite each finding
|
|
268
268
|
with the exact import lines or class-name evidence.
|
|
269
269
|
|
|
270
270
|
- *Block 7 severity ladder*: SA20 (cycle) → HIGH; SA21
|
|
@@ -308,11 +308,11 @@ interface quality, quality attributes, and architecture governance.
|
|
|
308
308
|
Because `!` and `?` are Mermaid special characters, *always
|
|
309
309
|
quote* anomaly-bearing node labels:
|
|
310
310
|
|
|
311
|
-
- *Problem node*
|
|
311
|
+
- *Problem node* - prefix label with `!` inside quotes:
|
|
312
312
|
`A["!ComponentA"]`.
|
|
313
|
-
- *Unclear node*
|
|
313
|
+
- *Unclear node* - suffix label with `(?)` inside quotes:
|
|
314
314
|
`B["ComponentB (?)"]`.
|
|
315
|
-
- *Cyclic edge*
|
|
315
|
+
- *Cyclic edge* - annotate the *edge* (not a node) with a
|
|
316
316
|
`cycle` label on a bidirectional arrow:
|
|
317
317
|
`A <-- "cycle" --> B` (or two labelled one-way edges if
|
|
318
318
|
the renderer rejects `<-->`).
|
|
@@ -325,11 +325,11 @@ interface quality, quality attributes, and architecture governance.
|
|
|
325
325
|
Before reporting, classify every finding into one of three
|
|
326
326
|
categories:
|
|
327
327
|
|
|
328
|
-
- *Unpaired*
|
|
328
|
+
- *Unpaired* - single aspect violated, no partner in the
|
|
329
329
|
tension matrix hit → emit `PROBLEM` template.
|
|
330
|
-
- *Paired*
|
|
330
|
+
- *Paired* - exactly two aspects of a single tension pair hit
|
|
331
331
|
→ emit `TRADEOFF` template (cluster of size 2).
|
|
332
|
-
- *Clustered*
|
|
332
|
+
- *Clustered* - an aspect appears in *multiple* triggered
|
|
333
333
|
tensions (e.g., SA10 hit against both SA12 and SA13) →
|
|
334
334
|
collapse into *one* `TRADEOFF` with the recurring aspect
|
|
335
335
|
as *focal aspect* and the others as *partners*. One
|
|
@@ -367,7 +367,7 @@ interface quality, quality attributes, and architecture governance.
|
|
|
367
367
|
<template>
|
|
368
368
|
<ase-tpl-bullet-normal/> **TRADEOFF** T<n/> (Severity: <severity/>): **<title/>**
|
|
369
369
|
|
|
370
|
-
- *Focal aspect*: <focal-aspect/>
|
|
370
|
+
- *Focal aspect*: <focal-aspect/> - <focal-state/>
|
|
371
371
|
- *In tension with*: <partner-list/>
|
|
372
372
|
|
|
373
373
|
**RECOMMENDED**: lean toward *<focal|partners/>*
|
|
@@ -396,7 +396,7 @@ interface quality, quality attributes, and architecture governance.
|
|
|
396
396
|
(<description/>, <focal-state/>, partner-implications)
|
|
397
397
|
are *very brief* but *precise*. <rationale/> is exactly
|
|
398
398
|
*one sentence* grounded in the detected style, domain
|
|
399
|
-
constraints, or language idioms
|
|
399
|
+
constraints, or language idioms - never generic
|
|
400
400
|
principles.
|
|
401
401
|
|
|
402
402
|
- Highlight *code* as <template>`<code/>`</template>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ase-code-analyze
|
|
3
|
-
argument-hint: "[--help|-h] <source-reference>"
|
|
3
|
+
argument-hint: "[--help|-h] [--performance|-p] [--security|-s] [--severity|-S=(LOW|MEDIUM|HIGH)] <source-reference>"
|
|
4
4
|
description: >
|
|
5
|
-
Analyze the source code for problems in the logic and
|
|
5
|
+
Analyze the source code for problems in either the logic and
|
|
6
|
+
semantics and its related control flow, performance and efficiency,
|
|
7
|
+
or security.
|
|
6
8
|
user-invocable: true
|
|
7
9
|
disable-model-invocation: false
|
|
8
10
|
effort: high
|
|
@@ -12,50 +14,174 @@ allowed-tools:
|
|
|
12
14
|
|
|
13
15
|
@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
|
|
14
16
|
@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
|
|
17
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
|
|
15
18
|
|
|
16
19
|
<skill name="ase-code-analyze">
|
|
17
20
|
Analyze Source Code
|
|
18
21
|
</skill>
|
|
19
22
|
|
|
23
|
+
<expand name="getopt"
|
|
24
|
+
arg1="ase-code-analyze"
|
|
25
|
+
arg2="--performance|-p --security|-s --severity|-S=(LOW|MEDIUM|HIGH)">
|
|
26
|
+
$ARGUMENTS
|
|
27
|
+
</expand>
|
|
28
|
+
|
|
20
29
|
<objective>
|
|
21
|
-
*Analyze* the source code of
|
|
22
|
-
code, for problems
|
|
23
|
-
*
|
|
30
|
+
*Analyze* the source code of <getopt-arguments/>, and its directly
|
|
31
|
+
related source code, for problems - read-only, *without* applying any
|
|
32
|
+
changes. The *analysis lens* depends on the selected options: problems
|
|
33
|
+
in its *logic* and *semantics* and its related *control flow*, or
|
|
34
|
+
problems in *performance* and *efficiency*, or problems in *security*.
|
|
24
35
|
</objective>
|
|
25
36
|
|
|
26
37
|
<flow>
|
|
27
38
|
|
|
28
|
-
1. <step id="STEP 1:
|
|
29
|
-
|
|
39
|
+
1. <step id="STEP 1: Sanity Check Usage">
|
|
40
|
+
|
|
41
|
+
<if condition="<getopt-option-performance/> is equal `true` and <getopt-option-security/> is equal `true`">
|
|
42
|
+
|
|
43
|
+
Only output the following <template/> and then *STOP* immediately:
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
⧉ **ASE**: ✪ skill: **ase-code-analyze**, ▶ ERROR: options `--performance` and `--security` are mutually exclusive
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
</if>
|
|
50
|
+
|
|
51
|
+
</step>
|
|
52
|
+
|
|
53
|
+
2. <step id="STEP 2: Investigate Code Base">
|
|
54
|
+
|
|
55
|
+
In this STEP 2, investigate on the code. If the code base is large,
|
|
30
56
|
you *MUST* use the `Agent` tool (not inline work) to create multiple
|
|
31
57
|
sub-agents to split the investigation task into appropriate chunks.
|
|
32
58
|
|
|
33
59
|
Tenets:
|
|
34
60
|
|
|
35
61
|
- **Quiet Operation**:
|
|
36
|
-
|
|
62
|
+
|
|
63
|
+
During investigation in this STEP 2, do *not* output anything else,
|
|
37
64
|
especially do not give any further explanations or information.
|
|
38
65
|
|
|
39
66
|
- **Practical Relevance Only**:
|
|
67
|
+
|
|
40
68
|
Focus on *practically relevant* cases and especially do *not*
|
|
41
69
|
investigate theoretical or fictive cases.
|
|
42
70
|
|
|
43
71
|
- **Problem Focus Only**:
|
|
72
|
+
|
|
44
73
|
Still focus on the *problem only* and do *not* already
|
|
45
|
-
investigate any possible *solution*.
|
|
74
|
+
investigate any possible *solution* or apply any *change*.
|
|
75
|
+
|
|
76
|
+
- **Lens Focus**:
|
|
77
|
+
|
|
78
|
+
<if condition="<getopt-option-performance/> is equal `true`">
|
|
79
|
+
|
|
80
|
+
Focus on *performance* and *efficiency* only - and do *not*
|
|
81
|
+
investigate logic, semantics, control flow, or security
|
|
82
|
+
problems.
|
|
83
|
+
|
|
84
|
+
Analysis Hints (not exhaustive, just indicators):
|
|
85
|
+
- high algorithmic complexity
|
|
86
|
+
- needless resource allocations/copies
|
|
87
|
+
- redundant recomputation
|
|
88
|
+
- many I/O and query round-trips
|
|
89
|
+
- concurrency bottlenecks
|
|
90
|
+
- mismatched data structures
|
|
91
|
+
- [...]
|
|
92
|
+
|
|
93
|
+
</if>
|
|
94
|
+
|
|
95
|
+
<if condition="<getopt-option-security/> is equal `true`">
|
|
96
|
+
|
|
97
|
+
Focus on *security* only - and do *not* investigate logic,
|
|
98
|
+
semantics, performance, or efficiency problems.
|
|
99
|
+
|
|
100
|
+
Analysis Hints (not exhaustive, just indicators):
|
|
101
|
+
- unsafe data deserialization
|
|
102
|
+
- missing input data validation/sanitization
|
|
103
|
+
- broken authentication/authorization
|
|
104
|
+
- sensitive-data exposure
|
|
105
|
+
- path traversal
|
|
106
|
+
- unsafe cryptography
|
|
107
|
+
- hard-coded secrets
|
|
108
|
+
- vulnerable dependencies
|
|
109
|
+
- [...]
|
|
110
|
+
|
|
111
|
+
</if>
|
|
112
|
+
|
|
113
|
+
<if condition="<getopt-option-performance/> is NOT equal `true` and <getopt-option-security/> is NOT equal `true`">
|
|
114
|
+
|
|
115
|
+
Focus on problems in the *logic* and *semantics* and the related
|
|
116
|
+
*control flow* only - and do *not* investigate performance,
|
|
117
|
+
efficiency, or security problems.
|
|
118
|
+
|
|
119
|
+
Analysis Hints (not exhaustive, just indicators):
|
|
120
|
+
- incorrect conditionals and boolean logic
|
|
121
|
+
- off-by-one and boundary errors
|
|
122
|
+
- operator misuse
|
|
123
|
+
- mishandled edge cases
|
|
124
|
+
- broken or missing error handling
|
|
125
|
+
- incorrect async/await/promise handling
|
|
126
|
+
- control-flow defects (unreachable code, missing breaks, wrong early returns)
|
|
127
|
+
- state-mutation bugs
|
|
128
|
+
- incorrect default values
|
|
129
|
+
- null/undefined mishandling
|
|
130
|
+
- type-coercion bugs
|
|
131
|
+
- faulty parsing or merge/override semantics
|
|
132
|
+
- [...]
|
|
133
|
+
|
|
134
|
+
</if>
|
|
135
|
+
|
|
136
|
+
You *MUST* not output anything in this STEP 2.
|
|
137
|
+
|
|
46
138
|
</step>
|
|
47
139
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
140
|
+
3. <step id="STEP 3: Show Results">
|
|
141
|
+
|
|
142
|
+
Before reporting, *apply the severity floor* selected via
|
|
143
|
+
<getopt-option-severity/> (default `LOW`): define the ordinal rank
|
|
144
|
+
`LOW`=1, `MEDIUM`=2, `HIGH`=3. *Keep* a detected problem if and only
|
|
145
|
+
if its <severity/> is `ACCEPTED` *or* `rank(severity)` is greater
|
|
146
|
+
than or equal to `rank(<getopt-option-severity/>)`; *silently drop*
|
|
147
|
+
all other problems (they are neither reported nor persisted). With
|
|
148
|
+
the default floor `LOW`, all problems are kept. `ACCEPTED` problems
|
|
149
|
+
are *never* dropped. Then renumber the surviving problems
|
|
150
|
+
contiguously as `P<n/>` with <n/> = 1, 2, ... in the original
|
|
151
|
+
ordering. If *all* problems are dropped, skip the per-problem report
|
|
152
|
+
but still emit the final hint <template/> below.
|
|
153
|
+
|
|
154
|
+
In this STEP 3, for *EVERY* surviving problem, immediately report
|
|
155
|
+
it with the following output <template/>, based on concise bullet
|
|
51
156
|
points.
|
|
52
157
|
|
|
158
|
+
<if condition="<getopt-option-performance/> is equal `true`">
|
|
159
|
+
|
|
53
160
|
<template>
|
|
54
|
-
|
|
161
|
+
|
|
162
|
+
<ase-tpl-bullet-signal/> **PROBLEM** (Severity: **<severity/>**): **P<n/>**: **<title/>**
|
|
163
|
+
|
|
164
|
+
<description/>
|
|
165
|
+
|
|
166
|
+
⊙ EVIDENCE: <evidence/>
|
|
167
|
+
⊖ TRADEOFF: <trade-off/>
|
|
168
|
+
|
|
169
|
+
</template>
|
|
170
|
+
|
|
171
|
+
</if>
|
|
172
|
+
|
|
173
|
+
<if condition="<getopt-option-performance/> is NOT equal `true`">
|
|
174
|
+
|
|
175
|
+
<template>
|
|
176
|
+
|
|
177
|
+
<ase-tpl-bullet-signal/> **PROBLEM** (Severity: **<severity/>**): **P<n/>**: **<title/>**
|
|
55
178
|
|
|
56
179
|
<description/>
|
|
180
|
+
|
|
57
181
|
</template>
|
|
58
182
|
|
|
183
|
+
</if>
|
|
184
|
+
|
|
59
185
|
Hints:
|
|
60
186
|
|
|
61
187
|
- For the final results, do *not* output anything else, especially do
|
|
@@ -77,7 +203,23 @@ code, for problems in its *logic* and *semantics* and its related
|
|
|
77
203
|
|
|
78
204
|
- In <description/>, classify the problem with a <severity/>
|
|
79
205
|
of <template>LOW</template>, <template>MEDIUM</template> or
|
|
80
|
-
<template>HIGH</template
|
|
206
|
+
<template>HIGH</template>, ranked by the estimated *impact* of the
|
|
207
|
+
problem.
|
|
208
|
+
|
|
209
|
+
- <if condition="<getopt-option-performance/> is equal `true`">
|
|
210
|
+
In <evidence/>, ground the finding by citing either the inferred
|
|
211
|
+
*Big-O* time/space complexity (e.g. `O(n²)` reducible to `O(n)`)
|
|
212
|
+
with the exact driving loop or recursion, or the matched
|
|
213
|
+
performance *anti-pattern* (e.g. N+1 query, sync-in-loop, repeated
|
|
214
|
+
recompute, string concat in loop), with an inline code reference.
|
|
215
|
+
</if>
|
|
216
|
+
|
|
217
|
+
- <if condition="<getopt-option-performance/> is equal `true`">
|
|
218
|
+
In <trade-off/>, state the *cost* of the optimization (e.g.
|
|
219
|
+
readability, additional memory for speed, added complexity), so
|
|
220
|
+
the user can make an informed decision; use *none* if there is no
|
|
221
|
+
meaningful trade-off.
|
|
222
|
+
</if>
|
|
81
223
|
|
|
82
224
|
- *Additionally*, persist all reported problems in a *single*
|
|
83
225
|
`ase_kv_batch` call to the `ase` MCP server with `transactional`
|
|
@@ -85,17 +227,19 @@ code, for problems in its *logic* and *semantics* and its related
|
|
|
85
227
|
starts with one `{ command: "clear" }` entry, followed by one
|
|
86
228
|
`{ command: "set", key: "ase-issue-P<n/>", val: "<title/>:
|
|
87
229
|
<description/>" }` entry per reported problem.
|
|
88
|
-
</step>
|
|
89
230
|
|
|
90
|
-
|
|
91
|
-
Finally, in this STEP 3, output the following <template/> to give a
|
|
92
|
-
final hint:
|
|
231
|
+
Finally, output the following <template/> to give a final hint:
|
|
93
232
|
|
|
94
233
|
<template>
|
|
95
234
|
⧉ **ASE**: ☻ skill: **<skill-name/>**, ▶ status: **skill finished**
|
|
96
235
|
⧉ **ASE**: ↪ hint: **For deeper analysis, suggestions on solution approaches and then final problem resolution, use `/ase-code-resolve P{n}` in the same or even a different session.**
|
|
97
236
|
</template>
|
|
237
|
+
|
|
238
|
+
You *MUST* not output anything else in this STEP 3,
|
|
239
|
+
especially not any further explanations.
|
|
240
|
+
|
|
98
241
|
</step>
|
|
99
242
|
|
|
100
243
|
</flow>
|
|
101
244
|
|
|
245
|
+
</output>
|
|
@@ -7,19 +7,41 @@
|
|
|
7
7
|
|
|
8
8
|
`ase-code-analyze`
|
|
9
9
|
[`--help`|`-h`]
|
|
10
|
+
[`--performance`|`-p`]
|
|
11
|
+
[`--security`|`-s`]
|
|
12
|
+
[`--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`)]
|
|
10
13
|
*source-reference*
|
|
11
14
|
|
|
12
15
|
## DESCRIPTION
|
|
13
16
|
|
|
14
17
|
The `ase-code-analyze` skill analyzes the source code of the referenced
|
|
15
|
-
location, and its directly related source code, for problems
|
|
16
|
-
*
|
|
18
|
+
location, and its directly related source code, for problems. It is
|
|
19
|
+
*read-only* and advisory: it reports problems but applies *no* changes.
|
|
20
|
+
|
|
21
|
+
The *analysis lens* depends on the selected options:
|
|
22
|
+
|
|
23
|
+
- **default** (neither `--performance` nor `--security`): problems in
|
|
24
|
+
its *logic*, *semantics*, and related *control flow*.
|
|
25
|
+
|
|
26
|
+
- `--performance`|`-p`: problems in *performance* and *efficiency*.
|
|
27
|
+
|
|
28
|
+
- `--security`|`-s`: problems in *security*.
|
|
29
|
+
|
|
30
|
+
The `--performance` and `--security` options are *mutually exclusive*.
|
|
31
|
+
|
|
32
|
+
The `--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`) option sets a *severity
|
|
33
|
+
floor* (default `LOW`): problems below the chosen threshold are silently
|
|
34
|
+
suppressed (neither reported nor persisted), ordered `LOW` < `MEDIUM` <
|
|
35
|
+
`HIGH`. The default `LOW` keeps all problems; `ACCEPTED` problems are
|
|
36
|
+
never suppressed. Surviving problems are renumbered contiguously as
|
|
37
|
+
`P<n>`.
|
|
17
38
|
|
|
18
39
|
The skill investigates the code base silently, reports each detected
|
|
19
|
-
problem as a `PROBLEM` entry with severity (`LOW`, `MEDIUM`, `HIGH`)
|
|
20
|
-
inline file/line references
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
problem as a `PROBLEM` entry with severity (`LOW`, `MEDIUM`, `HIGH`) and
|
|
41
|
+
inline file/line references (in the performance lens, each entry
|
|
42
|
+
additionally carries an *evidence* and a *trade-off* line), and persists
|
|
43
|
+
results in the `ase` MCP key/value store as `ase-issue-P<n>` entries so
|
|
44
|
+
they can later be resolved via `ase-code-resolve P<n>`.
|
|
23
45
|
|
|
24
46
|
## ARGUMENTS
|
|
25
47
|
|
|
@@ -29,7 +51,7 @@ resolved via `ase-code-resolve P<n>`.
|
|
|
29
51
|
|
|
30
52
|
## EXAMPLES
|
|
31
53
|
|
|
32
|
-
Analyze a specific source file:
|
|
54
|
+
Analyze a specific source file for logic/semantic problems:
|
|
33
55
|
|
|
34
56
|
```text
|
|
35
57
|
❯ /ase-code-analyze src/server.ts
|
|
@@ -41,6 +63,24 @@ Analyze a directory of code:
|
|
|
41
63
|
❯ /ase-code-analyze src/handlers/
|
|
42
64
|
```
|
|
43
65
|
|
|
66
|
+
Analyze a source file for performance/efficiency opportunities only:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
❯ /ase-code-analyze --performance src/server.ts
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Analyze a source file for security aspects only:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
❯ /ase-code-analyze -s src/handlers/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Analyze a directory, reporting only `MEDIUM` and `HIGH` problems:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
❯ /ase-code-analyze -S MEDIUM src/handlers/
|
|
82
|
+
```
|
|
83
|
+
|
|
44
84
|
## SEE ALSO
|
|
45
85
|
|
|
46
86
|
`ase-code-resolve`, `ase-code-refactor`, `ase-code-lint`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ase-code-lint
|
|
3
|
-
argument-hint: "[--help|-h] [--auto|-a] <source-reference>"
|
|
3
|
+
argument-hint: "[--help|-h] [--auto|-a] [--severity|-S=(LOW|MEDIUM|HIGH)] <source-reference>"
|
|
4
4
|
description: >
|
|
5
5
|
Lint source code for potential code quality problems.
|
|
6
6
|
Use when the user wants to "lint" or "check" source code.
|
|
@@ -20,7 +20,7 @@ Lint Source Code
|
|
|
20
20
|
|
|
21
21
|
<expand name="getopt"
|
|
22
22
|
arg1="ase-code-lint"
|
|
23
|
-
arg2="--auto|-a">
|
|
23
|
+
arg2="--auto|-a --severity|-S=(LOW|MEDIUM|HIGH)">
|
|
24
24
|
$ARGUMENTS
|
|
25
25
|
</expand>
|
|
26
26
|
|
|
@@ -59,6 +59,14 @@ related to a set of code quality aspects.
|
|
|
59
59
|
Parse the single result message of the `Agent` tool as a JSON array
|
|
60
60
|
and set <problems/> to that list.
|
|
61
61
|
|
|
62
|
+
Then *apply the severity floor* selected via <getopt-option-severity/>
|
|
63
|
+
(default `LOW`): define the ordinal rank `LOW`=1, `MEDIUM`=2,
|
|
64
|
+
`HIGH`=3. *Keep* a problem in <problems/> if and only if its
|
|
65
|
+
`severity` field is `ACCEPTED` *or* `rank(severity)` is greater than
|
|
66
|
+
or equal to `rank(<getopt-option-severity/>)`; *silently drop* all
|
|
67
|
+
other problems. With the default floor `LOW`, all problems are kept.
|
|
68
|
+
`ACCEPTED` problems are *never* dropped.
|
|
69
|
+
|
|
62
70
|
You *MUST* *NOT* output anything else in this step 1.
|
|
63
71
|
|
|
64
72
|
</step>
|
|
@@ -226,7 +234,7 @@ related to a set of code quality aspects.
|
|
|
226
234
|
Generate a *new* proposal for the *same* <item/>
|
|
227
235
|
(incorporating the user's free-text hint from <result/> if
|
|
228
236
|
provided via the "OTHER" prefix) and loop back to substep 2
|
|
229
|
-
of this iteration. There is *no* cap on refinement rounds
|
|
237
|
+
of this iteration. There is *no* cap on refinement rounds -
|
|
230
238
|
keep refining until the user picks `ACCEPT` or `REJECT`.
|
|
231
239
|
</if>
|
|
232
240
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
`ase-code-lint`
|
|
9
9
|
[`--help`|`-h`]
|
|
10
10
|
[`--auto`|`-a`]
|
|
11
|
+
[`--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`)]
|
|
11
12
|
*source-reference*
|
|
12
13
|
|
|
13
14
|
## DESCRIPTION
|
|
@@ -20,7 +21,7 @@ into the user-visible transcript.
|
|
|
20
21
|
|
|
21
22
|
For each detected problem, the skill renders a unified-diff *SOLUTION*
|
|
22
23
|
preview and either asks the user to `ACCEPT` or `REJECT` the proposed
|
|
23
|
-
correction interactively or
|
|
24
|
+
correction interactively or - with `--auto` - applies all corrections
|
|
24
25
|
automatically.
|
|
25
26
|
|
|
26
27
|
## OPTIONS
|
|
@@ -29,6 +30,12 @@ automatically.
|
|
|
29
30
|
Automatically apply every proposed correction without asking the
|
|
30
31
|
user via the interactive dialog.
|
|
31
32
|
|
|
33
|
+
`--severity`|`-S`=(`LOW`|`MEDIUM`|`HIGH`):
|
|
34
|
+
Set the *severity floor* (default `LOW`): findings below the chosen
|
|
35
|
+
threshold are silently suppressed, ordered `LOW` < `MEDIUM` <
|
|
36
|
+
`HIGH`. The default `LOW` keeps all findings; `ACCEPTED` findings are
|
|
37
|
+
never suppressed.
|
|
38
|
+
|
|
32
39
|
## ARGUMENTS
|
|
33
40
|
|
|
34
41
|
*source-reference*:
|
|
@@ -48,6 +55,12 @@ Lint a directory and automatically apply all corrections:
|
|
|
48
55
|
❯ /ase-code-lint --auto src/handlers/
|
|
49
56
|
```
|
|
50
57
|
|
|
58
|
+
Lint a directory, reporting only `MEDIUM` and `HIGH` findings:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
❯ /ase-code-lint -S MEDIUM src/handlers/
|
|
62
|
+
```
|
|
63
|
+
|
|
51
64
|
## SEE ALSO
|
|
52
65
|
|
|
53
66
|
`ase-code-analyze`, `ase-code-resolve`, `ase-code-refactor`,
|