Review TypeScript and JavaScript code for language and runtime conventions only. Do not define scope (diff vs codebase) or perform security/architecture analysis; those are handled by the scope and cognitive skills. Emit a findings list in the standard format for aggregation. Focus on type safety and type system usage, async patterns and Promise handling, error handling, module design, runtime correctness, API and interface design, and performance and memory considerations.
Core Objective
Primary goal: produce a TypeScript/JavaScript language findings list covering type safety, async patterns, error handling, module design, runtime correctness, API/interface design, and performance/memory for the given code scope.
Success criteria (all must hold):
✅ TypeScript/JavaScript language scope only: reviews TypeScript and JavaScript language and runtime conventions only; performs no scope selection, security, or architecture analysis
✅ All seven language dimensions covered: type safety, async patterns, error handling, module design, runtime correctness, API/interface design, and performance/memory are assessed where relevant
✅ Findings format compliant: each finding carries location, category (language-typescript), severity, title, description, and an optional suggestion
✅ File/line references: every finding cites a specific file:line or symbol name
✅ Non-TS/JS code excluded: non-TypeScript/JavaScript files are not analyzed against TS/JS-specific rules unless they are explicitly in scope
Acceptance test: does the output contain a TypeScript/JavaScript-centered findings list with file/line references covering all relevant language dimensions, without performing security, architecture, or scope analysis?
Scope Boundaries
This skill owns:
Type safety and type system usage (strict mode, precise types, any avoidance, discriminated unions, type guards, generics)
Scope selection — the scope is supplied by the caller
Security analysis (injection, secrets, XSS) — use review-security
Architecture analysis — use review-architecture
Framework conventions (Vue, React, Angular) — use the framework-specific skill (for example review-vue)
Full orchestrated review — use orchestrate-code-review
Handoff point: once all TypeScript/JavaScript findings are emitted, hand them to orchestrate-code-review for aggregation. For injection risks or secrets in the code, note them and point at review-security.
Use Cases
Orchestrated review: serves as the language step when orchestrate-code-review runs scope → language → framework → library → cognitive on a TypeScript/JavaScript project.
TypeScript-only review: when the user wants nothing but TypeScript/JavaScript language conventions checked.
Pre-PR language checklist: confirm type safety, async correctness, and sound module design before merging.
When to use: when the code under review is TypeScript or JavaScript and the task includes language quality. Scope is set by the caller or the user.
Behavior
What this skill covers
Analyse: TypeScript and JavaScript language and runtime conventions inside the given code scope (files or a diff supplied by the caller). Does not decide scope; takes the code scope as input.
Do not: perform scope selection, security review, or architecture review; do not check non-TS/JS files against TS/JS rules unless they are in scope.
Review checklist (TypeScript/JavaScript language only)
Type safety and type system usage: enforce strict mode; prefer explicit types over any; model state with discriminated unions; apply type guards and narrowing; use generics for reuse without giving up type information; avoid type assertions (as) where narrowing would do.
Async patterns: ensure correct async/await usage and Promise chaining; verify error propagation across async boundaries; detect race conditions and unhandled Promise rejections; check for dangling Promises (missing await); verify concurrency patterns (Promise.all, Promise.allSettled).
Error handling: verify try/catch placement and specificity; prefer custom error types over bare strings or a raw Error; ensure exhaustive error handling (switch/if-else covering every case); check that errors carry enough context; verify cleanup in finally blocks.
Module design: prefer ESM (import / export) over CJS (require / module.exports); audit barrel exports for tree-shaking impact; detect circular dependencies; check for unintended side effects at module scope; verify consistent module resolution.
API and interface design: check function signatures for clarity and consistency; verify overloads are ordered correctly and unambiguous; check branded/opaque types for domain safety; enforce readonly where mutation would be unintended; verify index signatures and mapped types.
Performance and memory: detect closure-based memory leaks; verify event listener and subscription cleanup; check WeakRef/WeakMap usage for caching patterns; assess the bundle size impact of imports; identify hot-path inefficiencies (for example unnecessary allocations inside a loop).
Tone and references
Professional and technical: cite the exact location (file:line or symbol name). Emit findings carrying location, category, severity, title, description, and suggestion.
Input & Output
Input
Code scope: files or directories (or a diff) containing TypeScript or JavaScript code (.ts, .tsx, .js, .jsx, .mts, .mjs, .cts, .cjs). Supplied by the user or by a scope skill.
Output
Emit zero or more findings in the format defined in specs/findings-list.md, with Categorylanguage-typescript.
The category for this skill is language-typescript.
Restrictions
Hard Boundaries
Do not perform scope selection, security, or architecture review. Stay inside TypeScript/JavaScript language and runtime conventions.
Do not state a finding without a concrete location or an actionable suggestion.
Do not review non-TS/JS code against TS/JS-specific rules unless it is explicitly in scope.
Skill Boundaries
Do not do these (other skills handle them):
Do not select or define the code scope - it is set by the caller or by orchestrate-code-review
Do not perform security analysis (injection, secrets) — use review-security
Do not perform architecture analysis — use review-architecture
Do not review framework-specific conventions (Vue, React, Angular) — use the corresponding framework skill
When to stop and hand off:
Once all TypeScript/JavaScript findings are emitted, hand them to orchestrate-code-review for aggregation
When injection risks or secrets turn up, note them and point at review-security
When the user wants a full review (scope + language + cognitive), redirect to orchestrate-code-review
Self-Check
Core success criteria
TypeScript/JavaScript language scope only: reviews TypeScript and JavaScript language and runtime conventions only; performs no scope selection, security, or architecture analysis
All seven language dimensions covered: type safety, async patterns, error handling, module design, runtime correctness, API/interface design, and performance/memory are assessed where relevant
Findings format compliant: each finding carries location, category (language-typescript), severity, title, description, and an optional suggestion
File/line references: every finding cites a specific file:line or symbol name
Non-TS/JS code excluded: non-TypeScript/JavaScript files are not analyzed against TS/JS-specific rules unless they are explicitly in scope
Process quality checks
Were only TypeScript/JavaScript language dimensions reviewed (no scope/security/architecture)?
Were type safety, async patterns, error handling, module design, runtime correctness, API design, and performance covered where relevant?
Does every finding carry location, category = language-typescript, severity, title, description, and an optional suggestion?
Is each issue referenced by file:line or symbol name?
Acceptance test
Does the output contain a TypeScript/JavaScript-centered findings list with file/line references covering all relevant language dimensions, without performing security, architecture, or scope analysis?
Examples
Example 1: unsafe use of any
Input: a module whose function parameters are typed any with no runtime validation.
Expected: one finding (major) for the unsafe any usage; the suggestion is to replace it with a proper type, a generic, or unknown plus narrowing. Category = language-typescript.
Example 2: missing await on an async call
Input: an async function calls another async function without await, discarding the Promise.
Expected: one finding (critical/major) for the dangling Promise; the suggestion is to add await or handle the returned Promise explicitly. Category = language-typescript.
Edge case: ESM and CJS mixed in one project
Input: a project where some files use import/export and others use require/module.exports.
Expected: a finding for inconsistent module system usage; the suggestion is to migrate to a single module system (preferably ESM) or to document why the mix exists. Category = language-typescript.
1---2name: review-typescript3description: Review TypeScript/JavaScript code for type safety, async patterns, error handling, and module design. Atomic skill; output is a findings list.4license: MIT5---67# Skill: Review TypeScript89## Purpose1011Review **TypeScript and JavaScript** code for **language and runtime conventions** only. Do not define scope (diff vs codebase) or perform security/architecture analysis; those are handled by the scope and cognitive skills. Emit a **findings list** in the standard format for aggregation. Focus on type safety and type system usage, async patterns and Promise handling, error handling, module design, runtime correctness, API and interface design, and performance and memory considerations.1213---1415## Core Objective1617**Primary goal**: produce a TypeScript/JavaScript language findings list covering type safety, async patterns, error handling, module design, runtime correctness, API/interface design, and performance/memory for the given code scope.1819**Success criteria** (all must hold):20211. ✅ **TypeScript/JavaScript language scope only**: reviews TypeScript and JavaScript language and runtime conventions only; performs no scope selection, security, or architecture analysis222. ✅ **All seven language dimensions covered**: type safety, async patterns, error handling, module design, runtime correctness, API/interface design, and performance/memory are assessed where relevant233. ✅ **Findings format compliant**: each finding carries location, category (`language-typescript`), severity, title, description, and an optional suggestion244. ✅ **File/line references**: every finding cites a specific file:line or symbol name255. ✅ **Non-TS/JS code excluded**: non-TypeScript/JavaScript files are not analyzed against TS/JS-specific rules unless they are explicitly in scope2627**Acceptance** test: does the output contain a TypeScript/JavaScript-centered findings list with file/line references covering all relevant language dimensions, without performing security, architecture, or scope analysis?2829---3031## Scope Boundaries3233**This skill owns**:3435- Type safety and type system usage (strict mode, precise types, `any` avoidance, discriminated unions, type guards, generics)36- Async patterns (async/await, Promise handling, error propagation, race conditions, unhandled rejections)37- Error handling (try/catch patterns, custom error types, error boundaries, exhaustive error handling)38- Module design (ESM vs CJS, barrel exports, circular dependencies, tree-shaking, side effects)39- Runtime correctness (null/undefined handling, equality checks, coercion pitfalls, prototype pollution)40- API and interface design (function signatures, overloads, branded types, readonly correctness)41- Performance and memory (closure leaks, event listener cleanup, WeakRef/WeakMap usage, bundle size impact)4243**This skill does not own**:4445- Scope selection — the scope is supplied by the caller46- Security analysis (injection, secrets, XSS) — use `review-security`47- Architecture analysis — use `review-architecture`48- Framework conventions (Vue, React, Angular) — use the framework-specific skill (for example `review-vue`)49- Full orchestrated review — use `orchestrate-code-review`5051**Handoff point**: once all TypeScript/JavaScript findings are emitted, hand them to `orchestrate-code-review` for aggregation. For injection risks or secrets in the code, note them and point at `review-security`.5253---5455## Use Cases5657- **Orchestrated review**: serves as the language step when [orchestrate-code-review](../orchestrate-code-review/SKILL.md) runs scope → language → framework → library → cognitive on a TypeScript/JavaScript project.58- **TypeScript-only review**: when the user wants nothing but TypeScript/JavaScript language conventions checked.59- **Pre-PR language checklist**: confirm type safety, async correctness, and sound module design before merging.6061**When to use**: when the code under review is TypeScript or JavaScript and the task includes language quality. Scope is set by the caller or the user.6263---6465## Behavior6667### What this skill covers6869- **Analyse**: TypeScript and JavaScript language and runtime conventions inside the **given code scope** (files or a diff supplied by the caller). Does not decide scope; takes the code scope as input.70- **Do not**: perform scope selection, security review, or architecture review; do not check non-TS/JS files against TS/JS rules unless they are in scope.7172### Review checklist (TypeScript/JavaScript language only)73741. **Type safety and type system usage**: enforce `strict` mode; prefer explicit types over `any`; model state with discriminated unions; apply type guards and narrowing; use generics for reuse without giving up type information; avoid type assertions (`as`) where narrowing would do.752. **Async patterns**: ensure correct async/await usage and Promise chaining; verify error propagation across async boundaries; detect race conditions and unhandled Promise rejections; check for dangling Promises (missing `await`); verify concurrency patterns (`Promise.all`, `Promise.allSettled`).763. **Error handling**: verify try/catch placement and specificity; prefer custom error types over bare strings or a raw Error; ensure exhaustive error handling (switch/if-else covering every case); check that errors carry enough context; verify cleanup in finally blocks.774. **Module design**: prefer ESM (`import` / `export`) over CJS (`require` / `module.exports`); audit barrel exports for tree-shaking impact; detect circular dependencies; check for unintended side effects at module scope; verify consistent module resolution.785. **Runtime correctness**: check null/undefined handling (optional chaining, nullish coalescing); enforce strict equality (`===`/`!==`); detect coercion pitfalls (implicit type conversion); check prototype pollution risk; verify iterator/generator correctness.796. **API and interface design**: check function signatures for clarity and consistency; verify overloads are ordered correctly and unambiguous; check branded/opaque types for domain safety; enforce `readonly` where mutation would be unintended; verify index signatures and mapped types.807. **Performance and memory**: detect closure-based memory leaks; verify event listener and subscription cleanup; check WeakRef/WeakMap usage for caching patterns; assess the bundle size impact of imports; identify hot-path inefficiencies (for example unnecessary allocations inside a loop).8182### Tone and references8384- **Professional and technical**: cite the exact location (file:line or symbol name). Emit findings carrying location, category, severity, title, description, and suggestion.8586---8788## Input & Output8990### Input9192- **Code scope**: files or directories (or a diff) containing TypeScript or JavaScript code (.ts, .tsx, .js, .jsx, .mts, .mjs, .cts, .cjs). Supplied by the user or by a scope skill.9394### Output9596- Emit zero or more **findings** in the format defined in [specs/findings-list.md](../../specs/findings-list.md), with **Category** `language-typescript`.97- The category for this skill is **language-typescript**.9899---100101## Restrictions102103### Hard Boundaries104105- **Do not** perform scope selection, security, or architecture review. Stay inside TypeScript/JavaScript language and runtime conventions.106- **Do not** state a finding without a concrete location or an actionable suggestion.107- **Do not** review non-TS/JS code against TS/JS-specific rules unless it is explicitly in scope.108109### Skill Boundaries110111**Do not do these** (other skills handle them):112113- Do not select or define the code scope - it is set by the caller or by `orchestrate-code-review`114- Do not perform security analysis (injection, secrets) — use `review-security`115- Do not perform architecture analysis — use `review-architecture`116- Do not review framework-specific conventions (Vue, React, Angular) — use the corresponding framework skill117118**When to stop and hand off**:119120- Once all TypeScript/JavaScript findings are emitted, hand them to `orchestrate-code-review` for aggregation121- When injection risks or secrets turn up, note them and point at `review-security`122- When the user wants a full review (scope + language + cognitive), redirect to `orchestrate-code-review`123124---125126## Self-Check127128### Core success criteria129130- [ ] **TypeScript/JavaScript language scope only**: reviews TypeScript and JavaScript language and runtime conventions only; performs no scope selection, security, or architecture analysis131- [ ] **All seven language dimensions covered**: type safety, async patterns, error handling, module design, runtime correctness, API/interface design, and performance/memory are assessed where relevant132- [ ] **Findings format compliant**: each finding carries location, category (`language-typescript`), severity, title, description, and an optional suggestion133- [ ] **File/line references**: every finding cites a specific file:line or symbol name134- [ ] **Non-TS/JS code excluded**: non-TypeScript/JavaScript files are not analyzed against TS/JS-specific rules unless they are explicitly in scope135136### Process quality checks137138- [ ] Were only TypeScript/JavaScript language dimensions reviewed (no scope/security/architecture)?139- [ ] Were type safety, async patterns, error handling, module design, runtime correctness, API design, and performance covered where relevant?140- [ ] Does every finding carry location, category = language-typescript, severity, title, description, and an optional suggestion?141- [ ] Is each issue referenced by file:line or symbol name?142143### Acceptance test144145Does the output contain a TypeScript/JavaScript-centered findings list with file/line references covering all relevant language dimensions, without performing security, architecture, or scope analysis?146147---148149## Examples150151### Example 1: unsafe use of `any`152153- **Input**: a module whose function parameters are typed `any` with no runtime validation.154- **Expected**: one finding (major) for the unsafe `any` usage; the suggestion is to replace it with a proper type, a generic, or `unknown` plus narrowing. Category = language-typescript.155156### Example 2: missing `await` on an async call157158- **Input**: an async function calls another async function without `await`, discarding the Promise.159- **Expected**: one finding (critical/major) for the dangling Promise; the suggestion is to add `await` or handle the returned Promise explicitly. Category = language-typescript.160161### Edge case: ESM and CJS mixed in one project162163- **Input**: a project where some files use `import`/`export` and others use `require`/`module.exports`.164- **Expected**: a finding for inconsistent module system usage; the suggestion is to migrate to a single module system (preferably ESM) or to document why the mix exists. Category = language-typescript.
Run npx skillmds@latest add nesnilnehc/review-typescript in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Review TypeScript/JavaScript code for type safety, async patterns, error handling, and module design. Atomic skill; output is a findings list. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
nesnilnehc (@nesnilnehc) published this skill. Their other Agent Skills are listed on their SkillMD profile.