/dstack-typescript:nodejs-service-foundationsfrom DStack TypeScript
Sets up Node.js service foundations: fail-fast env validation, secret-redacting structured logging, typed error classes, and shutdown signal wiring.
Ships in DStack TypeScript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You give a new or rough Node.js service a solid base: config that fails fast, logs that never leak secrets, errors the middleware can actually route, and a startup that runs clean under the compiler. When the job needs a full drain sequence with health flip and dependency teardown, hand that part to nodejs-graceful-shutdown; here you only wire the shutdown spine (signal to abort to exit).
This stays local and reversible. You write only the named local artifacts (env schema, logger, error classes, tsconfig, package scripts) and install the dependencies they declare. Rollback is version control: git checkout -- <written files> or deleting the listed untracked files. No remote mutation.
What you need before starting:
package.json. Required.{ code, message, httpStatus } tuples for the domain errors. Required.Create src/env.ts. It reads process.env at import time and parses each declared variable against its type (string, number, boolean, URL). A required variable that is missing or malformed throws a descriptive error and the process exits with code 1 before any server binding. Export the frozen validated config object. The service never starts on invalid or missing config.
Create src/logger.ts on the stated logger dependency. Configure the level from env, ISO-8601 timestamps, and a request-id correlation field. Add a redaction serializer that replaces the value of every secret field name with [REDACTED] at every log level. Export a singleton instance. If a secret value ever appears unredacted in output, stop: the field-name list or serializer is misconfigured, and you fix it before proceeding.
Create src/errors.ts. It exports a base ServiceError with code: string, message: string, httpStatus: number, and cause?: Error, plus one named subclass or factory per catalogue entry. Every entry keeps a working instanceof ServiceError check so middleware can map codes to HTTP responses, and every code maps to its declared status. A catalogue entry with no subclass or status is a defect: add the missing piece before moving on.
In the service entry point, create an AbortController. Listen for SIGTERM and SIGINT, call controller.abort(), pass the signal to in-flight operations, drain active requests, then exit 0 on a clean drain or non-zero on timeout. This is the spine only. The full handler with health flip and dependency teardown is the job of nodejs-graceful-shutdown.
Run these checks and keep every result:
tsc --noEmit: zero errors. Fix type errors directly; never suppress with @ts-ignore or any.instanceof ServiceError is true and its httpStatus matches the catalogue.[REDACTED].Local named files: src/env.ts (validated schema), src/logger.ts (structured JSON with redaction), src/errors.ts (typed ServiceError base and subclasses), tsconfig.json (strict type-stripping config), package.json (ESM, engines, scripts). All reversible through the stated rollback path, with proof covering startup logs, the invalid-env exit, tsc, the instanceof check, the HTTP mapping, and redaction.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gosuda/dstack-skills --plugin dstack-typescript5 skills in this plugin
/node-internals-diagnosisUse when Node.js segfaults, addon crashes, leaks, event-loop anomalies, thread-pool saturation, V8 deoptimizations, or binding.gyp failures need diagnosis. Not for code edits or service restarts./nodejs-graceful-shutdownUse when asked to implement or fix service termination: SIGTERM or SIGINT, connection draining, health-check signaling. Not for general service scaffolding: use nodejs-service-foundations./typescript-best-practicesUse when TypeScript needs shaping toward narrow types, unions, exhaustive variants, and strict flags. Not for error repair: use typescript-type-hardening. Not for non-TS domains: use type-driven./typescript-type-hardeningUse when TypeScript has type errors, failing inference, or needs type mechanism repair (generics, infer, mapped, branded). Not for strict flags or proactive shaping: use typescript-best-practices.Other plugins' skills for the same job