@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.
- package/dst/ase-hello.js +22 -0
- package/dst/ase-hook.js +3 -1
- package/dst/ase-setup.js +10 -7
- package/package.json +2 -1
- package/plugin/.claude/settings.local.json +7 -0
- package/plugin/.claude-plugin/plugin.json +20 -0
- package/plugin/.github/plugin/plugin.json +21 -0
- package/plugin/agents/ase-meta-chat.md +10 -0
- package/plugin/agents/ase-meta-search.md +16 -0
- package/plugin/commands/ase-code-lint/complete.md +9 -0
- package/plugin/commands/ase-code-lint/explain.md +9 -0
- package/plugin/commands/ase-code-lint/nope.md +11 -0
- package/plugin/commands/ase-code-lint/reassess.md +15 -0
- package/plugin/commands/ase-code-lint/recheck.md +9 -0
- package/plugin/commands/ase-code-lint/refine.md +9 -0
- package/plugin/hooks/hooks-copilot.json +23 -0
- package/plugin/hooks/hooks.json +40 -0
- package/plugin/meta/ase-constitution.md +114 -0
- package/plugin/meta/ase-dialog.md +122 -0
- package/plugin/meta/ase-persona.md +63 -0
- package/plugin/meta/ase-plan.md +69 -0
- package/plugin/meta/ase-skill.md +238 -0
- package/plugin/skills/ase-arch-analyze/SKILL.md +442 -0
- package/plugin/skills/ase-arch-discover/SKILL.md +160 -0
- package/plugin/skills/ase-code-analyze/SKILL.md +108 -0
- package/plugin/skills/ase-code-craft/SKILL.md +237 -0
- package/plugin/skills/ase-code-explain/SKILL.md +115 -0
- package/plugin/skills/ase-code-insight/SKILL.md +96 -0
- package/plugin/skills/ase-code-lint/SKILL.md +382 -0
- package/plugin/skills/ase-code-refactor/SKILL.md +241 -0
- package/plugin/skills/ase-code-resolve/SKILL.md +299 -0
- package/plugin/skills/ase-meta-changes/SKILL.md +95 -0
- package/plugin/skills/ase-meta-chat/SKILL.md +58 -0
- package/plugin/skills/ase-meta-commit/SKILL.md +64 -0
- package/plugin/skills/ase-meta-diagram/SKILL.md +101 -0
- package/plugin/skills/ase-meta-evaluate/SKILL.md +247 -0
- package/plugin/skills/ase-meta-persona/SKILL.md +52 -0
- package/plugin/skills/ase-meta-quorum/SKILL.md +122 -0
- package/plugin/skills/ase-meta-search/SKILL.md +48 -0
- package/plugin/skills/ase-meta-why/SKILL.md +69 -0
- package/plugin/skills/ase-task-delete/SKILL.md +76 -0
- package/plugin/skills/ase-task-edit/SKILL.md +390 -0
- package/plugin/skills/ase-task-id/SKILL.md +46 -0
- package/plugin/skills/ase-task-implement/SKILL.md +146 -0
- package/plugin/skills/ase-task-list/SKILL.md +44 -0
- package/plugin/skills/ase-task-preflight/SKILL.md +181 -0
- package/plugin/skills/ase-task-reboot/SKILL.md +161 -0
- package/plugin/skills/ase-task-view/SKILL.md +81 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ase-code-analyze
|
|
3
|
+
argument-hint: "<source-reference>"
|
|
4
|
+
description: >
|
|
5
|
+
Analyze the source code for problems in the logic and semantics and its related control flow.
|
|
6
|
+
user-invocable: true
|
|
7
|
+
disable-model-invocation: false
|
|
8
|
+
effort: medium
|
|
9
|
+
allowed-tools:
|
|
10
|
+
- "Agent"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-persona.md
|
|
14
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
|
|
15
|
+
|
|
16
|
+
Analyze Source Code
|
|
17
|
+
===================
|
|
18
|
+
|
|
19
|
+
<skill name="ase-code-analyze">
|
|
20
|
+
Analyze Source Code
|
|
21
|
+
</skill>
|
|
22
|
+
|
|
23
|
+
<role>
|
|
24
|
+
Your role is an experienced, *expert-level software developer*,
|
|
25
|
+
specialized in *analyzing source code*.
|
|
26
|
+
</role>
|
|
27
|
+
|
|
28
|
+
<objective>
|
|
29
|
+
*Analyze* the source code of $ARGUMENTS, and its directly related source
|
|
30
|
+
code, for problems in its *logic* and *semantics* and its related
|
|
31
|
+
*control flow*.
|
|
32
|
+
</objective>
|
|
33
|
+
|
|
34
|
+
<flow>
|
|
35
|
+
1. <step id="STEP 1: Investigate Code Base">
|
|
36
|
+
In this STEP 1, investigate on the code. If the code base is large,
|
|
37
|
+
you *MUST* use the `Agent` tool (not inline work) to create multiple
|
|
38
|
+
sub-agents to split the investigation task into appropriate chunks.
|
|
39
|
+
Hints:
|
|
40
|
+
|
|
41
|
+
- During investigation in this STEP 1, do *not* output anything else,
|
|
42
|
+
especially do not give any further explanations or information.
|
|
43
|
+
|
|
44
|
+
- Focus on *practically relevant* cases and especially do *not*
|
|
45
|
+
investigate on theoretical or fictive cases.
|
|
46
|
+
|
|
47
|
+
- In case of problems related to *obvious or expected* errors,
|
|
48
|
+
they *should* be handled *near the origin*.
|
|
49
|
+
|
|
50
|
+
- In case of problems related to *theoretical or unexpected* errors,
|
|
51
|
+
they *should* be handled in parent scopes to avoid cluttering the
|
|
52
|
+
source code with too much error handling at all.
|
|
53
|
+
|
|
54
|
+
- In this STEP 1, still focus on the *problem only* and do *not*
|
|
55
|
+
investigate on any possible *solution*.
|
|
56
|
+
</step>
|
|
57
|
+
|
|
58
|
+
2. <step id="STEP 2: Show Results">
|
|
59
|
+
In this STEP 2, for every detected problem, immediately report it
|
|
60
|
+
with the following output <template/>, based on concise bullet
|
|
61
|
+
points.
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
🟠 PROBLEM (Severity: **<severity/>**): **P<n/>**: **<title/>**
|
|
65
|
+
|
|
66
|
+
<description/>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
Hints:
|
|
70
|
+
- For the final results, do *not* output anything else, especially do
|
|
71
|
+
*not* give any further explanations or information.
|
|
72
|
+
|
|
73
|
+
- Uniquely identify the problems with `P<n/>` where <n/> is 1, 2, ...
|
|
74
|
+
|
|
75
|
+
- In <description/>, use *very brief* but as *precise* as possible problem
|
|
76
|
+
descriptions.
|
|
77
|
+
|
|
78
|
+
- In <description/>, highlight *code* as <template>`<code/>`</template>
|
|
79
|
+
and *key aspects* as <template>*<aspect/>*</template>.
|
|
80
|
+
|
|
81
|
+
- In <description/>, add inline *references* to the related
|
|
82
|
+
code positions in the form of either
|
|
83
|
+
<template>(`<filename/>:<line-number/>`)</template>,
|
|
84
|
+
<template>(`<filename/>:<line-number/>-<line-number/>`)</template> or
|
|
85
|
+
<template>(`<filename/>#<function-or-method/>`)</template>.
|
|
86
|
+
|
|
87
|
+
- In <description/>, classify the problem with a <severity/>
|
|
88
|
+
of <template>LOW</template>, <template>MEDIUM</template> or
|
|
89
|
+
<template>HIGH</template>.
|
|
90
|
+
|
|
91
|
+
- *Additionally*, first call the `kv_clear()` tool of the `ase`
|
|
92
|
+
MCP service to clear the in-memory key/value store, and then, for
|
|
93
|
+
*every* reported problem, persist its problem analysis result
|
|
94
|
+
via the `kv_set` tool of the `ase` MCP service, using `key` set
|
|
95
|
+
to `ase-issue-P<n/>` and `val` set to `<title/>: <description/>`.
|
|
96
|
+
</step>
|
|
97
|
+
|
|
98
|
+
3. <step id="STEP 3: Give Final Hint">
|
|
99
|
+
Finally, in this STEP 3, output the following <template/> to give a
|
|
100
|
+
final hint:
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
⧉ **ASE**: ☻ skill: **<skill-name/>**, ▶ status: **skill finished**
|
|
104
|
+
⧉ **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.**
|
|
105
|
+
</template>
|
|
106
|
+
</step>
|
|
107
|
+
</flow>
|
|
108
|
+
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ase-code-craft
|
|
3
|
+
argument-hint: "[<task-id>:] <feature>"
|
|
4
|
+
description: >
|
|
5
|
+
Craft Source Code:
|
|
6
|
+
Use when user wants to create or craft a new feature from scratch.
|
|
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
|
+
Craft Feature
|
|
19
|
+
=============
|
|
20
|
+
|
|
21
|
+
<skill name="ase-code-craft">
|
|
22
|
+
Craft Source Code
|
|
23
|
+
</skill>
|
|
24
|
+
|
|
25
|
+
<role>
|
|
26
|
+
Your role is an experienced, *expert-level software developer*.
|
|
27
|
+
</role>
|
|
28
|
+
|
|
29
|
+
<objective>
|
|
30
|
+
From scratch *craft* the following feature:
|
|
31
|
+
<feature>$ARGUMENTS</feature>
|
|
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 Feature**:
|
|
46
|
+
|
|
47
|
+
1. <if condition="
|
|
48
|
+
<feature/> matches the regexp `^[a-zA-Z][a-zA-Z0-9_-]*$`
|
|
49
|
+
">
|
|
50
|
+
Set <ase-task-id><feature/></ase-task-id> (set task id to feature)
|
|
51
|
+
and <feature></feature> (set feature 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 <feature/> has the format `<id/>: <text/>` where <id/> matches
|
|
62
|
+
the regexp `^[a-zA-Z][a-zA-Z0-9_-]+$`, then set
|
|
63
|
+
<feature><text/></feature> 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 <feature/> is empty,
|
|
69
|
+
ask the user interactively, without a special tool, for the
|
|
70
|
+
initial feature with a single question:
|
|
71
|
+
|
|
72
|
+
`**No feature known yet. What is the feature you want to craft?**`
|
|
73
|
+
|
|
74
|
+
Then set <feature/> to the response of the user.
|
|
75
|
+
|
|
76
|
+
4. Report the task and feature with the following <template/>:
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
⧉ **ASE**: ◉ task: **<ase-task-id/>**
|
|
80
|
+
⧉ **ASE**: ⇌ feature: **<feature/>**
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
5. Figure out what the requested <feature/> to be crafted is about.
|
|
84
|
+
|
|
85
|
+
6. Ask the user for clarification if the goal of this crafting is too
|
|
86
|
+
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
|
+
requested new <feature/>.
|
|
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 Feature Crafting Approaches**:
|
|
101
|
+
|
|
102
|
+
1. *Propose* corresponding *feature approach*, including optionally,
|
|
103
|
+
some *alternative* feature 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
|
+
|
|
110
|
+
<template>
|
|
111
|
+
🔵 **APPROACH A<n/>**<annotation/>: *<summary/>*
|
|
112
|
+
- [...]
|
|
113
|
+
- [...]
|
|
114
|
+
- [...]
|
|
115
|
+
<optional-diagram/>
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
Hints:
|
|
119
|
+
|
|
120
|
+
- Give a short one-sentence <summary/> of the feature approach plus
|
|
121
|
+
*precise* and *brief* feature information. Try to keep the
|
|
122
|
+
number of bullet points in the range of 1-4.
|
|
123
|
+
|
|
124
|
+
- In case of a *complex feature situation* only, visualize it with
|
|
125
|
+
an optional diagram <optional-diagram/> by invoking the
|
|
126
|
+
`ase-meta-diagram` skill via the `Skill` tool. For *current vs.
|
|
127
|
+
proposed* comparisons, render each side as a *separate*
|
|
128
|
+
`ase-meta-diagram` invocation and stack the rendered blocks
|
|
129
|
+
*vertically* (labels `**Before:**` / `**After:**`); never
|
|
130
|
+
side-by-side. Omit <optional-diagram/> entirely for simple or
|
|
131
|
+
purely local situation.
|
|
132
|
+
|
|
133
|
+
*Recommended* Tenets (generic):
|
|
134
|
+
|
|
135
|
+
- **Surgical Changes**:
|
|
136
|
+
Keep source code changes always as small as possible.
|
|
137
|
+
|
|
138
|
+
- **Separation of Concerns**:
|
|
139
|
+
Clearly separate all individual concerns as good as possible.
|
|
140
|
+
|
|
141
|
+
- **Single Responsibility Principle**:
|
|
142
|
+
Every module, class, or function should have only one reason to change.
|
|
143
|
+
|
|
144
|
+
- **Behavior Preservation**:
|
|
145
|
+
Refactoring changes only re-structure, never change any observable behavior.
|
|
146
|
+
|
|
147
|
+
- **Align with Code Base**:
|
|
148
|
+
Strictly align with the existing code base by exactly following its
|
|
149
|
+
coding style, its structure, its naming conventions, etc.
|
|
150
|
+
|
|
151
|
+
*Essential* Tenets (specific):
|
|
152
|
+
|
|
153
|
+
- **High Cohesion, Low Coupling**:
|
|
154
|
+
Strike for a set of small, focused parts (high cohesion) connected by
|
|
155
|
+
thin, explicit wires (low coupling).
|
|
156
|
+
|
|
157
|
+
4. **Choose Feature Crafting Approach**:
|
|
158
|
+
|
|
159
|
+
1. Let the *user interactively choose* the preferred feature approach A<n/>
|
|
160
|
+
with the help of the <user-dialog-tool/> tool. Use *single-selection* only
|
|
161
|
+
and provide small *code change previews*. Mark your recommended
|
|
162
|
+
feature approach with ` ⚝ **RECOMMENDATION** ⚝` here again.
|
|
163
|
+
|
|
164
|
+
5. **Write Feature Crafting Plan**:
|
|
165
|
+
|
|
166
|
+
1. *Write a feature plan* for the chosen feature A<n/> by
|
|
167
|
+
closely aligning to the existing architecture and the existing
|
|
168
|
+
code base. Use the <format/> defined for a task plan and inject
|
|
169
|
+
the information from feature A<n/> and all derived realization
|
|
170
|
+
decisions into it. Store the resulting task plan in <content/>.
|
|
171
|
+
|
|
172
|
+
2. Call the `timestamp(format: "yyyy-LL-dd HH:mm")` tool of the
|
|
173
|
+
`ase` MCP service and use the `text` field of its response for
|
|
174
|
+
<timestamp-created/> and <timestamp-modified/> information. Then
|
|
175
|
+
insert the current <ase-task-id/>, <timestamp-created/>, and
|
|
176
|
+
<timestamp-modified/> information and calculate the number of
|
|
177
|
+
words <words/> of <content/>.
|
|
178
|
+
|
|
179
|
+
3. You *MUST* *save* the resulting plan content with the
|
|
180
|
+
`task_save(id: <ase-task-id/>, text: <content/>)`.
|
|
181
|
+
|
|
182
|
+
4. Output a hint with the following <template/>:
|
|
183
|
+
|
|
184
|
+
<template>
|
|
185
|
+
⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **plan created**
|
|
186
|
+
</template>
|
|
187
|
+
|
|
188
|
+
5. *Ask user*: Let the *user interactively choose*
|
|
189
|
+
what to do as the next step.
|
|
190
|
+
|
|
191
|
+
<expand name="user-dialog>
|
|
192
|
+
Next Step: How would you like to proceed with the plan?
|
|
193
|
+
DONE: Stop processing.
|
|
194
|
+
EDIT: Hand processing off to editing.
|
|
195
|
+
PREFLIGHT: Hand processing off to preflighting.
|
|
196
|
+
IMPLEMENT: Hand processing off to implementation.
|
|
197
|
+
</expand>
|
|
198
|
+
|
|
199
|
+
6. Check the tool <result/> and dispatch accordingly:
|
|
200
|
+
|
|
201
|
+
- If <result/> is `DONE` or `CANCEL`:
|
|
202
|
+
Only output the following <template/> and then *STOP*.
|
|
203
|
+
|
|
204
|
+
<template>
|
|
205
|
+
⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **done**
|
|
206
|
+
</template>
|
|
207
|
+
|
|
208
|
+
- If <result/> is `EDIT`:
|
|
209
|
+
Only output the following <template/> and then use the
|
|
210
|
+
`Skill` tool to invoke the `ase:ase-task-edit` skill in
|
|
211
|
+
order to edit the plan. Immediately stop processing the
|
|
212
|
+
current skill once the `Skill` tool was used.
|
|
213
|
+
|
|
214
|
+
<template>
|
|
215
|
+
⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **hand off to edit**
|
|
216
|
+
</template>
|
|
217
|
+
|
|
218
|
+
- If <result/> is `PREFLIGHT`:
|
|
219
|
+
Only output the following <template/> and then use the
|
|
220
|
+
`Skill` tool to invoke the `ase:ase-task-preflight` skill in
|
|
221
|
+
order to preflight the plan. Immediately stop processing the
|
|
222
|
+
current skill once the `Skill` tool was used.
|
|
223
|
+
|
|
224
|
+
<template>
|
|
225
|
+
⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **hand off to preflight**
|
|
226
|
+
</template>
|
|
227
|
+
|
|
228
|
+
- If <result/> is `IMPLEMENT`:
|
|
229
|
+
Only output the following <template/> and then use the
|
|
230
|
+
`Skill` tool to invoke the `ase:ase-task-implement` skill in
|
|
231
|
+
order to implement the plan. Immediately stop processing the
|
|
232
|
+
current skill once the `Skill` tool was used.
|
|
233
|
+
|
|
234
|
+
<template>
|
|
235
|
+
⧉ **ASE**: ◉ task: **<ase-task-id/>**, ✪ plan: **<words/>** words, ▶ status: **hand off to implement**
|
|
236
|
+
</template>
|
|
237
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ase-code-explain
|
|
3
|
+
argument-hint: "<source-reference>"
|
|
4
|
+
description: >
|
|
5
|
+
Explains code with WHAT, WHY, ANALOGY, DIAGRAM, CRUXES, and GOTCHAS.
|
|
6
|
+
Use when you want to know how code works or when the user asks "how does this work?"
|
|
7
|
+
user-invocable: true
|
|
8
|
+
disable-model-invocation: false
|
|
9
|
+
effort: medium
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- "Skill"
|
|
12
|
+
- "Agent"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-persona.md
|
|
16
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
|
|
17
|
+
|
|
18
|
+
Explain Source Code
|
|
19
|
+
===================
|
|
20
|
+
|
|
21
|
+
Your role is an experienced, *expert-level software developer*,
|
|
22
|
+
specialized in *explaining source code*.
|
|
23
|
+
|
|
24
|
+
<objective>
|
|
25
|
+
*Analyze* the source code of $ARGUMENTS, and its directly related source
|
|
26
|
+
code and *explain* it in *brief*, *standardized*, and *concise* way.
|
|
27
|
+
</objective>
|
|
28
|
+
|
|
29
|
+
<flow>
|
|
30
|
+
1. <step id="STEP 1: Investigate Code Base">
|
|
31
|
+
Investigate on the code. If the code base is large, you *MUST* use
|
|
32
|
+
the `Agent` tool (not inline work) to create multiple sub-agents to
|
|
33
|
+
split the investigation task into appropriate chunks.
|
|
34
|
+
</step>
|
|
35
|
+
|
|
36
|
+
2. <step id="STEP 2: WHAT and WHY">
|
|
37
|
+
**Explain the WHAT and WHY**.
|
|
38
|
+
|
|
39
|
+
First, explain *WHAT* the code does (*functionality*).
|
|
40
|
+
Second, explain *WHY* the code does it (*rationale*).
|
|
41
|
+
|
|
42
|
+
Keep your explanations *brief* and *concise*.
|
|
43
|
+
Output the result with the following <template/>:
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
🔵 **WHAT** (You should know what):
|
|
47
|
+
- [...]
|
|
48
|
+
- [...]
|
|
49
|
+
- [...]
|
|
50
|
+
|
|
51
|
+
🔵 **WHY** (You should know why):
|
|
52
|
+
- [...]
|
|
53
|
+
- [...]
|
|
54
|
+
- [...]
|
|
55
|
+
</template>
|
|
56
|
+
</step>
|
|
57
|
+
|
|
58
|
+
3. <step id="STEP 3: ANALOGY and DIAGRAM">
|
|
59
|
+
**Give insights with ANALOGY and DIAGRAM**.
|
|
60
|
+
|
|
61
|
+
First, give an analogy by comparing the code to something from
|
|
62
|
+
everyday life. How can I understand this by something I already
|
|
63
|
+
know? Use simple wording as in "Explain Like I'm 5 Years Old (ELI5)"
|
|
64
|
+
style of explanations. For very complex concepts, use multiple
|
|
65
|
+
analogies.
|
|
66
|
+
|
|
67
|
+
Second, draw a diagram to show the control or data flow, code or
|
|
68
|
+
data structure, or code or data relationships. What gives the best
|
|
69
|
+
overall overview of the code?
|
|
70
|
+
Choose the Mermaid diagram type per intent: `classDiagram` for
|
|
71
|
+
class/method structure, `sequenceDiagram` for actor/message flow,
|
|
72
|
+
or `flowchart TB` for boxes-and-lines component layouts.
|
|
73
|
+
Invoke the `ase-meta-diagram` skill via the `Skill` tool to render the
|
|
74
|
+
diagram. Do *not* hand-draw.
|
|
75
|
+
|
|
76
|
+
Keep your explanation *brief* and *concise*.
|
|
77
|
+
Output the result with the following <template/>:
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
⚪ **ANALOGY** (You should imagine):
|
|
81
|
+
- [...]
|
|
82
|
+
- [...]
|
|
83
|
+
- [...]
|
|
84
|
+
|
|
85
|
+
⚪ **DIAGRAM** (You should grasp):
|
|
86
|
+
[...]
|
|
87
|
+
</template>
|
|
88
|
+
</step>
|
|
89
|
+
|
|
90
|
+
4. <step id="STEP 4: CRUXES and GOTCHAS">
|
|
91
|
+
**Highlight CRUXES and GOTCHAS**.
|
|
92
|
+
|
|
93
|
+
First, tell what are the *cruxes* of the code.
|
|
94
|
+
Is there something one should really *notice*?
|
|
95
|
+
|
|
96
|
+
Second, tell what are the gotchas of the code.
|
|
97
|
+
Is there something one could really *stumble over*?
|
|
98
|
+
|
|
99
|
+
Keep your explanation *brief* and *concise*.
|
|
100
|
+
Output the result with the following <template/>:
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
🟠 **CRUXES** (You should notice):
|
|
104
|
+
- [...]
|
|
105
|
+
- [...]
|
|
106
|
+
- [...]
|
|
107
|
+
|
|
108
|
+
🟠 **GOTCHAS** (You should not stumble over):
|
|
109
|
+
- [...]
|
|
110
|
+
- [...]
|
|
111
|
+
- [...]
|
|
112
|
+
</template>
|
|
113
|
+
</step>
|
|
114
|
+
</flow>
|
|
115
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ase-code-insight
|
|
3
|
+
argument-hint: "<code-references>"
|
|
4
|
+
description: >
|
|
5
|
+
Give insights into the source code.
|
|
6
|
+
user-invocable: true
|
|
7
|
+
disable-model-invocation: false
|
|
8
|
+
effort: low
|
|
9
|
+
allowed-tools:
|
|
10
|
+
- "Bash(git)"
|
|
11
|
+
- "Bash(sort)"
|
|
12
|
+
- "Bash(uniq)"
|
|
13
|
+
- "Bash(head)"
|
|
14
|
+
- "Skill"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-persona.md
|
|
18
|
+
@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
|
|
19
|
+
|
|
20
|
+
Project Insight
|
|
21
|
+
===============
|
|
22
|
+
|
|
23
|
+
Your role is an experienced, *expert-level software developer*,
|
|
24
|
+
specialized in *analyzing source code* and giving insights.
|
|
25
|
+
|
|
26
|
+
<objective>
|
|
27
|
+
Give *insights* into the project through the source code of $ARGUMENTS.
|
|
28
|
+
</objective>
|
|
29
|
+
|
|
30
|
+
<flow>
|
|
31
|
+
1. <step id="STEP 1: PROJECT ABSTRACT">
|
|
32
|
+
Determine an <abstract/> summary of this project.
|
|
33
|
+
For this, check a potentially existing `README.*` file
|
|
34
|
+
or scan the source files and figure it out indirectly.
|
|
35
|
+
|
|
36
|
+
Display the results with the following <template/>:
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
🔵 **PROJECT ABSTRACT**:
|
|
40
|
+
|
|
41
|
+
<abstract/>
|
|
42
|
+
</template>
|
|
43
|
+
</step>
|
|
44
|
+
|
|
45
|
+
2. <step id="STEP 2: PROJECT AUTHOR">
|
|
46
|
+
Determine the <author/> of this project.
|
|
47
|
+
For this, run the following command...
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
git shortlog -sn --no-merges HEAD
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
...and then display the results with the following <template/>:
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
🔵 **PROJECT AUTHOR**:
|
|
57
|
+
|
|
58
|
+
<author/>
|
|
59
|
+
</template>
|
|
60
|
+
</step>
|
|
61
|
+
|
|
62
|
+
3. <step id="STEP 3: SOURCE CHURN">
|
|
63
|
+
Display the source files with caused the most churn by
|
|
64
|
+
figuring out which source files have the most commits.
|
|
65
|
+
Display the following <template/>:
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
🔵 **SOURCE CHURN**:
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
Then run the following command...
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -10
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
...and then display its result as a table with a table head and
|
|
78
|
+
columns named "Commits" and "Source File". Do not display any
|
|
79
|
+
further explanation of this result.
|
|
80
|
+
</step>
|
|
81
|
+
|
|
82
|
+
4. <step id="STEP 4: MODULE STRUCTURE">
|
|
83
|
+
Display the following <template/>:
|
|
84
|
+
|
|
85
|
+
<template>
|
|
86
|
+
🔵 **MODULE STRUCTURE**:
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
Find all modules (or OOP classes) and draw a `flowchart TB`
|
|
90
|
+
diagram with all modules as boxes and the imports between modules
|
|
91
|
+
as the directed edges. Invoke the `ase-meta-diagram` skill via the
|
|
92
|
+
`Skill` tool to render the diagram. Do not display any further
|
|
93
|
+
explanation except for this diagram.
|
|
94
|
+
</step>
|
|
95
|
+
</flow>
|
|
96
|
+
|