NPM-agentskills:將AI代理文件與NPM套件打包
NPM-agentskills是一個新框架,讓函式庫作者能直接將AI代理文件打包進他們的NPM套件中。這使得AI程式設計助手在開發者使用函式庫時,能自動發現並利用關於API、模式和最佳實踐的上下文資訊。
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.
Framework-agnostic skill discovery and export for AI coding agents
License
Uh oh!
There was an error while loading. Please reload this page.
onmax/npm-agentskills
Folders and files
Latest commit
History
Repository files navigation
npm-agentskills
Bundle agent skills with your npm packages to help AI assistants understand your library.
What Are Agent Skills?
Agent Skills provide contextual documentation that AI coding assistants load automatically. When developers use your library, their AI agent reads your skill to deliver accurate guidance on your API, patterns, and best practices.
Skills follow the agentskills open format, supported by Claude Code, GitHub Copilot, Cursor, and other AI coding tools.
This package enables library authors to bundle skills with their npm packages. When users install your package, the skills are discovered and exported to the appropriate location for their AI agent.
Installation
For Library Authors: Bundling Skills
Add Skills to Your Package
Add an agentskills field to your package.json that points to skill directories:
Each skill directory must contain a SKILL.md file with YAML frontmatter:
SKILL.md Format
Your SKILL.md file requires YAML frontmatter with name, description, and license:
Writing Effective Descriptions
The description field is critical. AI agents use it to decide when to activate your skill automatically. Make it specific and actionable.
Good descriptions:
Poor descriptions:
Content Structure
Organize content by task to help AI agents find relevant information quickly:
Code Examples
Include practical, copy-paste examples with file path labels:
Reference Files
Split long documentation into focused reference files:
Reference them from SKILL.md using clear instructions:
Module Configuration
Document all available options with defaults and types:
Auto-imports
List what gets auto-imported to help AI agents understand available utilities:
Integration Patterns
Show how your module works with common tools and patterns:
TypeScript Types
Document exported types for better IDE support:
Multiple Skills Per Package
You can bundle multiple skills for different use cases:
For End Users: Installing Skills
Nuxt Applications (Automatic)
Add the module to your Nuxt config. Skills are automatically discovered from node_modules and exported when you run nuxi prepare or nuxi dev:
The module scans your dependencies for packages with agentskills fields and exports their skills to project-local directories.
Other Frameworks (CLI)
Run the CLI after installing packages that contain skills:
Add this to your postinstall script for automatic exports:
Supported Agents
All paths are project-local, keeping skills scoped to your project rather than polluting global configuration.
Cross-Agent Compatibility
Many agents read from multiple directories for compatibility:
If you target claude, your skills will work with Goose and OpenCode automatically.
Programmatic API
Use the core functions directly in build tools or custom integrations:
CLI Reference
How It Works
For Nuxt, this happens automatically during nuxi prepare. For other frameworks, you run the CLI manually or via npm scripts.
Checklist for Module Authors
Before publishing your package with skills:
Testing Your Skills Locally
Create a test project and verify skills are discovered correctly:
Best Practices
Keep Skills Updated
Update your skills when you:
Focus on Common Tasks
Document the most frequent use cases first:
Use Clear Language
Write for AI agents to parse effectively:
Avoid External Dependencies
Keep all documentation local:
Examples from the Ecosystem
Reference these Nuxt modules for skill patterns:
FAQ
Q: Can I include multiple skills in one package?
Yes. Add multiple entries to the skills array in your package.json:
Q: Should I commit skills to my repository?
Yes. Skills are part of your package's documentation. Users shouldn't need extra packages to get AI assistance with your module.
Q: How do I test skills with my AI agent?
Export skills to your agent's directory and ask questions about your module. Verify the AI provides accurate guidance based on your skill content.
Q: Can skills reference external URLs?
Avoid external links. AI agents work best with local markdown files. Use references/ to split content into focused files instead.
Q: What if my module has many features?
Split documentation across multiple reference files or create separate skills for distinct feature sets. Keep SKILL.md focused on common tasks.
Q: Do skills work with all AI agents?
Skills use the agentskills open format, supported by Claude Code, GitHub Copilot, Cursor, and other AI coding tools. The export paths are standardized across agents.
License
MIT
About
Framework-agnostic skill discovery and export for AI coding agents
Resources
License
Uh oh!
There was an error while loading. Please reload this page.
Stars
Watchers
Forks
Releases
Packages
0
Languages
Footer
Footer navigation
相關文章