unifai 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +106 -0
- package/dist/adapters/antigravity.d.ts +24 -0
- package/dist/adapters/antigravity.d.ts.map +1 -0
- package/dist/adapters/base.d.ts +60 -0
- package/dist/adapters/base.d.ts.map +1 -0
- package/dist/adapters/claude.d.ts +25 -0
- package/dist/adapters/claude.d.ts.map +1 -0
- package/dist/adapters/copilot.d.ts +25 -0
- package/dist/adapters/copilot.d.ts.map +1 -0
- package/dist/adapters/cursor.d.ts +30 -0
- package/dist/adapters/cursor.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +39 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/opencode.d.ts +25 -0
- package/dist/adapters/opencode.d.ts.map +1 -0
- package/dist/chunk-63EFN7CX.js +450 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14908 -0
- package/dist/cli.js.map +97 -0
- package/dist/commands/agent.d.ts +34 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/init.d.ts +16 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/install.d.ts +8 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/list.d.ts +8 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/mcp.d.ts +40 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/remove.d.ts +8 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/sync.d.ts +19 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/tui.d.ts +14 -0
- package/dist/commands/tui.d.ts.map +1 -0
- package/dist/data/prompts.d.ts +36 -0
- package/dist/data/prompts.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10648 -0
- package/dist/index.js.map +82 -0
- package/dist/openskill-ai.exe +0 -0
- package/dist/registry.d.ts +38 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/types/config.d.ts +103 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types.d.ts +23 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/agents.d.ts +15 -0
- package/dist/utils/agents.d.ts.map +1 -0
- package/dist/utils/fs-helpers.d.ts +29 -0
- package/dist/utils/fs-helpers.d.ts.map +1 -0
- package/dist/utils/git.d.ts +23 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/installer.d.ts +37 -0
- package/dist/utils/installer.d.ts.map +1 -0
- package/dist/utils/project-detector.d.ts +23 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/readme-generator.d.ts +9 -0
- package/dist/utils/readme-generator.d.ts.map +1 -0
- package/dist/utils/skills.d.ts +11 -0
- package/dist/utils/skills.d.ts.map +1 -0
- package/package.json +78 -0
- package/skills/skill-writer-skills/AGENTS.md +637 -0
- package/skills/skill-writer-skills/README.md +49 -0
- package/skills/skill-writer-skills/SKILL.md +97 -0
- package/skills/skill-writer-skills/metadata.json +17 -0
- package/skills/skill-writer-skills/references/common-pitfalls.md +291 -0
- package/skills/skill-writer-skills/references/core-principles.md +147 -0
- package/skills/skill-writer-skills/references/creation-process.md +250 -0
- package/skills/skill-writer-skills/references/design-patterns.md +300 -0
- package/skills/skill-writer-skills/references/skill-anatomy.md +174 -0
- package/skills/skill-writer-skills/references/validation-checklist.md +194 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-writer
|
|
3
|
+
description: Universal guide for creating well-structured Agent Skills for any technology or domain. Use when creating, writing, authoring, or designing a new Skill. Triggers on requests involving SKILL.md files, skill structure, frontmatter, bundled resources (scripts/references/assets), skill validation, skill packaging, or when user wants to convert workflows into reusable Skills.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill Writer
|
|
7
|
+
|
|
8
|
+
Create high-quality Agent Skills for any technology, language, or domain.
|
|
9
|
+
|
|
10
|
+
## What Skills Are
|
|
11
|
+
|
|
12
|
+
Skills are modular packages that extend AI capabilities by providing:
|
|
13
|
+
- **Specialized workflows** - Multi-step procedures for specific domains
|
|
14
|
+
- **Tool integrations** - Instructions for working with file formats or APIs
|
|
15
|
+
- **Domain expertise** - Schemas, business logic, conventions
|
|
16
|
+
- **Bundled resources** - Scripts, references, assets for complex tasks
|
|
17
|
+
|
|
18
|
+
Skills are **orchestrators**, not tools themselves. They guide AI on HOW to use tools.
|
|
19
|
+
|
|
20
|
+
## Core Principles
|
|
21
|
+
|
|
22
|
+
1. **Concise is Key** - Challenge each token; prefer examples over explanations
|
|
23
|
+
2. **Degrees of Freedom** - Match specificity to task fragility
|
|
24
|
+
3. **Progressive Disclosure** - Load details only when needed
|
|
25
|
+
|
|
26
|
+
See [references/core-principles.md](references/core-principles.md) for detailed guidance.
|
|
27
|
+
|
|
28
|
+
## Skill Anatomy
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
skill-name/
|
|
32
|
+
├── SKILL.md (REQUIRED)
|
|
33
|
+
│ ├── YAML frontmatter (name, description)
|
|
34
|
+
│ └── Markdown instructions
|
|
35
|
+
└── Bundled Resources (OPTIONAL)
|
|
36
|
+
├── scripts/ - Executable code (deterministic tasks)
|
|
37
|
+
├── references/ - Documentation (loaded as needed)
|
|
38
|
+
└── assets/ - Output files (not loaded into context)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
See [references/skill-anatomy.md](references/skill-anatomy.md) for when to use each resource type.
|
|
42
|
+
|
|
43
|
+
## 6-Step Creation Process
|
|
44
|
+
|
|
45
|
+
1. **Understand** - Gather concrete usage examples
|
|
46
|
+
2. **Plan** - Identify reusable resources (scripts/references/assets)
|
|
47
|
+
3. **Initialize** - Create directory structure
|
|
48
|
+
4. **Edit** - Implement resources + write SKILL.md
|
|
49
|
+
5. **Package** - Validate and create distributable
|
|
50
|
+
6. **Iterate** - Improve based on real usage
|
|
51
|
+
|
|
52
|
+
See [references/creation-process.md](references/creation-process.md) for step-by-step guidance.
|
|
53
|
+
|
|
54
|
+
## Writing SKILL.md
|
|
55
|
+
|
|
56
|
+
### Frontmatter (Critical)
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
---
|
|
60
|
+
name: lowercase-hyphenated-name
|
|
61
|
+
description: WHAT it does + WHEN to use it. Include trigger words and contexts.
|
|
62
|
+
---
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The description is the **primary triggering mechanism**. Include ALL trigger information here—the body only loads AFTER triggering.
|
|
66
|
+
|
|
67
|
+
### Body (Concise)
|
|
68
|
+
|
|
69
|
+
- Keep under 500 lines
|
|
70
|
+
- Use imperative form
|
|
71
|
+
- Reference bundled resources clearly
|
|
72
|
+
- For multi-step processes, give overview early
|
|
73
|
+
|
|
74
|
+
See [references/design-patterns.md](references/design-patterns.md) for workflow and output patterns.
|
|
75
|
+
|
|
76
|
+
## Common Pitfalls
|
|
77
|
+
|
|
78
|
+
| Pitfall | Solution |
|
|
79
|
+
|---------|----------|
|
|
80
|
+
| Verbose SKILL.md | Challenge each sentence—does AI need this? |
|
|
81
|
+
| "When to use" in body | Put ALL triggers in description field |
|
|
82
|
+
| Untested scripts | Always test before packaging |
|
|
83
|
+
| Unnecessary files | No README.md, CHANGELOG.md in skills |
|
|
84
|
+
| Duplicated info | Pick SKILL.md OR references, not both |
|
|
85
|
+
|
|
86
|
+
See [references/common-pitfalls.md](references/common-pitfalls.md) for complete list.
|
|
87
|
+
|
|
88
|
+
## Validation
|
|
89
|
+
|
|
90
|
+
Before packaging, verify:
|
|
91
|
+
- [ ] Frontmatter: name + description present
|
|
92
|
+
- [ ] Description: includes WHAT + WHEN
|
|
93
|
+
- [ ] SKILL.md: under 500 lines, only essentials
|
|
94
|
+
- [ ] Scripts: tested and working
|
|
95
|
+
- [ ] No duplication between SKILL.md and references
|
|
96
|
+
|
|
97
|
+
See [references/validation-checklist.md](references/validation-checklist.md) for full checklist.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"author": "Agent Skills Community",
|
|
4
|
+
"date": "January 2026",
|
|
5
|
+
"abstract": "Universal guide for AI agents to create high-quality, well-structured Skills for any technology, language, or domain. Based on Claude's official skill-writing principles: conciseness, appropriate degrees of freedom, and progressive disclosure. Covers the complete 6-step creation process from understanding use cases to packaging and iteration.",
|
|
6
|
+
"references": [
|
|
7
|
+
"https://claude.ai/docs/skills",
|
|
8
|
+
"https://github.com/vercel-labs/agent-skills",
|
|
9
|
+
"https://docs.anthropic.com"
|
|
10
|
+
],
|
|
11
|
+
"compatibility": [
|
|
12
|
+
"Claude Code",
|
|
13
|
+
"OpenCode",
|
|
14
|
+
"Cursor",
|
|
15
|
+
"Other MCP-compatible agents"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# Common Pitfalls and How to Avoid Them
|
|
2
|
+
|
|
3
|
+
Learn from common mistakes in skill creation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Pitfall 1: Verbose SKILL.md Files
|
|
8
|
+
|
|
9
|
+
### Problem
|
|
10
|
+
Including information Claude already knows, wasting context tokens.
|
|
11
|
+
|
|
12
|
+
### Bad Example
|
|
13
|
+
```markdown
|
|
14
|
+
## Introduction to Data Validation
|
|
15
|
+
|
|
16
|
+
Data validation is a crucial process in software development that ensures
|
|
17
|
+
the integrity and quality of data. When data enters a system, it must be
|
|
18
|
+
checked for correctness, completeness, and conformance to defined rules.
|
|
19
|
+
Without proper validation, applications may behave unexpectedly or produce
|
|
20
|
+
incorrect results. This skill helps with data validation tasks.
|
|
21
|
+
|
|
22
|
+
### What is JSON Schema?
|
|
23
|
+
|
|
24
|
+
JSON Schema is a vocabulary that allows you to annotate and validate JSON
|
|
25
|
+
documents. It provides a way to describe the structure of JSON data for
|
|
26
|
+
documentation, validation, and interaction control...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Good Example
|
|
30
|
+
```markdown
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
Validate JSON against schema:
|
|
34
|
+
```bash
|
|
35
|
+
python scripts/validate.py input.json --schema schema.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For custom validation rules, see [references/rules.md](references/rules.md).
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Solution
|
|
42
|
+
Challenge each sentence: "Does Claude really need this?" Claude already knows what JSON Schema is.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Pitfall 2: "When to Use" in Body
|
|
47
|
+
|
|
48
|
+
### Problem
|
|
49
|
+
Putting trigger information in the SKILL.md body, which only loads AFTER triggering.
|
|
50
|
+
|
|
51
|
+
### Bad Example
|
|
52
|
+
```yaml
|
|
53
|
+
---
|
|
54
|
+
name: report-generator
|
|
55
|
+
description: Generates reports
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
# Report Generator
|
|
59
|
+
|
|
60
|
+
## When to Use This Skill
|
|
61
|
+
|
|
62
|
+
Use this skill when:
|
|
63
|
+
- Creating quarterly reports
|
|
64
|
+
- Generating financial summaries
|
|
65
|
+
- Building dashboards
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Good Example
|
|
69
|
+
```yaml
|
|
70
|
+
---
|
|
71
|
+
name: report-generator
|
|
72
|
+
description: Generate professional reports including quarterly reports,
|
|
73
|
+
financial summaries, and dashboards. Use when creating any business report,
|
|
74
|
+
data visualization, or executive summary. Triggers on requests for Q1/Q2/Q3/Q4
|
|
75
|
+
reports, metrics dashboards, or financial documentation.
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
# Report Generator
|
|
79
|
+
|
|
80
|
+
## Quick Start
|
|
81
|
+
[Immediately useful content]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Solution
|
|
85
|
+
Put ALL trigger information in the description field. The body only loads after the skill is already triggered.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Pitfall 3: Untested Scripts
|
|
90
|
+
|
|
91
|
+
### Problem
|
|
92
|
+
Scripts fail when Claude tries to use them.
|
|
93
|
+
|
|
94
|
+
### Bad Example
|
|
95
|
+
Creating `scripts/process.py` without testing:
|
|
96
|
+
```python
|
|
97
|
+
def process(file):
|
|
98
|
+
# Untested code with potential bugs
|
|
99
|
+
data = load(file) # NameError: load is undefined
|
|
100
|
+
return transform(data)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Good Example
|
|
104
|
+
Test every script before including:
|
|
105
|
+
```bash
|
|
106
|
+
# Run the script with test data
|
|
107
|
+
python scripts/process.py test_input.json
|
|
108
|
+
|
|
109
|
+
# Verify output
|
|
110
|
+
cat output.json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Solution
|
|
114
|
+
- Always test scripts by actually running them
|
|
115
|
+
- Include error handling
|
|
116
|
+
- Test edge cases
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Pitfall 4: Unnecessary Documentation Files
|
|
121
|
+
|
|
122
|
+
### Problem
|
|
123
|
+
Including files that clutter the skill but don't help Claude.
|
|
124
|
+
|
|
125
|
+
### Bad Structure
|
|
126
|
+
```
|
|
127
|
+
my-skill/
|
|
128
|
+
├── SKILL.md
|
|
129
|
+
├── README.md ❌ Not needed
|
|
130
|
+
├── INSTALLATION.md ❌ Not needed
|
|
131
|
+
├── CHANGELOG.md ❌ Not needed
|
|
132
|
+
├── CONTRIBUTING.md ❌ Not needed
|
|
133
|
+
├── .gitignore ❌ Not needed
|
|
134
|
+
└── scripts/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Good Structure
|
|
138
|
+
```
|
|
139
|
+
my-skill/
|
|
140
|
+
├── SKILL.md
|
|
141
|
+
├── scripts/
|
|
142
|
+
│ └── process.py
|
|
143
|
+
└── references/
|
|
144
|
+
└── schema.md
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Solution
|
|
148
|
+
Only include files that Claude needs to do the job. No README, CHANGELOG, or other developer documentation.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Pitfall 5: Duplicated Information
|
|
153
|
+
|
|
154
|
+
### Problem
|
|
155
|
+
Same information in both SKILL.md and references, causing confusion.
|
|
156
|
+
|
|
157
|
+
### Bad Example
|
|
158
|
+
|
|
159
|
+
**In SKILL.md:**
|
|
160
|
+
```markdown
|
|
161
|
+
## API Endpoints
|
|
162
|
+
|
|
163
|
+
- GET /users - List all users
|
|
164
|
+
- POST /users - Create a user
|
|
165
|
+
- GET /users/{id} - Get specific user
|
|
166
|
+
...
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**In references/api.md:**
|
|
170
|
+
```markdown
|
|
171
|
+
## API Endpoints
|
|
172
|
+
|
|
173
|
+
- GET /users - List all users
|
|
174
|
+
- POST /users - Create a user
|
|
175
|
+
- GET /users/{id} - Get specific user
|
|
176
|
+
...
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Good Example
|
|
180
|
+
|
|
181
|
+
**In SKILL.md:**
|
|
182
|
+
```markdown
|
|
183
|
+
## API Reference
|
|
184
|
+
|
|
185
|
+
For complete endpoint documentation, see [references/api.md](references/api.md).
|
|
186
|
+
|
|
187
|
+
Quick examples:
|
|
188
|
+
- List users: `GET /users`
|
|
189
|
+
- Create user: `POST /users`
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**In references/api.md:**
|
|
193
|
+
```markdown
|
|
194
|
+
[Complete, detailed API documentation]
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Solution
|
|
198
|
+
Information lives in EITHER SKILL.md OR references, not both. Use SKILL.md for overview, references for details.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Pitfall 6: Over-Specifying When Flexibility is Better
|
|
203
|
+
|
|
204
|
+
### Problem
|
|
205
|
+
Giving rigid instructions when multiple approaches are valid.
|
|
206
|
+
|
|
207
|
+
### Bad Example
|
|
208
|
+
```markdown
|
|
209
|
+
## Writing Blog Posts
|
|
210
|
+
|
|
211
|
+
You MUST follow this EXACT process:
|
|
212
|
+
1. Write exactly 5 outline points
|
|
213
|
+
2. Each paragraph must be 100-150 words
|
|
214
|
+
3. Use exactly 3 subheadings
|
|
215
|
+
4. Include exactly 2 quotes
|
|
216
|
+
5. End with exactly 3 bullet points
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Good Example
|
|
220
|
+
```markdown
|
|
221
|
+
## Writing Blog Posts
|
|
222
|
+
|
|
223
|
+
Create engaging content following these guidelines:
|
|
224
|
+
- Start with a compelling hook
|
|
225
|
+
- Use subheadings to organize content
|
|
226
|
+
- Include relevant examples or quotes
|
|
227
|
+
- End with clear takeaways
|
|
228
|
+
|
|
229
|
+
Adjust structure based on topic and audience needs.
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Solution
|
|
233
|
+
Match specificity to task fragility. Creative tasks need high freedom; fragile operations need low freedom.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Pitfall 7: No Progressive Disclosure
|
|
238
|
+
|
|
239
|
+
### Problem
|
|
240
|
+
SKILL.md becomes too long, consuming too many tokens.
|
|
241
|
+
|
|
242
|
+
### Bad Example
|
|
243
|
+
```markdown
|
|
244
|
+
# PDF Processing
|
|
245
|
+
|
|
246
|
+
## Text Extraction
|
|
247
|
+
[500 lines of detailed documentation]
|
|
248
|
+
|
|
249
|
+
## Form Filling
|
|
250
|
+
[500 lines of detailed documentation]
|
|
251
|
+
|
|
252
|
+
## Table Extraction
|
|
253
|
+
[500 lines of detailed documentation]
|
|
254
|
+
|
|
255
|
+
## Merge and Split
|
|
256
|
+
[500 lines of detailed documentation]
|
|
257
|
+
|
|
258
|
+
Total: 2000+ lines loaded every time skill triggers
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Good Example
|
|
262
|
+
```markdown
|
|
263
|
+
# PDF Processing
|
|
264
|
+
|
|
265
|
+
## Quick Start
|
|
266
|
+
[50 lines covering basic usage]
|
|
267
|
+
|
|
268
|
+
## Features
|
|
269
|
+
- Text extraction: See [references/text.md](references/text.md)
|
|
270
|
+
- Form filling: See [references/forms.md](references/forms.md)
|
|
271
|
+
- Tables: See [references/tables.md](references/tables.md)
|
|
272
|
+
|
|
273
|
+
Total: ~100 lines in SKILL.md, details loaded only when needed
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Solution
|
|
277
|
+
Keep SKILL.md under 500 lines. Move variant-specific details into reference files.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Quick Reference: Pitfall Checklist
|
|
282
|
+
|
|
283
|
+
| Check | Question |
|
|
284
|
+
|-------|----------|
|
|
285
|
+
| ✓ | Is every sentence in SKILL.md necessary? |
|
|
286
|
+
| ✓ | Is ALL trigger info in the description field? |
|
|
287
|
+
| ✓ | Have all scripts been tested? |
|
|
288
|
+
| ✓ | Are there any unnecessary files (README, etc.)? |
|
|
289
|
+
| ✓ | Is information duplicated between files? |
|
|
290
|
+
| ✓ | Is the freedom level appropriate for each task? |
|
|
291
|
+
| ✓ | Is SKILL.md under 500 lines? |
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Core Principles for Skill Design
|
|
2
|
+
|
|
3
|
+
These three principles guide all skill creation decisions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Principle 1: Concise is Key
|
|
8
|
+
|
|
9
|
+
**The context window is a public good.** Skills share context with:
|
|
10
|
+
- System prompt
|
|
11
|
+
- Conversation history
|
|
12
|
+
- Other skills' metadata
|
|
13
|
+
- The actual user request
|
|
14
|
+
|
|
15
|
+
### Default Assumption
|
|
16
|
+
Claude is already very smart. Only add context Claude doesn't already have.
|
|
17
|
+
|
|
18
|
+
### Challenge Each Piece
|
|
19
|
+
Ask yourself:
|
|
20
|
+
- "Does Claude really need this explanation?"
|
|
21
|
+
- "Does this paragraph justify its token cost?"
|
|
22
|
+
- "Can I show this with an example instead of explaining it?"
|
|
23
|
+
|
|
24
|
+
### Prefer Examples Over Explanations
|
|
25
|
+
|
|
26
|
+
**Verbose (avoid):**
|
|
27
|
+
```markdown
|
|
28
|
+
When processing user data, you should validate each field
|
|
29
|
+
according to the schema. The validation process involves
|
|
30
|
+
checking that required fields are present, that data types
|
|
31
|
+
match the expected types, and that values fall within
|
|
32
|
+
acceptable ranges as defined in the schema documentation.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Concise (prefer):**
|
|
36
|
+
```markdown
|
|
37
|
+
Validate fields against schema:
|
|
38
|
+
- Required fields present
|
|
39
|
+
- Types match
|
|
40
|
+
- Values in range
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Principle 2: Degrees of Freedom
|
|
46
|
+
|
|
47
|
+
Match the level of specificity to the task's fragility and variability.
|
|
48
|
+
|
|
49
|
+
### High Freedom (text-based instructions)
|
|
50
|
+
|
|
51
|
+
**Use when:**
|
|
52
|
+
- Multiple approaches are valid
|
|
53
|
+
- Decisions depend on context
|
|
54
|
+
- Heuristics guide the approach
|
|
55
|
+
|
|
56
|
+
**Example:**
|
|
57
|
+
```markdown
|
|
58
|
+
Analyze the data and choose the most appropriate visualization
|
|
59
|
+
based on data type and user needs.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Medium Freedom (pseudocode or scripts with parameters)
|
|
63
|
+
|
|
64
|
+
**Use when:**
|
|
65
|
+
- A preferred pattern exists
|
|
66
|
+
- Some variation is acceptable
|
|
67
|
+
- Configuration affects behavior
|
|
68
|
+
|
|
69
|
+
**Example:**
|
|
70
|
+
```markdown
|
|
71
|
+
Generate report using:
|
|
72
|
+
1. Query data with provided filters
|
|
73
|
+
2. Apply template from references/templates.md
|
|
74
|
+
3. Format output as [PDF|HTML|Markdown] based on user preference
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Low Freedom (specific scripts, few parameters)
|
|
78
|
+
|
|
79
|
+
**Use when:**
|
|
80
|
+
- Operations are fragile and error-prone
|
|
81
|
+
- Consistency is critical
|
|
82
|
+
- A specific sequence must be followed
|
|
83
|
+
|
|
84
|
+
**Example:**
|
|
85
|
+
```markdown
|
|
86
|
+
Execute exactly:
|
|
87
|
+
1. Run `python scripts/validate.py input.json`
|
|
88
|
+
2. Run `python scripts/transform.py --config config.yaml`
|
|
89
|
+
3. Run `python scripts/output.py --format pdf`
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Mental Model
|
|
93
|
+
|
|
94
|
+
Think of Claude as exploring a path:
|
|
95
|
+
- **Narrow bridge with cliffs** → Specific guardrails (low freedom)
|
|
96
|
+
- **Open field** → Many valid routes (high freedom)
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Principle 3: Progressive Disclosure
|
|
101
|
+
|
|
102
|
+
Skills use a three-level loading system to manage context efficiently.
|
|
103
|
+
|
|
104
|
+
### Level 1: Metadata (Always in Context)
|
|
105
|
+
|
|
106
|
+
- **Content:** name + description (~100 words)
|
|
107
|
+
- **Loaded:** Always, for all skills
|
|
108
|
+
- **Purpose:** Determines when skill triggers
|
|
109
|
+
|
|
110
|
+
### Level 2: SKILL.md Body (When Triggered)
|
|
111
|
+
|
|
112
|
+
- **Content:** Instructions and guidance (<5k words, ideally <500 lines)
|
|
113
|
+
- **Loaded:** Only after skill triggers
|
|
114
|
+
- **Purpose:** Core workflow and navigation to resources
|
|
115
|
+
|
|
116
|
+
### Level 3: Bundled Resources (As Needed)
|
|
117
|
+
|
|
118
|
+
- **Content:** Scripts, references, assets (unlimited)
|
|
119
|
+
- **Loaded:** When Claude determines they're needed
|
|
120
|
+
- **Purpose:** Detailed information and executable code
|
|
121
|
+
|
|
122
|
+
### Practical Guidelines
|
|
123
|
+
|
|
124
|
+
| If SKILL.md is... | Action |
|
|
125
|
+
|-------------------|--------|
|
|
126
|
+
| Under 200 lines | Good, keep as is |
|
|
127
|
+
| 200-500 lines | Consider splitting some content to references |
|
|
128
|
+
| Over 500 lines | Must split into references |
|
|
129
|
+
|
|
130
|
+
### Example: Progressive Structure
|
|
131
|
+
|
|
132
|
+
**In SKILL.md (loaded when triggered):**
|
|
133
|
+
```markdown
|
|
134
|
+
## Quick Start
|
|
135
|
+
Extract text with pdfplumber:
|
|
136
|
+
[brief code example]
|
|
137
|
+
|
|
138
|
+
## Advanced Features
|
|
139
|
+
- Form filling: See [references/forms.md](references/forms.md)
|
|
140
|
+
- API reference: See [references/api.md](references/api.md)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**In references/forms.md (loaded only when needed):**
|
|
144
|
+
```markdown
|
|
145
|
+
# Complete Form Filling Guide
|
|
146
|
+
[Detailed multi-page documentation]
|
|
147
|
+
```
|