Use when writing generic TypeScript or Node, building an npm package, configuring tsconfig strictness, running ESLint, Biome or tsc, handling Node security, or framework-agnostic JS/TS logic.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ts Dev Core?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ddtcorex-ts-dev-core)
---
name: ts-dev-core
description: Use when writing generic TypeScript or Node, building an npm package, configuring tsconfig strictness, running ESLint, Biome or tsc, handling Node security, or framework-agnostic JS/TS logic.
compatibility: claude, codex, opencode, copilot, dsh
metadata:
audience: developers
workflow: typescript
---
# TypeScript/Node Developer Core
## When to use
Load this skill for TypeScript or Node work outside a specific framework.
- "write generic TypeScript", "create an npm package", "configure tsconfig"
- "run ESLint", "run Biome", "run tsc", "Node security", "framework-agnostic TS/JS logic"
Foundation skill for framework-agnostic TypeScript and Node. Covers strict typing, lint/format tooling, packaging and publishing, security, and testing, independent of any particular framework (Next.js, NestJS, etc. get their own skill when one exists).
## 1. Type Strictness
Every new package's `tsconfig.json` MUST enable strict mode plus the flags below; `strict: true` alone misses real classes of bugs the extras catch:
```json
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true,
"verbatimModuleSyntax": true
}
}
```
- `noUncheckedIndexedAccess`: an array or record index read returns `T | undefined`, not `T`; this is the single highest-value flag beyond base `strict`.
- `exactOptionalPropertyTypes`: `{ a?: string }` rejects `{ a: undefined }`, catching a common source of silent `undefined` leaking past an optional field.
- Prefer `type` imports (`import type { Foo } from './foo'`) for anything used only as a type; `verbatimModuleSyntax` enforces it and keeps the emitted JS free of dead imports.
- An existing project's narrower `tsconfig` wins; propose raising strictness rather than silently widening a shared config.
## 2. Lint and Format
Two live choices as of this writing, pick per project and state which:
- **Biome v2**: single binary, formatter plus linter plus import sorter, far faster than the ESLint/Prettier pair, fewer plugins than the ESLint ecosystem. Good default for a new project with no exotic lint needs.
- **typescript-eslint** (+ Prettier): still the right call when a project needs type-aware rules (`no-floating-promises`, `no-unsafe-*`) or a plugin Biome does not cover yet (framework-specific plugins, `eslint-plugin-n` for Node-specific checks).
```bash
# Biome v2
npx @biomejs/biome check --write .
# typescript-eslint
npx eslint . --fix
npx prettier --check .
```
Never run both stacks over the same files; pick one and remove the other's config so CI does not fight itself.
## 3. Packaging and Publishing
- Workspace: pnpm workspaces (`pnpm-workspace.yaml`) for a monorepo; plain `package.json` for a single package. Never mix npm/yarn lockfiles into a pnpm workspace.
- `package.json#exports` is the public API surface; list every subpath explicitly, and set `"types"` per export condition so consumers on `moduleResolution: bundler` and `node16` both resolve types correctly.
- Dual ESM/CJS only when a consumer genuinely needs CJS; otherwise ship ESM-only (`"type": "module"`) and say so, since dual builds double the surface to test.
- Publish only by CI from a pushed tag, never `npm publish` by hand (see this repo's own publishing rule); use `npm publish --provenance` when the CI identity supports OIDC, so the registry can verify the package came from the stated build.
- Semver discipline: a breaking change to `exports` or a public type is a major bump, never a patch "because it's just types".
## 4. Security Baseline
- **Never** `eval()`, `new Function()`, or `child_process.exec()` with interpolated untrusted input; use `execFile`/`spawn` with an argument array.
- Treat `require()`/dynamic `import()` with a path built from user input as a path-traversal risk; validate against an allowlist before resolving.
- Pin the lockfile (`pnpm-lock.yaml` committed) and run `npm audit` / `pnpm audit` in CI; fail on `high`/`critical`, triage `moderate`.
- Secrets never in source or committed `.env`; read from the process environment or a secrets manager at runtime.
- Validate at the boundary (HTTP body, CLI args, file reads) with a schema (`zod`, `valibot`) rather than trusting the declared TypeScript type, which is erased at runtime and proves nothing about the actual payload.
## 5. Testing and Verification
- Vitest for a modern project (fast, ESM-native, same API shape as Jest); Jest where a codebase already standardizes on it.
- Unit tests next to or under `tests/`, mirroring source layout; mock at the boundary (network, filesystem, clock), not internal collaborators.
- Verification checklist before every commit:
```bash
tsc --noEmit # 1. Types, no emit
npx @biomejs/biome check . # 2. Lint + format (or eslint . && prettier --check .)
npm audit --audit-level=high # 3. No known high/critical CVEs
vitest run # 4. Tests green
```
Rebuild the client bundle when client-facing code changed; a passing `tsc`/test suite proves the code compiles and the logic is covered, not that the built artifact works, run it the way a user runs it before calling the change done.