Skip to content

Commit c6ed248

Browse files
authored
feat: add clarifying questions to pptx, pdf, xlsx skills (#110)
* feat: add clarifying questions to pptx, pdf, xlsx skills Each skill now has a structured 'Clarifying Questions' section that tells the LLM exactly what to ask when details are missing: - pptx-expert: topic, audience, slide count, purpose, theme, charts - pdf-expert: document type, topic, audience, sections, page format - xlsx-expert: purpose, data structure, data source, charts, formulas Questions are grouped into three tiers: 1. Always needed (ask if missing) 2. Ask if relevant to the request 3. Never ask (use sensible defaults) The LLM is instructed to group questions into ONE ask_user call, skip anything already specified, and offer defaults the user can accept with 'yes'. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com> * fix: address PR #110 review feedback — clarify remote asset handling All 3 skills mentioned URLs/images in clarifying questions but the setup sequence only applies file-builder (fs-write), leaving the LLM unable to actually fetch remote content. - xlsx: data source URL now notes to apply web-research profile - pptx: images changed from URLs to local paths, with web-research guidance if remote URLs are needed - pdf: branding logo changed from URL to local path/bytes, with web-research guidance if remote URLs are needed Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com> --------- Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent b9d22f8 commit c6ed248

3 files changed

Lines changed: 94 additions & 7 deletions

File tree

skills/pdf-expert/SKILL.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,42 @@ Use `estimateHeight(elements)` to predict total height BEFORE rendering.
144144

145145
## Setup Sequence
146146

147-
1. `ask_user` — clarify requirements (topic, audience, data sources)
147+
1. **Clarify requirements** — use `ask_user` (see Clarifying Questions below)
148148
2. `apply_profile({ profiles: 'file-builder' })` — for fs-write plugin
149149
3. `module_info('pdf')` → read typeDefinitions for ALL parameters
150150
4. `module_info('pdf-charts')` → if charts needed
151151
5. Register handler and execute
152152

153+
## Clarifying Questions
154+
155+
Before building, check the user's request for these details. Ask about any
156+
that are missing — group into ONE `ask_user` call, never ask one at a time.
157+
Skip anything the user already specified. Offer sensible defaults they can
158+
accept with "yes" or "looks good".
159+
160+
**Always needed (ask if missing):**
161+
162+
- **Document type** — Report, letter, invoice, resume, brochure, manual, whitepaper?
163+
- **Topic/Subject** — What is the document about?
164+
- **Audience** — Who will read it? (management, clients, public, academic)
165+
- **Key sections** — What main sections or topics should it cover?
166+
167+
**Ask if relevant to the request:**
168+
169+
- **Page format** — Letter or A4? Portrait or landscape? (default: Letter, portrait)
170+
- **Length** — Approximate page count, or let content determine naturally?
171+
- **Style/Tone** — Formal/professional, casual, academic, technical?
172+
- **Data/Charts** — Any data to visualise? What chart types?
173+
- **Branding** — Company colours, logo image? (local path or provided bytes. If remote URLs are needed, also apply `web-research` profile)
174+
- **Table of contents** — Include a TOC? (suggest yes for 5+ pages)
175+
176+
**Never ask — use sensible defaults:**
177+
178+
- Theme → `light-clean` for content, dark only for title pages
179+
- Font → use standard PDF fonts
180+
- Headers/footers/page numbers → always include for multi-page docs
181+
- Margins → use standard 1" margins
182+
153183
## Common Mistakes to Avoid
154184

155185
- Forgetting `addPage()` before low-level drawing → ERROR

skills/pptx-expert/SKILL.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,38 @@ Call `module_info('ooxml-core')` to see available themes.
119119

120120
## Setup Sequence
121121

122-
1. `ask_user` — clarify topic, audience, slide count
122+
1. **Clarify requirements** — use `ask_user` (see Clarifying Questions below)
123123
2. `apply_profile({ profiles: 'file-builder' })` — for fs-write
124124
3. `module_info('pptx')` → read typeDefinitions
125125
4. Register handler(s) and execute
126126

127+
## Clarifying Questions
128+
129+
Before building, check the user's request for these details. Ask about any
130+
that are missing — group into ONE `ask_user` call, never ask one at a time.
131+
Skip anything the user already specified. Offer sensible defaults they can
132+
accept with "yes" or "looks good".
133+
134+
**Always needed (ask if missing):**
135+
136+
- **Topic/Title** — What is the presentation about?
137+
- **Audience** — Who will view it? (executives, team, customers, students, general)
138+
- **Slide count** — How many slides? Suggest 8–12 if unspecified.
139+
- **Purpose** — Inform, persuade, train, report?
140+
141+
**Ask if relevant to the request:**
142+
143+
- **Theme/Style** — Professional/corporate, creative, minimal, dark? Any brand colours?
144+
- **Content structure** — Do you have an outline, or should I create one?
145+
- **Data/Charts** — Any data to visualise? What chart types? (bar, pie, line, etc.)
146+
- **Images** — Any images to include? (local file paths or descriptions for placeholders. If remote URLs are needed, also apply `web-research` profile)
147+
148+
**Never ask — use sensible defaults:**
149+
150+
- Speaker notes style → always include professional speaker notes
151+
- Font choices → use theme defaults
152+
- Slide dimensions → always 16:9
153+
127154
## Common Mistakes
128155

129156
- Concatenating ShapeFragments with `+` → use arrays

skills/xlsx-expert/SKILL.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,41 @@ You are an expert at building professional Excel `.xlsx` workbooks inside the Hy
6060

6161
## Setup Sequence
6262

63-
1. `apply_profile({ profiles: 'file-builder' })` for binary output and larger buffers.
64-
2. `manage_plugin('fs-write', 'enable')` if the workbook needs to be written to disk.
65-
3. `module_info('xlsx')` and read the type definitions.
66-
4. Register a handler that imports from `ha:xlsx`.
67-
5. Build the workbook, then write the returned `Uint8Array` with the fs-write binary API.
63+
1. **Clarify requirements** — use `ask_user` (see Clarifying Questions below)
64+
2. `apply_profile({ profiles: 'file-builder' })` for binary output and larger buffers.
65+
3. `manage_plugin('fs-write', 'enable')` if the workbook needs to be written to disk.
66+
4. `module_info('xlsx')` and read the type definitions.
67+
5. Register a handler that imports from `ha:xlsx`.
68+
6. Build the workbook, then write the returned `Uint8Array` with the fs-write binary API.
69+
70+
## Clarifying Questions
71+
72+
Before building, check the user's request for these details. Ask about any
73+
that are missing — group into ONE `ask_user` call, never ask one at a time.
74+
Skip anything the user already specified. Offer sensible defaults they can
75+
accept with "yes" or "looks good".
76+
77+
**Always needed (ask if missing):**
78+
79+
- **Purpose** — What will this workbook be used for? (tracking, analysis, reporting)
80+
- **Data structure** — What columns/fields are needed? How many rows approximately?
81+
- **Data source** — Will data come from a file, URL, or should I generate sample data? If a URL, also apply `web-research` profile to enable fetching.
82+
83+
**Ask if relevant to the request:**
84+
85+
- **Multiple sheets** — One sheet or multiple? (e.g. summary + detail, by category)
86+
- **Charts** — Any visualisations needed? What types? (column, bar, line, pie)
87+
- **Formulas** — Any calculations? (totals, averages, percentages, lookups)
88+
- **Formatting** — Conditional formatting, data bars, colour coding for thresholds?
89+
- **Pivot tables** — Any pivot analysis needed? Which fields to group by?
90+
- **Filters/Sorting** — Auto-filter, frozen header rows?
91+
92+
**Never ask — use sensible defaults:**
93+
94+
- Column widths → auto-size based on content
95+
- Header styling → bold, coloured background, border
96+
- Number formats → auto-detect from data types
97+
- Sheet protection → don't apply unless explicitly requested
6898

6999
## Common Patterns
70100

0 commit comments

Comments
 (0)