Show HN:透過 NPM 發布 AI 代理技能
一個新的模板允許開發者將 AI 代理技能(例如用於 Claude Code、Cursor 和 Windsurf 的技能)作為標準 NPM 套件進行分發。這實現了版本控制、依賴管理和更輕鬆的分發,將技能視為真正的軟體成品。
Navigation Menu
Search code, repositories, users, issues, pull requests...
Provide feedback
We read every piece of feedback, and take your input very seriously.
Saved searches
Use saved searches to filter your results more quickly
To see all available qualifiers, see our documentation.
A template for creating and publishing Claude Code skills as npm packages
License
Uh oh!
There was an error while loading. Please reload this page.
RaoHai/agent-skill-npm-boilerplate
Folders and files
Latest commit
History
Repository files navigation
Agent Skill NPM Boilerplate
Distribute AI agent skills like any other npm package
AI coding tools (Claude Code, Cursor, Windsurf) support custom "skills" - reusable instructions that extend agent capabilities. But distributing them means manual file copying, no versioning, and painful updates.
This template lets you publish skills to npm:
Why this matters: Skills become proper software artifacts with semantic versioning, dependency management, private registries, and global discovery. Same infrastructure that distributes React and Express.
Quick start: Fork this template, edit SKILL.md, run npm publish. Your skill is now installable worldwide.
Supports: Claude Code, Cursor, Windsurf, and any tool following similar skill patterns. See MULTI-TOOL-SUPPORT.md.
💡 Why npm for Skills?
Manual skill distribution requires downloading files, copying to ~/.claude/skills/, and repeating for every update. No versioning, no dependency management, no discovery.
npm solves this:
Core benefits:
Skills become first-class software artifacts, using the same infrastructure as React, Express, and millions of other packages.
✨ Features
🚀 Quick Start
Option 1: Use as GitHub Template (Recommended)
This is a GitHub Template Repository. The easiest way to use it:
Option 2: Clone Directly
📁 Project Structure
🎨 Customization Guide
Step 1: Update package.json
Replace the following placeholders:
About npm scopes:
Step 2: Update SKILL.md
Edit SKILL.md and replace placeholders:
Step 3: Update .claude-skill.json
Step 4: Add Your Logic
Edit the "Instructions" section in SKILL.md:
Step 5: Test Locally
Step 6: Publish to npm
📖 Skill Development Best Practices
1. Write Clear Descriptions
The description field in SKILL.md is crucial - it determines when Claude uses your skill:
2. Use Progressive Disclosure
Keep SKILL.md under 500 lines. Put detailed content in separate files:
Claude will only load these files when needed, saving context.
3. Limit Tool Access
Use allowed-tools to restrict what your skill can do:
4. Include Examples
Show concrete examples in your SKILL.md:
📦 Installation Behavior
Global Installation (Recommended)
Installs to: ~/.claude/skills/your-skill-name/
Available: Across all projects for the current user
Project-Level Installation
Installs to: .claude/skills/your-skill-name/
Available: Only in this project (can be committed to git)
Priority Order
When multiple skills exist:
🔧 Advanced Features
Custom Hooks
Run scripts during installation:
Multiple Files
Support rich documentation:
Configuration
Let users customize your skill:
🐛 Troubleshooting
Skill Not Appearing
Permission Errors
Skill Not Triggering
📚 Resources
🤝 Contributing
Contributions are welcome! Please:
See CONTRIBUTING.md for details.
📄 License
This template is MIT licensed. Skills you create from this template can use any license you choose.
💡 Examples
Skills built with this template:
(Add your skill here after publishing!)
🙋 Support
🌟 Show Your Support
If you find this template helpful:
Made with ❤️ for the Claude Code community
About
A template for creating and publishing Claude Code skills as npm packages
Resources
License
Contributing
Uh oh!
There was an error while loading. Please reload this page.
Stars
Watchers
Forks
Releases
Packages
0
Languages
Footer
Footer navigation
相關文章