npm Publishing for Agent Skills
Configure an npm package to bundle and publish agent skills following the skills-npm convention, so consumers can symlink them automatically with skills-npm.
Role
You are an expert in npm package publishing, the agentskills.io specification, and the skills-npm distribution convention. You understand how to structure package.json, what belongs in the files array, and how skills should be bundled alongside npm packages.
- Configure
package.jsoncorrectly for publishing skills to npm - Ensure skills are included in the published package via the
filesfield - Follow semantic versioning and provide accurate package metadata
- Guide consumers on how to install and activate the bundled skills
Workflow
-
Check the skills directory — Confirm a
skills/directory exists at the package root and contains at least one skill subdirectory, each with aSKILL.mdfile:skills/ └── <skill-name>/ └── SKILL.mdIf skills are missing, create them first using the
writing-skillsskill. -
Create or update
package.json— Ensure the following fields are present and correct:{ "name": "<package-name>", "version": "1.0.0", "description": "<description>", "license": "<SPDX-identifier>", "repository": { "type": "git", "url": "git+https://github.com/<owner>/<repo>.git" }, "homepage": "https://github.com/<owner>/<repo>#readme", "bugs": { "url": "https://github.com/<owner>/<repo>/issues" }, "keywords": ["skills", "agent-skills", "agentskills"], "files": [ "skills" ] }name: use a scoped name (@org/package) when publishing under an organisationfiles: must include"skills"so the skills directory is included in the published tarballkeywords: includeagent-skillsandagentskillsto improve discoverability
-
Update
.gitignore— Add the following entries to prevent committing symlinks created byskills-npmin consuming projects, and to ignore installed dependencies:node_modules/ skills/npm-* -
Verify the publish tarball — Run a dry-run publish to confirm the
skills/directory is included:npm pack --dry-runConfirm the output lists
skills/<skill-name>/SKILL.mdfor each skill. -
Update the README — Add installation and usage instructions for consumers. At minimum, include an
## npmsection with:-
Installation:
npm install <package-name> -
Skill symlink:
npx skills-npm -
A
"prepare"script inpackage.jsonto automate symlinking on install, for example:{ "scripts": { "prepare": "npx skills-npm" } }
-
-
Publish the package — Authenticate with the npm registry and publish:
npm login npm publish --access publicFor scoped packages,
--access publicis required unless publishing to a private registry. -
Verify the published package — After publishing, confirm the skills are accessible:
npm pack <package-name> --dry-run npx skills-npm
Notes
- The
filesfield inpackage.jsonacts as an allowlist. Without"skills"in it, theskills/directory will not be included in the published tarball even if it exists locally. - Skills discovered via the
skills-npmconvention are symlinked toskills/npm-<package-name>-<skill-name>in the consuming project. Theskills/npm-*pattern in.gitignoreprevents these symlinks from being committed. - If the package is not yet published, consumers can reference it locally using
npm linkor a relative path inpackage.jsondependencies. - Use
npm version patch|minor|majorto bump the version before publishing updates. - Verify that all skills pass the
writing-skillschecklist before publishing.
Scan to join WeChat group