Node.js Development
Purpose
Build Node.js software against repository runtime, package, module, resource, and operational contracts. Keep language concerns in JavaScript or TypeScript.
Compose Deliberately
- Add
javascript-development when JavaScript source changes.
- Add
typescript-development when TypeScript source, types, declarations, or compiler behavior changes.
- Use neither language sibling for a package-metadata or runtime investigation that does not touch its language concerns.
- Add method or domain skills only when those concerns shape the task.
- Do not use this skill for browser-only, edge-runtime-only, or package-manager-neutral language work.
Establish the Node Profile
Before editing:
- Read repository instructions and nearby package boundaries.
- Identify supported Node versions from
engines, version files, CI, containers, and deployment configuration.
- Identify the package manager, workspace model, lockfile, install mode, registry, and repository scripts.
- Determine ESM/CommonJS behavior from extensions, nearest
package.json, maps, compiler output, and consumers.
- Identify runtime topology: CLI, long-lived service, worker, serverless function, build tool, library, or mixed target.
- Locate test/build commands and separate authored files from generated bundles, declarations, and vendored output.
When sources conflict, prefer the configuration used by CI and deployment, then report the inconsistency.
Respect Runtime Semantics
- Use APIs supported by the declared Node range unless changing it is in scope.
- Preserve ESM/CommonJS entry points, package conditions, file extensions, and import timing unless the task owns a migration.
- Treat paths, file URLs, working directory, executable location, and module location as distinct concepts.
- Preserve claimed platform portability; distinguish path and URL semantics.
- Preserve encoding and binary/text distinctions when crossing buffers, streams, files, or network boundaries.
- Avoid synchronous filesystem or process work on latency-sensitive paths; it can be appropriate during startup, build steps, or small CLIs.
- Do not rely on mutable process-global state when concurrent tests, workers, requests, or embedded consumers can observe it.
Read [runtime-and-modules.md](/references/runtime-and-modules.md) for module resolution, filesystem, processes, workers, and runtime compatibility.
Manage Async Resources and Lifecycle
- Decide whether work is buffered, streamed, sequential, concurrent, or cancellable before choosing an API.
- Honor stream backpressure; prefer established pipeline utilities when they match the repository's error and cleanup contract.
- Propagate cancellation and timeouts across owned operations, and clean up listeners, timers, sockets, files, subprocesses, and streams.
- Handle expected operational failures at a boundary that can recover, translate, retry safely, or terminate deliberately.
- Make shutdown stop new work, drain or cancel bounded in-flight work, close owned resources, and finish within the platform's grace period.
- Handle signals and unobserved failures under the application's supervision model; do not continue from unknown state.
Read [services-and-operations.md](/references/services-and-operations.md) for servers, CLIs, streams, subprocesses, signals, shutdown, and observability.
Preserve Package Contracts
- Keep the selected package manager and lockfile; do not generate a competing lockfile.
- Treat entry points, exports, types, bins, files, engines, dependencies, and workspace links as distribution behavior.
- Add or upgrade dependencies only within task scope and review the effective lockfile and lifecycle-script changes.
- Keep runtime dependencies separate from development-only tooling and use peer or optional dependencies only for their actual package semantics.
- Verify published shape with the repository's pack or distribution workflow when package metadata changes.
Read [packages-and-dependencies.md](/references/packages-and-dependencies.md) for manifests, exports, workspaces, installation, and dependency review.
Protect Host Boundaries
- Treat environment, arguments, files, network input, and IPC as untrusted until parsed.
- Do not pass untrusted input through a shell command string. Prefer argument-vector process APIs and explicit executable selection.
- Resolve and authorize filesystem targets before writing; account for traversal, symlinks, overwrite behavior, and permissions.
- Keep secrets out of source, command lines, error payloads, logs, and package artifacts.
- Do not assume environment variables are present, typed, secret, or reloadable.
Verify in the Native Environment
Run the narrowest existing checks first:
- Focused tests for runtime behavior, cleanup, failures, and package boundaries.
- Repository lint, type, and format checks relevant to touched files.
- A runtime, CLI, server, worker, or package smoke test on a supported Node version.
- Pack/build checks when exports, bins, files, declarations, or dependencies change.
- Broader integration tests when lifecycle, shared packages, or external resources change.
Where possible, detect leaked handles, incomplete shutdown, unobserved rejection, and partial cleanup. Report commands, runtime, package manager, verified behavior, and unavailable environments.
Avoid Universal Mandates
Do not prescribe ESM or CommonJS, a package manager, framework, logger, environment convention, dependency count, or server architecture universally.
1---2name: nodejs-development3description: Use for Node.js runtime or package work involving ESM/CJS resolution, exports, streams, buffers, processes, or resource lifecycles. Compose with JavaScript or TypeScript; exclude browser-only work.4---56# Node.js Development78## Purpose910Build Node.js software against repository runtime, package, module, resource, and operational contracts. Keep language concerns in JavaScript or TypeScript.1112## Compose Deliberately1314- Add `javascript-development` when JavaScript source changes.15- Add `typescript-development` when TypeScript source, types, declarations, or compiler behavior changes.16- Use neither language sibling for a package-metadata or runtime investigation that does not touch its language concerns.17- Add method or domain skills only when those concerns shape the task.18- Do not use this skill for browser-only, edge-runtime-only, or package-manager-neutral language work.1920## Establish the Node Profile2122Before editing:23241. Read repository instructions and nearby package boundaries.252. Identify supported Node versions from `engines`, version files, CI, containers, and deployment configuration.263. Identify the package manager, workspace model, lockfile, install mode, registry, and repository scripts.274. Determine ESM/CommonJS behavior from extensions, nearest `package.json`, maps, compiler output, and consumers.285. Identify runtime topology: CLI, long-lived service, worker, serverless function, build tool, library, or mixed target.296. Locate test/build commands and separate authored files from generated bundles, declarations, and vendored output.3031When sources conflict, prefer the configuration used by CI and deployment, then report the inconsistency.3233## Respect Runtime Semantics3435- Use APIs supported by the declared Node range unless changing it is in scope.36- Preserve ESM/CommonJS entry points, package conditions, file extensions, and import timing unless the task owns a migration.37- Treat paths, file URLs, working directory, executable location, and module location as distinct concepts.38- Preserve claimed platform portability; distinguish path and URL semantics.39- Preserve encoding and binary/text distinctions when crossing buffers, streams, files, or network boundaries.40- Avoid synchronous filesystem or process work on latency-sensitive paths; it can be appropriate during startup, build steps, or small CLIs.41- Do not rely on mutable process-global state when concurrent tests, workers, requests, or embedded consumers can observe it.4243Read [runtime-and-modules.md](<skills-file-root>/references/runtime-and-modules.md) for module resolution, filesystem, processes, workers, and runtime compatibility.4445## Manage Async Resources and Lifecycle4647- Decide whether work is buffered, streamed, sequential, concurrent, or cancellable before choosing an API.48- Honor stream backpressure; prefer established pipeline utilities when they match the repository's error and cleanup contract.49- Propagate cancellation and timeouts across owned operations, and clean up listeners, timers, sockets, files, subprocesses, and streams.50- Handle expected operational failures at a boundary that can recover, translate, retry safely, or terminate deliberately.51- Make shutdown stop new work, drain or cancel bounded in-flight work, close owned resources, and finish within the platform's grace period.52- Handle signals and unobserved failures under the application's supervision model; do not continue from unknown state.5354Read [services-and-operations.md](<skills-file-root>/references/services-and-operations.md) for servers, CLIs, streams, subprocesses, signals, shutdown, and observability.5556## Preserve Package Contracts5758- Keep the selected package manager and lockfile; do not generate a competing lockfile.59- Treat entry points, exports, types, bins, files, engines, dependencies, and workspace links as distribution behavior.60- Add or upgrade dependencies only within task scope and review the effective lockfile and lifecycle-script changes.61- Keep runtime dependencies separate from development-only tooling and use peer or optional dependencies only for their actual package semantics.62- Verify published shape with the repository's pack or distribution workflow when package metadata changes.6364Read [packages-and-dependencies.md](<skills-file-root>/references/packages-and-dependencies.md) for manifests, exports, workspaces, installation, and dependency review.6566## Protect Host Boundaries6768- Treat environment, arguments, files, network input, and IPC as untrusted until parsed.69- Do not pass untrusted input through a shell command string. Prefer argument-vector process APIs and explicit executable selection.70- Resolve and authorize filesystem targets before writing; account for traversal, symlinks, overwrite behavior, and permissions.71- Keep secrets out of source, command lines, error payloads, logs, and package artifacts.72- Do not assume environment variables are present, typed, secret, or reloadable.7374## Verify in the Native Environment7576Run the narrowest existing checks first:77781. Focused tests for runtime behavior, cleanup, failures, and package boundaries.792. Repository lint, type, and format checks relevant to touched files.803. A runtime, CLI, server, worker, or package smoke test on a supported Node version.814. Pack/build checks when exports, bins, files, declarations, or dependencies change.825. Broader integration tests when lifecycle, shared packages, or external resources change.8384Where possible, detect leaked handles, incomplete shutdown, unobserved rejection, and partial cleanup. Report commands, runtime, package manager, verified behavior, and unavailable environments.8586## Avoid Universal Mandates8788Do not prescribe ESM or CommonJS, a package manager, framework, logger, environment convention, dependency count, or server architecture universally.