cc-dev-template 0.1.5 → 0.1.6

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.
@@ -0,0 +1,370 @@
1
+ # Create a New Skill
2
+
3
+ This workflow guides the creation of a new Claude Code skill through interactive conversation. The goal is to extract domain knowledge from the user and produce a properly structured skill that works correctly on first use.
4
+
5
+ ## Purpose
6
+
7
+ Transform the user's domain expertise into a reusable skill that:
8
+ - Activates when relevant (good description with trigger phrases)
9
+ - Uses progressive disclosure (lean SKILL.md, heavy content in references/)
10
+ - Follows writing conventions (imperative form, positive framing)
11
+ - Includes appropriate tooling (scripts for deterministic operations)
12
+
13
+ **Success looks like:** The user can restart Claude Code, ask for help with the task the skill covers, and Claude performs exactly as discussed.
14
+
15
+ ## Before Starting
16
+
17
+ Read `references/principles.md` to understand skill fundamentals. This workflow assumes familiarity with:
18
+ - Three-level progressive disclosure
19
+ - Frontmatter requirements
20
+ - Writing style (imperative form)
21
+ - Structure patterns
22
+
23
+ ## Workflow
24
+
25
+ <steps>
26
+
27
+ <step name="Understand the Domain">
28
+ Start an open conversation to understand what the user wants the skill to do.
29
+
30
+ **Ask about:**
31
+ - What task or workflow should this skill handle?
32
+ - What does the user do repeatedly that they want to standardize?
33
+ - What domain knowledge is required that Claude doesn't naturally have?
34
+ - Are there specific tools, APIs, or file formats involved?
35
+ - What does success look like when this task is done well?
36
+
37
+ **Listen for:**
38
+ - Concrete examples of the task being performed
39
+ - Edge cases and gotchas the user has learned
40
+ - Terminology and concepts specific to this domain
41
+ - Patterns that work well vs. patterns to avoid
42
+
43
+ **Take time here.** The quality of the skill depends on extracting comprehensive domain knowledge. Ask follow-up questions. Request examples. Understand WHY certain approaches work better than others.
44
+
45
+ This is a conversation, not an interrogation. Let the user explain naturally and guide them to cover important aspects.
46
+ </step>
47
+
48
+ <step name="Identify Skill Scope">
49
+ Based on the conversation, determine the skill's scope.
50
+
51
+ **Determine:**
52
+ 1. **Name**: What should the skill be called? (hyphen-case, descriptive)
53
+ 2. **Single vs. Multi-workflow**: Is this one task or multiple related tasks?
54
+ 3. **Complexity**: Simple (one file) vs. Standard (with references) vs. Complete (with scripts)?
55
+
56
+ **Ask the user:**
57
+ - "Based on what you've described, I'm thinking this skill should be called `[name]` and handle [scope]. Does that capture what you need?"
58
+ - "Should this be a focused skill for just [X], or should it also handle [Y] and [Z]?"
59
+
60
+ **Scope guidance:**
61
+ - **Focused is better**: One skill = one capability
62
+ - **Split if needed**: "document-processing" should become "pdf-editor" + "xlsx-analyzer"
63
+ - **Group if cohesive**: Related tasks that share context can be one skill with routing
64
+ </step>
65
+
66
+ <step name="Design the Structure">
67
+ Plan the skill's file structure before writing anything.
68
+
69
+ **Determine what's needed:**
70
+
71
+ | Need | Solution |
72
+ |------|----------|
73
+ | Simple knowledge, single workflow | Minimal: just SKILL.md |
74
+ | Detailed procedures or multiple phases | references/ directory |
75
+ | Repeated code or validation | scripts/ directory |
76
+ | Templates or boilerplate | assets/ directory |
77
+
78
+ **For multi-workflow skills:**
79
+ Plan the routing in SKILL.md and what each reference file covers:
80
+
81
+ ```
82
+ skill-name/
83
+ ├── SKILL.md (router: ask user intent, route to workflow)
84
+ └── references/
85
+ ├── workflow-a.md
86
+ ├── workflow-b.md
87
+ └── shared-knowledge.md (if workflows share context)
88
+ ```
89
+
90
+ **For skills needing scripts:**
91
+ Identify deterministic operations that should be code:
92
+
93
+ ```
94
+ skill-name/
95
+ ├── SKILL.md
96
+ ├── references/
97
+ │ └── ...
98
+ └── scripts/
99
+ ├── validate.py # Validation that needs reliability
100
+ └── generate.sh # Code generation
101
+ ```
102
+
103
+ **Present the plan to the user:**
104
+ "Here's the structure I'm proposing: [describe]. Does this cover everything?"
105
+ </step>
106
+
107
+ <step name="Craft the Description">
108
+ Write the frontmatter description. This is critical for activation.
109
+
110
+ **Formula:**
111
+ ```
112
+ [What the skill does] + [When to use it with specific trigger phrases]
113
+ ```
114
+
115
+ **Process:**
116
+ 1. List 5-10 phrases a user might say when they need this skill
117
+ 2. Identify the core capability in one sentence
118
+ 3. Combine into third-person description under 1024 characters
119
+
120
+ **Example construction:**
121
+
122
+ User phrases:
123
+ - "create a new component"
124
+ - "build me a React component"
125
+ - "make a form component"
126
+ - "scaffold a page"
127
+ - "generate component boilerplate"
128
+
129
+ Core capability: "Creates React components following team conventions"
130
+
131
+ Final description:
132
+ ```yaml
133
+ description: This skill should be used when the user asks to "create a component", "build a React component", "scaffold a page", "generate component boilerplate", or mentions creating new UI elements. Creates React components following team conventions with proper TypeScript types, styling patterns, and test files.
134
+ ```
135
+
136
+ **Ask the user to validate:**
137
+ "When you need this skill, what would you say to Claude? Let me make sure those phrases are in the description."
138
+ </step>
139
+
140
+ <step name="Write the Content">
141
+ Generate the skill files following all conventions.
142
+
143
+ **Writing rules (from principles.md):**
144
+
145
+ 1. **Imperative form**: "Parse the file", not "You should parse"
146
+ 2. **Positive framing**: "Use X approach", not "Don't use Y approach"
147
+ 3. **Objective tone**: Facts and directives, not suggestions
148
+ 4. **Size limits**: SKILL.md under 2,000 words; move detail to references/
149
+
150
+ **Prompting principles (mandatory for quality skills):**
151
+
152
+ 1. **Explain WHY, not just WHAT**: Provide purpose and context. Trust Claude's intelligence.
153
+ 2. **Define success**: What does good output look like? Include concrete criteria.
154
+ 3. **Be clear and direct**: No hedging ("maybe consider..."). State what is needed.
155
+ 4. **Provide context**: Who is this for? Why does it matter? What constraints exist?
156
+ 5. **Avoid micromanagement**: Goals over step-by-step instructions unless complexity requires it.
157
+
158
+ See `references/principles.md` → "Prompting Principles for Skill Content" for complete guidance.
159
+
160
+ **SKILL.md structure for simple skills:**
161
+ ```markdown
162
+ ---
163
+ name: skill-name
164
+ description: [crafted description]
165
+ ---
166
+
167
+ # Skill Title
168
+
169
+ [Brief purpose - 1-2 sentences]
170
+
171
+ ## What To Do
172
+
173
+ [Core instructions in imperative form]
174
+
175
+ ## Key Principles
176
+
177
+ [Domain knowledge the user shared]
178
+
179
+ ## Examples
180
+
181
+ [Concrete examples from the conversation]
182
+ ```
183
+
184
+ **SKILL.md structure for routing skills:**
185
+ ```markdown
186
+ ---
187
+ name: skill-name
188
+ description: [crafted description]
189
+ ---
190
+
191
+ # Skill Title
192
+
193
+ [Brief purpose]
194
+
195
+ ## What To Do Now
196
+
197
+ <step name="Understand Intent">
198
+ Ask what the user wants to accomplish.
199
+ [Options based on workflows]
200
+ </step>
201
+
202
+ <step name="Route to Workflow">
203
+ | Choice | Action |
204
+ |--------|--------|
205
+ | Option A | Read `references/workflow-a.md` |
206
+ | Option B | Read `references/workflow-b.md` |
207
+ </step>
208
+
209
+ ## Quick Reference
210
+
211
+ [Shared knowledge that applies to all workflows]
212
+ ```
213
+
214
+ **Reference file structure:**
215
+ ```markdown
216
+ # Workflow Name
217
+
218
+ ## Purpose
219
+
220
+ [What this workflow accomplishes]
221
+
222
+ ## Steps
223
+
224
+ <steps>
225
+ <step name="Step 1">
226
+ [Instructions]
227
+ </step>
228
+
229
+ <step name="Step 2">
230
+ [Instructions]
231
+ </step>
232
+ </steps>
233
+
234
+ ## Key Principles
235
+
236
+ [Domain knowledge specific to this workflow]
237
+ ```
238
+
239
+ **Script considerations:**
240
+ - Use `process.cwd()` for project paths, not `__dirname`
241
+ - Include clear usage comments
242
+ - Handle errors gracefully
243
+ - Make scripts executable (`chmod +x`)
244
+ </step>
245
+
246
+ <step name="Determine Install Location">
247
+ Ask where the skill should be installed.
248
+
249
+ **Options:**
250
+
251
+ | Location | Path | Use When |
252
+ |----------|------|----------|
253
+ | User level | `~/.claude/skills/[name]/` | Personal skill, available everywhere |
254
+ | Project level | `.claude/skills/[name]/` | Team skill, shared via git |
255
+
256
+ **Ask the user:**
257
+ "Should this skill be available in all your projects (user level) or just this project/team (project level)?"
258
+
259
+ For this dev-template framework, skills typically go to `src/skills/` first, then get installed to user level via the install script.
260
+ </step>
261
+
262
+ <step name="Create the Files">
263
+ Write all skill files to the appropriate location.
264
+
265
+ **Order:**
266
+ 1. Create directory structure
267
+ 2. Write SKILL.md
268
+ 3. Write reference files (if any)
269
+ 4. Write scripts (if any)
270
+ 5. Copy assets (if any)
271
+
272
+ **After writing, display:**
273
+ - Full path to each created file
274
+ - Word count for SKILL.md
275
+ - Summary of what was created
276
+ </step>
277
+
278
+ <step name="Validate">
279
+ Run validation checks on the created skill.
280
+
281
+ **Check:**
282
+ - [ ] SKILL.md has valid YAML frontmatter
283
+ - [ ] `name` matches directory name
284
+ - [ ] `description` under 1024 characters
285
+ - [ ] `description` uses third person and has trigger phrases
286
+ - [ ] Body uses imperative form (scan for "you should", "you can")
287
+ - [ ] Body under 2,000 words
288
+ - [ ] All referenced files exist
289
+ - [ ] Scripts are executable (if any)
290
+
291
+ If validation finds issues, fix them immediately.
292
+
293
+ **Run the validation script:**
294
+ ```bash
295
+ node ~/.claude/skills/create-agent-skills/scripts/validate-skill.js [skill-path]
296
+ ```
297
+ </step>
298
+
299
+ <step name="Test Activation">
300
+ Guide the user to test the skill.
301
+
302
+ **Instructions for user:**
303
+ 1. Restart Claude Code (required to pick up new skills)
304
+ 2. Start a new conversation
305
+ 3. Say one of the trigger phrases from the description
306
+ 4. Verify the skill activates and behaves correctly
307
+
308
+ **If skill doesn't activate:**
309
+ - Check description has specific trigger phrases
310
+ - Verify skill is in correct location
311
+ - Try explicit invocation first to verify content works
312
+
313
+ **If skill activates but behaves incorrectly:**
314
+ - Review the instructions—are they clear enough?
315
+ - Check for second-person language that might confuse
316
+ - Verify examples match expected behavior
317
+ </step>
318
+
319
+ </steps>
320
+
321
+ ## Conversation Guidance
322
+
323
+ ### Good Questions to Ask
324
+
325
+ **Understanding the task:**
326
+ - "Walk me through how you do this task today, step by step."
327
+ - "What's the most important thing to get right?"
328
+ - "What mistakes do people commonly make?"
329
+
330
+ **Extracting domain knowledge:**
331
+ - "Is there terminology I should know for this domain?"
332
+ - "Are there patterns that always work well?"
333
+ - "What would a senior person know that a junior wouldn't?"
334
+
335
+ **Clarifying scope:**
336
+ - "Should this skill handle [edge case] or is that out of scope?"
337
+ - "Are there related tasks this should also cover?"
338
+ - "What's the minimal version of this skill that would be useful?"
339
+
340
+ **Validating understanding:**
341
+ - "Let me summarize what I've learned: [summary]. What am I missing?"
342
+ - "Here's a draft of the key instructions. Does this capture your approach?"
343
+
344
+ ### Signs the Conversation Needs More Depth
345
+
346
+ - User gives short, general answers
347
+ - No concrete examples have been shared
348
+ - Edge cases haven't been discussed
349
+ - User says "it depends" without explaining on what
350
+ - The domain has jargon that hasn't been defined
351
+
352
+ **Response:** Ask for specific examples, walk through scenarios, request clarification on terminology.
353
+
354
+ ### Signs Ready to Start Writing
355
+
356
+ - Clear understanding of the core task
357
+ - Multiple concrete examples discussed
358
+ - Edge cases and gotchas identified
359
+ - User has validated your understanding
360
+ - Structure decision made (simple vs. complex)
361
+
362
+ ## Output Quality Standards
363
+
364
+ The created skill must:
365
+
366
+ 1. **Activate reliably** - Description has specific trigger phrases
367
+ 2. **Instruct clearly** - Imperative form, no ambiguity
368
+ 3. **Use context efficiently** - Progressive disclosure, lean SKILL.md
369
+ 4. **Capture domain knowledge** - The user's expertise is preserved
370
+ 5. **Work on first use** - User can restart and immediately use it