typescript-node
Skill0 starsChanged 3 months agoMITView on GitHub
Use when writing or reviewing TypeScript or Node.js code. Strict mode, async/await footguns, error handling, null safety, real types vs any, ESM/CJS interop, npm hygiene (engines, lockfile, scripts, ci).
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- yanzyuyu/min-toktheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- yanzyuyu/min-tok★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository110 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/project-bootstrap/templates/agents.mdAGENTS.md
- a11y-auditSkill
- agentic-ragSkill
- agent-reachSkill
- ai3d-genSkill
- ai-coding-dictionarySkill
- ai-toolsSkill
- animation-directionSkill
- api-specSkill
- architecture-diagramsSkill
- architectureSkill
- ascii-artSkill
- ask-bundleSkill
- binary-triageSkill
- bragSkill
- brag-slimSkill
- career-opsSkill
- code-reviewSkill
- computer-useSkill
- context7Skill
- context-hygieneSkill
- creative-engineeringSkill
- cu-realtimeSkill
- data-analystSkill
- databaseSkill
- dead-wireSkill
- debuggingSkill
- deploySkill
- devin-configSkill
- dispatching-parallel-agentsSkill
- dmaSkill
- dockerSkill
- drift-reportSkill
- e2e-testingSkill
- edge-casesSkill
- executionSkill
- fact-checkSkill
- finishing-a-development-branchSkill
- firmware-probeSkill
- frontend-designSkill
- gatesSkill
- ghidraSkill
- ghSkill
- github-actionsSkill
- git-workflowsSkill
- grillingSkill
- handoffSkill
- humanizerSkill
- hyperframesSkill
- i18nSkill
- image-forensicsSkill
- impeccableSkill
- implement-layaSkill
- intakeSkill
- jiraSkill
- knowledge-modelingSkill
- laya-orchestratorSkill
- learn-modeSkill
- mcp-governanceSkill
- The first 60 shown.
The file
Files
TypeScript & Node.js
Modern TypeScript and Node.js. The compiler only helps if you do not lie to it - any, as, and ! disable the protection that justifies the cost of TS.
Config and types
strict: truein tsconfig (includesstrictNullChecks,noImplicitAny). A project without strict is JavaScript with annotations.noUncheckedIndexedAccessfor safe indexing (arr[i]returnsT | undefined- the source of most "undefined is not a function" bugs).exactOptionalPropertyTypeswhen the repo uses it -x?: Tdoes not accept explicitundefined.any= virus: propagates and disables checking. Preferunknown+ narrowing (typeof,instanceof, type guard).as Tonly when you KNOW more than the compiler (rarely).satisfiesvalidates without widening.!non-null assertion = "trust me": use only after a check that guarantees it, or refactor to narrowing.- Type guard:
function isX(v: unknown): v is X- real narrowing instead of cast. interfacefor objects/contracts,typefor unions/intersections/utilities.enumonly when a runtime value is needed;as const+ union covers the rest.- Generics with constraints (
<T extends X>); hiddenanyin a generic does not count as typed.
Null safety
?./??for optional access and fallback;??(not||) when0/''/falseare valid values -||swallows them.Array.find/Map.getreturnundefined: handle it, do not assume.- External API data is
unknownuntil validated:zod/valibotat the boundary (parse, not cast) -JSON.parsereturnsanyand lies. - With
strictNullCheckson,T | null | undefinedis explicit - do not bypass with!.
Async/await footguns
- Forgotten
await= dangling promise: anasyncreturningPromise<T>must be awaited or returned. forEach(async)does NOT wait: runs in parallel without awaiting. Correct: sequentialfor...oforPromise.all(map)for parallel.Promise.allrejects on the first failure and abandons the others (which keep running).Promise.allSettledwhen each result matters.- try/catch only catches errors after
await- a promise without await escapes the try (floating promise). ESLint@typescript-eslint/no-floating-promisescatches this. unhandledRejectioncrashes modern Node: every promise gets await,.catch(), orPromise.allSettled.asyncin event-handler/fire-and-forget callbacks: explicit.catch(log).- Fetch timeout:
AbortSignal.timeout(ms)- fetch without timeout can hang forever.
Error handling
throw new Error('msg', { cause: e })- neverthrow 'string'orthrow ewithout context.catch (e):eisunknownunder strict - narrow (e instanceof Error) beforee.message.- Custom errors: class
extends Errorwithname-instanceofdistinguishes failure types. - A catch that only logs and continues = swallowing: handle or re-throw with context.
process.on('unhandledRejection')as a safety net in services - not as a strategy.
Node and runtime
node:fs/promisesover sync callbacks; sync (readFileSync) blocks the whole event loop - only in scripts/CLIs, never in servers.- Buffer/stream for large files; whole-file
readFileinto memory explodes on big files. process.env.Xisstring | undefined: validate at the boundary (throw at boot if missing) or explicit default - neverprocess.env.KEY!.- ESM (
import) vs CJS (require): new projects ESM ("type": "module");__dirnamedoes not exist in ESM (import.meta.dirnameon Node 20.11+). - Top-level await only in ESM; in CJS wrap in
async main().
npm and dependencies
npm ciin CI/deploy (respects lockfile);npm installonly in dev.engines.nodedeclared; version pinned via.nvmrc/devcontainers.- Dependency
prepublish/postinstallscripts are supply-chain surface -npm install --ignore-scriptswhen not needed. npm audit/npm ls <pkg>before adopting a dep; commit the lockfile together withpackage.json(dep change without lockfile = CI installs something different from local).npxexecutes remote code:npx pkgdownloads and runs - confirm the package is official.
Common review findings
any/as/!proliferating (fake typing).forEach(async)ormapwith async withoutPromise.all.- Promises without await/catch (floating).
||where??was meant (swallows0/'').JSON.parse/res.json()cast straight to a type (lie).process.env.Xused unvalidated.readFileSync/execSyncin a server (blocks the loop).trywithout a realcatch(empty catch, log-only catch).- New dependency without updated
package-lock. console.logof large objects/objects with secrets in prod.
Cascade
- JS test fundamentals:
testing(vitest/jest at the boundary). - npm/shell script footguns:
shell-safe. - Node CI (npm ci, cache):
github-actions,deploy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

