bare-importmaps

Replace node:* imports with plain builtin specifiers and update package.json import maps.

102|4|Updated Apr 15, 2009
One-click install
npx skills add https://github.com/mikker/dotfiles --skill bare-importmaps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bare-importmaps
Source: https://github.com/mikker/dotfiles/tree/main/agents.symlink/skills/bare-importmaps
Command: npx skills add https://github.com/mikker/dotfiles --skill bare-importmaps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforce Bare-style builtin imports and package-local import maps for Holepunch, Pear, Autobonk, Bare runtime, and other dual-runtime JavaScript work. Use when editing code that may run under Bare or a repo that already uses package.json "imports" for bare polyfills. Prefer plain builtin specifiers like "fs", "path", "crypto", "url", "http", and "https" instead of "node:*", and update the nearest package.json import map and dependencies when a new builtin is introduced.

Core Features & Use Cases

  • Enforces plain builtin specifiers across codebases to avoid node:* imports.
  • Keeps import maps package-local by updating the nearest package.json.
  • Applies to Bare-compatible environments and repos with existing import maps.

Quick Start

Replace node:* imports with plain builtin specifiers and update the nearest package.json import map accordingly.

Frequently Asked Questions about bare-importmaps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I replace node:* imports with plain builtins for Bare runtime compatibility?

To replace node:* imports for Bare runtime compatibility, change specifiers like node:fs to plain builtins such as fs, path, or crypto, and update the nearest package.json import map to ensure the project builds correctly.

What are package-local import maps and when do I need them for Pear or Holepunch projects?

Package-local import maps are mappings defined in a project's package.json that route bare specifiers to builtins or polyfills. You need them for Pear or Holepunch projects to ensure dual-runtime JavaScript compatibility across both Node and Bare environments.

Can I use node:* specifiers in JavaScript code that runs under the Bare runtime?

No, you should avoid node:* specifiers in code running under the Bare runtime. Bare, Pear, and Holepunch environments require plain builtin specifiers like fs, http, and url to properly resolve modules via package-local import maps.

How do I update package.json imports when introducing a new builtin to a dual-runtime JavaScript codebase?

To update package.json imports when introducing a new builtin, add the plain specifier mapping to the nearest package.json imports field. This ensures the new builtin resolves correctly under Bare while maintaining build safety across dual-runtime environments.

What is the best way to enforce bare imports across a codebase that uses Bare polyfills?

The best way to enforce bare imports is to replace all node:* specifiers with plain builtins like fs or crypto and maintain package-local import maps in the nearest package.json. This ensures consistent resolution and build safety across dual-runtime JavaScript projects.

Why does my JavaScript build fail after adding a new builtin to a Bare or Autobonk project?

Your build fails because the nearest package.json import map lacks the mapping for the newly introduced builtin. Update the package.json imports field with the plain specifier to ensure the Bare or Autobonk project resolves the module and builds successfully.