add-npm-dependency
Skill1.4k starsChanged 6 months agoMITView on GitHub
This skill MUST be used whenever the task involves adding, installing, or upgrading an npm package/library/dependency in this project. Use when the user asks to "add a library", "install <package>", "use <package>", "add a dependency", "bump/upgrade a package", or any change to package.json dependencies. Covers the latest-version policy, esbuild renderer bundling, manual CSS copy, native module rebuilds, and the three build targets.
- Installs packages
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about elirantutia/vibeyard
- A Hacker News story“Show HN: Vibeyard – An open-source IDE for managing AI coding agents”Hacker News · Apr 23, 2026 · 2 points
- @beyondthecode.bsky.social“🧠 Vibeyard is an open-source IDE designed for managing AI coding agents. The tool provides an interface …”Bluesky · Apr 23, 2026 · 1 likes
- hesreallyhim/awesome-claude-code“[Resource]: Vibeyard - The IDE built for AI coding agents”GitHub · Apr 2, 2026 · 1 reactions
- AppImage/appimage.github.io“Add Vibeyard”GitHub · Sep 29, 2026
- sudosubin/agents.nix“agent-skills.github.elirantutia.vibeyard: init at 0.3.8”GitHub · Sep 27, 2026
The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 8
Talked about on GitHub, Hacker News and Bluesky (8 times).
On GitHub · 6
- Apr 2, 2026[Resource]: Vibeyard - The IDE built for AI coding agents — hesreallyhim/awesome-claude-code1 reaction · 1 comment
- Sep 29, 2026Add Vibeyard — AppImage/appimage.github.io0 reactions · 1 comment
- Sep 27, 2026agent-skills.github.elirantutia.vibeyard: init at 0.3.8 — sudosubin/agents.nix0 reactions
- Apr 12, 2026add web element info -> prompt integration — debuglebowski/slayzone0 reactions · 1 comment
- Apr 2, 2026Add Vibeyard to Local Apps — filipecalegario/awesome-vibe-coding0 reactions
1 more on GitHub
- Apr 2, 2026New agent interface proposal — no-fluff/awesome-vibe-coding0 reactions
On Hacker News · 1
- Apr 23, 2026Show HN: Vibeyard – An open-source IDE for managing AI coding agents2 points
On Bluesky · 1
- Apr 23, 2026🧠 Vibeyard is an open-source IDE designed for managing AI coding agents. The tool provides an interface for configuring and monitoring… — @beyondthecode.bsky.social1 likes and repost
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 21
Use npm only (the lockfile is package-lock.json — not yarn, not pnpm).
- Very specific: line 41
Add a copy step in scripts/copy-assets.js — copy from node_modules/<pkg>/.../file.css to dist/renderer/vendor/<file>.css.
- Very specific: line 42
Add a <link rel="stylesheet" href="vendor/<file>.css"> to src/renderer/index.html (gridstack/xterm links are already there as examples).
- Distinctive: line 44
If you skip this, the JS bundles fine but the component renders unstyled.
- Very specific: line 50
Must be a regular dependency (never imported from the renderer — main/preload only).
- Very specific: line 52
If the binary can't load from inside the asar archive, add the package to electron-builder's asarUnpack in package.json (precedent: …
- Distinctive: line 57
If the package ships its own type declarations, you're done.
- Very specific: line 84
Add the CSS copy step + <link> for any styled renderer library.
- Very specific: line 85
Run npm run build and npm test before declaring done.
- Distinctive: line 89
Import Node built-ins or native modules from the renderer.
- Very specific: line 91
Put a native module in devDependencies or assume it works without the postinstall rebuild.
≈ “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
Adding an npm Library
This is an Electron app with three separate build targets (main, preload, renderer) and a few non-obvious bundling rules. Adding a dependency the wrong way silently breaks CSS, native modules, or the renderer bundle. Follow this guide every time.
Golden Rule: install the latest, caret-pinned
Always install the newest published version. Never hand-edit package.json to set or downgrade a version.
npm install <pkg>@latest # runtime dependency
npm install -D <pkg>@latest # dev / build-only tool (types, bundlers, test libs)- This records a caret range
^x.y.z— the repo convention (every dep inpackage.jsonuses^). Leave it as a caret range. package-lock.jsonis committed and gets updated by the install. Bothpackage.jsonandpackage-lock.jsonare part of your change — stage both.- Use npm only (the lockfile is
package-lock.json— not yarn, not pnpm). - Node v24 is pinned in
.nvmrc;engines.nodeis>=18. Runnvm usefirst if needed.
Step 1 — Decide which build target consumes the package
This determines every gotcha that follows.
| Target | Source dirs | How it's built | What's allowed |
| Renderer | src/renderer/** | Bundled by esbuild into one IIFE (build:renderer) | Plain JS/TS deps only. No Node built-ins, no native modules. |
| Main | src/main/**, src/shared/** | tsc → CommonJS (dist/main/) | Any Node dep, including native modules. Resolved via require at runtime against node_modules — not bundled. |
| Preload | src/preload/**, src/shared/** | tsc → CommonJS (dist/preload/) | Runs in Node/Electron context; same rules as main. |
- A pure JS/TS library used in the UI (like
marked,dompurify,gridstack,@xterm/*) just getsimported in renderer code and esbuild bundles it. Nothing else to do (except CSS — see Step 2). - A library that touches the filesystem, spawns processes, or has a
.nodebinary belongs in main/preload only.
Step 2 — CSS / static assets gotcha (esbuild has NO CSS loader)
esbuild only has the .ts loader configured. It will not bundle any CSS the package ships. If the library needs a stylesheet to work (the way gridstack and @xterm/xterm do):
- Add a copy step in
scripts/copy-assets.js— copy fromnode_modules/<pkg>/.../file.csstodist/renderer/vendor/<file>.css. Mirror the existing gridstack precedent in that file. - Add a
<link rel="stylesheet" href="vendor/<file>.css">tosrc/renderer/index.html(gridstack/xterm links are already there as examples).
If you skip this, the JS bundles fine but the component renders unstyled. (CLAUDE.md documents this: "esbuild has no CSS loader" — gridstack CSS is copied manually.)
Step 3 — Native module gotcha (.node binaries)
Examples already in the repo: better-sqlite3, node-pty.
- Must be a regular
dependency(never imported from the renderer — main/preload only). npm installtriggers thepostinstallhook →electron-builder install-app-deps, which rebuilds the.nodebinary against the pinned Electron ABI. If the module fails to load at runtime ("NODE_MODULE_VERSION mismatch"), re-runnpm installand check the postinstall output.- If the binary can't load from inside the asar archive, add the package to electron-builder's
asarUnpackinpackage.json(precedent:**/node_modules/better-sqlite3/**). - Native modules must compile on macOS, Linux, and Windows — CI builds all three. Flag the cross-platform risk to the user; see
src/main/platform.tsfor the platform-detection helpers.
Step 4 — Types
- If the package ships its own type declarations, you're done.
- Otherwise add the community types as a devDependency:
npm install -D @types/<pkg>@latest(precedent:@types/better-sqlite3,@types/dompurify,@types/picomatch).
Step 5 — Verify (required, not optional)
There is no hot reload — every change needs a rebuild.
npm run build # must pass: tsc main + tsc preload + esbuild renderer + copy-assets
npm test # Vitest suiteThen confirm the dependency actually works end to end:
- Renderer / UI / CSS dep:
npm start, and visually confirm the feature renders and styles load. - Native / main dep: launch the app and exercise the feature that uses it.
Step 6 — Packaging sanity check
electron-builder packages only dist/main/**, dist/preload/**, dist/renderer/**:
- Renderer deps are safe — they're bundled into
dist/renderer/index.js. - Main/preload deps resolve from the packaged production
node_modulesat runtime, so they must be independencies(notdevDependencies). Keep build-only tooling (bundlers, types, test libs) indevDependencies.
Do / Don't
Do:
npm install <pkg>@latest, leave the caret range, commitpackage.json+package-lock.json.- Pick the right target (renderer vs main/preload) before importing.
- Add the CSS copy step +
<link>for any styled renderer library. - Run
npm run buildandnpm testbefore declaring done.
Don't:
- Pin an exact version or hand-edit a version in
package.json. - Import Node built-ins or native modules from the renderer.
- Forget the
scripts/copy-assets.jsstep for CSS (esbuild won't bundle it). - Put a native module in
devDependenciesor assume it works without the postinstall rebuild.
$ARGUMENTS
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.

