description: Validate and package a Claude Code Skill into a distributable zip file category: skills allowed-tools:
- Bash
- Read
Package Skill for Distribution
Validate and package a Claude Code Skill into a distributable zip file
Instructions
This command validates and packages an existing skill for distribution. Follow these steps:
Phase 1: Skill Selection
-
Identify the skill to package
- Determine skill location (personal or project)
- Verify skill exists and has SKILL.md
- Check current state of the skill
-
Pre-package checks
- Ensure all TODOs are completed
- Verify documentation is finalized
- Check that examples are tested
Phase 2: Validation
-
Run quick validation
- Use the quick_validate.py script
- Check YAML frontmatter validity
- Verify required fields (name, description)
- Check for prohibited characters
- Validate directory structure
-
Run comprehensive validation (if quick validation passes)
- Use validate-skill.sh for detailed checks
- Verify all 10 validation phases
- Check word counts for progressive disclosure
- Validate file references
- Test script syntax
-
Review validation results
- Fix any critical errors
- Address warnings if needed
- Re-validate after fixes
Phase 3: Packaging
-
Execute packaging script
python .claude/commands/skills/scripts/package_skill.py <skill-path> [output-dir] -
Package creation process
- Script validates again before packaging
- Creates zip file with skill name
- Includes all files while maintaining structure
- Excludes hidden files and
__pycache__
-
Verify package
- Check zip file created successfully
- Note file count and size
- Confirm ready for distribution
Phase 4: Distribution Options
-
Personal distribution
- Share zip file directly
- Upload to file sharing service
- Include installation instructions
-
Team distribution
- Add to shared repository
- Upload to team storage
- Document in team wiki
-
Public distribution
- Upload to skill marketplace (if available)
- Share on GitHub
- Add to community repositories
Command Execution Flow
Step 1: Locate Skill
# Personal skills
ls ~/.claude/skills/
# Project skills
ls .claude/skills/
Step 2: Quick Validation
python .claude/commands/skills/scripts/quick_validate.py <skill-path>
Expected output:
- ✅ Skill validation passed!
- Or specific error messages to fix
Step 3: Comprehensive Validation (Optional)
.claude/commands/skills/scripts/validate-skill.sh <skill-path>
Expected output:
- Detailed 10-phase validation report
- Score and recommendations
Step 4: Package Creation
# Package to current directory
python .claude/commands/skills/scripts/package_skill.py ~/.claude/skills/my-skill
# Package to specific directory
python .claude/commands/skills/scripts/package_skill.py ~/.claude/skills/my-skill ./dist
Expected output:
🔍 Validating skill...
✅ Skill validation passed!
📦 Creating package...
Added: my-skill/SKILL.md
Added: my-skill/scripts/helper.py
Added: my-skill/references/api-docs.md
...
✅ Successfully packaged skill!
📦 Package: ./my-skill.zip
📊 Files: 8
💾 Size: 0.15 MB
📤 Ready for distribution!
Validation Criteria
The packaging script checks:
Required Elements
- SKILL.md exists
- Valid YAML frontmatter
- Name and description fields present
- No TODO markers in description
Quality Checks
- Description in third-person format
- Description mentions when to use skill
- No angle brackets in description
- Word count within limits (<5,000 for SKILL.md)
Structure Validation
- Proper directory organization
- Scripts are executable
- File references are valid
- No duplicate content between SKILL.md and references/
Distribution Guidelines
Installation Instructions Template
Include with your packaged skill:
# Installing {{SKILL_NAME}}
## Personal Installation
1. Download {{skill-name}}.zip
2. Extract to ~/.claude/skills/
3. Restart Claude Code
## Project Installation
1. Extract to .claude/skills/ in your project
2. Commit to version control
3. Team members get skill on pull
## Verification
After installation, test with:
"Use the {{SKILL_NAME}} skill to {{example task}}"
Version Management
For skill updates:
- Update skill files
- Document changes in SKILL.md
- Increment version if using versioning
- Re-package with same process
- Distribute new package
Troubleshooting
Validation Fails
Issue: Package script reports validation errors
Solution:
- Run quick_validate.py to see specific errors
- Fix reported issues
- Re-run validation
- Try packaging again
Package Not Created
Issue: Zip file not generated
Possible causes:
- Validation failed (fix errors first)
- No write permissions (check directory)
- Disk space issues (check available space)
Scripts Not Executable
Issue: Warning about non-executable scripts
Solution:
chmod +x <skill-path>/scripts/*.py
chmod +x <skill-path>/scripts/*.sh
Large Package Size
Issue: Package is very large
Solutions:
- Move large docs to references/ directory
- Remove unnecessary files
- Compress images if included
- Use .gitignore patterns
Best Practices
- Complete all TODOs before packaging
- Test the skill thoroughly before distribution
- Document dependencies clearly
- Include examples that work
- Version your skills for updates
- Test installation on clean system
- Include uninstall instructions if complex
Examples
Example 1: Package Simple Skill
# Validate first
python .claude/commands/skills/scripts/quick_validate.py ~/.claude/skills/commit-helper
# Package if valid
python .claude/commands/skills/scripts/package_skill.py ~/.claude/skills/commit-helper
# Result: commit-helper.zip created
Example 2: Package to Distribution Directory
# Create dist directory
mkdir -p ~/skill-packages
# Package to specific location
python .claude/commands/skills/scripts/package_skill.py \
~/.claude/skills/pdf-processor \
~/skill-packages
# Result: ~/skill-packages/pdf-processor.zip
Example 3: Fix and Re-package
# Initial validation fails
python .claude/commands/skills/scripts/quick_validate.py ~/.claude/skills/my-skill
# ❌ Description contains TODO markers
# Fix the issue
# Edit SKILL.md to complete TODOs
# Re-validate
python .claude/commands/skills/scripts/quick_validate.py ~/.claude/skills/my-skill
# ✅ Skill validation passed!
# Package
python .claude/commands/skills/scripts/package_skill.py ~/.claude/skills/my-skill
# ✅ Successfully packaged!
Output Format
The command provides clear feedback:
📦 Packaging skill: {{skill-name}}
🔍 Validating skill...
[Validation results]
📦 Creating package...
[File listing]
✅ Successfully packaged skill!
📦 Package: {{path/to/package.zip}}
📊 Files: {{count}}
💾 Size: {{size}} MB
📤 Ready for distribution!
Next Steps
After packaging:
- Test installation on another system
- Share with team or community
- Document in skill catalog
- Gather feedback for improvements
- Plan updates based on usage
Related Commands
/skills:build-skill- Create new skills/skills:init-skill- Initialize skill from template/skills:validate-skill- Run validation only
Scripts Used
package_skill.py- Main packaging scriptquick_validate.py- Fast validationvalidate-skill.sh- Comprehensive validation
Your skill is now ready for distribution! 📦
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.