cc-dev-template 0.1.48 → 0.1.49
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/package.json +1 -1
- package/src/skills/creating-agent-skills/SKILL.md +7 -43
- package/src/skills/creating-agent-skills/references/create-step-1-understand.md +42 -0
- package/src/skills/creating-agent-skills/references/create-step-2-design.md +113 -0
- package/src/skills/creating-agent-skills/references/create-step-3-write.md +177 -0
- package/src/skills/creating-agent-skills/references/create-step-4-review.md +63 -0
- package/src/skills/creating-agent-skills/references/create-step-5-install.md +39 -0
- package/src/skills/creating-agent-skills/references/fix-step-1-diagnose.md +83 -0
- package/src/skills/creating-agent-skills/references/fix-step-2-apply.md +90 -0
- package/src/skills/creating-agent-skills/references/fix-step-3-validate.md +52 -0
- package/src/skills/creating-agent-skills/references/audit.md +0 -121
- package/src/skills/creating-agent-skills/references/create.md +0 -157
- package/src/skills/creating-agent-skills/references/modify.md +0 -131
- package/src/skills/creating-agent-skills/references/principles.md +0 -345
package/package.json
CHANGED
|
@@ -1,54 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: creating-agent-skills
|
|
3
|
-
description: Expert guidance for creating
|
|
3
|
+
description: Expert guidance for creating and fixing Claude Code skills. Use when the user asks to "create a skill", "build a new skill", "fix a skill", "audit skills", "review my skills", "update a skill", "modify a skill", "improve a skill", or mentions skill development, SKILL.md files, or progressive disclosure.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Creating Agent Skills
|
|
7
7
|
|
|
8
8
|
## What To Do Now
|
|
9
9
|
|
|
10
|
-
Ask
|
|
10
|
+
Ask the user what they need.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- **Create a new skill** - Build a skill through guided conversation
|
|
14
|
-
- **Audit existing skills** - Review skills for best practices compliance
|
|
15
|
-
- **Modify a skill** - Update or improve an existing skill
|
|
16
|
-
- **Something else** - Free-form request
|
|
17
|
-
|
|
18
|
-
## Route to Workflow
|
|
19
|
-
|
|
20
|
-
Based on choice, read the appropriate workflow:
|
|
21
|
-
|
|
22
|
-
| Choice | Action |
|
|
12
|
+
| Intent | Action |
|
|
23
13
|
|--------|--------|
|
|
24
|
-
| Create | Read `references/create.md` |
|
|
25
|
-
|
|
|
26
|
-
| Modify | Read `references/modify.md` |
|
|
27
|
-
| Something else | Help find the right approach |
|
|
28
|
-
|
|
29
|
-
## Essential Knowledge
|
|
30
|
-
|
|
31
|
-
**A skill IS a prompt.** When activated, Claude reads SKILL.md. It must contain instructions, not documentation about the skill.
|
|
32
|
-
|
|
33
|
-
**Progressive disclosure.** SKILL.md should be lean (<150 lines). Heavy content goes in references/. This keeps context efficient.
|
|
34
|
-
|
|
35
|
-
**The test:** After reading SKILL.md, would Claude know what to DO? If it only knows what the skill is about, it's written wrong.
|
|
36
|
-
|
|
37
|
-
For complete principles, workflows load `references/principles.md` as needed.
|
|
38
|
-
|
|
39
|
-
## Quick Reference
|
|
40
|
-
|
|
41
|
-
**Skill locations:**
|
|
42
|
-
|
|
43
|
-
| Level | Path |
|
|
44
|
-
|-------|------|
|
|
45
|
-
| User | `~/.claude/skills/` |
|
|
46
|
-
| Project | `.claude/skills/` |
|
|
47
|
-
|
|
48
|
-
**Bundled scripts:**
|
|
49
|
-
- `scripts/find-skills.js` - Discover all installed skills
|
|
50
|
-
- `scripts/validate-skill.js` - Validate a skill's structure
|
|
51
|
-
|
|
52
|
-
## Requirements
|
|
14
|
+
| Create a new skill | Read `references/create-step-1-understand.md` |
|
|
15
|
+
| Fix, improve, audit, or modify an existing skill | Read `references/fix-step-1-diagnose.md` |
|
|
53
16
|
|
|
54
|
-
|
|
17
|
+
If the user says "audit my skills", that is the fix path.
|
|
18
|
+
If they mention a specific skill that needs changes, that is also the fix path.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Step 1: Understand the Domain
|
|
2
|
+
|
|
3
|
+
The skill's quality depends entirely on understanding the domain. Start a conversation with the user.
|
|
4
|
+
|
|
5
|
+
## What To Uncover
|
|
6
|
+
|
|
7
|
+
- **The task** they want to standardize — what do they do repeatedly that they want encoded?
|
|
8
|
+
- **Domain knowledge** Claude does not naturally have — terminology, patterns, edge cases, gotchas
|
|
9
|
+
- **Why certain approaches work** — not just what the steps are, but the reasoning behind them
|
|
10
|
+
- **Concrete examples** of the task done well — ask for real examples or walk-throughs
|
|
11
|
+
- **Common mistakes** people make when doing this task
|
|
12
|
+
|
|
13
|
+
## How To Have This Conversation
|
|
14
|
+
|
|
15
|
+
If the user already provided comprehensive context (a detailed spec, all the steps, domain knowledge), verify your understanding and move on — do not re-ask what they already answered. If the context is thin or ambiguous, have a real conversation.
|
|
16
|
+
|
|
17
|
+
Ask one or two questions at a time. This should feel like a conversation, not a form.
|
|
18
|
+
|
|
19
|
+
Good questions:
|
|
20
|
+
- "Walk me through how you do this today."
|
|
21
|
+
- "What's the most important thing to get right?"
|
|
22
|
+
- "What mistakes do people commonly make?"
|
|
23
|
+
- "What would an expert know that a beginner wouldn't?"
|
|
24
|
+
- "Can you show me an example of this done well?"
|
|
25
|
+
|
|
26
|
+
Ask follow-up questions. Dig into the WHY behind their answers. If they say "always do X before Y", ask why that order matters.
|
|
27
|
+
|
|
28
|
+
## If the Task Is Non-Obvious
|
|
29
|
+
|
|
30
|
+
If this is a domain where Claude would not naturally know how to proceed — research it. Look at examples. Try to figure out how you would approach the task yourself. The skill author needs to understand the domain, not just record what the user says.
|
|
31
|
+
|
|
32
|
+
Use the Explore agent or web search if the domain requires knowledge you lack.
|
|
33
|
+
|
|
34
|
+
## When To Move On
|
|
35
|
+
|
|
36
|
+
Move on when all of these are true:
|
|
37
|
+
- You can articulate what makes this task hard or nuanced
|
|
38
|
+
- You have enough domain knowledge to write instructions a fresh Claude instance could follow
|
|
39
|
+
- You understand WHY the approaches work, not just WHAT they are
|
|
40
|
+
- The user confirms you understand their needs
|
|
41
|
+
|
|
42
|
+
Read `references/create-step-2-design.md`.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Step 2: Design the Skill
|
|
2
|
+
|
|
3
|
+
Based on what you learned in the conversation, design the skill's structure before writing anything.
|
|
4
|
+
|
|
5
|
+
## Determine the Name
|
|
6
|
+
|
|
7
|
+
- Hyphen-case: lowercase letters, numbers, and hyphens only
|
|
8
|
+
- Prefer gerund form: `processing-pdfs`, `creating-reports`, `reviewing-code`
|
|
9
|
+
- Must match the directory name
|
|
10
|
+
- Max 64 characters
|
|
11
|
+
|
|
12
|
+
## Determine the Skill Type
|
|
13
|
+
|
|
14
|
+
There are two types. Pick one:
|
|
15
|
+
|
|
16
|
+
**Informational** — A single SKILL.md file that captures knowledge, conventions, or best practices. No sequential workflow. The agent absorbs it and applies it to whatever it's doing. Example: a `prompting` skill that teaches how to write good prompts.
|
|
17
|
+
|
|
18
|
+
**Procedural** — A chain of step files for a sequential process. SKILL.md routes to step 1. Step 1 chains to step 2. Each step file covers ONE phase. The agent only sees the current step. Example: a skill that downloads a video, transcribes it, formats it, and summarizes it — four distinct phases, four files.
|
|
19
|
+
|
|
20
|
+
**How to decide:** If the skill describes a process with distinct sequential phases, it is procedural. If it captures principles or knowledge applied whenever relevant, it is informational.
|
|
21
|
+
|
|
22
|
+
## Design the Frontmatter
|
|
23
|
+
|
|
24
|
+
Every skill has YAML frontmatter. Required and optional fields:
|
|
25
|
+
|
|
26
|
+
### Required
|
|
27
|
+
|
|
28
|
+
| Field | Rules |
|
|
29
|
+
|-------|-------|
|
|
30
|
+
| `name` | Hyphen-case, matches directory name, max 64 chars |
|
|
31
|
+
| `description` | Third person, quoted trigger phrases, WHEN to use not HOW it works, max 1024 chars |
|
|
32
|
+
|
|
33
|
+
### Optional
|
|
34
|
+
|
|
35
|
+
| Field | Purpose |
|
|
36
|
+
|-------|---------|
|
|
37
|
+
| `argument-hint` | Placeholder shown after slash command (e.g., `[issue-number]`, `[filename]`) |
|
|
38
|
+
| `disable-model-invocation` | Set `true` to prevent Claude from auto-activating — use for side-effect workflows like deploy or commit |
|
|
39
|
+
| `user-invocable` | Set `false` to hide from the `/` menu — use for background knowledge skills |
|
|
40
|
+
| `allowed-tools` | Restrict which tools the skill can use (e.g., `Read, Grep, Glob` for read-only) |
|
|
41
|
+
| `model` | Override the model used when this skill is active |
|
|
42
|
+
| `context` | Set `fork` to run in an isolated sub-agent context |
|
|
43
|
+
| `agent` | Sub-agent type when `context: fork` is set (`Explore`, `Plan`, `general-purpose`, or custom) |
|
|
44
|
+
| `hooks` | Lifecycle hooks scoped to this skill |
|
|
45
|
+
|
|
46
|
+
### String Substitutions Available in Skill Content
|
|
47
|
+
|
|
48
|
+
| Syntax | What It Does |
|
|
49
|
+
|--------|--------------|
|
|
50
|
+
| `$ARGUMENTS` | Full argument string passed after `/skill-name` |
|
|
51
|
+
| `$ARGUMENTS[N]` or `$N` | Positional argument (0-based) |
|
|
52
|
+
| `${CLAUDE_SESSION_ID}` | Current session ID |
|
|
53
|
+
| `` !`command` `` | Output of a shell command, injected at activation time before Claude sees the content |
|
|
54
|
+
|
|
55
|
+
## Craft the Description
|
|
56
|
+
|
|
57
|
+
The description determines when Claude activates the skill. This is the most important piece of metadata.
|
|
58
|
+
|
|
59
|
+
Collect 5-10 trigger phrases from the user: "When you need this skill, what would you say to Claude?"
|
|
60
|
+
|
|
61
|
+
Combine into a description that:
|
|
62
|
+
- Uses third person: "This skill should be used when..."
|
|
63
|
+
- Includes the actual trigger phrases in quotes
|
|
64
|
+
- Focuses on WHEN to use, not HOW it works
|
|
65
|
+
- Stays under 1024 characters
|
|
66
|
+
|
|
67
|
+
**Key insight:** If the description explains too much about WHAT the skill does, Claude believes it already knows enough and will not activate. Keep it about WHEN.
|
|
68
|
+
|
|
69
|
+
**Context budget note:** Skill descriptions load at startup and share a character budget (default 15,000 chars across all skills). Keep descriptions tight — they cost tokens every session.
|
|
70
|
+
|
|
71
|
+
## Plan the File Layout
|
|
72
|
+
|
|
73
|
+
**For informational skills:**
|
|
74
|
+
```
|
|
75
|
+
skill-name/
|
|
76
|
+
└── SKILL.md
|
|
77
|
+
```
|
|
78
|
+
Optionally add `references/` for depth that is not always needed.
|
|
79
|
+
|
|
80
|
+
**For procedural skills:**
|
|
81
|
+
```
|
|
82
|
+
skill-name/
|
|
83
|
+
├── SKILL.md # Routes to step 1
|
|
84
|
+
└── references/
|
|
85
|
+
├── step-1-[name].md # Chains to step 2
|
|
86
|
+
├── step-2-[name].md # Chains to step 3
|
|
87
|
+
└── step-3-[name].md # Final step
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**When to add `scripts/`:** Deterministic operations that need reliability — validation, code generation, file operations.
|
|
91
|
+
|
|
92
|
+
**When to add `templates/`:** Boilerplate files that get copied or modified by the agent.
|
|
93
|
+
|
|
94
|
+
## For Procedural Skills: Plan the Steps
|
|
95
|
+
|
|
96
|
+
List out the steps. Each step becomes one markdown file in `references/`. For each step, determine:
|
|
97
|
+
- What the agent does during this step
|
|
98
|
+
- What signals the step is complete (the chain condition)
|
|
99
|
+
- What the next step is
|
|
100
|
+
|
|
101
|
+
## Confirm With the User
|
|
102
|
+
|
|
103
|
+
Present the design:
|
|
104
|
+
- Name
|
|
105
|
+
- Type (informational or procedural)
|
|
106
|
+
- Frontmatter configuration
|
|
107
|
+
- Description text
|
|
108
|
+
- File layout
|
|
109
|
+
- For procedural: the step breakdown
|
|
110
|
+
|
|
111
|
+
Ask: "Does this design look right?"
|
|
112
|
+
|
|
113
|
+
Read `references/create-step-3-write.md` when the design is confirmed.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Step 3: Write the Skill
|
|
2
|
+
|
|
3
|
+
Write the skill files based on the design from step 2. Everything in this file applies while writing.
|
|
4
|
+
|
|
5
|
+
## The Fundamental Rule
|
|
6
|
+
|
|
7
|
+
A skill IS a prompt. When Claude reads SKILL.md, it must know what to DO — not what the skill is about.
|
|
8
|
+
|
|
9
|
+
**The test:** After writing each file, ask: "If Claude reads this right now, does it know what action to take?" If it would understand what the skill is about but not know what to do — rewrite it.
|
|
10
|
+
|
|
11
|
+
## Writing Style
|
|
12
|
+
|
|
13
|
+
### Instructions, Not Documentation
|
|
14
|
+
|
|
15
|
+
Write as instructions. Imperative form.
|
|
16
|
+
|
|
17
|
+
| Wrong | Right |
|
|
18
|
+
|-------|-------|
|
|
19
|
+
| "This skill parses PDF files" | "Parse the PDF file" |
|
|
20
|
+
| "You should validate the input" | "Validate the input" |
|
|
21
|
+
| "The next step involves formatting" | "Format the output" |
|
|
22
|
+
|
|
23
|
+
Never describe what the skill IS. Tell Claude what to DO.
|
|
24
|
+
|
|
25
|
+
### No Meta-Descriptions
|
|
26
|
+
|
|
27
|
+
Remove any of these — they describe, they do not instruct:
|
|
28
|
+
|
|
29
|
+
- "Who this is for:" — Claude does not need audience info
|
|
30
|
+
- "Success looks like:" — describe outcomes through instructions, not meta-sections
|
|
31
|
+
- "The purpose is..." — documentation language
|
|
32
|
+
- "This skill orchestrates..." — describes what the skill IS
|
|
33
|
+
- "Overview" or "Introduction" sections — get to the action
|
|
34
|
+
|
|
35
|
+
### Positive Framing
|
|
36
|
+
|
|
37
|
+
Tell Claude what TO do, not what NOT to do. Negatives require extra processing and can prime the unwanted behavior.
|
|
38
|
+
|
|
39
|
+
| Negative | Positive |
|
|
40
|
+
|----------|----------|
|
|
41
|
+
| "Don't hallucinate facts" | "Only use information from the provided documents" |
|
|
42
|
+
| "Don't be too formal" | "Write in a conversational, friendly tone" |
|
|
43
|
+
| "Avoid long paragraphs" | "Keep paragraphs to 3-4 sentences" |
|
|
44
|
+
| "Don't skip validation" | "Always validate before proceeding" |
|
|
45
|
+
|
|
46
|
+
### Explain WHY, Not Just WHAT
|
|
47
|
+
|
|
48
|
+
Trust Claude's intelligence. Provide goals and constraints rather than exhaustive implementation details.
|
|
49
|
+
|
|
50
|
+
Provide:
|
|
51
|
+
- The goal or purpose of the task
|
|
52
|
+
- Why this matters (business context, use case)
|
|
53
|
+
- Constraints that exist (technical, business)
|
|
54
|
+
- What success looks like
|
|
55
|
+
|
|
56
|
+
Let Claude handle:
|
|
57
|
+
- Edge cases it can reason about
|
|
58
|
+
- Best practices for the domain
|
|
59
|
+
- Reasonable implementation choices
|
|
60
|
+
|
|
61
|
+
Only give step-by-step instructions when the task genuinely requires precision or the domain knowledge is non-obvious.
|
|
62
|
+
|
|
63
|
+
### Public Knowledge vs Tribal Knowledge
|
|
64
|
+
|
|
65
|
+
This is critical. If the agent writing this skill knows how to do something, the agent executing it will know too. Both are Claude.
|
|
66
|
+
|
|
67
|
+
**Public knowledge — state WHAT to do, not HOW:**
|
|
68
|
+
- Standard CLI tools (git, npm, yt-dlp, ffmpeg, curl): "Use yt-dlp to search YouTube" — not the full command with flags
|
|
69
|
+
- Common libraries and frameworks: "Parse the JSON response" — not the exact API call
|
|
70
|
+
- Standard programming patterns: "Validate the input" — not a code block showing validation
|
|
71
|
+
|
|
72
|
+
**Tribal knowledge — include the specifics:**
|
|
73
|
+
- Custom internal CLI tools the project built
|
|
74
|
+
- Project-specific conventions or configurations that are non-obvious
|
|
75
|
+
- Workarounds for known bugs or quirks in the codebase
|
|
76
|
+
- Domain-specific sequences that only an expert would know
|
|
77
|
+
- Exact file paths, schemas, or formats unique to this project
|
|
78
|
+
|
|
79
|
+
The test: if you removed the specific details, would a fresh Claude instance still know how to do it? If yes, remove the details. If no, keep them — that is the skill's value.
|
|
80
|
+
|
|
81
|
+
### Be Clear and Direct
|
|
82
|
+
|
|
83
|
+
No hedging. State exactly what to do.
|
|
84
|
+
|
|
85
|
+
| Vague | Clear |
|
|
86
|
+
|-------|-------|
|
|
87
|
+
| "Maybe consider adding..." | "Add..." |
|
|
88
|
+
| "It might be nice to have..." | "Include..." |
|
|
89
|
+
| "You could potentially..." | "Use..." |
|
|
90
|
+
|
|
91
|
+
### Challenge Every Line
|
|
92
|
+
|
|
93
|
+
The context window is a shared resource. For every piece of content, ask: does this justify its token cost?
|
|
94
|
+
|
|
95
|
+
- If Claude already knows it (common programming knowledge, obvious best practices) — remove it.
|
|
96
|
+
- If it is not needed for the current step — it belongs in a different step file or not at all.
|
|
97
|
+
- Three similar examples are better than ten. Pick the best ones.
|
|
98
|
+
|
|
99
|
+
## Structural Rules
|
|
100
|
+
|
|
101
|
+
### Size Targets
|
|
102
|
+
|
|
103
|
+
| Type | SKILL.md Target |
|
|
104
|
+
|------|-----------------|
|
|
105
|
+
| Router (procedural) | Under 150 lines |
|
|
106
|
+
| Informational | Under 300 lines |
|
|
107
|
+
|
|
108
|
+
If SKILL.md exceeds these, move content to `references/`.
|
|
109
|
+
|
|
110
|
+
### For Procedural Skills: Chained Steps
|
|
111
|
+
|
|
112
|
+
Each step file covers ONE phase of the workflow. Structure each file:
|
|
113
|
+
|
|
114
|
+
1. A clear header naming the step
|
|
115
|
+
2. Immediate actionable instructions — what to do NOW
|
|
116
|
+
3. A chain link at the bottom: "Read `references/[next-step].md`" with an optional condition
|
|
117
|
+
|
|
118
|
+
**Critical rules:**
|
|
119
|
+
- No table of contents across steps
|
|
120
|
+
- No "this is step 3 of 5"
|
|
121
|
+
- No overview of the full workflow
|
|
122
|
+
- Each file is self-contained for what the agent needs RIGHT NOW
|
|
123
|
+
- The agent discovers future steps only by reaching them
|
|
124
|
+
|
|
125
|
+
### For Informational Skills
|
|
126
|
+
|
|
127
|
+
Single SKILL.md file. Use sections and tables to organize knowledge. No chaining needed.
|
|
128
|
+
|
|
129
|
+
Optionally add `references/` for depth that is not always needed — the SKILL.md would say "for more detail on X, read `references/x-details.md`".
|
|
130
|
+
|
|
131
|
+
### SKILL.md Structure for Router Skills
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
---
|
|
135
|
+
name: skill-name
|
|
136
|
+
description: [third person, trigger phrases, WHEN not HOW]
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
# Skill Title
|
|
140
|
+
|
|
141
|
+
## What To Do Now
|
|
142
|
+
|
|
143
|
+
[Immediate action — ask a question, route to a workflow]
|
|
144
|
+
|
|
145
|
+
| Choice | Action |
|
|
146
|
+
|--------|--------|
|
|
147
|
+
| Option A | Read `references/step-1-a.md` |
|
|
148
|
+
| Option B | Read `references/step-1-b.md` |
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Keep it minimal. Only include context that is needed at EVERY activation.
|
|
152
|
+
|
|
153
|
+
### MCP Tool References
|
|
154
|
+
|
|
155
|
+
When a skill uses MCP tools, use fully qualified names:
|
|
156
|
+
```
|
|
157
|
+
Use the BigQuery:bigquery_schema tool to retrieve table schemas.
|
|
158
|
+
```
|
|
159
|
+
Without the server prefix, Claude may fail to locate the tool.
|
|
160
|
+
|
|
161
|
+
## Anti-Patterns
|
|
162
|
+
|
|
163
|
+
**Option menus instead of defaults:** Provide a recommended default, not a menu of choices. "Use pdfplumber for text extraction" not "You can use pypdf, pdfplumber, PyMuPDF, or pdf2image."
|
|
164
|
+
|
|
165
|
+
**Windows-style paths:** Always use forward slashes: `references/guide.md`, not `references\guide.md`.
|
|
166
|
+
|
|
167
|
+
**Deeply nested indirection:** Sequential chaining is fine (step 1 → step 2 → step 3) because each step is self-contained. What to avoid is layers of indirection where you must read through multiple files to reach the actual instructions: SKILL.md → overview.md → details.md → actual-info.md.
|
|
168
|
+
|
|
169
|
+
## Write the Files
|
|
170
|
+
|
|
171
|
+
With these principles applied, write all the skill files now:
|
|
172
|
+
|
|
173
|
+
1. SKILL.md (router or informational, depending on the design)
|
|
174
|
+
2. For procedural: each step file in `references/`
|
|
175
|
+
3. Any `scripts/` or `templates/` files if the design calls for them
|
|
176
|
+
|
|
177
|
+
Read `references/create-step-4-review.md` when all files are written.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Step 4: Review
|
|
2
|
+
|
|
3
|
+
Review every file you wrote before proceeding. Fix issues now — do not proceed with known problems.
|
|
4
|
+
|
|
5
|
+
## Public Knowledge Audit
|
|
6
|
+
|
|
7
|
+
Do this first. Go through every file in the skill and find each:
|
|
8
|
+
- Code block (``` fenced blocks)
|
|
9
|
+
- CLI command or flag sequence
|
|
10
|
+
- API call or library usage example
|
|
11
|
+
- Specific implementation detail
|
|
12
|
+
|
|
13
|
+
For EACH one, ask: **"Would a fresh Claude instance — with no access to the user's original request — know how to do this?"**
|
|
14
|
+
|
|
15
|
+
- If yes: **delete the code block or detail.** Replace with a high-level instruction. Example: replace `yt-dlp "ytsearch5:<query>" --print "%(title)s | %(channel)s | %(duration_string)s | %(webpage_url)s" --no-download` with "Use yt-dlp to search YouTube and display results."
|
|
16
|
+
- If no: **keep it.** This is tribal knowledge — project-specific commands, internal tools, non-obvious configurations. This is the skill's value.
|
|
17
|
+
|
|
18
|
+
The user's original request may have included specific commands and implementation details. That does not mean they belong in the skill. The user provided them for YOUR understanding. The skill is for a future Claude instance that already knows standard tools. Only encode what a fresh instance would NOT know.
|
|
19
|
+
|
|
20
|
+
## Self-Review Checklist
|
|
21
|
+
|
|
22
|
+
Go through each file and verify:
|
|
23
|
+
|
|
24
|
+
### Actionability
|
|
25
|
+
- After reading this file, would Claude know what action to take?
|
|
26
|
+
- Is every section written as instructions, not documentation?
|
|
27
|
+
- Are there any meta-descriptions? ("Who this is for", "Success looks like", "The purpose is...") Remove them.
|
|
28
|
+
|
|
29
|
+
### Progressive Disclosure
|
|
30
|
+
- For procedural skills: does each step file focus on ONE phase?
|
|
31
|
+
- Does each step chain correctly to the next?
|
|
32
|
+
- Is SKILL.md lean? Is heavy content in `references/`?
|
|
33
|
+
- For informational skills: is it a single cohesive file without unnecessary splitting?
|
|
34
|
+
|
|
35
|
+
### Writing Style
|
|
36
|
+
- Imperative form throughout? ("Parse" not "You should parse")
|
|
37
|
+
- Positive framing? ("Use X" not "Don't use Y")
|
|
38
|
+
- No hedging? ("Add" not "Maybe consider adding")
|
|
39
|
+
- Is every line worth its token cost? Remove what Claude already knows.
|
|
40
|
+
|
|
41
|
+
### Structure
|
|
42
|
+
- SKILL.md under size target? (150 lines for router, 300 for informational)
|
|
43
|
+
- Valid YAML frontmatter with `name` and `description`?
|
|
44
|
+
- Name matches the directory name?
|
|
45
|
+
- Description uses third person with quoted trigger phrases?
|
|
46
|
+
- All referenced files exist? (no broken links)
|
|
47
|
+
|
|
48
|
+
## Run Validation
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
node ~/.claude/skills/creating-agent-skills/scripts/validate-skill.js [skill-path]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Handle results:
|
|
55
|
+
- **Errors:** Fix each one, re-run validation, repeat until passing
|
|
56
|
+
- **Warnings:** Evaluate each — most should be fixed
|
|
57
|
+
- **Info:** Review but these may be acceptable (e.g., step files referenced from other steps rather than SKILL.md)
|
|
58
|
+
|
|
59
|
+
Only proceed when validation passes and self-review is clean.
|
|
60
|
+
|
|
61
|
+
If you found and fixed issues, re-run both the self-review and validation to confirm.
|
|
62
|
+
|
|
63
|
+
Read `references/create-step-5-install.md` when review passes with no remaining issues.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Step 5: Install and Test
|
|
2
|
+
|
|
3
|
+
## Choose Install Location
|
|
4
|
+
|
|
5
|
+
Ask the user where to install:
|
|
6
|
+
|
|
7
|
+
| Level | Path | When to Use |
|
|
8
|
+
|-------|------|-------------|
|
|
9
|
+
| User | `~/.claude/skills/[name]/` | Available across all projects |
|
|
10
|
+
| Project | `.claude/skills/[name]/` | This project only |
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
Copy the skill directory to the target location. Ensure all files are in place — SKILL.md, `references/`, `scripts/`, `templates/` as applicable.
|
|
15
|
+
|
|
16
|
+
## Test
|
|
17
|
+
|
|
18
|
+
Guide the user through testing:
|
|
19
|
+
|
|
20
|
+
1. Start a new Claude Code session (or restart the current one)
|
|
21
|
+
2. Test explicit invocation: type `/skill-name`
|
|
22
|
+
3. Test autonomous activation: say one of the trigger phrases from the description
|
|
23
|
+
4. Verify the skill activates and behaves as expected
|
|
24
|
+
|
|
25
|
+
## If Testing Reveals Issues
|
|
26
|
+
|
|
27
|
+
Iterate. The job is not done until the skill works.
|
|
28
|
+
|
|
29
|
+
- Instructions wrong? Go back to the write step.
|
|
30
|
+
- Structure wrong? Go back to the design step.
|
|
31
|
+
- Domain knowledge missing? Go back to the understand step.
|
|
32
|
+
|
|
33
|
+
## Completion
|
|
34
|
+
|
|
35
|
+
Summarize what was created:
|
|
36
|
+
- Skill name
|
|
37
|
+
- Install location
|
|
38
|
+
- Trigger phrases
|
|
39
|
+
- File structure (list all files)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Step 1: Diagnose
|
|
2
|
+
|
|
3
|
+
Find the skill, read everything, and understand what is wrong.
|
|
4
|
+
|
|
5
|
+
## Find the Skill
|
|
6
|
+
|
|
7
|
+
If the user named a specific skill, locate it. Otherwise, discover available skills:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
node ~/.claude/skills/creating-agent-skills/scripts/find-skills.js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Ask which skill to fix.
|
|
14
|
+
|
|
15
|
+
## Read Everything
|
|
16
|
+
|
|
17
|
+
Read the entire skill — every file:
|
|
18
|
+
- SKILL.md
|
|
19
|
+
- Every file in `references/`
|
|
20
|
+
- Every file in `scripts/`
|
|
21
|
+
- Every file in `templates/` or `assets/`
|
|
22
|
+
|
|
23
|
+
Trace the execution path: if SKILL.md says "read `references/step-1.md`", read that file and follow its chain.
|
|
24
|
+
|
|
25
|
+
Cannot diagnose a skill without reading all its files.
|
|
26
|
+
|
|
27
|
+
## Understand What Is Wrong
|
|
28
|
+
|
|
29
|
+
Ask the user:
|
|
30
|
+
- "What is the skill supposed to do?"
|
|
31
|
+
- "What does it actually do instead?"
|
|
32
|
+
- "Can you show me an example of it failing or behaving incorrectly?"
|
|
33
|
+
|
|
34
|
+
Get specific about expected behavior versus actual behavior.
|
|
35
|
+
|
|
36
|
+
## Diagnose Against Principles
|
|
37
|
+
|
|
38
|
+
Evaluate each file against these criteria:
|
|
39
|
+
|
|
40
|
+
### Actionability
|
|
41
|
+
- After reading this file, would Claude know what to DO?
|
|
42
|
+
- Or does it just describe what the skill is about?
|
|
43
|
+
- Any dead ends where Claude would not know what to do next?
|
|
44
|
+
|
|
45
|
+
### Progressive Disclosure
|
|
46
|
+
- Is SKILL.md lean (under 150 lines for routers, under 300 for informational)?
|
|
47
|
+
- Is heavy content in `references/`, not inline?
|
|
48
|
+
- For procedural skills: is each phase in its own step file, chained to the next?
|
|
49
|
+
- Or is everything crammed into one file?
|
|
50
|
+
|
|
51
|
+
### Routing and Chaining
|
|
52
|
+
- For multi-step skills: does each file hand off clearly to the next?
|
|
53
|
+
- Are there dead ends with no next action?
|
|
54
|
+
- Is the chain condition clear (when to move on)?
|
|
55
|
+
|
|
56
|
+
### Writing Style
|
|
57
|
+
- Second person language? ("You should..." — should be imperative: "Parse...")
|
|
58
|
+
- Negative framing? ("Don't skip..." — should be positive: "Always validate...")
|
|
59
|
+
- Meta-descriptions? ("Who this is for", "Success looks like", "The purpose is...")
|
|
60
|
+
- Hedging? ("Maybe consider..." — should be direct: "Add...")
|
|
61
|
+
- Public knowledge spelled out? (exact CLI flags, standard API calls that Claude already knows — should state WHAT to do, not HOW, unless it is tribal/project-specific knowledge)
|
|
62
|
+
|
|
63
|
+
### Description Quality
|
|
64
|
+
- Third person? ("This skill should be used when...")
|
|
65
|
+
- Quoted trigger phrases?
|
|
66
|
+
- Focuses on WHEN to use, not HOW it works?
|
|
67
|
+
- Under 1024 characters?
|
|
68
|
+
|
|
69
|
+
### Structural
|
|
70
|
+
- Valid YAML frontmatter with `name` and `description`?
|
|
71
|
+
- Name matches directory name?
|
|
72
|
+
- All referenced files exist?
|
|
73
|
+
- Any unreferenced files in `references/` that should be connected?
|
|
74
|
+
|
|
75
|
+
## Summarize Findings
|
|
76
|
+
|
|
77
|
+
Present the diagnosis to the user:
|
|
78
|
+
- List each issue found
|
|
79
|
+
- Which file it is in
|
|
80
|
+
- What principle it violates
|
|
81
|
+
- What the fix would look like
|
|
82
|
+
|
|
83
|
+
Read `references/fix-step-2-apply.md` when diagnosis is complete and findings are summarized.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Step 2: Apply Fixes
|
|
2
|
+
|
|
3
|
+
Fix the issues identified in diagnosis. Plan the changes, confirm with the user, then apply.
|
|
4
|
+
|
|
5
|
+
## Plan Changes First
|
|
6
|
+
|
|
7
|
+
Before editing, state:
|
|
8
|
+
- Which files will change and what specifically changes
|
|
9
|
+
- Any new files needed (e.g., splitting a monolithic file into step files)
|
|
10
|
+
- Any files to delete
|
|
11
|
+
|
|
12
|
+
Confirm the plan with the user before making changes.
|
|
13
|
+
|
|
14
|
+
## Writing Principles
|
|
15
|
+
|
|
16
|
+
Apply these while making every change:
|
|
17
|
+
|
|
18
|
+
### Instructions, Not Documentation
|
|
19
|
+
|
|
20
|
+
Write as instructions. Imperative form.
|
|
21
|
+
|
|
22
|
+
| Wrong | Right |
|
|
23
|
+
|-------|-------|
|
|
24
|
+
| "This skill parses PDF files" | "Parse the PDF file" |
|
|
25
|
+
| "You should validate the input" | "Validate the input" |
|
|
26
|
+
| "The next step involves formatting" | "Format the output" |
|
|
27
|
+
|
|
28
|
+
### No Meta-Descriptions
|
|
29
|
+
|
|
30
|
+
Remove any of these:
|
|
31
|
+
- "Who this is for:" — Claude does not need audience info
|
|
32
|
+
- "Success looks like:" — describe outcomes through instructions
|
|
33
|
+
- "The purpose is..." — documentation language
|
|
34
|
+
- "This skill orchestrates..." — describes what the skill IS
|
|
35
|
+
- "Overview" or "Introduction" sections — get to the action
|
|
36
|
+
|
|
37
|
+
### Positive Framing
|
|
38
|
+
|
|
39
|
+
| Negative | Positive |
|
|
40
|
+
|----------|----------|
|
|
41
|
+
| "Don't hallucinate facts" | "Only use information from the provided documents" |
|
|
42
|
+
| "Don't skip validation" | "Always validate before proceeding" |
|
|
43
|
+
| "Avoid long paragraphs" | "Keep paragraphs to 3-4 sentences" |
|
|
44
|
+
|
|
45
|
+
### Explain WHY, Not Just WHAT
|
|
46
|
+
|
|
47
|
+
Provide goals and constraints. Trust Claude's intelligence. Only give step-by-step when the domain genuinely requires precision.
|
|
48
|
+
|
|
49
|
+
### Public Knowledge vs Tribal Knowledge
|
|
50
|
+
|
|
51
|
+
If the agent writing this skill knows how to do something, the agent executing it will know too. Both are Claude.
|
|
52
|
+
|
|
53
|
+
- **Public knowledge** (standard CLI tools, common libraries, standard patterns): state WHAT to do, not HOW. "Use yt-dlp to search YouTube" — not the full command with flags.
|
|
54
|
+
- **Tribal knowledge** (custom internal tools, project-specific conventions, workarounds, non-obvious domain sequences): include the specifics. That is the skill's value.
|
|
55
|
+
|
|
56
|
+
The test: if you removed the specific details, would a fresh Claude instance still know how to do it? If yes, remove them.
|
|
57
|
+
|
|
58
|
+
### Be Clear and Direct
|
|
59
|
+
|
|
60
|
+
No hedging. "Add..." not "Maybe consider adding..."
|
|
61
|
+
|
|
62
|
+
### Challenge Every Line
|
|
63
|
+
|
|
64
|
+
Does this justify its token cost? If Claude already knows it — remove it. If it is not needed for the current step — move or remove it.
|
|
65
|
+
|
|
66
|
+
**The test:** After rewriting each file, ask: "If Claude reads this right now, does it know what action to take?"
|
|
67
|
+
|
|
68
|
+
## Common Fix Patterns
|
|
69
|
+
|
|
70
|
+
**Documentation to instructions:** Rewrite "This skill does X" as "Do X".
|
|
71
|
+
|
|
72
|
+
**Add trigger phrases:** Collect phrases from user, add to description in third person with quotes.
|
|
73
|
+
|
|
74
|
+
**Move content to references:** Identify inline content that should be loaded on-demand. Create reference files, add pointers.
|
|
75
|
+
|
|
76
|
+
**Fix second person:** "You should parse" becomes "Parse". "You can use" becomes "Use".
|
|
77
|
+
|
|
78
|
+
**Fix negative framing:** "Don't skip validation" becomes "Always validate". "Never assume" becomes "Verify explicitly".
|
|
79
|
+
|
|
80
|
+
**Fix progressive disclosure:** Split a monolithic SKILL.md into a lean router + step files in `references/`. Each step file covers one phase and chains to the next.
|
|
81
|
+
|
|
82
|
+
**Fix dead ends:** Ensure every file either chains to the next step or completes the flow with a clear ending.
|
|
83
|
+
|
|
84
|
+
**Fix description:** Rewrite to third person, add quoted trigger phrases, focus on WHEN not HOW.
|
|
85
|
+
|
|
86
|
+
## Apply the Changes
|
|
87
|
+
|
|
88
|
+
Make all planned modifications now.
|
|
89
|
+
|
|
90
|
+
Read `references/fix-step-3-validate.md` when all fixes are applied.
|