nodejs
Node.js/Bun backend reference skill: TypeScript-first, structured error handling, pino logging, Zod validation, async patterns, HTTP server conventions, database access, auth, queues, caching, testing, security, CLI tooling, and observability. Covers both Node.js and Bun runtimes. Use when the task touches server-side TypeScript/JavaScript code and should follow the project's backend conventions.
What this skill does
<EXTREMELY-IMPORTANT> This skill is a routing shell over the Node.js/Bun reference set. Non-negotiable rules: 1. Read `references/stack.md` first to determine the runtime (Node.js or Bun), framework, and locked decisions. 2. Then load only the references needed for the actual task. 3. **TypeScript strict mode** — no `any`, no implicit returns, no unchecked index access. 4. **All async functions must handle errors** — no unhandled promise rejections. Use try/catch or `.catch()` at every boundary. 5. **Input validation at system boundaries** — Zod schemas on every external input (request bodies, query params, env vars, CLI args). Never trust `req.body`. 6. **Structured logging via pino** — no `console.log` in production code. JSON to stdout, parsed by log aggregators. 7. **Graceful shutdown** — handle SIGTERM/SIGINT, drain connections, finish in-flight work, close DB pools. 8. **No secrets in code or logs** — env vars validated at startup, never logged, never in error responses. </EXTREMELY-IMPORTANT> # nodejs ## Inputs - `$request`: The backend task, subsystem, bug, or feature being worked on ## Goal Route Node.js/Bun backend work through the project's conventions so implementation follows the established patterns for server architecture, data access, error handling, and deployment. ## Step 0: Read the stack contract Always start with: - `references/stack.md` That establishes: runtime (Node.js or Bun), framework (Express/Fastify/Hono/none), ORM, test runner, package manager, and locked dependency choices. If `bun.lockb` or `bunfig.toml` exists, the runtime is Bun — also load `references/bun-runtime.md` for native API differences. **Success criteria**: The project's runtime, framework, and toolchain choices are explicit before implementation starts. ## Step 1: Load only the relevant references Use the routing table to pick reference files. Do not bulk-load the full reference tree. | Task | Read | |------|------| | Runtime, TypeScript, package manager, locked deps | `references/stack.md` | | Folder conventions, entry points, monorepo layout | `references/project-structure.md` | | Express/Fastify/Hono patterns, middleware, routing | `references/http-server.md` | | REST conventions, versioning, pagination, error responses | `references/api-design.md` | | Zod/AJV input validation, DTO patterns | `references/validation.md` | | Prisma/Drizzle/Knex, migrations, connection pooling | `references/database.md` | | JWT, sessions, OAuth2, RBAC, middleware guards | `references/auth.md` | | Error classes, async error boundaries, HTTP error responses | `references/error-handling.md` | | pino structured logging, request correlation, log levels | `references/logging.md` | | vitest/jest/bun test, supertest, test factories, coverage | `references/testing.md` | | Promises, streams, worker threads, AbortController, shutdown | `references/async-patterns.md` | | helmet, CORS, rate limiting, input sanitization, dep audit | `references/security.md` | | Redis, in-memory caching, cache invalidation patterns | `references/caching.md` | | BullMQ, job patterns, retry strategies, dead-letter queues | `references/queues-jobs.md` | | Env validation, dotenv, config modules, secrets management | `references/config.md` | | OpenTelemetry, health checks, metrics, distributed tracing | `references/observability.md` | | Multi-stage Dockerfile, .dockerignore, prod vs dev images | `references/docker.md` | | ws/Socket.io, connection lifecycle, scaling, rooms | `references/websockets.md` | | commander/yargs, argument parsing, exit codes, stdin/stdout | `references/cli.md` | | Bun-native APIs, bun test, bun build, Bun.serve, Bun.$ | `references/bun-runtime.md` | Multiple tasks? Read multiple files. The references are self-contained. **Success criteria**: Only the task-relevant backend conventions are in play. ## Step 2: Implement with the core backend guardrails Keep these rules active: - TypeScript strict mode with `noUncheckedIndexedAccess` - all external input validated at the boundary (Zod schemas) - errors are typed, caught, and returned as structured HTTP responses - logging via pino child loggers with request correlation IDs - database access through the project's ORM/query builder, not raw SQL strings - mutations wrapped in transactions where atomicity matters - graceful shutdown: SIGTERM handler drains server, closes pools, exits cleanly - env vars validated at startup — fail fast on missing required config - no `any`, no `as` type assertions unless justified with a comment - if Bun runtime: prefer `Bun.serve()`, `Bun.file()`, `bun test` over Node.js equivalents **Success criteria**: The change matches the project's backend architecture instead of generic defaults. ## Step 3: Verify the affected surface Use the narrowest relevant verification: - unit tests (`vitest run`, `jest`, or `bun test`) - integration tests with supertest or actual HTTP calls - type checking (`tsc --noEmit`) - linting (`eslint .`) - if Docker: build the image and verify it starts **Success criteria**: The changed backend surface still builds, type-checks, and passes tests. ## Guardrails - Do not inline the whole Node.js handbook in `SKILL.md`. - Do not skip `references/stack.md`. - Do not use `console.log` in production code — use pino. - Do not bypass input validation at API boundaries. - Do not leave unhandled promise rejections. - Do not hardcode secrets, ports, or environment-specific values. - Do not add `disable-model-invocation`; this is a normal domain skill. ## When To Load References - `references/stack.md` Always. - `references/bun-runtime.md` When the project uses Bun (detected via `bun.lockb` or `bunfig.toml`). - then only the task-relevant files under `references/` ## Output Contract Report: 1. which references were loaded 2. the architecture pattern chosen 3. the change made 4. the verification run
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.