Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

Add /create-skill command and skill-creator skill

Jez81e9bbee98c3
diff --git a/commands/README.md b/commands/README.md
index a256ef6f..c74b614f 100644
--- a/commands/README.md
+++ b/commands/README.md
@@ -1,6 +1,6 @@
# Claude Code Slash Commands
-Seven slash commands for automating project exploration, planning, session workflow, and release safety with Claude Code.
+Eight slash commands for automating project exploration, planning, session workflow, skill creation, and release safety with Claude Code.
## ⚠️ New Installation Method
@@ -177,6 +177,39 @@ Commands are immediately available in Claude Code after copying.
---
+#### `/create-skill`
+
+**Purpose**: Scaffold a new Claude Code skill from template
+
+**Usage**: Type `/create-skill my-skill-name` when you want to create a new skill
+
+**What it does**:
+1. Validates skill name (lowercase-hyphen-case, max 40 chars)
+2. Asks about skill type (Cloudflare/AI/Frontend/Auth/Database/Tooling/Generic)
+3. Copies `templates/skill-skeleton/` to `skills/<name>/`
+4. Auto-populates name and dates in SKILL.md
+5. Applies type-specific customizations
+6. Creates README.md with auto-trigger keywords
+7. Runs metadata check
+8. Installs skill (symlinks to ~/.claude/skills/)
+
+**Time savings**: 5-10 minutes per skill (manual setup + remembering structure → 1 command)
+
+**When to use**:
+- Creating a new skill from scratch
+- Want proper directory structure
+- Need type-specific template guidance
+
+**When to skip**:
+- Copying/adapting an existing skill
+- Just need quick edit to existing skill
+
+**Related**: Use `skill-creator` skill for deeper guidance on designing effective skills (descriptions, token efficiency, freedom levels)
+
+**Output**: Complete skill directory structure, installed and ready to fill with content
+
+---
+
#### `/release`
**Purpose**: Pre-release safety checks for GitHub publishing
diff --git a/commands/create-skill.md b/commands/create-skill.md
new file mode 100644
index 00000000..a4e141d9
--- /dev/null
+++ b/commands/create-skill.md
@@ -0,0 +1,165 @@
+# Create Skill
+
+You are creating a new Claude Code skill from the standard template.
+
+## Command Usage
+
+`/create-skill <skill-name>`
+
+Example: `/create-skill cloudflare-analytics`
+
+## Validation
+
+**Skill name requirements:**
+- Lowercase letters, digits, and hyphens only
+- Must start with a letter
+- Max 40 characters
+- No underscores or spaces
+
+If name is invalid, explain why and suggest a corrected version.
+
+## Process
+
+### 1. Check if skill exists
+
+```bash
+ls skills/<skill-name>/
+```
+
+If exists, ask user: "Skill `<skill-name>` already exists. Overwrite? [y/N]"
+
+### 2. Ask about skill type (interactive)
+
+Present options to customize the template:
+
+```
+What type of skill is this?
+
+1. **Cloudflare** - Workers, D1, R2, KV, AI, etc.
+2. **AI/ML** - OpenAI, Anthropic, Gemini, AI SDK
+3. **Frontend** - React, UI libraries, styling
+4. **Auth** - Authentication providers
+5. **Database** - ORMs, data stores
+6. **Tooling** - CLI tools, build systems, MCPs
+7. **Generic** - Standard template (no customization)
+
+Your choice [1-7]:
+```
+
+### 3. Create skill directory structure
+
+```bash
+# Copy skeleton
+cp -r templates/skill-skeleton/ skills/<skill-name>/
+```
+
+### 4. Auto-populate fields in SKILL.md
+
+Replace these automatically:
+- `name:` → the skill name provided
+- `Last Updated` → today's date (YYYY-MM-DD)
+- `Verified` date → today's date
+
+### 5. Apply type-specific customizations
+
+Based on skill type choice, provide guidance:
+
+**Cloudflare skills:**
+- Remind to check cloudflare-docs MCP for accuracy
+- Suggest prerequisite: `cloudflare-worker-base`
+- Add wrangler.jsonc to Configuration section
+- Reference: `skills/cloudflare-d1/` as example
+
+**AI/ML skills:**
+- Remind to verify model names/versions are current
+- Add model configuration patterns
+- Include rate limiting considerations
+- Reference: `skills/ai-sdk-core/` as example
+
+**Frontend skills:**
+- Add component patterns section
+- Include TypeScript types
+- Reference: `skills/tailwind-v4-shadcn/` as example
+
+**Auth skills:**
+- Security considerations section
+- Token handling patterns
+- Reference: `skills/clerk-auth/` as example
+
+**Database skills:**
+- Schema patterns section
+- Migration workflow
+- Reference: `skills/drizzle-orm-d1/` as example
+
+**Tooling skills:**
+- CLI usage patterns
+- Integration examples
+- Reference: `skills/fastmcp/` as example
+
+### 6. Create README.md with auto-trigger keywords
+
+The README.md should include:
+```markdown
+# <Skill Name>
+
+Auto-trigger keywords: <technology>, <use-case>, <common-errors>
+
+See SKILL.md for full documentation.
+```
+
+### 7. Run metadata check
+
+```bash
+./scripts/check-metadata.sh <skill-name>
+```
+
+Report any issues found.
+
+### 8. Install the skill
+
+```bash
+./scripts/install-skill.sh <skill-name>
+```
+
+## Output
+
+After creating:
+
+```markdown
+## Skill Created: `<skill-name>`
+
+**Location**: `skills/<skill-name>/`
+**Type**: [Selected type]
+**Installed**: ~/.claude/skills/<skill-name> → skills/<skill-name>
+
+### Files Created:
+- `SKILL.md` - Main documentation (fill [TODO] markers)
+- `README.md` - Auto-trigger keywords
+- `scripts/` - Helper scripts
+- `references/` - Documentation files
+- `assets/` - Templates, images
+
+### Next Steps:
+
+1. **Fill TODOs** - Search for `[TODO:` in SKILL.md and replace all
+2. **Add content** - Write the actual skill knowledge
+3. **Test discovery** - Ask Claude Code to use your skill
+4. **Verify** - Run `./scripts/check-metadata.sh <skill-name>`
+5. **Commit** - `git add skills/<skill-name> && git commit -m "Add <skill-name> skill"`
+
+### Reference Examples:
+- Similar skill: `skills/[reference-skill]/`
+- Template guide: `templates/SKILL-TEMPLATE.md`
+- Checklist: `ONE_PAGE_CHECKLIST.md`
+
+### Quick Test:
+Ask Claude Code: "Use the <skill-name> skill to..."
+```
+
+## Important Notes
+
+- Skills are symlinked to `~/.claude/skills/` for Claude Code to discover
+- The [TODO] markers in SKILL.md are intentional - fill them all before committing
+- Description should be 250-350 characters with "Use when:" scenarios
+- Keywords in metadata improve discoverability
+- Test with `check-metadata.sh` before committing
diff --git a/skills/skill-creator/README.md b/skills/skill-creator/README.md
new file mode 100644
index 00000000..9e9b14c7
--- /dev/null
+++ b/skills/skill-creator/README.md
@@ -0,0 +1,25 @@
+# Skill Creator
+
+Auto-trigger keywords: create skill, new skill, make skill, skill template, skill description, skill design, skill discovery, token efficiency, progressive disclosure
+
+## Purpose
+
+Guides the design of effective Claude Code skills with optimal descriptions, progressive disclosure patterns, and quality standards.
+
+## Usage
+
+**Quick scaffolding**: Use `/create-skill <name>` command
+
+**Design guidance**: Ask Claude Code to use this skill when you need help with:
+- Writing effective skill descriptions
+- Structuring skill content
+- Optimizing token efficiency
+- Debugging skill discovery issues
+- Understanding freedom levels
+
+## See Also
+
+- `SKILL.md` - Full documentation
+- `templates/SKILL-TEMPLATE.md` - Copy-paste template
+- `ONE_PAGE_CHECKLIST.md` - Quick verification
+- `planning/claude-code-skill-standards.md` - Our standards
diff --git a/skills/skill-creator/SKILL.md b/skills/skill-creator/SKILL.md
new file mode 100644
index 00000000..25142e19
--- /dev/null
+++ b/skills/skill-creator/SKILL.md
@@ -0,0 +1,366 @@
+---
+name: skill-creator
+description: |
+ Design effective Claude Code skills with optimal descriptions, progressive disclosure, and error prevention patterns. Covers freedom levels, token efficiency, and quality standards.
+
+ Use when: creating new skills, improving skill descriptions, optimizing token usage, structuring skill content, or debugging why skills aren't being discovered.
+license: MIT
+metadata:
+ keywords: skill, create skill, new skill, skill description, skill design, token efficiency, progressive disclosure, freedom levels, skill discovery
+---
+
+# Skill Creator
+
+**Status**: Production Ready
+**Last Updated**: 2025-12-01
+**Dependencies**: None
+**Reference**: [Anthropic's skill-creator](https://github.com/anthropics/skills/tree/main/skill-creator)
+
+---
+
+## Quick Start
+
+**To scaffold a new skill**, use the `/create-skill` command:
+```
+/create-skill my-new-skill
+```
+
+**To design an effective skill**, continue reading this guide.
+
+---
+
+## Core Principles
+
+### 1. The Context Window is a Public Good
+
+Every token in your skill competes with conversation context. Be ruthlessly concise.
+
+**Ask for each paragraph:**
+- Does Claude genuinely need this?
+- Could this be in `references/` instead of main SKILL.md?
+- Is this duplicating information Claude already knows?
+
+### 2. Progressive Disclosure
+
+Load information in layers:
+
+| Layer | When Loaded | Target Size | Content |
+|-------|-------------|-------------|---------|
+| **Metadata** | Always | 40-55 tokens | name + description |
+| **SKILL.md** | When triggered | <5k words | Instructions, patterns |
+| **Resources** | As needed | Variable | scripts/, references/, assets/ |
+
+### 3. Freedom Levels
+
+Match instruction specificity to error probability:
+
+**High Freedom** (text instructions)
+- For flexible approaches where multiple solutions work
+- Example: "Structure components for reusability"
+
+**Medium Freedom** (pseudocode/patterns)
+- For preferred patterns with some flexibility
+- Example: Show a pattern with `[CUSTOMIZE]` placeholders
+
+**Low Freedom** (specific scripts/templates)
+- For fragile operations where exact steps matter
+- Example: Exact wrangler.jsonc configuration for D1 binding
+
+---
+
+## Writing Effective Descriptions
+
+The description is **the most critical part** - it determines if your skill gets discovered.
+
+### Target: 250-350 Characters
+
+```yaml
+# Too short (loses context):
+description: "A skill for Tailwind" # ❌ 25 chars
+
+# Too long (wastes tokens):
+description: "This comprehensive skill provides detailed knowledge..." # ❌ 500+ chars
+
+# Just right:
+description: |
+ Build modern UIs with Tailwind v4 + shadcn/ui. Covers CSS variable theming,
+ component installation, dark mode, and semantic color tokens.
+
+ Use when: setting up Tailwind v4, adding shadcn components, fixing theme issues,
+ or troubleshooting "Cannot find module" errors.
+```
+
+### Two-Paragraph Structure
+
+**Paragraph 1**: What you can build + key features (active voice)
+**Paragraph 2**: When to use + error keywords for discovery
+
+### Description Checklist
+
+- [ ] Active voice ("Build X" not "This skill provides X")
+- [ ] Specific technologies named
+- [ ] 3-5 "Use when" scenarios
+- [ ] 2-3 distinctive error messages/keywords
+- [ ] No meta-commentary about the skill itself
+- [ ] 250-350 characters total
+
+### Bad vs Good Examples
+
+```yaml
+# ❌ Bad: Passive, vague, no discovery keywords
+description: |
+ This skill helps you with database operations. It provides patterns
+ for working with data and can be useful in many situations.
+
+# ✅ Good: Active, specific, discoverable
+description: |
+ Build type-safe database queries with Drizzle ORM and Cloudflare D1.
+ Covers schema definition, migrations, relations, and transaction patterns.
+
+ Use when: setting up D1 database, writing Drizzle schemas, debugging
+ "no such table" or "D1_ERROR" issues.
+```
+
+---
+
+## Skill Structure
+
+### Required Files
+
+```
+skills/my-skill/
+├── SKILL.md # Main documentation (required)
+└── README.md # Auto-trigger keywords (required)
+```
+
+### Optional Resources
+
+```
+skills/my-skill/
+├── scripts/ # Executable helpers
+│ └── setup.sh # Example: automated setup script
+├── references/ # Extended documentation
+│ └── api-guide.md # Loaded when user needs deep details
+└── assets/ # Templates, images
+ └── config.json # Template files for output
+```
+
+### When to Use Each
+
+**scripts/**: Deterministic tasks that must be exact
+- Database migrations
+- Project scaffolding
+- Configuration generation
+
+**references/**: Extended documentation too long for SKILL.md
+- Full API references
+- Comprehensive troubleshooting guides
+- Migration guides between versions
+
+**assets/**: Template files for output
+- Configuration file templates
+- Boilerplate code
+- Images/diagrams
+
+---
+
+## YAML Frontmatter
+
+### Required Fields
+
+```yaml
+---
+name: lowercase-hyphen-case
+description: |
+ [250-350 chars with "Use when:" section]
+---
+```
+
+### Optional Fields
+
+```yaml
+---
+name: my-skill
+description: |
+ [description]
+license: MIT
+metadata:
+ keywords: [tech, use-case, error-keyword]
+ last_verified: 2025-12-01
+allowed-tools:
+ - Bash
+ - Read
+ - Write
+---
+```
+
+### Field Guidelines
+
+- **name**: Lowercase, hyphens only, max 40 chars
+- **description**: Multi-line with | for proper formatting
+- **license**: Usually MIT for open skills
+- **metadata.keywords**: Improve discovery beyond description
+- **allowed-tools**: Restrict which tools skill can request (rare)
+
+---
+
+## Common Mistakes
+
+### 1. Description Too Vague
+
+```yaml
+# ❌ Won't be discovered
+description: "Helps with authentication"
+
+# ✅ Will be discovered
+description: |
+ Implement authentication with Clerk - React components, middleware,
+ and Cloudflare Workers integration with JWT verification.
+
+ Use when: adding auth to React apps, protecting API routes, or
+ troubleshooting "clerk/backend" import errors.
+```
+
+### 2. Duplicating Claude's Knowledge
+
+```yaml
+# ❌ Claude already knows JavaScript basics
+## Variables
+Use `const` for constants and `let` for variables...
+
+# ✅ Focus on what Claude might get wrong
+## Critical: Cloudflare Workers Differences
+- No `process.env` - use `env` parameter from fetch handler
+- No Node.js `fs` module - use R2 or KV for storage
+```
+
+### 3. Missing Error Keywords
+
+Skills are often triggered when users hit errors. Include common error messages:
+
+```yaml
+description: |
+ ...
+ Use when: troubleshooting "Cannot read properties of undefined",
+ "NEXT_REDIRECT" errors, or hydration mismatches.
+```
+
+### 4. Overly Rigid Instructions
+
+```markdown
+# ❌ Too rigid (breaks if API changes)
+Always call api.configure({ version: "2.1.0" }) first.
+
+# ✅ Flexible with rationale
+Configure the API client before making calls. The version should match
+your installed package version (check package.json).
+```
+
+### 5. No Production Validation
+
+Skills should be tested in real projects, not just theoretically correct:
+
+```markdown
+## Production Example
+
+Tested in [Project Name]:
+- Build time: 45 seconds
+- Errors prevented: 6/6 documented issues
+- Zero runtime errors after deployment
+```
+
+---
+
+## Token Efficiency
+
+### Measuring Efficiency
+
+Compare tokens used with vs without skill:
+
+| Metric | Without Skill | With Skill | Savings |
+|--------|---------------|------------|---------|
+| Setup tokens | ~15k | ~5k | 67% |
+| Errors hit | 2-3 | 0 | 100% |
+| Iterations | 3-4 | 1 | 75% |
+
+### Optimization Techniques
+
+1. **Move examples to references/**: Keep SKILL.md under 5k words
+2. **Use code blocks strategically**: One good example > three mediocre ones
+3. **Link don't duplicate**: Reference official docs instead of copying
+4. **Prune ruthlessly**: If Claude knows it, don't include it
+
+---
+
+## Testing Your Skill
+
+### Discovery Test
+
+Ask Claude Code naturally:
+```
+"Help me set up [technology your skill covers]"
+```
+
+Claude should propose using your skill. If not:
+- Check description has relevant keywords
+- Verify README.md has auto-trigger keywords
+- Ensure skill is symlinked to ~/.claude/skills/
+
+### Functionality Test
+
+Build a real project using only the skill's guidance:
+- Did you need to search for additional information?
+- Did you hit any errors the skill should have prevented?
+- Was any instruction unclear or wrong?
+
+### Verification Script
+
+```bash
+./scripts/check-metadata.sh <skill-name>
+```
+
+---
+
+## Quality Checklist
+
+Before committing a skill:
+
+- [ ] Name is lowercase-hyphen-case, max 40 chars
+- [ ] Description is 250-350 chars with "Use when:" section
+- [ ] SKILL.md under 5k words
+- [ ] All code examples tested and working
+- [ ] Package versions verified current
+- [ ] Known issues documented with sources (GitHub issues, etc.)
+- [ ] Production tested (not just theoretically correct)
+- [ ] README.md has auto-trigger keywords
+- [ ] Symlinked and discoverable
+
+---
+
+## References
+
+- **Official Spec**: https://github.com/anthropics/skills/blob/main/agent_skills_spec.md
+- **Our Standards**: `planning/claude-code-skill-standards.md`
+- **Checklist**: `ONE_PAGE_CHECKLIST.md`
+- **Example Skills**: `skills/tailwind-v4-shadcn/`, `skills/cloudflare-d1/`
+
+---
+
+## Quick Command Reference
+
+```bash
+# Create new skill
+/create-skill my-skill-name
+
+# Install skill
+./scripts/install-skill.sh my-skill-name
+
+# Verify metadata
+./scripts/check-metadata.sh my-skill-name
+
+# Check all skills
+./scripts/check-all-versions.sh
+
+# Generate marketplace manifest
+./scripts/generate-plugin-manifests.sh my-skill-name
+```