npm-package
Skill3 starsChanged 3 months agoMITView on GitHub
Practical, human-friendly guidance for building, testing, securing, versioning, and publishing npm packages. Use this skill for libraries, CLIs, SDKs, component packages, or when the user mentions package.json, publishing, semver, build tools, or audits.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- medy-gribkov/arcanatheir own version, first seen Mar 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- medy-gribkov/arcana★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- pern-stackSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Don't scaffold until the key decisions are clear.
- Very specific: line 21
Test framework preference (Vitest/Jest/node:test)
- Very specific: line 25
If the user asks you to pick defaults, recommend a pragmatic stack and list choices so they can veto.
- Distinctive: line 29
After intake, pick the skeleton and read the most relevant reference:
- Very specific: line 40
Read references/testing.md and aim for three practical checks:
- Very specific: line 46
Run scripts/preflight.py helpers to catch common packaging mistakes.
- Very specific: line 52
Run npm audit and interpret results (separate dev-only issues from runtime risks).
- Very specific: line 53
Keep lockfiles, prefer npm ci in CI, avoid risky postinstall scripts, and limit transitive deps where possible.
- Distinctive: line 55
Prefer OIDC-based CI publishing and ephemeral tokens over long-lived repo secrets.
- Distinctive: line 58
If asked to assess security, run the tooling and report findings with severity and concrete fixes, separating package code issues from …
- Very specific: line 62
Treat semver as a contract.
- Distinctive: line 74
Ask first, scaffold second: short, targeted questions avoid wasted work.
- Distinctive: line 76
Verify facts before stating them (versions, advisories, metrics).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
npm Package Builder
Packages have many consumers and environments; early choices (module format, exports, deps, types) shape future compatibility. Start by understanding who will use the package, then pick the shape, then write code.
Phase 0 — Intake (do this before scaffolding)
Don't scaffold until the key decisions are clear. Ask the user a short, batched set of questions (or offer sensible defaults they can accept).
See references/intake-questions.md for the full question bank. Minimum questions to resolve:
- Package name and scope (public vs private)
- TypeScript or JavaScript
- Target runtimes (Node, browser, isomorphic, CLI, framework)
- Module format (ESM-only or dual ESM+CJS)
- Runtime dependency policy (zero-dep goal or not)
- Test framework preference (Vitest/Jest/node:test)
- Node version floor (e.g.
>=20) - Release flow (manual publish / Changesets / semantic-release)
If the user asks you to pick defaults, recommend a pragmatic stack and list choices so they can veto. If an existing package needs review, run scripts/preflight.py first and use references/checklist.md to triage issues.
Phase 1 — Shape the package
After intake, pick the skeleton and read the most relevant reference:
references/project-setup.md—package.jsonfields,exports,files,sideEffects,engines, dep classification.references/backend-packages.md— Node libraries and CLI patterns.references/frontend-packages.md— component libraries, peer deps, tree-shaking.references/build-and-bundling.md— tsup/rollup/unbuild decisions.
Guideline: Node-targeted libraries usually shouldn't bundle dependencies; browser-facing packages should be tree-shakeable and avoid bundling peer deps.
Phase 2 — Correctness: types, tests, smoke tests
Read references/testing.md and aim for three practical checks:
- Unit tests covering the public API.
- Type tests for TypeScript packages (
expectTypeOf/tsd). - Install smoke test:
npm packthe package, install into a temporary project, and import via bothrequire()andimportto validateexportsand published files (scripts/smoke_test.sh).
Run scripts/preflight.py helpers to catch common packaging mistakes.
Phase 3 — Security and supply chain
Security is mandatory for published packages. Key checks:
- Run
npm auditand interpret results (separate dev-only issues from runtime risks). - Keep lockfiles, prefer
npm ciin CI, avoid riskypostinstallscripts, and limit transitive deps where possible. - Review
npm pack --dry-runto ensure only intended files ship; run secret scanning before publish. - Prefer OIDC-based CI publishing and ephemeral tokens over long-lived repo secrets; enable 2FA on the npm account.
- Harden code at public boundaries and provide
SECURITY.mdand a clear patch/release plan.
If asked to assess security, run the tooling and report findings with severity and concrete fixes, separating package code issues from dependency issues.
Phase 4 — Release
Treat semver as a contract. Prepare consumer-focused changelogs and use npm publish --dry-run to inspect the tarball before publishing. Use prerelease tags (--tag next) for non-GA releases and prefer deprecation over unpublishing.
Automate releases from CI if the project owner approves the workflow and permissions; otherwise keep publishing manual. Always run the final gate: references/checklist.md + scripts/preflight.py.
Templates and scripts
assets/templates contains starter configs (package.json, tsconfig.json, tsup.config.ts, vitest.config.ts, eslint.config.js, .npmignore, .gitignore, README.template.md, SECURITY.template.md) and optional github-workflows examples. Copy and adapt; do not enable or run workflows that require repository or account permissions without explicit user approval.
scripts/preflight.py, scripts/smoke_test.sh, and scripts/security_scan.sh are provided to validate package.json, published tarball, and basic security checks — prefer running these locally or with the owner's consent.
Working style for this skill
- Ask first, scaffold second: short, targeted questions avoid wasted work.
- Explain trade-offs, then recommend a single pragmatic option.
- Verify facts before stating them (versions, advisories, metrics).
- Match the user's language for explanations; keep code and config in English.
- Adapt depth to the user's experience level.
- Permission note: do not modify or run CI/workflow configs that require repository or account permissions without explicit user consent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

