Package Claude Code skill for distribution via npm, GitHub, or direct sharing. Creates distributable archives with installation instructions and validation.
Package Claude Code skills for distribution via npm, GitHub, or direct archives. Creates complete packages with installation scripts, README, license, and validation.
/plugin marketplace add anton-abyzov/specweave/plugin install anton-abyzov-specweave-plugin-dev-plugins-specweave-plugin-dev@anton-abyzov/specweavePackage Claude Code skill for distribution via npm, GitHub, or direct sharing. Creates distributable archives with installation instructions and validation.
Distribution-Ready Packaging: Create shareable skill packages with installation scripts and documentation.
You are helping the user package a Claude Code skill for distribution to others.
npm install workflowBefore packaging, ensure skill is valid:
validate_before_package() {
local skill_path="$1"
echo "Validating skill before packaging..."
# Run validation (from skill-validate command)
if ! validate_skill "$skill_path"; then
echo "❌ Skill validation failed"
echo " Fix errors before packaging"
return 1
fi
echo "✅ Skill validation passed"
return 0
}
Collect information for package:
claude-skill-python-data-science)1.0.0)Example:
{
"name": "claude-skill-python-data-science",
"version": "1.0.0",
"description": "Python data science expert skill for Claude Code",
"author": "Your Name <email@example.com>",
"license": "MIT",
"repository": "https://github.com/username/claude-skill-python-data-science",
"keywords": ["claude", "skill", "python", "data-science", "pandas", "numpy"]
}
Standard package structure:
package-name/
├── README.md # Installation and usage
├── LICENSE # License file
├── package.json # NPM metadata (if NPM)
├── install.sh # Installation script
├── uninstall.sh # Uninstall script
├── skill/ # Skill files
│ └── SKILL.md # The actual skill
└── examples/ # Usage examples (optional)
└── example-conversation.md
Create structure:
create_package_structure() {
local skill_path="$1"
local package_name="$2"
local package_dir="$3"
# Create directories
mkdir -p "$package_dir/skill"
mkdir -p "$package_dir/examples"
# Copy skill
cp "$skill_path" "$package_dir/skill/SKILL.md"
echo "✅ Package structure created"
}
Comprehensive README template:
# [Skill Name]
[Brief description of what the skill does]
## Installation
### Personal Skills (Recommended)
```bash
# Clone or download this repository
git clone [repository-url]
# Run installation script
cd [package-name]
bash install.sh
Or manually:
# Copy skill to personal skills directory
mkdir -p ~/.claude/skills/[skill-name]
cp skill/SKILL.md ~/.claude/skills/[skill-name]/SKILL.md
# Copy skill to project skills directory
mkdir -p .claude/skills/[skill-name]
cp skill/SKILL.md .claude/skills/[skill-name]/SKILL.md
npm install -g [package-name]
This skill activates automatically when you mention:
You ask:
[Example question]
Skill provides: [Description of response]
You ask:
[Example question]
Skill provides: [Description of response]
[Bullet list of expertise areas]
bash uninstall.sh
Or manually:
rm -rf ~/.claude/skills/[skill-name]
[License name] - See LICENSE file for details
[Author name and contact]
[Contribution guidelines if applicable]
**Generate README**:
```bash
generate_readme() {
local package_dir="$1"
local skill_name="$2"
local description="$3"
local author="$4"
local license="$5"
cat > "$package_dir/README.md" <<EOF
# $skill_name
$description
## Installation
### Personal Skills (Recommended)
\`\`\`bash
# Clone or download this repository
git clone [repository-url]
# Run installation script
cd [package-name]
bash install.sh
\`\`\`
Or manually:
\`\`\`bash
# Copy skill to personal skills directory
mkdir -p ~/.claude/skills/$skill_name
cp skill/SKILL.md ~/.claude/skills/$skill_name/SKILL.md
\`\`\`
## Activation
This skill activates automatically when needed.
## License
$license
## Author
$author
EOF
echo "✅ README.md generated"
}
Universal installation script (install.sh):
#!/bin/bash
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Skill configuration
SKILL_NAME="[skill-name]"
SKILL_DISPLAY_NAME="[Skill Display Name]"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "INSTALLING: $SKILL_DISPLAY_NAME"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Check if skill already installed
if [ -d "$HOME/.claude/skills/$SKILL_NAME" ]; then
echo -e "${YELLOW}⚠️ Skill already installed at: ~/.claude/skills/$SKILL_NAME${NC}"
echo ""
read -p "Overwrite existing installation? (y/N) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Installation cancelled."
exit 0
fi
rm -rf "$HOME/.claude/skills/$SKILL_NAME"
fi
# Create skills directory if needed
mkdir -p "$HOME/.claude/skills"
# Copy skill
echo "📦 Installing skill..."
mkdir -p "$HOME/.claude/skills/$SKILL_NAME"
cp skill/SKILL.md "$HOME/.claude/skills/$SKILL_NAME/SKILL.md"
# Validate installation
if [ -f "$HOME/.claude/skills/$SKILL_NAME/SKILL.md" ]; then
echo -e "${GREEN}✅ Installation successful!${NC}"
echo ""
echo "📁 Installed to: ~/.claude/skills/$SKILL_NAME/"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "NEXT STEPS"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "1. 🔄 Restart Claude Code to load the skill"
echo "2. 🧪 Test the skill by asking a relevant question"
echo "3. 📚 See README.md for usage examples"
echo ""
echo "To uninstall: bash uninstall.sh"
echo ""
else
echo -e "${RED}❌ Installation failed${NC}"
exit 1
fi
Generate install.sh:
generate_install_script() {
local package_dir="$1"
local skill_name="$2"
local skill_display_name="$3"
cat > "$package_dir/install.sh" <<'INSTALL_SCRIPT'
#!/bin/bash
set -e
# [Installation script content from above]
INSTALL_SCRIPT
# Make executable
chmod +x "$package_dir/install.sh"
echo "✅ install.sh generated"
}
Uninstallation script (uninstall.sh):
#!/bin/bash
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Skill configuration
SKILL_NAME="[skill-name]"
SKILL_DISPLAY_NAME="[Skill Display Name]"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "UNINSTALLING: $SKILL_DISPLAY_NAME"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Check if skill is installed
if [ ! -d "$HOME/.claude/skills/$SKILL_NAME" ]; then
echo -e "${YELLOW}⚠️ Skill not found at: ~/.claude/skills/$SKILL_NAME${NC}"
echo ""
echo "Nothing to uninstall."
exit 0
fi
# Confirm uninstallation
echo "This will remove: ~/.claude/skills/$SKILL_NAME/"
echo ""
read -p "Continue with uninstallation? (y/N) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Uninstallation cancelled."
exit 0
fi
# Remove skill
rm -rf "$HOME/.claude/skills/$SKILL_NAME"
# Verify removal
if [ ! -d "$HOME/.claude/skills/$SKILL_NAME" ]; then
echo -e "${GREEN}✅ Uninstallation successful!${NC}"
echo ""
echo "Skill removed from: ~/.claude/skills/$SKILL_NAME/"
echo ""
echo "🔄 Restart Claude Code to complete uninstallation"
else
echo -e "${RED}❌ Uninstallation failed${NC}"
exit 1
fi
Common licenses:
MIT License (most permissive):
MIT License
Copyright (c) [year] [author]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
NPM package.json:
{
"name": "claude-skill-[skill-name]",
"version": "1.0.0",
"description": "[Skill description]",
"main": "index.js",
"scripts": {
"postinstall": "bash install.sh",
"preuninstall": "bash uninstall.sh"
},
"keywords": [
"claude",
"claude-code",
"skill",
"[domain]"
],
"author": "[Author Name] <[email]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/[username]/[repo].git"
},
"bugs": {
"url": "https://github.com/[username]/[repo]/issues"
},
"homepage": "https://github.com/[username]/[repo]#readme",
"files": [
"skill/",
"install.sh",
"uninstall.sh",
"README.md",
"LICENSE"
],
"engines": {
"node": ">=14.0.0"
}
}
For direct distribution:
create_archive() {
local package_dir="$1"
local package_name="$2"
local version="$3"
# Archive filename
archive_name="${package_name}-${version}.tar.gz"
# Create archive
tar -czf "$archive_name" -C "$(dirname "$package_dir")" "$(basename "$package_dir")"
# Verify archive
if [ -f "$archive_name" ]; then
echo "✅ Archive created: $archive_name"
echo ""
echo "Archive contents:"
tar -tzf "$archive_name" | head -20
echo ""
echo "Distribution ready!"
else
echo "❌ Failed to create archive"
return 1
fi
}
Include installation guide:
# Distribution Instructions
## For NPM
1. Publish to npm:
```bash
npm publish
npm install -g [package-name]
Push to GitHub:
git init
git add .
git commit -m "Initial commit"
git remote add origin [repository-url]
git push -u origin main
Create release:
Users install with:
git clone [repository-url]
cd [package-name]
bash install.sh
Share the .tar.gz archive
Users install with:
tar -xzf [package-name]-1.0.0.tar.gz
cd [package-name]
bash install.sh
After installation, users should:
## Packaging Examples
### Example 1: NPM Package
**Input**:
- Skill: `python-data-science`
- Distribution: NPM
- Version: 1.0.0
- License: MIT
**Output structure**:
claude-skill-python-data-science/ ├── README.md ├── LICENSE ├── package.json ├── install.sh ├── uninstall.sh ├── skill/ │ └── SKILL.md └── examples/ └── example-conversation.md
**package.json**:
```json
{
"name": "claude-skill-python-data-science",
"version": "1.0.0",
"description": "Python data science expert skill for Claude Code",
"author": "Your Name <email@example.com>",
"license": "MIT",
"keywords": ["claude", "skill", "python", "data-science"]
}
Publishing:
npm publish
Input:
kubernetes-expertgithub.com/username/claude-skill-k8sSetup:
# Initialize repo
git init
git add .
git commit -m "Initial commit: Kubernetes expert skill"
# Push to GitHub
git remote add origin https://github.com/username/claude-skill-k8s.git
git push -u origin main
# Create release
gh release create v1.0.0 --title "v1.0.0" --notes "Initial release"
Users install:
git clone https://github.com/username/claude-skill-k8s.git
cd claude-skill-k8s
bash install.sh
Input:
project-docs-helperproject-docs-helper-1.0.0.tar.gzCreate archive:
# Package structure already created
tar -czf project-docs-helper-1.0.0.tar.gz project-docs-helper/
# Share archive via email, shared drive, etc.
Users install:
tar -xzf project-docs-helper-1.0.0.tar.gz
cd project-docs-helper
bash install.sh
Before distributing, verify:
Step-by-step:
# 1. Login to npm
npm login
# 2. Validate package.json
npm pack --dry-run
# 3. Publish
npm publish
# 4. Verify
npm view [package-name]
Scope packages (recommended):
{
"name": "@your-username/claude-skill-python-data-science",
...
}
Package includes:
Distribution methods:
npm install -g)Remember: Test installation on clean system before distributing!