Skip to content

RFC: Standardize npm/JavaScript Package Distribution #81

@onmax

Description

@onmax

Tip

This proposal complements the filesystem discussions in #63 and #27 by providing a distribution mechanism for the JavaScript ecosystem.

Context & Problem

The current Agent Skills specification defines the format of SKILL.md files but does not standardize how these skills are distributed to developers.

Currently, there is no standard way to:

  1. Bundle skills alongside the code they document.
  2. Auto-discover skills installed via package managers.
  3. Ensure skills stay version-locked with the library code.

Related: #27, #63, #9

Proposal

Add an optional agentskills field to package.json. This allows library authors to declare the skills contained within their npm packages.

Schema Definition

{
  "name": "my-library",
  "agentskills": {
    "skills": [
      { "name": "my-skill", "path": "./skills/my-skill" }
    ]
  },
  "files": ["dist", "skills"]
}
  • name: Lowercase, hyphenated unique identifier for the skill.
  • path: Relative path from package root to directory containing SKILL.md.

Benefits

  1. Version Locking: Skills are versioned with the code. Install v2.0.0 of a library, get v2.0.0 skills.
  2. Single Install: npm install my-library installs both the code and the agent instructions.
  3. Infrastructure: Leverages existing npm caching, distribution, and security scanning.
  4. Auto-Discovery: Agents can scan node_modules to find all available capabilities.

Reference Implementation

I have built a working implementation: npm-agentskills.

Features:

  • Scans node_modules for the agentskills field
  • Exports skills to agent-specific directories
  • CLI: agentskills list and agentskills export --target <agent>
  • Nuxt module for automatic export on nuxi prepare
  • Programmatic API for custom integrations

Real-world Example:
onmax/nuxt-better-auth#58

Related

Supported Targets

Agent Target Path
Claude .claude/skills/
GitHub Copilot .github/skills/
Cursor .cursor/skills/
Codex .codex/skills/
OpenCode .opencode/skill/
Amp .agents/skills/
Goose .goose/skills/

Ecosystem & Compatibility

Future Scope

While this proposal focuses on npm/package.json, the pattern is applicable to other ecosystems:

  • Rust: Cargo.toml metadata
  • Python: pyproject.toml metadata
  • Deno/Bun: Compatible with package.json usage

Metadata

Metadata

Assignees

No one assigned

    Labels

    distributionRelated to distributing skills.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions