You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Guide for creating and maintaining user-facing agent skills
3
+
description: Guide for creating and maintaining user-facing agent skills. Use when creating a new skill, adding a SKILL.md file, writing skill frontmatter/descriptions, organizing skill directories, or improving an existing skill's discoverability. Covers SKILL.md format, progressive disclosure, reference files, and writing effective descriptions.
4
4
metadata:
5
5
internal: true
6
6
---
@@ -9,6 +9,23 @@ metadata:
9
9
10
10
This skill guides you through creating user-facing agent skills. For the canonical reference, see [agentskills.io](https://agentskills.io/home).
11
11
12
+
## Before You Start
13
+
14
+
Identify **2-3 concrete use cases** your skill should enable before writing anything.
15
+
16
+
Good use case definition:
17
+
```
18
+
Use Case: [Name]
19
+
Trigger: User says "[phrase 1]" or "[phrase 2]"
20
+
Steps: 1. [action] 2. [action] 3. [action]
21
+
Result: [What the user gets]
22
+
```
23
+
24
+
Ask yourself:
25
+
- What does a user want to accomplish?
26
+
- What domain knowledge or best practices should be embedded?
27
+
- What multi-step workflows does this require?
28
+
12
29
## Skill Structure
13
30
14
31
A skill is a folder containing a `SKILL.md` file with metadata and instructions:
@@ -21,32 +38,38 @@ my-skill/
21
38
└── assets/ # Optional: templates, resources
22
39
```
23
40
41
+
**Critical rules:**
42
+
- File must be exactly `SKILL.md` (case-sensitive). No variations (`SKILL.MD`, `skill.md`).
43
+
- Folder names must be **kebab-case**: `my-skill-name` (no spaces, no underscores, no capitals)
44
+
-**No README.md** inside the skill folder. All documentation goes in SKILL.md or references/.
45
+
24
46
## SKILL.md Format
25
47
26
48
### Required Frontmatter
27
49
28
50
```yaml
29
51
---
30
52
name: skill-name
31
-
description: Brief description of what the skill does
53
+
description: What it does. Use when user asks to [specific phrases].
32
54
---
33
55
```
34
56
35
-
-**name**: Unique identifier (lowercase, hyphens)
36
-
-**description**: Rich description for skill discovery (1-1024 characters)
57
+
-**name**: kebab-case, must match folder name. No spaces or capitals.
58
+
-**description**: 1-1024 characters. Must include BOTH what it does AND when to use it.
59
+
60
+
**Security restrictions** — forbidden in frontmatter:
61
+
- XML angle brackets (`<` or `>`) — frontmatter appears in Claude's system prompt
62
+
- Skill names containing "claude" or "anthropic" (reserved)
37
63
38
64
### Writing Effective Descriptions
39
65
40
-
The description field is **critical for skill discovery**by coding agents. It should include:
66
+
The description is the **only discovery mechanism**— it determines whether Claude loads your skill. It should include:
41
67
42
-
1.**What the skill does**- Core functionality
43
-
2.**When to use it**- Trigger scenarios
44
-
3.**Keywords**- Task-oriented phrases that help agents connect questions to skills
68
+
1.**What the skill does**— Core functionality
69
+
2.**When to use it**— Trigger conditions and phrases
70
+
3.**Key capabilities**— Task-oriented phrases users might say
45
71
46
-
**Format:**
47
-
```yaml
48
-
description: "[What it does]. Use when [scenarios]. Keywords/phrases."
49
-
```
72
+
**Structure:**`[What it does] + [When to use it] + [Key capabilities]`
50
73
51
74
**Good examples:**
52
75
```yaml
@@ -56,204 +79,158 @@ description: Search and read B2C Commerce Script API documentation and XSD schem
56
79
# Include common error scenarios
57
80
description: View and debug B2C CLI configuration. Use when authentication fails, connection errors occur, wrong instance is used, or you need to verify dw.json settings, environment variables, or OAuth credentials.
58
81
59
-
# Disambiguation helps agents choose the right skill
82
+
# Disambiguation with negative triggers
60
83
description: Run and monitor existing jobs, import/export site archives. Use when executing batch jobs, importing site data, or checking job status. For creating new job code, use b2c-custom-job-steps instead.
84
+
85
+
# Negative triggers prevent over-triggering
86
+
description: Advanced data analysis for CSV files. Use for statistical modeling, regression, clustering. Do NOT use for simple data exploration (use data-viz skill instead).
description: Using the b2c CLI to search and read Script API documentation
97
+
#Too technical, no user-oriented phrases
98
+
description: Implements the Project entity model with hierarchical relationships.
70
99
```
71
100
72
101
**Key insight:** Include **task-oriented phrases** ("generating URLs", "querying products") not just class names, since users ask about tasks they want to accomplish.
73
102
74
-
### Instructions Body
103
+
### Writing the Main Instructions
75
104
76
-
The body contains markdown instructions that tell the agent how to perform the task.
105
+
After the frontmatter, write instructions in Markdown. Recommended structure:
77
106
78
107
```markdown
79
-
---
80
-
name: my-skill
81
-
description: Does something useful. Use when [scenarios]. Keywords: [task phrases].
82
-
---
83
-
84
108
# Skill Title
85
109
86
-
Brief overview of what this skill helps accomplish.
87
-
88
-
## Examples
89
-
90
-
Concrete examples demonstrating usage.
91
-
92
-
## Reference
93
-
94
-
- [Detailed Reference](references/REFERENCE.md) - Link to additional docs
95
-
```
96
-
97
-
Note: The description frontmatter is the **only** discovery mechanism. "When to Use" sections in the body are not used for discovery. Put all discovery-relevant information in the description.
| SKILL.md body | < 5000 tokens | When skill activated |
159
+
| Linked files (references/) | As needed | On demand |
213
160
214
-
### Basic Usage
161
+
### Guidelines
215
162
216
-
\`\`\`bash
217
-
b2c command --flag value
218
-
\`\`\`
163
+
1.**Keep SKILL.md under 500 lines** — Move detailed content to references
164
+
2.**Front-load key information** — Put most important patterns first
165
+
3.**Use tables for quick reference** — Easy to scan
166
+
4.**Link to references** — Don't inline everything
219
167
220
-
### Advanced Usage
168
+
##Optional Directories
221
169
222
-
\`\`\`bash
223
-
b2c command --complex-flag
224
-
\`\`\`
225
-
```
170
+
### scripts/
171
+
Executable code that agents can run. Scripts should be self-contained, include helpful error messages, and handle edge cases.
226
172
227
-
### 4. Explain When NOT to Use
173
+
### references/
174
+
Additional documentation loaded on demand. Keep individual reference files focused on one topic. Smaller files = less context usage.
228
175
229
-
```markdown
230
-
## When NOT to Use
176
+
### assets/
177
+
Static resources: templates, fonts, icons used in output.
231
178
232
-
- Scenario A (use skill-x instead)
233
-
- Scenario B (manual approach better)
234
-
```
179
+
## File References
235
180
236
-
### 5. Link to Authoritative Sources
181
+
Use relative paths from the skill root. Keep references one level deep — avoid deeply nested chains (SKILL.md → ref1.md → ref2.md is too deep).
237
182
238
-
Reference official documentation rather than duplicating it:
183
+
## Skill Categories
239
184
240
-
```markdown
241
-
## Reference
185
+
### Developer Skills (`.claude/skills/`)
186
+
Skills for contributors working on this codebase (command development patterns, testing approaches, API client patterns, documentation standards).
242
187
243
-
For complete API documentation, see [Official Docs](https://example.com/docs).
244
-
```
188
+
### User-Facing Skills (`skills/*/skills/`)
189
+
Skills for users of the tool (CLI command usage, platform-specific patterns, integration guides).
245
190
246
191
## Validation Checklist
247
192
248
-
Before publishing a skill:
249
-
250
-
-[ ] Frontmatter has `name` and `description`
251
-
-[ ] SKILL.md under 500 lines
252
-
-[ ] Key information appears early
253
-
-[ ] Examples are concrete and runnable
254
-
-[ ] Reference links are valid
255
-
-[ ] No deeply nested reference chains
256
-
-[ ] Tested with target agent
193
+
### Before you start
194
+
-[ ] Identified 2-3 concrete use cases
195
+
-[ ] Planned folder structure
196
+
197
+
### During development
198
+
-[ ] Folder named in kebab-case
199
+
-[ ]`SKILL.md` file exists (exact spelling)
200
+
-[ ] No `README.md` inside the skill folder
201
+
-[ ] YAML frontmatter has `---` delimiters
202
+
-[ ]`name` field: kebab-case, matches folder name
203
+
-[ ]`description` includes WHAT and WHEN (trigger phrases)
204
+
-[ ] No XML tags (`<` or `>`) in frontmatter
205
+
-[ ] Instructions are clear and actionable
206
+
-[ ] Examples provided
207
+
-[ ] Error handling / troubleshooting included
208
+
-[ ] References clearly linked
209
+
210
+
### Testing
211
+
-[ ] Triggers on obvious task requests
212
+
-[ ] Triggers on paraphrased requests
213
+
-[ ] Does NOT trigger on unrelated topics
214
+
-[ ] Functional output is correct
215
+
216
+
### After deployment
217
+
-[ ] Test in real conversations
218
+
-[ ] Monitor for under/over-triggering
219
+
-[ ] Iterate on description and instructions
220
+
221
+
## Iteration Signals
222
+
223
+
**Undertriggering** (skill doesn't load when it should):
224
+
- Users manually enabling it or asking "when should I use this?"
225
+
- Solution: Add more trigger phrases and task-oriented keywords to description
226
+
227
+
**Overtriggering** (skill loads for unrelated queries):
228
+
- Users disabling it or confusion about purpose
229
+
- Solution: Add negative triggers ("Do NOT use for..."), be more specific, clarify scope
230
+
231
+
**Execution issues** (skill loads but results are inconsistent):
232
+
- Users correcting Claude or re-prompting
233
+
- Solution: Make instructions more specific, add error handling, use scripts for critical validations (code is deterministic; language interpretation isn't)
Copy file name to clipboardExpand all lines: skills/b2c-cli/skills/b2c-scaffold/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: b2c-scaffold
3
-
description: Generate B2C Commerce cartridges, controllers, hooks, custom APIs, job steps, and Page Designer components from scaffold templates.
3
+
description: Generate B2C Commerce cartridges, controllers, hooks, custom APIs, job steps, and Page Designer components from scaffold templates. Use when starting a new cartridge, adding a controller to an existing cartridge, creating hook implementations, bootstrapping custom API endpoints, or generating job steps and Page Designer components.
0 commit comments