javascript-strict

Enforces strictness, clean code, and security rules for plain JavaScript Node.js code.

Updated Jan 1, 2026
One-click install
npx skills add https://github.com/sarkarshivaditya-lab/WellMate --skill javascript-strict-sarkarshivaditya-lab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: javascript-strict
Source: https://github.com/sarkarshivaditya-lab/WellMate/tree/main/.engineering-skills/0xMassi-claude-skills/javascript-strict
Command: npx skills add https://github.com/sarkarshivaditya-lab/WellMate --skill javascript-strict-sarkarshivaditya-lab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and reviewing plain JavaScript (non-TypeScript) Node.js code often leads to inconsistent style, swallowed errors, unbounded retries, blocking I/O, and security vulnerabilities. This Skill provides a concrete, numbered rule set (JS-01 through JS-25) derived from production Node.js services so code reviews and refactors follow one consistent standard. ## Core Features & Use Cases - Strictness and style rules: const-first declarations, destructuring, async/await over raw Promises, CommonJS export patterns, and JSDoc for all public methods. - Error handling and performance: contextual error logging, bounded retries with backoff, Set/Map for O(1) lookups, single-pass hot-path algorithms, and streaming large I/O with pipeline. - Security checklist: bans eval/Function, innerHTML with user data, hardcoded secrets, Math.random for tokens, and unsafe NODE_TLS_REJECT_UNAUTHORIZED usage, with AbortController-based timeouts. - Use Case: When reviewing a Node.js service pull request, apply the vulnerability checklist to catch a writeFileSync blocking the event loop, an unbounded recursive retry, and an unmasked token in logs before merge. ## Quick Start Review my Node.js service code against the javascript-strict rules and list every violation with a fixed version.

Frequently Asked Questions about javascript-strict

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

FAQPage Schema
How do I handle errors properly in Node.js async code?▼

Never catch and swallow errors; always log with context using a format like [Module] identifier Action: message, then decide to retry, skip, or throw. Replace recursive retries with bounded loops using backoff, and throw after the retry limit is exhausted.

What is the best way to add timeouts to fetch in Node.js?▼

Use AbortController with a setTimeout that aborts the request, clearing the timer in a finally block. This replaces the older Promise.race timeout pattern and also supports caller-driven cancellation via an external signal.

Should I use const, let, or var in modern JavaScript?▼

Use const by default for anything never reassigned, let only when reassignment is required, and never use var. Destructure objects at declaration with defaults, for example const { mode = 'both', delay = 1000 } = options.

Can I replace third-party npm packages with Node.js built-ins?▼

Yes, Node 22+ ships equivalents for many packages: global fetch replaces node-fetch, node:test replaces mocha or jest for simple libraries, --env-file replaces dotenv, fs.glob replaces glob, and node:sqlite covers simple database use.

Why is Math.random not safe for generating tokens?▼

Math.random is predictable and seedable, making it unsuitable for session IDs, password reset tokens, nonces, or salts. Use crypto.randomBytes from node:crypto instead, for example randomBytes(32).toString('hex') for a cryptographically random token.

When should I avoid writeFileSync in Node.js?▼

Avoid writeFileSync in the event loop because it blocks execution for 5-50ms per call. Use await fs.promises.writeFile instead, and for large files or network data use streams with pipeline from node:stream/promises to handle backpressure.