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.
@@ -1,345 +0,0 @@
1
- # Skill Development Principles
2
-
3
- ## Contents
4
-
5
- - [The Fundamental Truth](#the-fundamental-truth)
6
- - [Documentation vs Instructions](#the-most-common-mistake-documentation-vs-instructions)
7
- - [Progressive Disclosure](#progressive-disclosure)
8
- - [Frontmatter Requirements](#frontmatter-requirements)
9
- - [Skill Structure](#skill-structure)
10
- - [Size Guidelines](#size-guidelines)
11
- - [Activation Patterns](#activation-patterns)
12
- - [Iterative Development](#iterative-development)
13
- - [Anti-patterns](#anti-patterns)
14
- - [MCP Tool References](#mcp-tool-references)
15
- - [Common Mistakes](#common-mistakes)
16
- - [Validation](#validation)
17
-
18
- ---
19
-
20
- ## The Fundamental Truth
21
-
22
- **A skill is just a prompt with progressive disclosure.**
23
-
24
- | Misconception | Reality |
25
- |---------------|---------|
26
- | Skills are a special runtime | Skills are markdown files |
27
- | Skills have special syntax | Skills use natural language |
28
- | Skills execute code | Skills prompt Claude to do things |
29
- | Skills have state | Skills tell Claude to read/write files for state |
30
- | SKILL.md is documentation | SKILL.md IS the prompt Claude reads |
31
-
32
- When a skill "activates," Claude simply reads the SKILL.md file. The file contains natural language instructions telling Claude what to do.
33
-
34
- ## The Most Common Mistake: Documentation vs Instructions
35
-
36
- **This is the #1 reason skills fail.** People write SKILL.md as if it's a README explaining what the skill does. But SKILL.md IS the prompt—it must tell Claude what to DO.
37
-
38
- ### Documentation (WRONG)
39
-
40
- ```markdown
41
- ## Purpose
42
-
43
- This skill orchestrates the complete migration of Oracle Forms to React/Go.
44
-
45
- **Who this is for**: Developers migrating Oracle Forms.
46
-
47
- **Success looks like**: Running /implement-form progresses through all phases.
48
-
49
- ## How It Works
50
-
51
- The skill has 12 phases. Phase 1 does scaffolding, Phase 2 does discovery...
52
- ```
53
-
54
- **Why this fails:** Claude reads this and thinks "interesting information, but what should I DO right now?" There are no actionable instructions.
55
-
56
- ### Instructions (CORRECT)
57
-
58
- ```markdown
59
- ## What To Do Now
60
-
61
- Ask which form to implement. Store the form name.
62
-
63
- Then check workflow state:
64
- Look for `.claude/workflows/{formname}/workflow.yaml`
65
-
66
- If exists: Read it, determine current phase.
67
- If not: Create new workflow, start at phase 1.
68
-
69
- Based on `currentPhase`, read the appropriate file:
70
-
71
- | Phase | File |
72
- |-------|------|
73
- | phase1 | `references/phase1.md` |
74
- | phase2 | `references/phase2.md` |
75
- ```
76
-
77
- **Why this works:** Claude knows exactly what to do. Each step is an action. Heavy content (schemas, phase details) lives in references/.
78
-
79
- ### Red Flags in SKILL.md
80
-
81
- | Red Flag | Problem |
82
- |----------|---------|
83
- | "Who this is for:" | Meta-description. Claude doesn't need audience info. |
84
- | "Success looks like:" | Describes outcomes, doesn't instruct. |
85
- | "This skill orchestrates..." | Describes what skill IS, not what to DO. |
86
- | "The purpose is..." | Documentation language. |
87
- | Large inline schemas | Reference material, not instructions. |
88
- | Phase explanations | Should route to phase files, not explain inline. |
89
-
90
- ### The Test
91
-
92
- After writing SKILL.md, ask: **"If Claude reads this right now, does it know what action to take?"**
93
-
94
- If the answer is "it would understand what the skill is about" but not "it would know what to do," rewrite it.
95
-
96
- ### Agent Prompts Are Different
97
-
98
- The red flags above apply to SKILL.md files, not agent prompts. Agent prompts and skills have different characteristics:
99
-
100
- | Aspect | Agent Prompt | SKILL.md |
101
- |--------|--------------|----------|
102
- | When read | Once per spawn | Repeatedly during session |
103
- | Purpose | Provide context for focused task | Route to workflows |
104
- | WHY/WHO/SUCCESS | Appropriate—crucial context | Red flag—wastes tokens |
105
- | Lifespan | Single invocation | Entire user session |
106
-
107
- Agent prompts benefit from a Purpose section with WHY/WHO/SUCCESS because:
108
- - Agents spawn for a single focused task and need full context upfront
109
- - The context is read once, not repeatedly
110
- - Understanding purpose helps agents make better decisions
111
-
112
- Skills should route to actions immediately because:
113
- - Users interact with skills throughout a session
114
- - Meta-descriptions consume tokens on every activation
115
- - Instructions are more valuable than context in repeated interactions
116
-
117
- ## Progressive Disclosure
118
-
119
- ### The Problem Without It
120
-
121
- To handle a complex workflow, all instructions must be in one giant prompt (3,000+ lines). Problems:
122
- - Massive context consumption upfront
123
- - Claude may get confused by irrelevant instructions
124
- - Hard to maintain and update
125
- - Scales poorly
126
-
127
- ### The Solution: Three-Level Loading
128
-
129
- | Level | What Loads | When | Size Target |
130
- |-------|------------|------|-------------|
131
- | **1. Metadata** | `name` + `description` | Always (at startup) | ~100 words |
132
- | **2. SKILL.md body** | Full instructions | When skill triggers | <150 lines |
133
- | **3. Bundled resources** | references/, scripts/ | Only when Claude needs them | Unlimited |
134
-
135
- ### In Practice
136
-
137
- ```
138
- SKILL.md (small router):
139
- "Ask what user wants.
140
- If planning → read references/planning.md"
141
-
142
- references/planning.md:
143
- "Gather requirements.
144
- When done → read references/drafting.md"
145
- ```
146
-
147
- If the user stops after planning, drafting instructions are never loaded.
148
-
149
- ## Frontmatter Requirements
150
-
151
- ### Required Fields
152
-
153
- ```yaml
154
- ---
155
- name: skill-name
156
- description: What this skill does and when to use it
157
- ---
158
- ```
159
-
160
- **name:**
161
- - Hyphen-case format (lowercase + hyphens only)
162
- - Prefer gerund form (e.g., `processing-pdfs`, `creating-reports`)
163
- - Must match the directory name
164
- - Max 64 characters
165
-
166
- **description:**
167
- - Max 1024 characters
168
- - CRITICAL for discovery—this determines when Claude triggers the skill
169
- - Must explain WHAT and WHEN
170
-
171
- ### Description Quality
172
-
173
- The description is the most important part of a skill. Claude uses it to decide whether to activate.
174
-
175
- **Good (specific triggers, third person):**
176
- ```yaml
177
- description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", or mentions hook events (PreToolUse, PostToolUse, Stop).
178
- ```
179
-
180
- **Bad:**
181
- ```yaml
182
- # Wrong person
183
- description: Use this skill when working with hooks.
184
-
185
- # Vague, no triggers
186
- description: Provides hook guidance.
187
-
188
- # Too detailed (Claude thinks it knows enough and won't activate)
189
- description: This skill parses PDF files using PyPDF2, extracts text with OCR fallback...
190
- ```
191
-
192
- **Key insight:** If the description explains too much about WHAT, Claude believes it already knows enough and won't activate. Focus on WHEN to use, not HOW it works.
193
-
194
- ## Skill Structure
195
-
196
- ### Minimal
197
- ```
198
- skill-name/
199
- └── SKILL.md
200
- ```
201
- Good for: Simple knowledge, no complex workflows
202
-
203
- ### Standard (Recommended)
204
- ```
205
- skill-name/
206
- ├── SKILL.md
207
- ├── references/
208
- │ └── detailed-guide.md
209
- └── scripts/
210
- └── helper.py
211
- ```
212
- Good for: Most skills with detailed documentation or utilities
213
-
214
- ### When to Use Each Directory
215
-
216
- **references/** - Content Claude reads into context:
217
- - Detailed workflow instructions
218
- - Domain knowledge and patterns
219
- - Schemas and specifications
220
-
221
- **scripts/** - Executable code for deterministic operations:
222
- - Validation utilities
223
- - Code generation
224
- - File operations that need reliability
225
-
226
- **assets/** - Files used in output but never read:
227
- - Templates Claude copies/modifies
228
- - Boilerplate code
229
-
230
- ## Size Guidelines
231
-
232
- - **SKILL.md target**: <150 lines (routers), <300 lines (simple skills)
233
- - **SKILL.md maximum**: 500 lines (strongly discouraged)
234
- - **Reference files >100 lines**: Add a table of contents
235
-
236
- If SKILL.md exceeds limits, move content to references/.
237
-
238
- > "The context window is a public good—your skill shares it with everything else."
239
-
240
- Challenge every piece of content: Does it justify its token cost? If Claude already knows it, remove it.
241
-
242
- ## Activation Patterns
243
-
244
- ### How Skills Activate
245
-
246
- **1. Autonomous (Description Match)**
247
- Claude reads skill descriptions and decides when to activate based on user request matching.
248
- - Less reliable (~50-84% success rate)
249
- - Works better with specific trigger phrases
250
- - Fails if description is too detailed
251
-
252
- **2. Explicit (Slash Command)**
253
- Every skill automatically works as a slash command using `/skill-name`. This is the most reliable activation method.
254
-
255
- **3. Hybrid (Recommended)**
256
- Use `/skill-name` for explicit invocation when needed, while a good description enables autonomous discovery for natural conversations.
257
-
258
- ## Iterative Development
259
-
260
- The most effective skill development involves Claude itself. Work with one instance ("Claude A") to create a skill used by other instances ("Claude B").
261
-
262
- ### The Pattern
263
-
264
- 1. **Complete a task without a skill**: Work through a problem naturally. Notice what context you repeatedly provide.
265
-
266
- 2. **Identify the reusable pattern**: After completing the task, identify what context would be useful for similar future tasks.
267
-
268
- 3. **Ask Claude A to create a skill**: "Create a skill that captures this pattern we just used."
269
-
270
- 4. **Review for conciseness**: Check that Claude A hasn't added unnecessary explanations. Remove what Claude already knows.
271
-
272
- 5. **Test with Claude B**: Use the skill with a fresh instance on related use cases.
273
-
274
- 6. **Iterate based on observation**: If Claude B struggles, return to Claude A with specifics: "When Claude used this skill, it forgot X. Should we make that more prominent?"
275
-
276
- ### Why This Works
277
-
278
- - Claude A understands agent needs
279
- - You provide domain expertise
280
- - Claude B reveals gaps through real usage
281
- - Iterative refinement improves skills based on observed behavior rather than assumptions
282
-
283
- ## Anti-patterns
284
-
285
- ### Windows-Style Paths
286
- Always use forward slashes, even on Windows:
287
- - Good: `scripts/helper.py`, `reference/guide.md`
288
- - Bad: `scripts\helper.py`, `reference\guide.md`
289
-
290
- ### Too Many Options
291
- Don't present multiple approaches unless necessary:
292
-
293
- **Bad:**
294
- "You can use pypdf, or pdfplumber, or PyMuPDF, or pdf2image, or..."
295
-
296
- **Good:**
297
- "Use pdfplumber for text extraction. For scanned PDFs requiring OCR, use pdf2image with pytesseract instead."
298
-
299
- Provide a default, not a menu.
300
-
301
- ### Deeply Nested References
302
- Keep references one level deep from SKILL.md. Avoid:
303
- ```
304
- SKILL.md → advanced.md → details.md → actual-info.md
305
- ```
306
-
307
- Claude may only partially read deeply nested files.
308
-
309
- ## MCP Tool References
310
-
311
- If your skill uses MCP (Model Context Protocol) tools, always use fully qualified tool names.
312
-
313
- **Format**: `ServerName:tool_name`
314
-
315
- **Example:**
316
- ```markdown
317
- Use the BigQuery:bigquery_schema tool to retrieve table schemas.
318
- Use the GitHub:create_issue tool to create issues.
319
- ```
320
-
321
- Without the server prefix, Claude may fail to locate the tool when multiple MCP servers are available.
322
-
323
- ## Common Mistakes
324
-
325
- ### Mistake 1: Treating SKILL.md as Documentation
326
- Writing about the skill instead of instructions for Claude.
327
-
328
- ### Mistake 2: Everything in One File
329
- Putting all content in SKILL.md instead of using references/.
330
-
331
- ### Mistake 3: Vague Descriptions
332
- No trigger phrases, unclear when to use.
333
-
334
- ### Mistake 4: Missing Resource References
335
- References exist but SKILL.md doesn't mention them.
336
-
337
- ## Validation
338
-
339
- Run: `node ~/.claude/skills/creating-agent-skills/scripts/validate-skill.js [skill-path]`
340
-
341
- Manual checks:
342
- - Is this instructions, not documentation?
343
- - Would Claude know what to DO?
344
- - Is heavy content in references/?
345
- - Does the description have trigger phrases?