Skip to content

Commit fac1596

Browse files
committed
skill fixes
1 parent 59829f8 commit fac1596

5 files changed

Lines changed: 506 additions & 319 deletions

File tree

.claude/skills/skill-authoring/SKILL.md

Lines changed: 139 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: skill-authoring
3-
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.
44
metadata:
55
internal: true
66
---
@@ -9,6 +9,23 @@ metadata:
99

1010
This skill guides you through creating user-facing agent skills. For the canonical reference, see [agentskills.io](https://agentskills.io/home).
1111

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+
1229
## Skill Structure
1330

1431
A skill is a folder containing a `SKILL.md` file with metadata and instructions:
@@ -21,32 +38,38 @@ my-skill/
2138
└── assets/ # Optional: templates, resources
2239
```
2340

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+
2446
## SKILL.md Format
2547

2648
### Required Frontmatter
2749

2850
```yaml
2951
---
3052
name: skill-name
31-
description: Brief description of what the skill does
53+
description: What it does. Use when user asks to [specific phrases].
3254
---
3355
```
3456

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)
3763

3864
### Writing Effective Descriptions
3965

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:
4167

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
4571

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]`
5073

5174
**Good examples:**
5275
```yaml
@@ -56,204 +79,158 @@ description: Search and read B2C Commerce Script API documentation and XSD schem
5679
# Include common error scenarios
5780
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.
5881

59-
# Disambiguation helps agents choose the right skill
82+
# Disambiguation with negative triggers
6083
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).
6187
```
6288
6389
**Bad examples:**
6490
```yaml
65-
# Too brief - no discovery keywords
66-
description: Using the b2c CLI for documentation
91+
# Too vague - no trigger phrases
92+
description: Helps with projects.
93+
94+
# Missing triggers - only says what, not when
95+
description: Creates sophisticated multi-page documentation systems.
6796

68-
# Action-oriented instead of problem-oriented
69-
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.
7099
```
71100
72101
**Key insight:** Include **task-oriented phrases** ("generating URLs", "querying products") not just class names, since users ask about tasks they want to accomplish.
73102
74-
### Instructions Body
103+
### Writing the Main Instructions
75104
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:
77106
78107
```markdown
79-
---
80-
name: my-skill
81-
description: Does something useful. Use when [scenarios]. Keywords: [task phrases].
82-
---
83-
84108
# Skill Title
85109

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.
98-
99-
## Progressive Disclosure
100-
101-
Structure skills for efficient context usage:
110+
Brief overview (2-3 sentences).
102111

103-
| Layer | Token Budget | When Loaded |
104-
|-------|--------------|-------------|
105-
| Metadata | ~100 tokens | At startup (all skills) |
106-
| Instructions | < 5000 tokens | When skill activated |
107-
| References | As needed | On demand |
112+
## Instructions
108113

109-
### Guidelines
114+
### Step 1: [First Major Step]
115+
Clear explanation of what happens.
110116

111-
1. **Keep SKILL.md under 500 lines** - Move detailed content to references
112-
2. **Front-load key information** - Put most important patterns first
113-
3. **Use tables for quick reference** - Easy to scan
114-
4. **Link to references** - Don't inline everything
117+
### Step 2: [Next Step]
118+
Continue with specifics.
115119

116-
## Optional Directories
120+
## Examples
117121

118-
### scripts/
122+
### Example 1: [Common scenario]
123+
User says: "[trigger phrase]"
124+
Actions: 1. [step] 2. [step]
125+
Result: [What the user gets]
119126

120-
Executable code that agents can run:
127+
## Troubleshooting
121128

122-
```
123-
scripts/
124-
├── validate.sh # Validation script
125-
├── generate.py # Code generator
126-
└── setup.js # Setup helper
129+
### Error: [Common error message]
130+
**Cause:** [Why it happens]
131+
**Solution:** [How to fix]
127132
```
128133

129-
Scripts should:
130-
- Be self-contained or document dependencies
131-
- Include helpful error messages
132-
- Handle edge cases gracefully
133-
134-
### references/
135-
136-
Additional documentation loaded on demand:
134+
**Be specific and actionable:**
137135

136+
Good:
138137
```
139-
references/
140-
├── PATTERNS.md # Common patterns
141-
├── API.md # API reference
142-
└── EXAMPLES.md # Extended examples
138+
Run `python scripts/validate.py --input {filename}` to check data format.
139+
If validation fails, common issues include:
140+
- Missing required fields (add them to the CSV)
141+
- Invalid date formats (use YYYY-MM-DD)
143142
```
144143

145-
Keep individual reference files focused. Smaller files = less context usage.
146-
147-
### assets/
148-
149-
Static resources:
150-
144+
Bad:
151145
```
152-
assets/
153-
├── template.xml # File templates
154-
├── schema.json # Schemas
155-
└── diagram.png # Visual aids
146+
Validate the data before proceeding.
156147
```
157148

158-
## File References
149+
Note: "When to Use" sections in the body are **not** used for discovery. Put all discovery-relevant information in the description frontmatter.
159150

160-
Use relative paths from the skill root:
161-
162-
```markdown
163-
See [the reference guide](references/REFERENCE.md) for details.
164-
165-
Run the setup script:
166-
scripts/setup.sh
167-
```
168-
169-
Keep references one level deep. Avoid deeply nested chains.
170-
171-
## Skill Categories
172-
173-
### Developer Skills (`.claude/skills/`)
174-
175-
Skills for contributors working on this codebase:
176-
177-
- Command development patterns
178-
- Testing approaches
179-
- API client patterns
180-
- Documentation standards
181-
182-
### User-Facing Skills (`plugins/*/skills/`)
183-
184-
Skills for users of the tool:
185-
186-
- CLI command usage
187-
- Platform-specific patterns (B2C Commerce)
188-
- Integration guides
189-
190-
## Writing Effective Skills
191-
192-
### 1. Start with the User's Goal
193-
194-
```markdown
195-
## Overview
196-
197-
This skill helps you [accomplish X] by [doing Y].
198-
```
199-
200-
### 2. Provide Quick Reference Tables
201-
202-
```markdown
203-
| Command | Description |
204-
|---------|-------------|
205-
| `cmd1` | Does X |
206-
| `cmd2` | Does Y |
207-
```
151+
## Progressive Disclosure
208152

209-
### 3. Show Concrete Examples
153+
Skills use a three-level system to minimize token usage:
210154

211-
```markdown
212-
## Examples
155+
| Layer | Budget | When Loaded |
156+
|-------|--------|-------------|
157+
| YAML frontmatter | ~100 tokens | At startup (all skills) |
158+
| SKILL.md body | < 5000 tokens | When skill activated |
159+
| Linked files (references/) | As needed | On demand |
213160

214-
### Basic Usage
161+
### Guidelines
215162

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
219167

220-
### Advanced Usage
168+
## Optional Directories
221169

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.
226172

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.
228175

229-
```markdown
230-
## When NOT to Use
176+
### assets/
177+
Static resources: templates, fonts, icons used in output.
231178

232-
- Scenario A (use skill-x instead)
233-
- Scenario B (manual approach better)
234-
```
179+
## File References
235180

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).
237182

238-
Reference official documentation rather than duplicating it:
183+
## Skill Categories
239184

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).
242187

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).
245190

246191
## Validation Checklist
247192

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)
257234

258235
## Detailed Reference
259236

skills/b2c-cli/skills/b2c-scaffold/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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.
44
---
55

66
# B2C Scaffold Skill

0 commit comments

Comments
 (0)