An AI coding agent skill that scaffolds production-grade npm packages in seconds. One command sets up TypeScript, dual ESM/CJS output, testing, linting, CI/CD, and publishing configuration — so you can skip the boilerplate and start building.
Works with Claude Code, Cursor, Windsurf, Codex, Antigravity, and any AI coding agent that can follow markdown instructions.
Every package scaffolded by this skill includes:
| Feature | Details |
|---|---|
| TypeScript | Strict mode, declaration maps, isolated modules |
| Dual output | ESM (.mjs) + CJS (.cjs) via tsup |
| Testing | Vitest (or Jest) with 80% coverage thresholds |
| Linting | ESLint flat config with strict TypeScript rules |
| Formatting | Prettier |
| Versioning | Changesets for semantic versioning |
| CI/CD | GitHub Actions testing Node 20/22 + publish dry-run on PRs |
| Package exports | Proper conditional exports map with types for both ESM and CJS |
npx npm-package-skillThis copies the skill into ~/.claude/skills/npm-package/ so it's available in all your Claude Code sessions.
Copy the skill file into your Cursor rules directory:
mkdir -p ~/.cursor/rules
cp skills/npm-package/SKILL.md ~/.cursor/rules/npm-package.mdOr add it as a project-level rule by copying to .cursor/rules/npm-package.md in your repo.
Copy the skill file into your Windsurf rules:
cp skills/npm-package/SKILL.md ~/.windsurf/rules/npm-package.mdOr add it to your project as .windsurfrules or .windsurf/rules/npm-package.md.
Copy the skill file so Codex can reference it:
cp skills/npm-package/SKILL.md AGENTS.mdOr reference it in your existing AGENTS.md.
Copy skills/npm-package/SKILL.md into whichever directory your agent reads for instructions (e.g., project root or a rules/prompts directory). The skill is plain markdown — any agent that can follow structured instructions will work.
npm install -g npm-package-skill
npm-package-skill installUse the /npm-package slash command:
/npm-package my-awesome-lib
Paste or reference the skill content and ask:
Follow the npm-package skill to scaffold a package called my-awesome-lib
The agent will walk you through a brief discovery phase (package description, runtime target, test framework, license, etc.) and then scaffold a complete, verified, publish-ready package.
- Discovery — Asks targeted questions to tailor the scaffold to your needs
- Scaffold — Creates 15+ files: source, tests, configs, CI, README, LICENSE, CHANGELOG
- Install — Runs
npm installwith all dev dependencies - Verify — Runs typecheck, lint, test, build, and
npm pack --dry-runsequentially - Git init — Initializes the repo with an initial commit
You can also use the package programmatically:
import { getSkillContent, getSkillMeta, getDefaultInstallPath } from "npm-package-skill";
// Get the raw skill markdown
const content = getSkillContent();
// Get parsed metadata
const meta = getSkillMeta();
// => { name: "npm-package", description: "...", argumentHint: "[package-name]" }
// Get the default install path
const path = getDefaultInstallPath();
// => "/Users/you/.claude/skills/npm-package"npx npm-package-skill [command] [options]
Commands:
install Install the skill to ~/.claude/skills/ (default)
uninstall Remove the skill from ~/.claude/skills/
help Show help
Options:
--force Overwrite an existing skill file
git clone https://github.com/SiluPanda/npm-package-skill.git
cd npm-package-skill
npm install
npm run dev # Watch mode
npm run build # Build ESM + CJS + types
npm run test # Run tests
npm run test:coverage # Run tests with coverage
npm run lint # Lint with ESLint
npm run format # Format with Prettier
npm run typecheck # Type-check with TypeScript
npm run check # Run all checks (typecheck + lint + test)Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feat/my-feature) - Make your changes
- Run
npm run checkto ensure everything passes - Create a changeset (
npx changeset) describing your change - Open a pull request
See issues for things to work on.