1---2name: ase-help-skill3description: Show the manual page of an ASE skill, addressed by its full name, by any abbreviation of it, or by a description of its purpose, and list the entire skill catalog when no name is given. Use when the user wants the "manual", "man page", "manpage", or "help" of a particular ASE skill, or asks what a certain `ase-xxx-xxx` skill does.4---5
6@${CLAUDE_SKILL_DIR}/../../meta/ase-control.md
7@${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md
8@${CLAUDE_SKILL_DIR}/../../meta/ase-dialog.md
9@${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md
10
11<skill name="ase-help-skill">
12Show the Manual Page of an ASE Skill
13</skill>
14
15<expand name="getopt"
16 arg1="ase-help-skill"
17 arg2="">
18 $ARGUMENTS
19</expand>
20
21<objective>
22*Show* the *manual page* of the ASE skill addressed by the following
23skill name, abbreviation of it, or description of its purpose:
24<skill-ref><getopt-arguments/></skill-ref>
25</objective>
26
27The following <catalog/> is index of all ASE skills -- one
28`⎈ **<group/>**` entry per skill group and one
29``○ `<name/>`: <purpose/>`` entry per skill -- and this is
30the *sole* index <skill-ref/> is resolved against:
31
32<catalog>
33@${CLAUDE_SKILL_DIR}/catalog.md
34</catalog>
35
36<flow>
37
381. <step id="STEP 1: Resolve Skill Name">
39
40 1. <if condition="<skill-ref/> is empty">
41 No particular skill was addressed, so render the *entire*
42 <catalog/> as a browsable list with the following <template/>
43 -- one list entry per catalog entry, in catalog order, where
44 <name/> and <purpose/> are the two fields of the entry (and
45 <name-padded/> is <name/>, padded to 22 characters with
46 spaces on the right) -- and then immediately *STOP* processing
47 the entire current skill:
48
49 <template>
50 <ase-tpl-head title="SKILL CATALOG"/>
51
52 <catalog/>
53
54 <ase-tpl-foot title="SKILL CATALOG"/>
55
56 ⧉ **ASE**: ✪ skill: **ase-help-skill**, ▶ hint: **run `/ase-help-skill ase-xxx-xxx` for manual page of individual skill**
57 </template>
58 </if>
59
60 2. Set <skill-ref-raw/> to <skill-ref/> with only its leading and
61 trailing whitespace stripped, as the *verbatim* wording of the
62 user is required later on.
63
64 *Normalize* <skill-ref/> by stripping all leading and trailing
65 whitespace and then, repeatedly, any leading `/` and `ase:`
66 prefix, so that `ase-code-lint`, `/ase-code-lint`,
67 `ase:ase-code-lint`, and `/ase:ase-code-lint` all normalize to
68 `ase-code-lint`. Do not output anything.
69
70 3. Resolve the normalized <skill-ref/> against <catalog/> in *three*
71 tiers and store the outcome in <candidates/>. Each tier is tried
72 only if all preceding tiers yielded *no* candidate at all:
73
74 1. *Exact Name Tier*:
75
76 If a catalog *name* is *equal* to <skill-ref/>, set
77 <candidates/> to exactly that *single* name.
78
79 2. *Substring Name Tier*:
80
81 Set <candidates/> to *all* catalog *names* *containing*
82 <skill-ref/> as a substring, in alphabetical order.
83
84 3. *Fuzzy Purpose Tier*:
85
86 Set <candidates/> to *all* catalog names whose *purpose* --
87 the part *after* the colon of the catalog entry -- *fuzzily*
88 matches <skill-ref-raw/>, in *descending* order of match
89 quality. Match against <skill-ref-raw/>, and *not* against
90 <skill-ref/>, as this tier matches free-text wording, which
91 the normalization of sub-step 2 would distort.
92
93 A purpose matches fuzzily if it shares the topic, the
94 wording, or evident synonyms with <skill-ref-raw/>, so
95 that e.g. `manpage` matches `Show the Manual Page of an
96 ASE Skill` and `root cause` matches `Five-Whys Root-Cause
97 Analysis`. Include *plausible* matches only -- if none is
98 plausible, leave <candidates/> empty.
99
100 Set <count/> to the number of entries in <candidates/>.
101 Do not output anything.
102
103 </step>
104
1052. <step id="STEP 2: Dispatch Resolution">
106
107 1. <if condition="<count/> is equal 0">
108 Only output the following <template/> and then immediately
109 *STOP* processing the entire current skill:
110
111 <template>
112 ⧉ **ASE**: ✪ skill: **ase-help-skill**, ▶ ERROR: unknown skill: **<skill-ref-raw/>**
113 </template>
114 </if>
115
116 2. <elseif condition="<count/> is equal 1">
117 Set <name/> to the single entry of <candidates/> and continue
118 processing. Do not output anything.
119 </elseif>
120
121 3. <else>
122 The abbreviation is *ambiguous*, so let the user pick the
123 intended skill.
124
125 Set <shown/> to the *first* 9 entries of <candidates/>, as the
126 dialog renders at most *nine* answer lines.
127
128 <if condition="<count/> is greater than 9">
129 Set <truncation> (showing 9 of <count/> candidates)</truncation>
130 </if>
131 <else>
132 Set <truncation></truncation> (set to empty)
133 </else>
134
135 In the following, you *MUST* *NOT* use your built-in
136 <user-dialog-tool/> tool! Instead, you *MUST* just show a custom
137 dialog according to the expanded `custom-dialog` definition. You
138 *MUST* closely follow this definition.
139
140 Let the user select the intended skill by raising a question
141 with the following custom dialog, where each answer line
142 corresponds to one entry of <shown/>, using the catalog *name*
143 as the label and its catalog *purpose* as the description:
144
145 <expand name="custom-dialog" arg1="--no-other">
146 Ambiguous Skill: Which skill's manual page should be shown?<truncation/>
147 <name/>: <purpose/>
148 [...]
149 </expand>
150
151 Check the <result/> and dispatch accordingly:
152
153 - If <result/> is `CANCEL`:
154 *STOP* processing without any further output.
155
156 - Otherwise: Set <name/> to the selected skill name and
157 continue processing.
158 </else>
159
160 </step>
161
1623. <step id="STEP 3: Render Manual Page">
163
164 1. Use the `Read` tool to read the manual page of the resolved
165 skill <name/> and set <manual/> to its content. The file path is
166 formed by joining <ase-plugin-root/> and `skills/<name/>/help.md`
167 with exactly *one* `/` separator, as <ase-plugin-root/> may or
168 may not carry a trailing `/`. Do not output anything related to
169 this tool call.
170
171 2. <if condition="<manual/> is empty or could not be read">
172 Only output the following <template/> and then immediately
173 *STOP* processing the entire current skill:
174
175 <template>
176 ⧉ **ASE**: ✪ skill: **ase-help-skill**, ▶ ERROR: unreadable manual page: **<name/>**
177 </template>
178 </if>
179
180 3. Treat <manual/> as *verbatim* Markdown. You *MUST* *NOT*
181 truncate, summarize, reformat, or partially show it. Only output
182 the following <template/>:
183
184 <template>
185 <ase-tpl-head title="MANUAL PAGE: <name/>"/>
186 <manual/>
187 <ase-tpl-foot title="MANUAL PAGE: <name/>"/>
188 </template>
189
190 </step>
191
192</flow>