@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,442 @@
1
+ ---
2
+ name: ase-arch-analyze
3
+ argument-hint: "<source-reference>"
4
+ description: Review software architecture, including package cohesion and inter-package coupling
5
+ user-invocable: true
6
+ disable-model-invocation: false
7
+ model: opus
8
+ effort: medium
9
+ allowed-tools:
10
+ - "Bash(wc:*)"
11
+ - "Bash(ls:*)"
12
+ - "Bash(tree:*)"
13
+ - "Bash(file:*)"
14
+ - "Bash(du:*)"
15
+ - "Bash(stat:*)"
16
+ - "Bash(grep:*)"
17
+ - "Bash(awk:*)"
18
+ - "Bash(head:*)"
19
+ - "Bash(tail:*)"
20
+ - "Bash(sort:*)"
21
+ - "Bash(uniq:*)"
22
+ - "Bash(cat:*)"
23
+ - "Bash(cut:*)"
24
+ - "Bash(tr:*)"
25
+ - "Bash(nl:*)"
26
+ - "Bash(column:*)"
27
+ - "Bash(diff:*)"
28
+ - "Bash(cmp:*)"
29
+ - "Bash(jq:*)"
30
+ - "Bash(cloc:*)"
31
+ - "Bash(tokei:*)"
32
+ - "Bash(scc:*)"
33
+ - "Bash(basename:*)"
34
+ - "Bash(dirname:*)"
35
+ - "Bash(realpath:*)"
36
+ - "Bash(readlink:*)"
37
+ - "Bash(pwd:*)"
38
+ - "Bash(which:*)"
39
+ - "Bash(whereis:*)"
40
+ - "Bash(type:*)"
41
+ - "Bash(namei:*)"
42
+ - "Bash(git log:*)"
43
+ - "Bash(git show:*)"
44
+ - "Bash(git diff:*)"
45
+ - "Bash(git blame:*)"
46
+ - "Bash(git ls-files:*)"
47
+ - "Bash(git ls-tree:*)"
48
+ - "Bash(git grep:*)"
49
+ - "Bash(git status:*)"
50
+ - "Bash(git rev-list:*)"
51
+ - "Bash(git rev-parse:*)"
52
+ - "Bash(git for-each-ref:*)"
53
+ - "Bash(git reflog:*)"
54
+ - "Bash(git cat-file:*)"
55
+ - "Bash(git config --get:*)"
56
+ - "Bash(git config --list:*)"
57
+ - "Bash(git remote:*)"
58
+ - "Bash(git branch:*)"
59
+ - "Bash(git tag --list:*)"
60
+ - "Bash(git describe:*)"
61
+ - "Bash(git shortlog:*)"
62
+ - "Bash(find * -name:*)"
63
+ - "Bash(find * -type:*)"
64
+ - "Bash(find * -path:*)"
65
+ - "Bash(find * -maxdepth:*)"
66
+ - "Bash(find * -mindepth:*)"
67
+ - "Bash(find * -size:*)"
68
+ - "Bash(find * -mtime:*)"
69
+ - "Bash(find * -newer:*)"
70
+ - "Bash(git diff:* | awk:*)"
71
+ - "Bash(git diff:* | grep:*)"
72
+ - "Bash(git diff:* | head:*)"
73
+ - "Bash(git diff:* | tail:*)"
74
+ - "Bash(git diff:* | wc:*)"
75
+ - "Bash(git log:* | head:*)"
76
+ - "Bash(git log:* | grep:*)"
77
+ - "Bash(git log:* | wc:*)"
78
+ - "Bash(git show:* | head:*)"
79
+ - "Bash(git show:* | grep:*)"
80
+ - "Bash(git grep:* | head:*)"
81
+ - "Bash(git grep:* | wc:*)"
82
+ - "Bash(git ls-files:* | grep:*)"
83
+ - "Bash(git ls-files:* | head:*)"
84
+ - "Bash(git ls-files:* | wc:*)"
85
+ - "Bash(grep:* | head:*)"
86
+ - "Bash(grep:* | sort:*)"
87
+ - "Bash(grep:* | wc:*)"
88
+ - "Bash(grep:* | sort:* | uniq:*)"
89
+ - "Bash(cat:* | grep:*)"
90
+ - "Bash(cat:* | awk:*)"
91
+ - "Bash(cat:* | head:*)"
92
+ - "Bash(cat:* | wc:*)"
93
+ - "Bash(find:* | head:*)"
94
+ - "Bash(find:* | wc:*)"
95
+ - "Bash(awk:* | head:*)"
96
+ - "Bash(sort:* | uniq:*)"
97
+ - "Bash(sort:* | head:*)"
98
+ - "Agent"
99
+ - "Skill"
100
+ ---
101
+
102
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-persona.md
103
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
104
+
105
+ Review Software Architecture
106
+ ============================
107
+
108
+ <skill name="ase-arch-analyze">
109
+ Review Software Architecture
110
+ </skill>
111
+
112
+ <role>
113
+ Your role is an experienced, *expert-level software architect*,
114
+ specialized in *reviewing software architecture*.
115
+ </role>
116
+
117
+ <objective>
118
+ *Review* the *software architecture* of $ARGUMENTS, and its directly
119
+ related source code, for *potential problems* across component
120
+ boundaries, structural organization, architecture principles,
121
+ interface quality, quality attributes, and architecture governance.
122
+ </objective>
123
+
124
+ <flow>
125
+ 1. <step id="STEP 1: Investigate Code Base">
126
+ Investigate the code from an *architectural* perspective. If the
127
+ code base is large, you *MUST* use the `Agent` tool (not inline
128
+ work) to create multiple sub-agents to split the investigation
129
+ task into appropriate chunks.
130
+
131
+ *Determine* the *target programming language* and the *declared
132
+ architecture style* (if any) — e.g., Layered, Hexagonal
133
+ (Ports & Adapters), Onion, Clean, CQRS, Microservices,
134
+ Event-Driven, Modular Monolith — from code, project documentation,
135
+ README files, or folder structure.
136
+
137
+ Investigate the following architecture quality aspects across
138
+ 6 thematic blocks:
139
+
140
+ **Block 1 — Component Boundaries**
141
+ - **SA01 COMPONENT-RESPONSIBILITY**: each component (module,
142
+ class, package) addresses exactly *one single concern* —
143
+ i.e., has exactly *one reason to change*.
144
+ - **SA02 COMPONENT-GRANULARITY**: components have *appropriate
145
+ size* — neither monolithic nor fragmented.
146
+ - **SA03 COMPONENT-HIERARCHY**: components placed at the *correct
147
+ level* of the component hierarchy (system / program / module /
148
+ class / function).
149
+
150
+ **Block 2 — Structural Organization**
151
+ - **SA04 LAYERING**: *layers* (horizontal cuts) clearly
152
+ separated, named, and ranked; no upward dependencies.
153
+ - **SA05 SLICING**: *slices* (vertical cuts — e.g., feature
154
+ modules, bounded contexts) clearly separated and *cycle-free*.
155
+ - **SA06 DEPENDENCY-DIRECTION**: dependencies flow in exactly
156
+ *one direction*; no *circular dependencies*.
157
+ - **SA07 REFERENCE-ARCHITECTURE**: *declared-style conformance* —
158
+ the chosen architecture style (see STEP 1 intro for the
159
+ recognized style list) is applied *consistently* throughout
160
+ the codebase, without accidental mixing of styles.
161
+
162
+ **Block 3 — Architecture Principles**
163
+ - **SA08 COUPLING**: *loose data coupling* between components —
164
+ no *concrete-type dependencies* where abstractions exist, no
165
+ shared data structures leaking across boundaries, communication
166
+ via defined ports / facades / DTOs. (Runtime coupling such as
167
+ races and shared mutable state is covered by SA17.)
168
+ - **SA09 COHESION**: *strong cohesion* within each component —
169
+ internal parts (functions, fields, methods) are *tightly
170
+ related*, *co-change*, and share data or behaviour; scattered
171
+ helpers that merely coexist by accident are flagged.
172
+ - **SA10 EXTENSIBILITY**: components are *open for extension*
173
+ (plugins, SPIs, hooks) but *closed for modification*.
174
+ - **SA11 SEPARATION**: *cross-cutting concerns* (logging,
175
+ security, caching, transactions, tracing) isolated from
176
+ domain logic; trace context propagated across component
177
+ boundaries.
178
+ - **SA12 ENCAPSULATION**: unavoidable complexity *encapsulated*
179
+ behind a simple interface that *shields* its implementation
180
+ details.
181
+
182
+ **Block 4 — Interface Quality**
183
+ - **SA13 INTERFACE-SIZE**: each interface *proportional in size*
184
+ to its functionality.
185
+ - **SA14 INTERFACE-COMPOSABILITY**: interface methods are
186
+ *orthogonal* and enable combinatorial use-cases without
187
+ boilerplate.
188
+ - **SA15 INTERFACE-CONTRACT**: each interface declares clear
189
+ *syntactic* and *semantic* contracts (pre/post-conditions,
190
+ invariants, idempotency, thread-safety).
191
+
192
+ **Block 5 — Quality Attributes**
193
+ - **SA16 TESTABILITY**: architectural *seams* enable testing in
194
+ isolation — dependency injection at component boundaries,
195
+ mockable interfaces, side effects (DB, filesystem, network,
196
+ time, randomness) hidden behind abstractions.
197
+ - **SA17 CONCURRENCY**: the *concurrency model* (event loop,
198
+ threads, goroutines, async/await, actors, ...) is *explicitly
199
+ chosen* and applied *consistently*. *Runtime coupling* —
200
+ thread-safety boundaries, shared mutable state, races, lock
201
+ hold times, async/sync boundaries — is explicit and localized;
202
+ shared mutable state is protected.
203
+
204
+ **Block 6 — Architecture Governance**
205
+ - **SA18 DECISION-RECORDS**: non-trivial architectural decisions
206
+ are *documented* with rationale (Architecture Decision Records
207
+ / ADRs, README sections, or in-code comments capturing *why*).
208
+ The chosen style, deviations from defaults, and trade-offs are
209
+ traceable.
210
+
211
+ **Block 7 — Package Cohesion**
212
+ - **SA19 PACKAGE-COHESION**: each first-party package has a
213
+ coherent role *and* topical theme — its members serve a
214
+ common purpose, share a dominant noun-cluster, and have
215
+ non-trivial cross-package use. Flag:
216
+ - *grab-bag*: members split into ≥3 unrelated topical
217
+ clusters (e.g. a `util` package mixing date-parsing,
218
+ network-retry, and string-formatting helpers)
219
+ - *misplaced class*: a class only imported once cross-package
220
+ but referenced *≥3 times* inside the consumer (likely
221
+ belongs in the consumer or in a shared utility package)
222
+ - *topical outlier*: a class whose name-tokens share *<30%*
223
+ overlap with the package's dominant noun-cluster, or with
224
+ its `package-info` / `README` declaration when present
225
+ - **SA20 PACKAGE-CYCLE**: no *cyclic dependencies* between
226
+ first-party packages — neither direct (`A → B` and `B → A`)
227
+ nor transitive (via *Tarjan SCC* or pairwise scan). Each
228
+ cycle is reported with the exact import lines that close it.
229
+ - **SA21 PACKAGE-SIZE**: package size and coupling shape are
230
+ justified — flag packages at either extreme:
231
+ - *god-package*: *incoming ≥ 5* and *outgoing ≥ 3* —
232
+ coordinator dumping ground that should be split along its
233
+ internal topical clusters
234
+ - *fragment*: 1–2 files under a sibling parent that share a
235
+ *name prefix* or *imported interface* with that sibling —
236
+ consolidation candidate
237
+
238
+ Hints:
239
+
240
+ - During investigation, do *not* output anything else,
241
+ especially do not give any further explanations or information.
242
+
243
+ - Focus on *practically relevant* problems and especially do
244
+ *not* investigate on theoretical or fictive cases.
245
+
246
+ - Focus on the *problem only* and do *not* investigate on any
247
+ possible *solution*.
248
+
249
+ - For the *target programming language*, apply each aspect
250
+ according to its *idiomatic conventions* and *best practices*.
251
+
252
+ - *Control-flow verification* (SA17, SA08, SA06, SA11): for
253
+ any claim about *ordering*, *lock hold time*, *thread
254
+ boundary*, or *call from context X*, trace the actual
255
+ acquire/release and call order line-by-line. Do not
256
+ pattern-match on "loop inside method with lock" — verify
257
+ which operations sit *between* the specific acquire and
258
+ release in source order.
259
+
260
+ - *Package-graph construction (SA19–SA21)*: parse each file's
261
+ import (or equivalent language construct) statement, keep
262
+ only first-party packages within the analysed scope, and
263
+ persist two intermediate structures: the per-package
264
+ incoming/outgoing class-edge map (drives SA20, SA21) and
265
+ the per-package noun-token frequency table extracted from
266
+ class names in camelCase / snake_case (drives SA19 topical
267
+ analysis). No external NLP — pure tokens. Cite each finding
268
+ with the exact import lines or class-name evidence.
269
+
270
+ - *Block 7 severity ladder*: SA20 (cycle) → HIGH; SA21
271
+ (size/shape) → MEDIUM; SA19 (cohesion) → LOW. Mark ACCEPTED
272
+ when `CLAUDE.md`, `AGENTS.md`, `package-info`, or class
273
+ Javadoc explicitly justifies the pattern (per skill-meta
274
+ contract-already-addressed rule).
275
+ </step>
276
+
277
+ 2. <step id="STEP 2: Show Architecture Overview">
278
+ Render the *discovered architecture* as a concise *diagram*
279
+ so the user can verify what you understood as the architecture
280
+ before reading the findings.
281
+
282
+ Use the following output <template/>:
283
+
284
+ <template>
285
+ &#x1F4D0; **ARCHITECTURE OVERVIEW**
286
+
287
+ *Detected style*: <style/>
288
+ *Target language*: <language/>
289
+
290
+ <rendered-diagram-as-fenced-code-block/>
291
+ </template>
292
+
293
+ Hints:
294
+
295
+ - For <style/>, name the detected architecture style or
296
+ "*undeclared*" if none is documented.
297
+
298
+ - For <rendered-diagram-as-fenced-code-block/>, emit *Mermaid*
299
+ source for a `flowchart TB` of the high-level component or
300
+ layer structure and invoke the `ase-meta-diagram` skill via the
301
+ `Skill` tool to render it. Show layers / slices / major
302
+ components and their dependency direction.
303
+
304
+ - Mark detected *anomalies* directly in the Mermaid source.
305
+ Because `!` and `?` are Mermaid special characters, *always
306
+ quote* anomaly-bearing node labels:
307
+
308
+ - *Problem node* — prefix label with `!` inside quotes:
309
+ `A["!ComponentA"]`.
310
+ - *Unclear node* — suffix label with `(?)` inside quotes:
311
+ `B["ComponentB (?)"]`.
312
+ - *Cyclic edge* — annotate the *edge* (not a node) with a
313
+ `cycle` label on a bidirectional arrow:
314
+ `A <-- "cycle" --> B` (or two labelled one-way edges if
315
+ the renderer rejects `<-->`).
316
+
317
+ The renderer preserves these glyphs verbatim inside the
318
+ boxes and along the edges.
319
+ </step>
320
+
321
+ 3. <step id="STEP 3: Reconcile and Show Results">
322
+ Before reporting, classify every finding into one of three
323
+ categories:
324
+
325
+ - *Unpaired* — single aspect violated, no partner in the
326
+ tension matrix hit → emit `PROBLEM` template.
327
+ - *Paired* — exactly two aspects of a single tension pair hit
328
+ → emit `TRADEOFF` template (cluster of size 2).
329
+ - *Clustered* — an aspect appears in *multiple* triggered
330
+ tensions (e.g., SA10 hit against both SA12 and SA13) →
331
+ collapse into *one* `TRADEOFF` with the recurring aspect
332
+ as *focal aspect* and the others as *partners*. One
333
+ direction for the whole cluster.
334
+
335
+ **Tension matrix** (use to detect paired/clustered findings):
336
+
337
+ ```
338
+ ┌─────────────┬───────────────────────────────────────────────┐
339
+ │ Pair │ Tension │
340
+ ├─────────────┼───────────────────────────────────────────────┤
341
+ │ SA01 ↔ SA02 │ single concern/responsibility vs. granularity │
342
+ │ SA08 ↔ SA09 │ loose coupling vs. strong cohesion │
343
+ │ SA10 ↔ SA12 │ extensibility vs. encapsulation │
344
+ │ SA10 ↔ SA13 │ extensibility vs. interface size │
345
+ │ SA11 ↔ SA08 │ cross-cutting separation vs. coupling │
346
+ │ SA12 ↔ SA14 │ encapsulation vs. composability │
347
+ │ SA16 ↔ SA12 │ testability vs. encapsulation │
348
+ │ SA16 ↔ SA13 │ testability vs. interface size │
349
+ │ SA05 ↔ SA09 │ slice cycle-freeness vs. cohesion │
350
+ │ SA06 ↔ SA10 │ single dependency direction vs. extensibility │
351
+ └─────────────┴───────────────────────────────────────────────┘
352
+ ```
353
+
354
+ Report each unpaired finding with the following <template/>:
355
+
356
+ <template>
357
+ &#x1F7E0; **PROBLEM** P<n/> (Severity: <severity/>, Aspect: <aspect-id/>): **<title/>**
358
+
359
+ <description/>
360
+ </template>
361
+
362
+ Report each paired or clustered finding with the following <template/>:
363
+
364
+ <template>
365
+ &#x1F535; **TRADEOFF** T<n/> (Severity: <severity/>): **<title/>**
366
+
367
+ - *Focal aspect*: <focal-aspect/> — <focal-state/>
368
+ - *In tension with*: <partner-list/>
369
+
370
+ **RECOMMENDED**: lean toward *<focal|partners/>*
371
+ *Reason*: <rationale/>
372
+ *Implies*:
373
+ - <partner-aspect-1/>: <partner-implication-1/>
374
+ - <partner-aspect-2/>: <partner-implication-2/>
375
+ </template>
376
+
377
+ Hints:
378
+
379
+ - For the final results, do *not* output anything else,
380
+ especially do *not* give any further explanations or
381
+ information.
382
+
383
+ - For <aspect-id/>, <focal-aspect/> and every entry in
384
+ <partner-list/>, name the aspect (e.g., `SA06
385
+ DEPENDENCY-DIRECTION`).
386
+
387
+ - The <focal-aspect/> is the aspect that participates in
388
+ *all* tensions of the cluster. For a size-2 cluster, pick
389
+ the aspect whose direction is most constrained by the
390
+ detected style.
391
+
392
+ - *Brevity and precision*: all free-form placeholders
393
+ (<description/>, <focal-state/>, partner-implications)
394
+ are *very brief* but *precise*. <rationale/> is exactly
395
+ *one sentence* grounded in the detected style, domain
396
+ constraints, or language idioms — never generic
397
+ principles.
398
+
399
+ - Highlight *code* as <template>`<code/>`</template>
400
+ and *key aspects* as <template>*<aspect/>*</template>.
401
+
402
+ - Add inline *references* to related code positions in the
403
+ form of either
404
+ <template>(`<filename/>:<line-number/>`)</template>,
405
+ <template>(`<filename/>:<line-number/>-<line-number/>`)</template> or
406
+ <template>(`<filename/>#<function-or-method/>`)</template>.
407
+
408
+ - Classify each finding with a <severity/> of
409
+ <template>LOW</template>, <template>MEDIUM</template>,
410
+ <template>HIGH</template>, or <template>ACCEPTED</template>.
411
+ Use <template>ACCEPTED</template> when the
412
+ contract-already-addressed check applies (see skill meta
413
+ rules on Findings).
414
+
415
+ - *Per-aspect consistency (mandatory)*: every aspect may
416
+ appear in *at most one* output. Collapse both halves of
417
+ a hit tension pair into a single TRADEOFF; if an aspect
418
+ participates in *multiple* hit tensions, collapse all of
419
+ them into one clustered TRADEOFF with that aspect as the
420
+ focal aspect. Never emit contradictory recommendations
421
+ for the same aspect, and never emit both halves of a
422
+ tension pair as separate PROBLEMs.
423
+
424
+ - *Additionally*, first call the `kv_clear()` tool of the `ase`
425
+ MCP service to clear the in-memory key/value store, and then,
426
+ for *every* reported PROBLEM and TRADEOFF, persist its finding
427
+ result via the `kv_set` tool of the `ase` MCP service, using
428
+ `key` set to `ase-issue-P<n/>` (for PROBLEMs) or
429
+ `ase-issue-T<n/>` (for TRADEOFFs) and `val` set to
430
+ `<title/>: <description/>`.
431
+ </step>
432
+
433
+ 4. <step id="STEP 4: Give Final Hint">
434
+ Finally, output the following <template/> to give a final hint:
435
+
436
+ <template>
437
+ ⧉ **ASE**: ☻ skill: **<skill-name/>**, ▶ status: **skill finished**
438
+ ⧉ **ASE**: ↪ hint: **For deeper analysis, suggestions on solution approaches and then final source code changes, use `/ase-code-resolve P{n}` or `/ase-code-resolve T{n}` in the same or even a different session.**
439
+ </template>
440
+ </step>
441
+ </flow>
442
+
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: ase-arch-discover
3
+ argument-hint: "<functionality>"
4
+ description: >
5
+ Discover additional, third-party components (libraries/frameworks) for
6
+ the technology stack to provide needed functionality.
7
+ user-invocable: true
8
+ disable-model-invocation: false
9
+ effort: medium
10
+ allowed-tools:
11
+ - "Bash(npm search --json *)"
12
+ - "Bash(npm view --json *)"
13
+ - "Skill"
14
+ - "Agent"
15
+ - "WebFetch"
16
+ ---
17
+
18
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-persona.md
19
+ @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
20
+
21
+ Discover Components
22
+ ===================
23
+
24
+ Your role is an experienced, *expert-level software architect*,
25
+ specialized in *finding components* (libraries/frameworks) for the technology stack.
26
+
27
+ <objective>
28
+ *Discover* additional, *third-party components* (libraries/frameworks)
29
+ for the technology stack to *provide* the *needed functionality*
30
+ <request>$ARGUMENTS</request>.
31
+ </objective>
32
+
33
+ <flow>
34
+ 1. <step id="STEP 1: Determine Functionality">
35
+ - Derive the needed <functionality/> from the <request/>, but keep
36
+ the functionality description very *brief* but still *precise*.
37
+
38
+ - If <functionality/> is not clear or not precise enough, raise
39
+ questions to the user with the help of an interactive user dialog tool.
40
+
41
+ - Display the determined final functionality with just the following
42
+ <template/>:
43
+
44
+ <template>
45
+ &#x1F535; **FUNCTIONALITY**: <functionality/>
46
+ </template>
47
+ </step>
48
+
49
+ 2. <step id="STEP 2: Determine Technology Stack">
50
+ - Determine the used technology stack:
51
+
52
+ - If a file `package.json` is found in the top-level directory
53
+ of the project and contains an entry `typescript` under `dependencies`
54
+ or `devDependencies`, then <stack>TypeScript</stack>.
55
+
56
+ - Else, if a file `package.json` is found in the top-level directory
57
+ of the project, then <stack>JavaScript</stack>.
58
+
59
+ - Else, if a file `build.gradle.kts` or `settings.gradle.kts`
60
+ is found in the top-level directory, then <stack>Kotlin</stack>.
61
+
62
+ - Else, if a file `build.gradle` is found in the top-level directory and
63
+ is applying `kotlin`, `org.jetbrains.kotlin.jvm`, `kotlin-android`,
64
+ or `kotlin-multiplatform` plugins, then <stack>Kotlin</stack>.
65
+
66
+ - Else, if a file `pom.xml` is found in the top-level directory and
67
+ contains `kotlin-maven-plugin` or `kotlin-stdlib` dependencies, then
68
+ <stack>Kotlin</stack>.
69
+
70
+ - Else, if a file `pom.xml` or `build.gradle` is found in the top-level directory
71
+ of the project, then <stack>Java</stack>.
72
+
73
+ - Else, use <stack>Unknown</stack>.
74
+
75
+ - Display the determined final technology stack with just the
76
+ following <template/>:
77
+
78
+ <template>
79
+ &#x1F535; **TECHNOLOGY STACK**: <stack/>
80
+ </template>
81
+ </step>
82
+
83
+ 3. <step id="STEP 3: Discover Components">
84
+ - From <stack/> and <functionality/>, derive essential keywords
85
+ <keyword-L/> (L=1-M), which allow you to search for suitable
86
+ components.
87
+
88
+ - In the to be discovered result set of components <component-K/>
89
+ (K=1-N), remember the component name as <name-K/>, the
90
+ official package name as <package-K/>, the latest version as
91
+ <version-K/>, the stars as <stars-K/>, the created date as
92
+ <created-K/>, the last updated date as <updated-K/>, the total
93
+ number of downloads in the last month is <downloads-K/>.
94
+
95
+ - If <stack/> is "JavaScript" or "TypeScript":
96
+
97
+ - Based on the essential keywords <keyword-L/> (L=1-M),
98
+ use the `ase-meta-search` skill in a subagent to *generally*
99
+ discover an initial set of a maximum of 12 *NPM packages*
100
+ <component-K/> and at least their real name <name-K/> and
101
+ their unique package names <package-K/>.
102
+
103
+ - Use the shell command `npm search --json --searchlimit 12
104
+ "<keyword-1/>" [...] "<keyword-M/>"` to *specifically*
105
+ discover an additional set of a maximum of 12 *NPM packages*
106
+ <component-K/> and at least their unique package names
107
+ <package-K/>, based on the essential keywords <keyword-L/>
108
+ (L=1-M). Merge the results into the already existing result
109
+ set, but deduplicate entries.
110
+
111
+ - For each discovered *NPM package* <component-K/> (K=1-N),
112
+ use the shell command `npm view --json "<package-K/>"
113
+ version time repository.url` to discover
114
+ its version <version-K/>, the publish time of that
115
+ version <updated-K/> (read from `time[<version-K/>]`),
116
+ its time created <created-K/> (read from `time.created`),
117
+ and its repository URL <repository-K/>.
118
+
119
+ - If the <repository-K/> regexp-matches
120
+ `.+?//github\.com/([^/]+/[^/.]+).*` use the `WebFetch` tool
121
+ to fetch the URL `https://api.github.com/repos/$1` (`$1`
122
+ is the value matched by the first capturing parenthesis
123
+ in the regexp) and extract <stars-K/> from its JSON
124
+ `stargazers_count` field, else set <stars-K/> to `N.A.`.
125
+
126
+ - For each discovered *NPM package* <component-K/>
127
+ (K=1-N), use the `WebFetch` tool on the URL
128
+ `https://api.npmjs.org/downloads/point/last-month/<package-K/>`
129
+ to extract the <downloads-K/> from the `downloads` field.
130
+
131
+ - If <stack/> is "Java" or "Kotlin":
132
+
133
+ - Based on the essential keywords <keyword-L/> (L=1-M),
134
+ use the `ase-meta-search` skill in a subagent to *generally*
135
+ discover an initial set of a maximum of 12 *Java packages*
136
+ <component-K/> and at least their real name <name-K/> and
137
+ their unique package names <package-K/>.
138
+ </step>
139
+
140
+ 4. <step id="STEP 4: Report Components">
141
+ - Sort, in descending order, the discovered components
142
+ <component-K/> (K=1-N) first by their <downloads-K/> and second
143
+ by their <stars-K/> and trim the result list to just a maximum
144
+ of 12 total components.
145
+
146
+ - Display the discovered components as a Markdown *table*
147
+ with just the following <template/>:
148
+
149
+ <template>
150
+ &#x1F535; **COMPONENTS**:
151
+
152
+ | *Component* | *Package* | *Version* | *Downloads* | *Stars* | *Updated* | *Created* |
153
+ | :------------ | :------------- | -----------: | -----------------: | -------------: | :--------------- | :----------- |
154
+ | **<name-1/>** | `<package-1/>` | <version-1/> | **<downloads-1/>** | **<stars-1/>** | **<updated-1/>** | <created-1/> |
155
+ [...]
156
+ | **<name-N/>** | `<package-N/>` | <version-N/> | **<downloads-N/>** | **<stars-N/>** | **<updated-N/>** | <created-N/> |
157
+ </template>
158
+ </step>
159
+ </flow>
160
+