loom-javascript

loom-javascript is a skill for Claude Code, Codex from cosmix/loom. It costs 29 tokens per session (5,580 once invoked), scanned A, original, MIT.

A set of guidance for writing modern JavaScript for Node.js, a runtime that runs JavaScript outside a web browser. It covers asynchronous code, modules, type checking through comments, dependency commands, linting, formatting, and tests.

In plain words
What is it for?
It is for building and checking Node.js programs with Bun or Node, including installing packages, running scripts, checking types, linting, formatting, and testing.
Why use it?
It highlights common JavaScript mistakes such as ignored asynchronous errors, unsafe parsed data, swallowed errors, and tests that accidentally run no files.

Skill for Claude CodeCodex

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

Good fit It is for building and checking Node.js programs with Bun or Node, including installing packages, running scripts, checking types, linting, formatting, and testing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmix/loom/loom-javascript
View source ↗ cosmix/loom
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 cosmix/loom --skill loom-javascript
Clone the repo
git clone --depth 1 https://github.com/cosmix/loom

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 loom-javascript

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmix/loom/loom-javascript/github.svg)](https://agentmods.dev/skills/cosmix/loom/loom-javascript)
Your own site
<a href="https://agentmods.dev/skills/cosmix/loom/loom-javascript"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-javascript/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 loom-javascript

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmix/loom/loom-javascript"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-javascript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,580 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. 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.00029 $0.05580
Opus 5.5 $0.00012 $0.02232
Sonnet 5.5 $0.00006 $0.01116
Haiku 4.5 $0.00003 $0.00558

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

Security

Grade A, and why

loom-javascript scanned grade A with 2 findings 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 24d 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.

const res = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

| Child processes | `node:child_process` (`execFile`, `spawn`) |
skills/loom-javascript/SKILL.md · 400 lines

How it starts

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

JavaScript Language Expertise

Overview

Idiomatic ES2022+ JavaScript on Node.js 22+ (or Bun): ES modules, async/await, JSDoc types checked by tsc, the built-in node: APIs, and a small tool set. Assumes the reader knows the language. The content is decision rules and the traps that survive review: a floating promise, == on mixed types, a lost this, JSON.parse output merged into an object (prototype pollution), a catch that swallows the error, a test runner that finds zero files and exits 0. TypeScript syntax is covered by loom-typescript.

Tooling

Use the package manager the repository's lockfile names. For new work prefer Bun: bun add, bun remove, bunx. Do not run npm or npx commands in this workflow.

Task Command
Install bun install
Add a dependency bun add zod (dev: bun add -d vitest)
Run a script bun run build
Run a one-off tool bunx eslint .
Run a file node src/main.js or bun src/main.js
Type-check JSDoc bunx tsc --noEmit
Lint bunx eslint . or bunx biome check .
Format bunx biome format --write . or bunx prettier --write .
Test, whole suite bun test / bunx vitest run / node --test
Audit dependencies bun audit
  • Lockfile: commit bun.lock. Install in CI with bun install --frozen-lockfile, which fails when package.json and the lockfile disagree.
  • Node version: pin it in package.json ("engines": {"node": ">=22"}) and in .nvmrc or .tool-versions. Node 22+ ships require(esm), fetch, node:test, --watch and --env-file.
  • Linting: ESLint 9 uses a flat config (eslint.config.js); .eslintrc* is the legacy format. Biome is a single binary that lints and formats (biome.json) and replaces ESLint plus Prettier when the rule set it ships is enough. Pick one linter per repository.

Floating promises need type information. ESLint's @typescript-eslint/no-floating-promises works on JavaScript when parserOptions.projectService points at a jsconfig.json. Without it, review every call to an async function for an await or a .catch.

Read the full file on GitHub · 400 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. 24d ago First seen · 400 lines · 29 tokens per session scan A a28bb3dd4573

Subscribe to this mod's changes

loom-javascript is a skill published in the GitHub repository cosmix/loom (64 stars, last pushed 2d ago), licensed MIT. It adds 29 tokens to every session and 5,580 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-04.