Creating Custom Skills
Creating Custom Skills
Section titled “Creating Custom Skills”Learn how to create custom skills that extend PopKit’s capabilities for your specific workflows.
Skill Structure
Section titled “Skill Structure”Skills are defined in SKILL.md format with three main sections:
- Frontmatter: YAML metadata
- Description: What the skill does
- Implementation: Instructions for Claude
Basic Skill Template
Section titled “Basic Skill Template”---name: my-custom-skilldescription: Brief description of what the skill doescategory: customversion: 1.0.0---
# My Custom Skill
Detailed description of the skill's purpose and use cases.
## Usage
How to invoke and use the skill.
## Implementation
Detailed step-by-step instructions for Claude to execute the skill.
## Examples
Real-world usage examples.Skill Categories
Section titled “Skill Categories”Organize skills into categories:
core: Fundamental operationsgit: Git and version controlanalysis: Code analysis and inspectionworkflow: Development workflowscustom: User-defined skills
Frontmatter Options
Section titled “Frontmatter Options”---name: skill-name # Required: Unique identifierdescription: Short description # Required: One-line summarycategory: custom # Required: Category nameversion: 1.0.0 # Required: Semantic versionauthor: Your Name # Optional: Creator namecontext: fork # Optional: Run in isolated contexttools: # Optional: Tool permissions - Read - Write - Bash(npm test*)---Adding Tool Permissions
Section titled “Adding Tool Permissions”Control what the skill can do:
tools: - Read # Read files - Write # Write files - Grep # Search files - Glob # Find files - Bash(git status) # Exact command - Bash(npm test*) # Command with args - Bash(pytest *) # Any pytest commandForked Context Skills
Section titled “Forked Context Skills”For expensive operations, use forked context:
---name: expensive-analysisdescription: Deep code analysiscontext: fork # Runs in isolated context---When to use fork:
- Embedding generation
- Large-scale analysis
- Web research
- One-time operations
Skill Installation
Section titled “Skill Installation”Local Skills (Project-Specific)
Section titled “Local Skills (Project-Specific)”Create in .claude/skills/:
.claude/└── skills/ └── my-skill/ └── SKILL.mdPlugin Skills (Reusable)
Section titled “Plugin Skills (Reusable)”Create in plugin package:
packages/my-plugin/└── skills/ └── my-skill/ └── SKILL.mdTesting Skills
Section titled “Testing Skills”Manual Testing
Section titled “Manual Testing”/skill invoke my-custom-skillAutomated Testing
Section titled “Automated Testing”Create test file in skills/tests/:
def test_my_skill(): """Test skill functionality""" # Test implementation assert skill_works()Best Practices
Section titled “Best Practices”- Clear Names: Use descriptive, hyphenated names
- Good Descriptions: One-line summary of purpose
- Detailed Instructions: Step-by-step for Claude
- Real Examples: Show actual usage scenarios
- Minimal Permissions: Only request tools needed
- Version Control: Use semantic versioning
- Test Thoroughly: Verify skill works as expected
Example: Custom Code Review Skill
Section titled “Example: Custom Code Review Skill”---name: review-securitydescription: Security-focused code reviewcategory: analysisversion: 1.0.0tools: - Read - Grep - Bash(grep -r *)---
# Security Code Review
Performs security-focused code review looking for common vulnerabilities.
## Usage
Invoke this skill when reviewing code for security issues:
\`\`\`bash/skill invoke review-security\`\`\`
## Implementation
1. **Scan for Sensitive Data** - Search for API keys, tokens, passwords - Check for hardcoded credentials - Look for exposed secrets
2. **Check Input Validation** - Identify user input points - Verify sanitization - Check for SQL injection risks
3. **Review Authentication** - Check authentication logic - Verify authorization checks - Look for session issues
4. **Generate Report** - List vulnerabilities found - Prioritize by severity - Suggest fixes
## Examples
\`\`\`bash
# Review current changes
/skill invoke review-security
# Review specific file
/skill invoke review-security src/auth.js\`\`\`Next Steps
Section titled “Next Steps”- Learn about Agent Configuration
- Explore Hook Development
- Review existing skills in PopKit packages
Troubleshooting
Section titled “Troubleshooting”Skill Not Found
Section titled “Skill Not Found”Symptom: /skill invoke says skill doesn’t exist
Solution:
- Check file name is
SKILL.md - Verify frontmatter
namefield - Ensure in
.claude/skills/or pluginskills/directory - Restart Claude Code (for plugin skills)
Permission Errors
Section titled “Permission Errors”Symptom: Skill can’t access tools
Solution:
- Add required tools to
toolsfield - Use wildcard patterns:
Bash(command *) - Check tool names match exactly
Context Issues
Section titled “Context Issues”Symptom: Skill loses context or runs slowly
Solution:
- Consider using
context: fork - Reduce tool permissions
- Optimize implementation steps