Agent skill

npm Library Setup

by vana-com in vana-com/personal-server

Comprehensive guidance on setting up npm libraries with package.json, with a preference for ES Modules (ESM).

MITAuto-check passedFrontend & Design

Install npm Library Setup

skills CLI
$ npx skills add vana-com/personal-server --skill npm-library-setup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vana-com/personal-server npm-library-setup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vana-com/personal-server.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/npm-library-setup .claude/skills/npm-library-setup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
npm-library-setup
GitHub stars
116
Token cost
~1.1k tokens
SKILL.md length
360 words
Files
17 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Comprehensive guidance on setting up npm libraries with package.json, with a preference for ES Modules (ESM).

  • Works in 4 steps: Initialize your package → Configure for ESM by adding "type":… → Install build and test tools → …
  • Setting up npm packages
  • SKILL.md covers Overview, When to Use This Skill, Quick Start and Essential Configuration, plus 7 more sections
  • Runs TypeScript and JavaScript scripts from its folder; calls npm

What it does

npm Library Setup is an agent skill from vana-com/personal-server. Comprehensive guidance on setting up npm libraries with package.json, with a preference for ES Modules (ESM). Use when setting up npm packages, configuring ESM, TypeScript packages, or React component libraries.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 23 other files, including reference files (for example `examples/example-package/package.json`, `examples/example-package/src/helpers.js` and `examples/example-package/src/index.js`).

It sits in Frontend & Design, covering React components. It works with npm and TypeScript. The repository describes itself as: TypeScript implementation of the Vana Data Portability Protocol's Personal Server. The licence is MIT.

When your agent uses it

  • Setting up npm packages
  • Configuring ESM
  • TypeScript packages
  • React component libraries

Example prompts

  • “/npm-library-setup”

Requirements

  • Node.js

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Initialize your package
  2. Configure for ESM by adding "type": "module" to package.json
  3. Install build and test tools
  4. Create your source files in src/ and run npm run build

What it can do on your machine

Read from SKILL.md and the folder at commit 0b67a90. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript and JavaScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • vitest.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

npm Library Setup loads about 1.1k tokens when it runs, and up to ~9.3k if it reads all its reference files. Until then it costs about 57 tokens; SKILL.md has 360 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vana-com/personal-server at commit 0b67a90, republished under its MIT licence (© vana-com). 360 words, ~1,084 tokens.

Download SKILL.mdSave it as .claude/skills/npm-library-setup/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
npm-library-setup
description
Comprehensive guidance on setting up npm libraries with package.json, with a preference for ES Modules (ESM). Use when setting up npm packages, configuring ESM, TypeScript packages, or React component libraries.

npm Library Setup with ESM

This skill provides comprehensive guidance on setting up an npm library with package.json, with a preference for ES Modules (ESM).

Overview

This skill helps you create npm packages that:

  • Use ES Modules (ESM) with "type": "module"
  • Configure modern exports field (no deprecated module field)
  • Use bunchee for zero-config bundling
  • Use vitest for modern testing
  • Support TypeScript and React component libraries

When to Use This Skill

Use when:

  • "Set up an npm package"
  • "Create a new npm library"
  • "Configure package.json for ESM"
  • "Set up a TypeScript npm package"
  • "Create a React component library"

Categories covered:

  • Basic package setup with ESM
  • TypeScript package configuration
  • React component library setup
  • Build configuration with bunchee
  • Testing setup with vitest

Quick Start

  1. Initialize your package:

    bash
    npm init -y
  2. Configure for ESM by adding "type": "module" to package.json

  3. Install build and test tools:

    bash
    npm install -D bunchee vitest
  4. Create your source files in src/ and run npm run build

Essential Configuration

package.json
json
{
  "type": "module",
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
  "scripts": {
    "build": "bunchee",
    "test": "vitest",
    "test:run": "vitest run"
  },
  "engines": {
    "node": ">=20"
  }
}

Note: Use the oldest currently-maintained LTS version (check Node.js Release Schedule).

Key Principles
  1. ESM-first: Use "type": "module" for pure ESM packages
  2. Modern exports: Use exports field instead of deprecated module field
  3. Zero-config bundling: Bunchee handles most configuration automatically
  4. File extensions: Use explicit .js extensions in imports (even in TypeScript)
  5. Kebab-case files: Use kebab-case for file paths
Show full SKILL.md (143 more words)Show less

TypeScript Setup

Install TypeScript and configure:

bash
npm install -D typescript @types/node

Create tsconfig.json:

json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "NodeNext",
    "declaration": true,
    "strict": true
  }
}

Bunchee automatically compiles TypeScript and generates .d.ts files.

React Component Libraries

Install React as dev dependency:

bash
npm install -D react @types/react

Configure peerDependencies:

json
{
  "peerDependencies": {
    "react": "*"
  }
}

Best Practices

  1. ✅ Use exports field (no deprecated module field)
  2. ✅ Use explicit file extensions in imports (.js)
  3. ✅ Use kebab-case for file paths
  4. ✅ Separate runtime dependencies from dev dependencies
  5. ✅ Specify Node.js version using oldest maintained LTS
  6. ✅ Write source in ESM syntax

Common Patterns

ESM Import/Export
javascript
// Named exports
export function greet(name) {
  return "Hello, " + name + "!";
}

// Default export
export default class MyLibrary {}

// Import
import { greet } from "./module.js";
import MyLibrary from "./MyLibrary.js";

Important: Always use .js extension in imports, even in TypeScript files.

File Structure
my-package/
├── package.json
├── src/
│   ├── index.js         # or index.ts
│   └── helpers.js
├── dist/                # Build output
└── README.md

References

See references/ directory for detailed guides:

  • Getting Started
  • Package.json Configuration
  • ESM Syntax and Patterns
  • Building and Testing
  • TypeScript Packages
  • React Packages
  • Best Practices

Examples

See examples/ directory for complete working examples:

  • JavaScript ESM package
  • TypeScript ESM package

Additional Resources

© vana-com, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 16 other files (references) in .agents/skills/npm-library-setup of vana-com/personal-server.

  • SKILL.md
  • examples/example-package/package.json
  • examples/example-package/src/helpers.js
  • examples/example-package/src/index.js
  • examples/example-ts-package/package.json
  • examples/example-ts-package/src/helpers.ts
  • examples/example-ts-package/src/index.test.ts
  • examples/example-ts-package/src/index.ts
  • examples/example-ts-package/tsconfig.json
  • references/guides/01-getting-started.md
  • references/guides/02-package-json-config.md
  • references/guides/03-esm-syntax.md
  • references/guides/04-building-and-testing.md
  • references/guides/05-best-practices.md
  • … and 3 more

Open the folder on GitHubat commit 0b67a90

Compare with similar skills

npm Library Setup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

npm Library Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
npm Library Setup this skillvana-com/personal-server116—~1.1kAutomated safety check: PassMIT
Spotpatchhuanglvjing/spotpatch134—~998Automated safety check: PassMIT
Frontendstreamband/hydra-srt146—~582Automated safety check: PassApache-2.0
Typescriptccusage/ccusage19k—~696Automated safety check: PassCustom licence
Create Custom Widgetmendixlabs/mxcli128—~3.3kAutomated safety check: PassApache-2.0
React Emailviclafouch/meme-studio1102 repos~3.6kAutomated safety check: PassMIT

Similar skills

  • Spotpatch

    huanglvjing/spotpatch

    为 React 项目建立从浏览器页面元素到精确 JSX/TSX 源码、结构化上下文与可审阅修改的 SpotPatch 工作流。用户提到 SpotPatch、截图沟通前端修改、页面元素定位源码、Vite 或 Next.js 接入、组件数据链路、结构化 Prompt、AI 补丁审阅、安装检查或故障排查时使用此技能。

    134 GitHub stars~998 tokensUpdated 9 days ago
    Frontend & DesignAuto-check passed
  • Frontend

    streamband/hydra-srt

    A skill your agent uses for frontend work in webapp (React/TypeScript, UI implementation, tests, and refactors).

    146 GitHub stars~582 tokensUpdated 21 days ago
    Frontend & DesignAuto-check passed
  • Typescript

    ccusage/ccusage

    Guides ccusage TypeScript and JavaScript work. An agent skill from ccusage/ccusage.

    19k GitHub stars~696 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Create Custom Widget

    mendixlabs/mxcli

    Build a Mendix pluggable widget from scratch with React and TypeScript and package it as an .mpk.

    128 GitHub stars~3.3k tokensUpdated today
    Frontend & DesignAuto-check passed
  • React Email

    viclafouch/meme-studio

    A skill your agent uses when creating HTML email templates with React components - welcome emails, password resets, notifications, order confirmations, newsletters, or transactional emails.

    110 GitHub starsUsed in 2 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 40 repos~769 tokens
    Frontend & DesignAuto-check passed

More from vana-com/personal-server

  • Typescript

    vana-com/personal-server

    This skill should be used when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters…

    116 GitHub starsUsed in 2 repos~2.2k tokens
    Auto-check passed
  • Hono

    vana-com/personal-server

    Efficiently develop Hono applications using Hono CLI. An agent skill from vana-com/personal-server.

    116 GitHub stars~500 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about npm Library Setup

What does npm Library Setup do?

Comprehensive guidance on setting up npm libraries with package.json, with a preference for ES Modules (ESM). npm Library Setup is an agent skill from vana-com/personal-server.json, with a preference for ES Modules (ESM).

When should I use npm Library Setup?

npm Library Setup fits situations like: setting up npm packages; configuring ESM; typeScript packages; React component libraries.

How do I install npm Library Setup in Claude Code?

Run `npx skills add vana-com/personal-server --skill npm-library-setup -a claude-code`. Or copy the skill folder (.agents/skills/npm-library-setup in vana-com/personal-server) into .claude/skills/npm-library-setup in your project. Claude Code loads it when a task matches its description.

How do I install npm Library Setup in Codex?

Run `npx skills add vana-com/personal-server --skill npm-library-setup -a codex`. Or copy the skill folder (.agents/skills/npm-library-setup in vana-com/personal-server) into .agents/skills/npm-library-setup in your project. Codex loads it when a task matches its description.

Can I use npm Library Setup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vana-com/personal-server --skill npm-library-setup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/npm-library-setup, .gemini/skills/npm-library-setup, .github/skills/npm-library-setup and .opencode/skills/npm-library-setup in your project.

What does npm Library Setup need to run?

Going by SKILL.md and its folder, npm Library Setup needs TypeScript and JavaScript for the scripts in its folder and the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does npm Library Setup access the network?

SKILL.md names 2 domains. As links in the text: github.com and vitest.dev. This is read from the text; nothing was executed.

Is npm Library Setup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does npm Library Setup use?

npm Library Setup is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does npm Library Setup use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.3k tokens, read only when the agent opens those files.

What are the alternatives to npm Library Setup?

Skills that share tags, products or a category with npm Library Setup: Spotpatch (huanglvjing/spotpatch, 134 stars), Frontend (streamband/hydra-srt, 146 stars), Typescript (ccusage/ccusage, 19k stars) and Create Custom Widget (mendixlabs/mxcli, 128 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains npm Library Setup?

vana-com (a GitHub organization) maintains it in vana-com/personal-server, which has 116 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 7, 2026.

Source: vana-com/personal-server on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.