javascript-strict

javascript-strict is a skill for Claude Code, Codex from 0xMassi/claude-skills. It costs 85 tokens per session (3,191 once invoked), scanned A, original, MIT.

A set of strict rules for writing and reviewing plain JavaScript in Node.js, the environment for running JavaScript outside a web browser. It covers variable declarations, asynchronous code, classes and functions, documentation, errors, performance, and module usage.

In plain words
What is it for?
Use it when writing, reviewing, or reorganising non-TypeScript Node.js code.
Why use it?
It reduces common JavaScript mistakes and makes server-side code easier to maintain and diagnose. The rules also address unsafe error handling and avoidable performance problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing, reviewing, or reorganising non-TypeScript Node.js code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/0xmassi/claude-skills/javascript-strict
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 0xMassi/claude-skills --skill javascript-strict
Clone the repo
git clone --depth 1 https://github.com/0xMassi/claude-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for javascript-strict

README.md
[![agentmods](https://agentmods.dev/badge/skills/0xmassi/claude-skills/javascript-strict/github.svg)](https://agentmods.dev/skills/0xmassi/claude-skills/javascript-strict)
Your own site
<a href="https://agentmods.dev/skills/0xmassi/claude-skills/javascript-strict"><img src="https://agentmods.dev/badge/skills/0xmassi/claude-skills/javascript-strict/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for javascript-strict

Your own site · 80×15
<a href="https://agentmods.dev/skills/0xmassi/claude-skills/javascript-strict"><img src="https://agentmods.dev/badge/skills/0xmassi/claude-skills/javascript-strict.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,191 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00085 $0.03191
Opus 5.5 $0.00034 $0.01276
Sonnet 5.5 $0.00017 $0.00638
Haiku 4.5 $0.00009 $0.00319

Measured 1mo ago against content hash f71191522dbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

javascript-strict scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

return fetch(url).then(r => r.json()).then(data => process(data)).catch(handleError);
javascript-strict/SKILL.md · 460 lines

How it starts

The opening of the file, as written. The whole thing — 460 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JavaScript Strict Standard

Rules extracted from production Node.js services (non-TypeScript).

CRITICAL: Variable Declarations

JS-01: const by default, let when necessary, never var

// BAD
var count = 0;
var items = [];

// GOOD
const VALID_MODES = ['bypass', 'browser', 'capsolver'];  // Never changes
let activeCount = 0;  // Reassigned in loop
let currentDelay = baseDelay;  // Mutated by logic

No var anywhere.

JS-02: Destructure at declaration

// BAD
const name = config.name;
const port = config.port;
const mode = config.mode;

// GOOD
const { name, port, mode } = config;

// GOOD: with defaults
const { mode = 'both', delay = 1000 } = options;

CRITICAL: Error Handling

JS-03: Never catch and swallow errors

// BAD
try { await save(); } catch (e) {}

// BAD: logs but no recovery
try { await save(); } catch (e) { console.log(e); }

// GOOD: context + action
try {
  await save();
} catch (err) {
  console.error(`[Monitor] ${this.monitorId} Save failed:`, err.message);
  await this.notifyError('save_failure', err.message);
  // Decide: retry, skip, or throw
}

JS-04: Prefix error logs with context

// BAD
console.error(err.message);

// GOOD
console.error(`[Monitor] ${this.monitorId} Error:`, err.message);
console.error(`[TokenBank] ${this.baseHost} Persist failed:`, err.message);
console.warn(`[DEPRECATED] MONITOR_BYPASS is deprecated, use TMPT_MODE`);

Format: [Module] ${identifier} Action: message

JS-05: Avoid recursive retry without limits

// BAD: infinite recursion on persistent failure
async getTmpt() {
  try {
    const token = await this.tmptBank.getTmpt();
    if (!token) { await sleep(1000); return this.getTmpt(); }
    return token;
  } catch {
    await sleep(1000);
    return this.getTmpt(); // STACK OVERFLOW on persistent failure
  }
}

// GOOD: bounded retries
async getTmpt(retries = 10) {
  for (let i = 0; i < retries; i++) {
    try {
      const token = await this.tmptBank.getTmpt();
      if (token) return token;
    } catch (err) {
      console.error(`[Monitor] getTmpt attempt ${i + 1}/${retries}:`, err.message);
    }
    await sleep(1000 * Math.min(i + 1, 5)); // Backoff
  }
  throw new Error(`Failed to get TMPT after ${retries} attempts`);
}

Read the full file on GitHub · 460 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 460 lines · 85 tokens per session scan A f71191522dbe

Subscribe to this mod's changes

javascript-strict is a skill published in the GitHub repository 0xMassi/claude-skills (8 stars, last pushed 6mo ago), licensed MIT. It adds 85 tokens to every session and 3,191 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.