1
+### skills_tool
2
+
3
+manage and use agent skills for specialized capabilities
4
+skills are composable bundles of instructions context and executable code
5
+use progressive disclosure: metadata → full content → referenced files
6
+use "method" arg to specify operation: "list" "load" "read_file" "execute_script" "search"
7
+
8
+## Overview
9
+
10
+Skills system provides three-level progressive disclosure:
11
+- Level 1: Metadata (name + description) loaded in system prompt at startup
12
+- Level 2: Full SKILL.md content loaded when relevant to task
13
+- Level 3+: Referenced files and scripts loaded on-demand
14
+
15
+When to use skills:
16
+- Task matches skill description from available skills list
17
+- Need specialized procedures or domain knowledge
18
+- Task requires bundled scripts or automation
19
+- Need step-by-step guidance for complex operations
20
+
21
+Progressive workflow:
22
+1. Check available skills metadata already in your context
23
+2. Use "search" if looking for specific capability
24
+3. Use "load" to get full skill instructions and context
25
+4. Use "read_file" to load additional reference documents
26
+5. Use "execute_script" to run deterministic operations
27
+
28
+## Operations
29
+
30
+### 1. list available skills
31
+
32
+Lists all available skills with metadata
33
+Shows name, version, description, tags, and author
34
+Use when: exploring available capabilities or confirming skill exists
35
+
36
+~~~json
37
+{
38
+ "thoughts": [
39
+ "Need to see what skills are available",
40
+ "User asked about available capabilities"
41
+ ],
42
+ "headline": "Listing all available skills",
43
+ "tool_name": "skills_tool",
44
+ "tool_args": {
45
+ "method": "list"
46
+ }
47
+}
48
+~~~
49
+
50
+Response format:
51
+- Skill name and version
52
+- Brief description
53
+- Tags for categorization
54
+- Author attribution
55
+
56
+### 2. load full skill content
57
+
58
+Loads complete SKILL.md content with instructions and procedures
59
+Returns metadata, full content, and list of referenced files
60
+Use when: identified relevant skill and need detailed instructions
61
+
62
+~~~json
63
+{
64
+ "thoughts": [
65
+ "User needs PDF form extraction",
66
+ "pdf_editing skill will provide procedures",
67
+ "Loading full skill content"
68
+ ],
69
+ "headline": "Loading PDF editing skill",
70
+ "tool_name": "skills_tool",
71
+ "tool_args": {
72
+ "method": "load",
73
+ "skill_name": "pdf_editing"
74
+ }
75
+}
76
+~~~
77
+
78
+Required args:
79
+- skill_name: exact name from metadata or list
80
+
81
+Response includes:
82
+- Skill metadata (name, version, description, tags)
83
+- Full markdown content with instructions
84
+- List of referenced files available to load
85
+- Code examples and procedures
86
+
87
+### 3. read skill reference file
88
+
89
+Reads additional reference files from skill directory
90
+Files referenced in SKILL.md can be loaded progressively
91
+Use when: need detailed documentation or examples from skill references
92
+
93
+~~~json
94
+{
95
+ "thoughts": [
96
+ "Skill mentioned forms.md for form filling details",
97
+ "Need specific form field handling instructions",
98
+ "Loading reference file"
99
+ ],
100
+ "headline": "Reading PDF forms reference documentation",
101
+ "tool_name": "skills_tool",
102
+ "tool_args": {
103
+ "method": "read_file",
104
+ "skill_name": "pdf_editing",
105
+ "file_path": "forms.md"
106
+ }
107
+}
108
+~~~
109
+
110
+Required args:
111
+- skill_name: name of skill containing file
112
+- file_path: relative path within skill directory (e.g. "reference.md" or "examples/example1.md")
113
+
114
+Security:
115
+- Path validation prevents directory traversal
116
+- Only files within skill directory accessible
117
+- Supports markdown, text, code files
118
+
119
+### 4. execute skill script
120
+
121
+Executes bundled scripts from skill with arguments
122
+Scripts run in sandbox with injected arguments
123
+Use when: skill provides script for deterministic operation or automation
124
+
125
+~~~json
126
+{
127
+ "thoughts": [
128
+ "Need to extract PDF form fields programmatically",
129
+ "Skill provides extract_fields.py script",
130
+ "Executing with target PDF path"
131
+ ],
132
+ "headline": "Executing PDF field extraction script",
133
+ "tool_name": "skills_tool",
134
+ "tool_args": {
135
+ "method": "execute_script",
136
+ "skill_name": "pdf_editing",
137
+ "script_path": "scripts/extract_fields.py",
138
+ "script_args": {
139
+ "pdf_path": "/path/to/form.pdf",
140
+ "output_format": "json"
141
+ }
142
+ }
143
+}
144
+~~~
145
+
146
+Required args:
147
+- skill_name: name of skill containing script
148
+- script_path: relative path to script file
149
+- script_args: dictionary of arguments passed to script
150
+
151
+Supported script types:
152
+- .py (Python): args injected as _skill_args dictionary
153
+- .js (Node.js): args injected as _skill_args constant
154
+- .sh (Shell): args exported as environment variables
155
+
156
+Script execution:
157
+- Runs in Docker container sandbox
158
+- Has access to installed packages
159
+- Returns stdout/stderr output
160
+- Secure and isolated execution
161
+
162
+### 5. search skills by query
163
+
164
+Searches skills by text matching in name, description, and tags
165
+Returns ranked results by relevance score
166
+Use when: looking for skills without knowing exact name
167
+
168
+~~~json
169
+{
170
+ "thoughts": [
171
+ "User needs web scraping capability",
172
+ "Not sure of exact skill name",
173
+ "Searching for web-related skills"
174
+ ],
175
+ "headline": "Searching for web scraping skills",
176
+ "tool_name": "skills_tool",
177
+ "tool_args": {
178
+ "method": "search",
179
+ "query": "web scraping html parsing"
180
+ }
181
+}
182
+~~~
183
+
184
+Required args:
185
+- query: search text (searches name, description, tags)
186
+
187
+Scoring:
188
+- Name match: +3 points
189
+- Description match: +2 points
190
+- Tag match: +1 point per tag
191
+- Results sorted by descending score
192
+
193
+## Best Practices
194
+
195
+### When to use skills vs other tools
196
+
197
+Use skills when:
198
+- Task requires specialized domain knowledge
199
+- Need structured procedures or step-by-step guidance
200
+- Deterministic scripts available for automation
201
+- Complex multi-step operations with best practices
202
+
203
+Use other tools when:
204
+- Simple file operations (use code_execution_tool)
205
+- Web search (use search_engine)
206
+- General computation (use code_execution_tool)
207
+- Memory operations (use memory tools)
208
+
209
+### Progressive disclosure workflow
210
+
211
+1. Start with metadata (already in context)
212
+ - Check available skills list in system prompt
213
+ - Match task to skill description
214
+
215
+2. Load full content when relevant
216
+ - Use "load" to get complete instructions
217
+ - Review procedures and examples
218
+
219
+3. Load references as needed
220
+ - Use "read_file" for detailed documentation
221
+ - Load only files relevant to current subtask
222
+
223
+4. Execute scripts for automation
224
+ - Use "execute_script" for deterministic operations
225
+ - Provide appropriate arguments from context
226
+
227
+### Common patterns
228
+
229
+Pattern: Using a skill for first time
230
+1. Identify skill from metadata
231
+2. Load full skill content
232
+3. Follow instructions in content
233
+4. Load reference files if mentioned
234
+5. Execute scripts if provided
235
+
236
+Pattern: Quick script execution
237
+1. Know skill name from previous use
238
+2. Execute script directly with args
239
+3. Process output
240
+
241
+Pattern: Exploring capabilities
242
+1. Search with query terms
243
+2. Review matches
244
+3. Load most relevant skill
245
+
246
+## Error Handling
247
+
248
+Common errors:
249
+- "Skill not found": Check spelling, use list or search to find correct name
250
+- "File not found": Verify file_path matches referenced files from load output
251
+- "Script failed": Check script_args match expected parameters, review skill docs
252
+- "Unsupported script type": Only .py, .js, .sh supported
253
+
254
+When skill loading fails:
255
+- Verify skill exists using list method
256
+- Check for typos in skill_name
257
+- Ensure skill system is enabled in settings
258
+
259
+When script execution fails:
260
+- Review skill documentation for required arguments
261
+- Check script_args dictionary format
262
+- Verify required packages installed in container
263
+- Check script output for specific error messages
264
+
265
+## Examples
266
+
267
+Example 1: PDF form field extraction
268
+~~~json
269
+{
270
+ "thoughts": [
271
+ "User has PDF form to analyze",
272
+ "pdf_editing skill has extraction capabilities",
273
+ "Will load skill and execute extraction script"
274
+ ],
275
+ "headline": "Extracting PDF form fields",
276
+ "tool_name": "skills_tool",
277
+ "tool_args": {
278
+ "method": "execute_script",
279
+ "skill_name": "pdf_editing",
280
+ "script_path": "scripts/extract_fields.py",
281
+ "script_args": {
282
+ "pdf_path": "/workspace/application.pdf"
283
+ }
284
+ }
285
+}
286
+~~~
287
+
288
+Example 2: Web scraping with custom selector
289
+~~~json
290
+{
291
+ "thoughts": [
292
+ "Need to scrape product prices from website",
293
+ "web_scraping skill provides fetch script",
294
+ "Using CSS selector to target price elements"
295
+ ],
296
+ "headline": "Scraping product prices from webpage",
297
+ "tool_name": "skills_tool",
298
+ "tool_args": {
299
+ "method": "execute_script",
300
+ "skill_name": "web_scraping",
301
+ "script_path": "scripts/fetch_page.py",
302
+ "script_args": {
303
+ "url": "https://example.com/products",
304
+ "selector": ".price"
305
+ }
306
+ }
307
+}
308
+~~~
309
+
310
+Example 3: Data analysis workflow
311
+~~~json
312
+{
313
+ "thoughts": [
314
+ "User needs CSV analysis",
315
+ "data_analysis skill has analysis procedures",
316
+ "Loading skill for detailed instructions"
317
+ ],
318
+ "headline": "Loading data analysis skill",
319
+ "tool_name": "skills_tool",
320
+ "tool_args": {
321
+ "method": "load",
322
+ "skill_name": "data_analysis"
323
+ }
324
+}
325
+~~~
326
+
327
+Then follow up with script:
328
+~~~json
329
+{
330
+ "thoughts": [
331
+ "Skill loaded, now analyzing CSV with grouping",
332
+ "Using analyze_csv script with group_by parameter"
333
+ ],
334
+ "headline": "Analyzing sales data grouped by category",
335
+ "tool_name": "skills_tool",
336
+ "tool_args": {
337
+ "method": "execute_script",
338
+ "skill_name": "data_analysis",
339
+ "script_path": "scripts/analyze_csv.py",
340
+ "script_args": {
341
+ "csv_path": "/workspace/sales_data.csv",
342
+ "group_by": "category"
343
+ }
344
+ }
345
+}
346
+~~~
347
+
348
+## Notes
349
+
350
+- Skills metadata already loaded in your system prompt
351
+- Skills cache after first load for efficiency
352
+- Referenced files listed in load response
353
+- Scripts inject arguments as _skill_args variable
354
+- All operations return formatted text responses
355
+- Skills follow the open SKILL.md standard (cross-platform compatible)
356
+- Use skills for structured procedures and contextual expertise