Sota Javascript Typescript 标志

Sota Javascript Typescript

社区
martinholovsky
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.

概览

发布者martinholovsky
代码仓库SOTA-skills
技能名称sota-javascript-typescript
星标数
28
复刻数
3
附带文件
9
许可协议CC-BY-4.0
链接
  • Markdown 格式的指令

    模型按需加载的 SKILL.md 文件,因此只有在请求确实匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 9 个随附文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 martinholovsky 发布于 GitHub。请在安装前查看源内容。

安装

在 TypingMind 中安装 Sota Javascript Typescript AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/martinholovsky/SOTA-skills/tree/main/skills/sota-javascript-typescript
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/martinholovsky/SOTA-skills.git /tmp/SOTA-skills
mkdir -p .claude/skills
cp -r /tmp/SOTA-skills/skills/sota-javascript-typescript .claude/skills/sota-javascript-typescript
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Sota Javascript Typescript,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Sota Javascript Typescript。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Sota Javascript Typescript 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会获取指令,因此未使用的技能不会产生额外费用。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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 since July 2026, shipped as the regular typescript package with no compiler API — typescript-eslint, including the non-negotiable no-floating-promises, and Volar-based frameworks (Vue/Angular/Astro/Svelte) still need the 6.0 API, so install typescript as npm:@typescript/typescript6 beside 7.0 until they support 7: rules/01), ESM-first, Node LTS ≥22 (run the line marked Active LTS at github.com/nodejs/Release; 26 is scheduled for LTS on 2026-10-28 and ships Temporal by default), ES2024+ available, React 19.2-era with Server Components and React Compiler (stable since 1.0) where relevant, latest stable Vitest + flat-config ESLint (the default since v9).

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)

Coverage: every rules/ file's Audit checklist applies in AUDIT mode. Mark one not applicable only with its reason in the report — never skip a file because the thing it checks for is absent, since that absence may be the finding.

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/exec/SQL, auth bypass, an XSS where script can read a session token or secret (one band up from HIGH, as sota-code-security adjusts for context).
  • HIGH — exploitable with conditions, or guaranteed-corruption bug class: untrusted HTML reaching innerHTML/dangerouslySetInnerHTML (stored or reflected XSS, sota-code-security's High band), 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: Expands the router's canonical row (file:line | rule | severity | effort | fix, which wins on a cross-domain roll-up); evidence block and report order: sota rules/03 §2 and §5.

[SEVERITY] Title (CWE-xxx if security)
File: path/to/file.ts:42
Rule: rules/NN-name.md § section
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)
Effort: trivial | small | medium | large

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 (TS ≥6.0 types: [] / rootDir defaults; TS 7.0 has no compiler API — the typescript6 alias for typed lint; .ts import specifiers under Node type stripping); 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, in-band sentinels (absence encoded as -1/0/"") — -1 lies where NaN poisons, 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 (Node Permission Model: scoped --allow-*, symlinks escape it, no network scope before v25), dropping deps for built-ins, env config, dev servers, --inspect and an unset NODE_ENV in production, HTTP hardening (timeouts/body limits), graceful shutdown, request context kept out of module scope (AsyncLocalStorage.run, not enterWith), process error policy (unlistened 'error' events, Express 4 async handlers; heap exhaustion is fatal past every handler, JSON.parse has no depth or size option), pino; require(esm) vs dual publishing, and top-level await in a library entry (ERR_REQUIRE_ASYNC_MODULE); node:crypto AEAD traps (update() before final(), missing authTagLength), TLS/ssh2 verification opt-outs, server-side headless browsers (goto as SSRF, string evaluate)
rules/05-security.mdany security-relevant code or audit: XSS sinks (incl. string-to-code DOM APIs: setAttribute('on…'), script text, Lit unsafe*), CSP, server-side template engines (raw output, template/view-name injection), prototype pollution, invisible/bidi characters in source, NoSQL operator injection, Ajv and cors config, npm supply chain (install/build-time hooks per package manager, credential-free install job), ReDoS, token storage/JWT, app-set cookie defaults per framework, dynamic code evaluation (Function, node:vm, dispatch tables), postMessage and Web Worker scripts/messages, frozen security objects and attacker-chosen global keys (child_process injection and SSRF moved to rules/08); escape hatches into raw memory: native addons, node:ffi and Buffer.allocUnsafe; pnpm cooldown that fails open unless minimumReleaseAge is written, trustPolicy: no-downgrade; npx/dlx in CI bypassing the lockfile, a sanitizer job for native addons, bundles that carry no SBOM
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, suppressions that fail CI once stale (reportUnusedDisableDirectives defaults to warn; Biome --error-on-warnings), test code exempted by path in config, knip, publint/attw, tarball review (npm pack --dry-run, files over .npmignore), 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.
rules/08-process-and-outbound.mdserver code that spawns processes, fetches a caller-influenced URL, or validates request bodies (mass assignment, NoSQL operator injection, Ajv, cors config — rule bodies here, probes in rules/05): child_process (execFile array form, shell: true), SSRF with the connect-time lookup check, credentials that follow a redirect, and its browser counterpart: client-side fetch/XHR/EventSource to a page-supplied URL (split out of rules/05, section names unchanged)
rules/09-browser-platform-security.mdbrowser code with more reach than a page: service workers (same-origin script, narrow scope, stable URL, kill switch; AppCache retired), DOM clobbering (named elements shadowing globals; DOMPurify SANITIZE_NAMED_PROPS, Sanitizer API keys), browser extensions (no remote code, isolated world, sender checks, least permissions, storage access level), client-side storage (sessionStorage over localStorage, non-extractable CryptoKey for IndexedDB, read-back as untrusted input; Web SQL removed)

For a full audit, read 01→09 in order; security-focused audits prioritize 05, 08, 09, 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.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Sota Javascript Typescript AI 技能有什么作用?

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.

为什么在 TypingMind 中使用 Sota Javascript Typescript?

因为您只需安装一次,就能搭配任何模型使用。Sota Javascript Typescript 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型,甚至可以在聊天中途切换模型,而不会影响技能正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Sota Javascript Typescript?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/martinholovsky/SOTA-skills/tree/main/skills/sota-javascript-typescript。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Sota Javascript Typescript?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Sota Javascript Typescript 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以搭配 Sota Javascript Typescript 使用,包括 GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等,都可在 TypingMind 中使用您自己的 API 密钥接入。

Sota Javascript Typescript AI 技能免费吗?

是的。该技能源自 martinholovsky 在 GitHub 上以 CC-BY-4.0 许可证发布的项目。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇