agentsclimarketplace

Sota javascript typescript

Skill martinholovsky/SOTA-skills/skills/sota-javascript-typescript

State-of-the-art JavaScript and TypeScript engineering (2026) for both writing and auditing code. Covers strict TypeScript configuration and type design, language idioms and pitfalls, async patterns, Node.js backends, JS/TS-specific security (XSS, prototype pollution, supply chain, injection), frontend/React and Node performance, and testing/tooling. Use whenever building, reviewing, refactoring, or security-auditing code involving JavaScript, TypeScript, Node, npm, React, frontend code, tsconfig, package.json, vitest, or any .ts/.tsx/.js/.mjs files.From its SKILL.md

Install
npx -y skills add martinholovsky/SOTA-skills --skill sota-javascript-typescript

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 12 stars12 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

7.9 KB, ~1.8k tokens by cl100k_base, as published. Nobody here has run it

SOTA JavaScript / TypeScript Engineering

Purpose

This skill encodes 2026 state-of-the-art for JS/TS so generated code is strict, secure, and fast by default — and so audits of existing code find the bug classes that actually bite: untyped boundaries, floating promises, XSS sinks, prototype pollution, supply-chain gaps, event-loop blocking, and leak-prone listeners. It has two operating modes; pick one explicitly at the start of a task.

Baseline assumptions (mid-2026): TypeScript ≥5.9 strict (6.0 = last JS-based compiler; 7.0 Go-native stable since July 2026, shipped as the regular typescript package — frameworks embedding the compiler API via Volar, e.g. Vue/Angular/Astro/Svelte, stay on 6.0 until a stable plugin API lands), ESM-first, Node LTS ≥22 (24 = active LTS; Node 26 ships Temporal by default), ES2024+ available, React 19.2-era with Server Components and React Compiler 1.0 where relevant, vitest 4 + flat-config ESLint (v9/v10).

BUILD mode (writing or modifying code)

  1. Read the relevant rules files first (index below) for the area you're touching. Don't generate from memory what a rules file specifies.
  2. Defaults unless the codebase dictates otherwise: strict tsconfig (rules/01), ESM, unknown over any, discriminated unions for state, zod/valibot parse at every untrusted boundary, ??/?. discipline, AbortController on cancellable ops, pino logging in services, Web APIs over deps.
  3. Match the host codebase for style, framework, and structure — but do not replicate its security bugs or any-sprawl into new code. New code meets the bar even in old repos.
  4. Boundary rule: every input from outside the type system (HTTP, env, JSON.parse, storage, postMessage, DB without typed client) is parsed with a schema before use. No as T on external data.
  5. Finish the job: new code compiles under tsc --noEmit, passes lint, and ships with behavior-level tests (rules/07). Handle the error path of every async call — no floating promises.
  6. When a requirement conflicts with a rule (e.g., legacy CJS, jest), follow the codebase and note the deviation; don't silently half-apply both.

AUDIT mode (reviewing existing code)

Scope first (frontend? Node service? library?), then read the matching rules files and run their audit checklists — each ends with grep/eslint hunt patterns. Validate findings: confirm attacker-controlled data actually reaches the sink, confirm the perf issue is on a hot path. No speculative findings.

Severity conventions:

  • CRITICAL — remotely exploitable now: untrusted input reaching eval/innerHTML/exec/SQL, auth bypass, secrets exfiltratable via XSS.
  • HIGH — exploitable with conditions, or guaranteed-corruption bug class: missing boundary validation, prototype-pollution-prone merge of request data, floating promises dropping errors, tokens in localStorage, unbounded request bodies, float money math, sync crypto blocking the loop.
  • MEDIUM — weakened posture or latent defect: missing strict tsconfig flags, no graceful shutdown, missing CSP/timeouts, || vs ?? on falsy-valid values, index keys on mutable lists, unbounded caches, missing supply-chain controls.
  • LOW — hygiene/debt: dead deps, hasOwnProperty, console.log in services, snapshot sprawl, missing memoization on profiled-hot paths.

Finding format:

[SEVERITY] Title (CWE-xxx if security)
File: path/to/file.ts:42
Issue: what is wrong, in one or two sentences
Evidence: the offending snippet
Impact: what an attacker/user/operator experiences
Fix: concrete change (code if short)

Order the report CRITICAL→LOW, deduplicate repeated patterns into one finding with a file list, and end with the top 3 systemic recommendations (e.g., "enable noUncheckedIndexedAccess", "adopt MSW", "add zod to route boundaries").

Rules index

FileRead this when...
rules/01-typescript-config-and-types.mdtouching tsconfig; designing types/interfaces; seeing any/casts; modeling state; validating input shape; setting up a library or monorepo; deciding zod-vs-types questions
rules/02-language-idioms.mdwriting any JS/TS logic: equality, ??/?., array methods, immutability, Map/Set, error classes and Result types, generators, dates (Temporal), money/number precision
rules/03-async-patterns.mdanything with promises/async: combinator choice, floating promises, AbortController/timeouts, event-loop ordering, top-level await, workers, streams, async race conditions
rules/04-node-backend.mdbuilding/auditing Node services: runtime choice, dropping deps for built-ins, env config, HTTP hardening (timeouts/body limits), graceful shutdown, process error policy, pino
rules/05-security.mdany security-relevant code or audit: XSS sinks, CSP, prototype pollution, npm supply chain, ReDoS, token storage/JWT, postMessage, child_process injection, SSRF
rules/06-performance.mdbundle size, React re-renders/keys/RSC, virtualization, debounce/throttle, memory leaks, Node event-loop blocking, profiling before optimizing
rules/07-testing-and-tooling.mdwriting tests or setting up tooling: vitest, testing-library behavior testing, MSW, Playwright, ESLint flat + typescript-eslint strict, knip, publint/attw, CI gates. Test strategy — suite shape, TDD, doubles, test data, flake policy — lives in sota-testing; load it for any build that writes logic. This file owns JS/TS runner mechanics only.

For a full audit, read 01→07 in order; security-focused audits prioritize 05, 01, 03, 04.

Top 10 non-negotiables

  1. strict: true + noUncheckedIndexedAccess in every tsconfig; no any, no @ts-ignore — unknown + narrowing, @ts-expect-error with reason.
  2. Parse, don't cast, at boundaries: zod/valibot on every HTTP body/query, env var, JSON.parse, webhook, postMessage payload. Types inside, schemas at the edge.
  3. No floating promises: every promise awaited or explicitly .catch-handled; @typescript-eslint/no-floating-promises as error. allSettled for independent work; bounded concurrency.
  4. Discriminated unions for state, exhaustive switch with never default — no boolean-soup interfaces with optional data/error pairs.
  5. === always; ??/?. over ||/&& for null-handling; immutable updates (toSorted, structuredClone, spread) on shared data.
  6. Errors are Error subclasses with cause; never throw strings; never swallow with empty catch; Node policy = log fatally then exit on uncaught.
  7. XSS sinks are forbidden by default: no innerHTML/dangerouslySetInnerHTML with non-constant input unless DOMPurify-sanitized at render; no eval family ever; CSP on HTML responses.
  8. No secrets in localStorage; no shell interpolation: httpOnly cookies for tokens; execFile/spawn array-args, never exec with template strings; parameterized SQL.
  9. Supply chain controlled: committed lockfile + npm ci, install scripts disabled/allowlisted, update cooldown, minimal deps — prefer platform built-ins (fetch, node:test, crypto.randomUUID).
  10. AbortController + timeouts on all I/O; never block the event loop (>50ms CPU → worker; no *Sync in request paths); listeners and intervals always cleaned up.

What ships with it: 7 files

110.2 KB alongside SKILL.md

Gives 0 of the 12 instructions most design frontend skills give in ~1.8k tokens

Counted across 1,179 of the 2,086 authors here whose files we hold, read 2026-09-06

  • Commit to a bold aesthetic directionin 31 of 1179, across 24 files
  • Prefer component composition over inheritancein 28 of 1179, across 14 files
  • Animate only transform and opacity propertiesin 27 of 1179, across 22 files
  • Memoize expensive computations with useMemoin 26 of 1179, across 13 files
  • Use semantic HTML elementsin 24 of 1179, across 23 files
  • Virtualize long lists for performancein 21 of 1179, across 10 files
  • Use CSS variables for design tokensin 20 of 1179, across 14 files
  • Implement loading, empty, and error statesin 20 of 1179
  • Lazy load heavy components with Suspensein 19 of 1179, across 8 files
  • Respect prefers-reduced-motion media queriesin 18 of 1179, across 10 files
  • Prioritize CSS-only animations for HTMLin 18 of 1179, across 16 files
  • Use compound components for related UI elementsin 18 of 1179, across 7 files

Said here and by no other author read

  • Pick build or audit mode at the start
  • Read relevant rules files before generating code
  • Use strict tsconfig settings
  • Parse external data with schemas at boundaries
  • Use unknown instead of any
  • Handle every async call error path

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.