@yeongjaeyou/claude-code-config 0.16.0 → 0.17.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/.claude/agents/code-review-handler.md +79 -0
- package/.claude/agents/issue-resolver.md +123 -0
- package/.claude/agents/python-pro.md +7 -2
- package/.claude/agents/web-researcher.md +5 -1
- package/.claude/commands/ask-deepwiki.md +46 -11
- package/.claude/commands/gh/auto-review-loop.md +178 -0
- package/.claude/commands/gh/create-issue-label.md +4 -0
- package/.claude/commands/gh/decompose-issue.md +24 -2
- package/.claude/commands/gh/post-merge.md +52 -10
- package/.claude/commands/gh/resolve-and-review.md +69 -0
- package/.claude/commands/gh/resolve-issue.md +3 -0
- package/.claude/commands/tm/convert-prd.md +4 -0
- package/.claude/commands/tm/post-merge.md +7 -1
- package/.claude/commands/tm/resolve-issue.md +4 -0
- package/.claude/commands/tm/sync-to-github.md +4 -0
- package/.claude/settings.json +15 -0
- package/.claude/skills/claude-md-generator/SKILL.md +130 -0
- package/.claude/skills/claude-md-generator/references/examples.md +261 -0
- package/.claude/skills/claude-md-generator/references/templates.md +156 -0
- package/.claude/skills/hook-creator/SKILL.md +88 -0
- package/.claude/skills/hook-creator/references/examples.md +339 -0
- package/.claude/skills/hook-creator/references/hook-events.md +193 -0
- package/.claude/skills/skill-creator/SKILL.md +160 -13
- package/.claude/skills/skill-creator/references/output-patterns.md +82 -0
- package/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/.claude/skills/skill-creator/scripts/package_skill.py +10 -10
- package/.claude/skills/skill-creator/scripts/quick_validate.py +45 -15
- package/.claude/skills/slash-command-creator/SKILL.md +108 -0
- package/.claude/skills/slash-command-creator/references/examples.md +161 -0
- package/.claude/skills/slash-command-creator/references/frontmatter.md +74 -0
- package/.claude/skills/slash-command-creator/scripts/init_command.py +221 -0
- package/.claude/skills/subagent-creator/SKILL.md +127 -0
- package/.claude/skills/subagent-creator/assets/subagent-template.md +31 -0
- package/.claude/skills/subagent-creator/references/available-tools.md +63 -0
- package/.claude/skills/subagent-creator/references/examples.md +213 -0
- package/.claude/skills/youtube-collector/README.md +107 -0
- package/.claude/skills/youtube-collector/SKILL.md +158 -0
- package/.claude/skills/youtube-collector/references/data-schema.md +110 -0
- package/.claude/skills/youtube-collector/scripts/collect_videos.py +304 -0
- package/.claude/skills/youtube-collector/scripts/fetch_transcript.py +138 -0
- package/.claude/skills/youtube-collector/scripts/fetch_videos.py +229 -0
- package/.claude/skills/youtube-collector/scripts/register_channel.py +247 -0
- package/.claude/skills/youtube-collector/scripts/setup_api_key.py +151 -0
- package/package.json +1 -1
|
@@ -22,6 +22,28 @@ equipped with procedural knowledge that no model can fully possess.
|
|
|
22
22
|
3. Domain expertise - Company-specific knowledge, schemas, business logic
|
|
23
23
|
4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
|
|
24
24
|
|
|
25
|
+
## Core Principles
|
|
26
|
+
|
|
27
|
+
### Concise is Key
|
|
28
|
+
|
|
29
|
+
The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
|
|
30
|
+
|
|
31
|
+
**Default assumption: Claude is already very smart.** Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"
|
|
32
|
+
|
|
33
|
+
Prefer concise examples over verbose explanations.
|
|
34
|
+
|
|
35
|
+
### Set Appropriate Degrees of Freedom
|
|
36
|
+
|
|
37
|
+
Match the level of specificity to the task's fragility and variability:
|
|
38
|
+
|
|
39
|
+
**High freedom (text-based instructions)**: Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
|
|
40
|
+
|
|
41
|
+
**Medium freedom (pseudocode or scripts with parameters)**: Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
|
|
42
|
+
|
|
43
|
+
**Low freedom (specific scripts, few parameters)**: Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
|
|
44
|
+
|
|
45
|
+
Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).
|
|
46
|
+
|
|
25
47
|
### Anatomy of a Skill
|
|
26
48
|
|
|
27
49
|
Every skill consists of a required SKILL.md file and optional bundled resources:
|
|
@@ -41,7 +63,10 @@ skill-name/
|
|
|
41
63
|
|
|
42
64
|
#### SKILL.md (required)
|
|
43
65
|
|
|
44
|
-
|
|
66
|
+
Every SKILL.md consists of:
|
|
67
|
+
|
|
68
|
+
- **Frontmatter** (YAML): Contains `name` and `description` fields. These are the only fields that Claude reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
|
|
69
|
+
- **Body** (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).
|
|
45
70
|
|
|
46
71
|
#### Bundled Resources (optional)
|
|
47
72
|
|
|
@@ -74,19 +99,118 @@ Files not intended to be loaded into context, but rather used within the output
|
|
|
74
99
|
- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
|
|
75
100
|
- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context
|
|
76
101
|
|
|
102
|
+
#### What to Not Include in a Skill
|
|
103
|
+
|
|
104
|
+
A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:
|
|
105
|
+
|
|
106
|
+
- README.md
|
|
107
|
+
- INSTALLATION_GUIDE.md
|
|
108
|
+
- QUICK_REFERENCE.md
|
|
109
|
+
- CHANGELOG.md
|
|
110
|
+
- etc.
|
|
111
|
+
|
|
112
|
+
The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxilary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.
|
|
113
|
+
|
|
77
114
|
### Progressive Disclosure Design Principle
|
|
78
115
|
|
|
79
116
|
Skills use a three-level loading system to manage context efficiently:
|
|
80
117
|
|
|
81
118
|
1. **Metadata (name + description)** - Always in context (~100 words)
|
|
82
119
|
2. **SKILL.md body** - When skill triggers (<5k words)
|
|
83
|
-
3. **Bundled resources** - As needed by Claude (Unlimited
|
|
120
|
+
3. **Bundled resources** - As needed by Claude (Unlimited because scripts can be executed without reading into context window)
|
|
121
|
+
|
|
122
|
+
#### Progressive Disclosure Patterns
|
|
123
|
+
|
|
124
|
+
Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.
|
|
125
|
+
|
|
126
|
+
**Key principle:** When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.
|
|
127
|
+
|
|
128
|
+
**Pattern 1: High-level guide with references**
|
|
129
|
+
|
|
130
|
+
```markdown
|
|
131
|
+
# PDF Processing
|
|
132
|
+
|
|
133
|
+
## Quick start
|
|
134
|
+
|
|
135
|
+
Extract text with pdfplumber:
|
|
136
|
+
[code example]
|
|
137
|
+
|
|
138
|
+
## Advanced features
|
|
139
|
+
|
|
140
|
+
- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
|
|
141
|
+
- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
|
|
142
|
+
- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.
|
|
146
|
+
|
|
147
|
+
**Pattern 2: Domain-specific organization**
|
|
148
|
+
|
|
149
|
+
For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
bigquery-skill/
|
|
153
|
+
├── SKILL.md (overview and navigation)
|
|
154
|
+
└── reference/
|
|
155
|
+
├── finance.md (revenue, billing metrics)
|
|
156
|
+
├── sales.md (opportunities, pipeline)
|
|
157
|
+
├── product.md (API usage, features)
|
|
158
|
+
└── marketing.md (campaigns, attribution)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
When a user asks about sales metrics, Claude only reads sales.md.
|
|
162
|
+
|
|
163
|
+
Similarly, for skills supporting multiple frameworks or variants, organize by variant:
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
cloud-deploy/
|
|
167
|
+
├── SKILL.md (workflow + provider selection)
|
|
168
|
+
└── references/
|
|
169
|
+
├── aws.md (AWS deployment patterns)
|
|
170
|
+
├── gcp.md (GCP deployment patterns)
|
|
171
|
+
└── azure.md (Azure deployment patterns)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
When the user chooses AWS, Claude only reads aws.md.
|
|
175
|
+
|
|
176
|
+
**Pattern 3: Conditional details**
|
|
177
|
+
|
|
178
|
+
Show basic content, link to advanced content:
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
# DOCX Processing
|
|
182
|
+
|
|
183
|
+
## Creating documents
|
|
184
|
+
|
|
185
|
+
Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).
|
|
186
|
+
|
|
187
|
+
## Editing documents
|
|
188
|
+
|
|
189
|
+
For simple edits, modify the XML directly.
|
|
190
|
+
|
|
191
|
+
**For tracked changes**: See [REDLINING.md](REDLINING.md)
|
|
192
|
+
**For OOXML details**: See [OOXML.md](OOXML.md)
|
|
193
|
+
```
|
|
84
194
|
|
|
85
|
-
|
|
195
|
+
Claude reads REDLINING.md or OOXML.md only when the user needs those features.
|
|
196
|
+
|
|
197
|
+
**Important guidelines:**
|
|
198
|
+
|
|
199
|
+
- **Avoid deeply nested references** - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
|
|
200
|
+
- **Structure longer reference files** - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.
|
|
86
201
|
|
|
87
202
|
## Skill Creation Process
|
|
88
203
|
|
|
89
|
-
|
|
204
|
+
Skill creation involves these steps:
|
|
205
|
+
|
|
206
|
+
1. Understand the skill with concrete examples
|
|
207
|
+
2. Plan reusable skill contents (scripts, references, assets)
|
|
208
|
+
3. Initialize the skill (run init_skill.py)
|
|
209
|
+
4. Edit the skill (implement resources and write SKILL.md)
|
|
210
|
+
5. Package the skill (run package_skill.py)
|
|
211
|
+
6. Iterate based on real usage
|
|
212
|
+
|
|
213
|
+
Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
|
|
90
214
|
|
|
91
215
|
### Step 1: Understanding the Skill with Concrete Examples
|
|
92
216
|
|
|
@@ -154,27 +278,48 @@ After initialization, customize or remove the generated SKILL.md and example fil
|
|
|
154
278
|
|
|
155
279
|
### Step 4: Edit the Skill
|
|
156
280
|
|
|
157
|
-
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use.
|
|
281
|
+
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
|
|
282
|
+
|
|
283
|
+
#### Learn Proven Design Patterns
|
|
284
|
+
|
|
285
|
+
Consult these helpful guides based on your skill's needs:
|
|
286
|
+
|
|
287
|
+
- **Multi-step processes**: See references/workflows.md for sequential workflows and conditional logic
|
|
288
|
+
- **Specific output formats or quality standards**: See references/output-patterns.md for template and example patterns
|
|
289
|
+
|
|
290
|
+
These files contain established best practices for effective skill design.
|
|
158
291
|
|
|
159
292
|
#### Start with Reusable Skill Contents
|
|
160
293
|
|
|
161
294
|
To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
|
|
162
295
|
|
|
163
|
-
|
|
296
|
+
Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.
|
|
297
|
+
|
|
298
|
+
Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
|
|
164
299
|
|
|
165
300
|
#### Update SKILL.md
|
|
166
301
|
|
|
167
|
-
**Writing
|
|
302
|
+
**Writing Guidelines:** Always use imperative/infinitive form.
|
|
303
|
+
|
|
304
|
+
##### Frontmatter
|
|
305
|
+
|
|
306
|
+
Write the YAML frontmatter with `name` and `description`:
|
|
307
|
+
|
|
308
|
+
- `name`: The skill name
|
|
309
|
+
- `description`: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.
|
|
310
|
+
- Include both what the Skill does and specific triggers/contexts for when to use it.
|
|
311
|
+
- Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.
|
|
312
|
+
- Example description for a `docx` skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
|
|
168
313
|
|
|
169
|
-
|
|
314
|
+
Do not include any other fields in YAML frontmatter.
|
|
170
315
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
316
|
+
##### Body
|
|
317
|
+
|
|
318
|
+
Write instructions for using the skill and its bundled resources.
|
|
174
319
|
|
|
175
320
|
### Step 5: Packaging a Skill
|
|
176
321
|
|
|
177
|
-
Once the skill is
|
|
322
|
+
Once development of the skill is complete, it must be packaged into a distributable .skill file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
|
|
178
323
|
|
|
179
324
|
```bash
|
|
180
325
|
scripts/package_skill.py <path/to/skill-folder>
|
|
@@ -189,12 +334,13 @@ scripts/package_skill.py <path/to/skill-folder> ./dist
|
|
|
189
334
|
The packaging script will:
|
|
190
335
|
|
|
191
336
|
1. **Validate** the skill automatically, checking:
|
|
337
|
+
|
|
192
338
|
- YAML frontmatter format and required fields
|
|
193
339
|
- Skill naming conventions and directory structure
|
|
194
340
|
- Description completeness and quality
|
|
195
341
|
- File organization and resource references
|
|
196
342
|
|
|
197
|
-
2. **Package** the skill if validation passes, creating a
|
|
343
|
+
2. **Package** the skill if validation passes, creating a .skill file named after the skill (e.g., `my-skill.skill`) that includes all files and maintains the proper directory structure for distribution. The .skill file is a zip file with a .skill extension.
|
|
198
344
|
|
|
199
345
|
If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.
|
|
200
346
|
|
|
@@ -203,6 +349,7 @@ If validation fails, the script will report the errors and exit without creating
|
|
|
203
349
|
After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
|
|
204
350
|
|
|
205
351
|
**Iteration workflow:**
|
|
352
|
+
|
|
206
353
|
1. Use the skill on real tasks
|
|
207
354
|
2. Notice struggles or inefficiencies
|
|
208
355
|
3. Identify how SKILL.md or bundled resources should be updated
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Output Patterns
|
|
2
|
+
|
|
3
|
+
Use these patterns when skills need to produce consistent, high-quality output.
|
|
4
|
+
|
|
5
|
+
## Template Pattern
|
|
6
|
+
|
|
7
|
+
Provide templates for output format. Match the level of strictness to your needs.
|
|
8
|
+
|
|
9
|
+
**For strict requirements (like API responses or data formats):**
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
## Report structure
|
|
13
|
+
|
|
14
|
+
ALWAYS use this exact template structure:
|
|
15
|
+
|
|
16
|
+
# [Analysis Title]
|
|
17
|
+
|
|
18
|
+
## Executive summary
|
|
19
|
+
[One-paragraph overview of key findings]
|
|
20
|
+
|
|
21
|
+
## Key findings
|
|
22
|
+
- Finding 1 with supporting data
|
|
23
|
+
- Finding 2 with supporting data
|
|
24
|
+
- Finding 3 with supporting data
|
|
25
|
+
|
|
26
|
+
## Recommendations
|
|
27
|
+
1. Specific actionable recommendation
|
|
28
|
+
2. Specific actionable recommendation
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**For flexible guidance (when adaptation is useful):**
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
## Report structure
|
|
35
|
+
|
|
36
|
+
Here is a sensible default format, but use your best judgment:
|
|
37
|
+
|
|
38
|
+
# [Analysis Title]
|
|
39
|
+
|
|
40
|
+
## Executive summary
|
|
41
|
+
[Overview]
|
|
42
|
+
|
|
43
|
+
## Key findings
|
|
44
|
+
[Adapt sections based on what you discover]
|
|
45
|
+
|
|
46
|
+
## Recommendations
|
|
47
|
+
[Tailor to the specific context]
|
|
48
|
+
|
|
49
|
+
Adjust sections as needed for the specific analysis type.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Examples Pattern
|
|
53
|
+
|
|
54
|
+
For skills where output quality depends on seeing examples, provide input/output pairs:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## Commit message format
|
|
58
|
+
|
|
59
|
+
Generate commit messages following these examples:
|
|
60
|
+
|
|
61
|
+
**Example 1:**
|
|
62
|
+
Input: Added user authentication with JWT tokens
|
|
63
|
+
Output:
|
|
64
|
+
```
|
|
65
|
+
feat(auth): implement JWT-based authentication
|
|
66
|
+
|
|
67
|
+
Add login endpoint and token validation middleware
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Example 2:**
|
|
71
|
+
Input: Fixed bug where dates displayed incorrectly in reports
|
|
72
|
+
Output:
|
|
73
|
+
```
|
|
74
|
+
fix(reports): correct date formatting in timezone conversion
|
|
75
|
+
|
|
76
|
+
Use UTC timestamps consistently across report generation
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Follow this style: type(scope): brief description, then detailed explanation.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Workflow Patterns
|
|
2
|
+
|
|
3
|
+
## Sequential Workflows
|
|
4
|
+
|
|
5
|
+
For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
Filling a PDF form involves these steps:
|
|
9
|
+
|
|
10
|
+
1. Analyze the form (run analyze_form.py)
|
|
11
|
+
2. Create field mapping (edit fields.json)
|
|
12
|
+
3. Validate mapping (run validate_fields.py)
|
|
13
|
+
4. Fill the form (run fill_form.py)
|
|
14
|
+
5. Verify output (run verify_output.py)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Conditional Workflows
|
|
18
|
+
|
|
19
|
+
For tasks with branching logic, guide Claude through decision points:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
1. Determine the modification type:
|
|
23
|
+
**Creating new content?** → Follow "Creation workflow" below
|
|
24
|
+
**Editing existing content?** → Follow "Editing workflow" below
|
|
25
|
+
|
|
26
|
+
2. Creation workflow: [steps]
|
|
27
|
+
3. Editing workflow: [steps]
|
|
28
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
Skill Packager - Creates a distributable
|
|
3
|
+
Skill Packager - Creates a distributable .skill file of a skill folder
|
|
4
4
|
|
|
5
5
|
Usage:
|
|
6
6
|
python utils/package_skill.py <path/to/skill-folder> [output-directory]
|
|
@@ -18,14 +18,14 @@ from quick_validate import validate_skill
|
|
|
18
18
|
|
|
19
19
|
def package_skill(skill_path, output_dir=None):
|
|
20
20
|
"""
|
|
21
|
-
Package a skill folder into a
|
|
21
|
+
Package a skill folder into a .skill file.
|
|
22
22
|
|
|
23
23
|
Args:
|
|
24
24
|
skill_path: Path to the skill folder
|
|
25
|
-
output_dir: Optional output directory for the
|
|
25
|
+
output_dir: Optional output directory for the .skill file (defaults to current directory)
|
|
26
26
|
|
|
27
27
|
Returns:
|
|
28
|
-
Path to the created
|
|
28
|
+
Path to the created .skill file, or None if error
|
|
29
29
|
"""
|
|
30
30
|
skill_path = Path(skill_path).resolve()
|
|
31
31
|
|
|
@@ -61,11 +61,11 @@ def package_skill(skill_path, output_dir=None):
|
|
|
61
61
|
else:
|
|
62
62
|
output_path = Path.cwd()
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
skill_filename = output_path / f"{skill_name}.skill"
|
|
65
65
|
|
|
66
|
-
# Create the zip
|
|
66
|
+
# Create the .skill file (zip format)
|
|
67
67
|
try:
|
|
68
|
-
with zipfile.ZipFile(
|
|
68
|
+
with zipfile.ZipFile(skill_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
|
69
69
|
# Walk through the skill directory
|
|
70
70
|
for file_path in skill_path.rglob('*'):
|
|
71
71
|
if file_path.is_file():
|
|
@@ -74,11 +74,11 @@ def package_skill(skill_path, output_dir=None):
|
|
|
74
74
|
zipf.write(file_path, arcname)
|
|
75
75
|
print(f" Added: {arcname}")
|
|
76
76
|
|
|
77
|
-
print(f"\n✅ Successfully packaged skill to: {
|
|
78
|
-
return
|
|
77
|
+
print(f"\n✅ Successfully packaged skill to: {skill_filename}")
|
|
78
|
+
return skill_filename
|
|
79
79
|
|
|
80
80
|
except Exception as e:
|
|
81
|
-
print(f"❌ Error creating
|
|
81
|
+
print(f"❌ Error creating .skill file: {e}")
|
|
82
82
|
return None
|
|
83
83
|
|
|
84
84
|
|
|
@@ -6,52 +6,82 @@ Quick validation script for skills - minimal version
|
|
|
6
6
|
import sys
|
|
7
7
|
import os
|
|
8
8
|
import re
|
|
9
|
+
import yaml
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
|
|
11
12
|
def validate_skill(skill_path):
|
|
12
13
|
"""Basic validation of a skill"""
|
|
13
14
|
skill_path = Path(skill_path)
|
|
14
|
-
|
|
15
|
+
|
|
15
16
|
# Check SKILL.md exists
|
|
16
17
|
skill_md = skill_path / 'SKILL.md'
|
|
17
18
|
if not skill_md.exists():
|
|
18
19
|
return False, "SKILL.md not found"
|
|
19
|
-
|
|
20
|
+
|
|
20
21
|
# Read and validate frontmatter
|
|
21
22
|
content = skill_md.read_text()
|
|
22
23
|
if not content.startswith('---'):
|
|
23
24
|
return False, "No YAML frontmatter found"
|
|
24
|
-
|
|
25
|
+
|
|
25
26
|
# Extract frontmatter
|
|
26
27
|
match = re.match(r'^---\n(.*?)\n---', content, re.DOTALL)
|
|
27
28
|
if not match:
|
|
28
29
|
return False, "Invalid frontmatter format"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
|
|
31
|
+
frontmatter_text = match.group(1)
|
|
32
|
+
|
|
33
|
+
# Parse YAML frontmatter
|
|
34
|
+
try:
|
|
35
|
+
frontmatter = yaml.safe_load(frontmatter_text)
|
|
36
|
+
if not isinstance(frontmatter, dict):
|
|
37
|
+
return False, "Frontmatter must be a YAML dictionary"
|
|
38
|
+
except yaml.YAMLError as e:
|
|
39
|
+
return False, f"Invalid YAML in frontmatter: {e}"
|
|
40
|
+
|
|
41
|
+
# Define allowed properties
|
|
42
|
+
ALLOWED_PROPERTIES = {'name', 'description', 'license', 'allowed-tools', 'metadata'}
|
|
43
|
+
|
|
44
|
+
# Check for unexpected properties (excluding nested keys under metadata)
|
|
45
|
+
unexpected_keys = set(frontmatter.keys()) - ALLOWED_PROPERTIES
|
|
46
|
+
if unexpected_keys:
|
|
47
|
+
return False, (
|
|
48
|
+
f"Unexpected key(s) in SKILL.md frontmatter: {', '.join(sorted(unexpected_keys))}. "
|
|
49
|
+
f"Allowed properties are: {', '.join(sorted(ALLOWED_PROPERTIES))}"
|
|
50
|
+
)
|
|
51
|
+
|
|
32
52
|
# Check required fields
|
|
33
|
-
if 'name
|
|
53
|
+
if 'name' not in frontmatter:
|
|
34
54
|
return False, "Missing 'name' in frontmatter"
|
|
35
|
-
if 'description
|
|
55
|
+
if 'description' not in frontmatter:
|
|
36
56
|
return False, "Missing 'description' in frontmatter"
|
|
37
|
-
|
|
57
|
+
|
|
38
58
|
# Extract name for validation
|
|
39
|
-
|
|
40
|
-
if
|
|
41
|
-
|
|
59
|
+
name = frontmatter.get('name', '')
|
|
60
|
+
if not isinstance(name, str):
|
|
61
|
+
return False, f"Name must be a string, got {type(name).__name__}"
|
|
62
|
+
name = name.strip()
|
|
63
|
+
if name:
|
|
42
64
|
# Check naming convention (hyphen-case: lowercase with hyphens)
|
|
43
65
|
if not re.match(r'^[a-z0-9-]+$', name):
|
|
44
66
|
return False, f"Name '{name}' should be hyphen-case (lowercase letters, digits, and hyphens only)"
|
|
45
67
|
if name.startswith('-') or name.endswith('-') or '--' in name:
|
|
46
68
|
return False, f"Name '{name}' cannot start/end with hyphen or contain consecutive hyphens"
|
|
69
|
+
# Check name length (max 64 characters per spec)
|
|
70
|
+
if len(name) > 64:
|
|
71
|
+
return False, f"Name is too long ({len(name)} characters). Maximum is 64 characters."
|
|
47
72
|
|
|
48
73
|
# Extract and validate description
|
|
49
|
-
|
|
50
|
-
if
|
|
51
|
-
|
|
74
|
+
description = frontmatter.get('description', '')
|
|
75
|
+
if not isinstance(description, str):
|
|
76
|
+
return False, f"Description must be a string, got {type(description).__name__}"
|
|
77
|
+
description = description.strip()
|
|
78
|
+
if description:
|
|
52
79
|
# Check for angle brackets
|
|
53
80
|
if '<' in description or '>' in description:
|
|
54
81
|
return False, "Description cannot contain angle brackets (< or >)"
|
|
82
|
+
# Check description length (max 1024 characters per spec)
|
|
83
|
+
if len(description) > 1024:
|
|
84
|
+
return False, f"Description is too long ({len(description)} characters). Maximum is 1024 characters."
|
|
55
85
|
|
|
56
86
|
return True, "Skill is valid!"
|
|
57
87
|
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: slash-command-creator
|
|
3
|
+
description: Guide for creating Claude Code slash commands. Use when the user wants to create a new slash command, update an existing slash command, or asks about slash command syntax, frontmatter options, or best practices.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Slash Command Creator
|
|
7
|
+
|
|
8
|
+
Create custom slash commands for Claude Code to automate frequently-used prompts.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
Initialize a new command:
|
|
13
|
+
```bash
|
|
14
|
+
scripts/init_command.py <command-name> [--scope project|personal]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Command Structure
|
|
18
|
+
|
|
19
|
+
Slash commands are Markdown files with optional YAML frontmatter:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
---
|
|
23
|
+
description: Brief description shown in /help
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
Your prompt instructions here.
|
|
27
|
+
|
|
28
|
+
$ARGUMENTS
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### File Locations
|
|
32
|
+
|
|
33
|
+
| Scope | Path | Shown as |
|
|
34
|
+
|----------|-------------------------|-------------------|
|
|
35
|
+
| Project | `.claude/commands/` | (project) |
|
|
36
|
+
| Personal | `~/.claude/commands/` | (user) |
|
|
37
|
+
|
|
38
|
+
### Namespacing
|
|
39
|
+
|
|
40
|
+
Organize commands in subdirectories:
|
|
41
|
+
- `.claude/commands/frontend/component.md` → `/component` shows "(project:frontend)"
|
|
42
|
+
- `~/.claude/commands/backend/api.md` → `/api` shows "(user:backend)"
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
### Arguments
|
|
47
|
+
|
|
48
|
+
**All arguments** - `$ARGUMENTS`:
|
|
49
|
+
```markdown
|
|
50
|
+
Fix issue #$ARGUMENTS following our coding standards
|
|
51
|
+
# /fix-issue 123 → "Fix issue #123 following..."
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Positional** - `$1`, `$2`, etc.:
|
|
55
|
+
```markdown
|
|
56
|
+
Review PR #$1 with priority $2
|
|
57
|
+
# /review 456 high → "Review PR #456 with priority high"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Bash Execution
|
|
61
|
+
|
|
62
|
+
Execute shell commands with `!` prefix (requires `allowed-tools` in frontmatter):
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
---
|
|
66
|
+
allowed-tools: Bash(git status:*), Bash(git diff:*)
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
Current status: !`git status`
|
|
70
|
+
Changes: !`git diff HEAD`
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### File References
|
|
74
|
+
|
|
75
|
+
Include file contents with `@` prefix:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
Review @src/utils/helpers.js for issues.
|
|
79
|
+
Compare @$1 with @$2.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Frontmatter Options
|
|
83
|
+
|
|
84
|
+
| Field | Purpose | Required |
|
|
85
|
+
|---------------------------|----------------------------------------|----------|
|
|
86
|
+
| `description` | Brief description for /help | Yes |
|
|
87
|
+
| `allowed-tools` | Tools the command can use | No |
|
|
88
|
+
| `argument-hint` | Expected arguments hint | No |
|
|
89
|
+
| `model` | Specific model to use | No |
|
|
90
|
+
| `disable-model-invocation`| Prevent SlashCommand tool invocation | No |
|
|
91
|
+
|
|
92
|
+
See [references/frontmatter.md](references/frontmatter.md) for detailed reference.
|
|
93
|
+
|
|
94
|
+
## Examples
|
|
95
|
+
|
|
96
|
+
See [references/examples.md](references/examples.md) for complete examples including:
|
|
97
|
+
- Simple review/explain commands
|
|
98
|
+
- Commands with positional arguments
|
|
99
|
+
- Git workflow commands with bash execution
|
|
100
|
+
- Namespaced commands for frontend/backend
|
|
101
|
+
|
|
102
|
+
## Creation Workflow
|
|
103
|
+
|
|
104
|
+
1. **Identify the use case**: What prompt do you repeat often?
|
|
105
|
+
2. **Choose scope**: Project (shared) or personal (private)?
|
|
106
|
+
3. **Initialize**: Run `scripts/init_command.py <name>`
|
|
107
|
+
4. **Edit**: Update description and body
|
|
108
|
+
5. **Test**: Run the command in Claude Code
|