agents/npm-packages/SKILL.md
Conventions for package.json, README.md, coding & testing styles
npx skillsauth add sanand0/scripts npm-packagesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Include these keys:
{ ".": { "default": "./dist/package-name.min.js", "types": "./package-name.d.ts" } }{
"build": "npx -y esbuild package-name.js --bundle --format esm --minify --outfile=dist/package-name.min.js",
"lint": "dprint fmt -c https://raw.githubusercontent.com/sanand0/scripts/refs/heads/main/dprint.jsonc && npx -y oxlint --fix",
"test": "npx -y vitest@3 run --globals",
"prepublishOnly": "npm run lint && npm run build && npm test"
// docs, watch, pretest, ...
}
npx -y in scripts over devDependencies. Used mainly if tests/utilities need packages, e.g. jsdom, playwright, sharpInclude these H2 headings in order:
Begin with shields, followed by a 1-line description of the package. Shields include
[](https://www.npmjs.com/package/package-name)
[](https://opensource.org/licenses/MIT)
[](https://bundlephobia.com/package/package-name)
Installation. Typically:
Add this to your script:
```js
import { something } from "package-name";
```
To use via CDN, add this to your HTML file:
```html
<script type="importmap">
{
"imports": {
"package-name": "https://cdn.jsdelivr.net/npm/package-name@1"
}
}
</script>
```
To use locally, install via `npm`:
```bash
npm install package-name
```
... and add this to your HTML file:
```html
<script type="importmap">
{
"imports": {
"package-name": "./node_modules/package-name/dist/package-name.js"
}
}
</script>
```
Usage. Provide detailed examples covering all scenarios
Development. Use this content:
git clone https://github.com/user/package-name.git
cd package-name
npm install
npm run lint && npm run build && npm test
npm publish
git commit . -m"$COMMIT_MSG"; git tag $VERSION; git push --follow-tags
Release notes. This is a list of [x.y.z](https://npmjs.com/package/package-name/v/x.y.y): dd mmm yyyy: Description of the change
License. Just mention [MIT](LICENSE)
Follow these conventions:
.d.ts for public APIs where feasible*.test.js (or *.spec.ts for Playwright suites)describe, it), deterministic tests, small fixtures; mock network when applicablenode_modules/
dist/
testing
If the task had failures or was inefficient or complex, ALWAYS run this post-mortem.
tools
If any tool call fails, log it IMMEDIATELY with this skill
data-ai
Brainstorm creative, novel, non-obvious ideas or options for an open-ended problem and narrow them to a recommendation. Not for writing prose, research, explanation, summaries, or questions with one right answer.
documentation
To write in Anand's style in blog posts, talk summaries, interview questions, emails, ...