typescript-review-patterns

typescript-review-patterns is a skill for Claude Code, Codex from mickeyyaya/refactoring-skills. It costs 88 tokens per session (3,724 once invoked), scanned A, original, MIT.

A TypeScript code-review guide focused on common ways the language's safety checks can be bypassed. It covers unsafe casts, type narrowing, async errors, React hook rules, module patterns, and immutability.

In plain words
What is it for?
Use it when reviewing TypeScript or TSX code, especially public APIs, asynchronous code, React components, and imports.
Why use it?
It helps reviewers catch bugs that generic review rules may miss, such as unhandled Promise failures, stale React data, or unjustified type assertions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when reviewing TypeScript or TSX code, especially public APIs, asynchronous code, React components, and imports.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mickeyyaya/refactoring-skills/typescript-review-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mickeyyaya/refactoring-skills --skill typescript-review-patterns
Clone the repo
git clone --depth 1 https://github.com/mickeyyaya/refactoring-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for typescript-review-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/typescript-review-patterns/github.svg)](https://agentmods.dev/skills/mickeyyaya/refactoring-skills/typescript-review-patterns)
Your own site
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/typescript-review-patterns"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/typescript-review-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for typescript-review-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/typescript-review-patterns"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/typescript-review-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,724 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.03724
Opus 5 $0.00044 $0.01862
Sonnet 5 $0.00018 $0.00745
Haiku 4.5 $0.00009 $0.00372

Measured 9d ago against content hash 649898c792a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

typescript-review-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/typescript-review-patterns/SKILL.md · 422 lines

How it starts

The opening of the file, as written. The whole thing — 422 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TypeScript Code Review Patterns

Overview

TypeScript adds a rich static type system on top of JavaScript, but the type system has escape hatches — and those escape hatches are where most TypeScript-specific bugs hide. A reviewer who does not know where the safety net has holes will miss real defects while flagging non-issues.

This skill covers five high-value review dimensions unique to TypeScript: type escape hatches (any, as, !, @ts-ignore), type narrowing (discriminated unions, type guards), async/Promise pitfalls (unhandled rejections, floating promises), React hook rules (stale closures, dependency arrays), and module patterns (barrel exports, import type).

Load alongside review-accuracy-calibration to score confidence before posting.

Quick Reference

Review Dimension Severity Primary Red Flag
any on public API boundary HIGH param: any or : any in exported function
as assertion without prior narrowing HIGH value as SpecificType after JSON.parse or fetch
Non-null assertion ! MEDIUM obj!.prop where null is plausible
@ts-ignore without explanation MEDIUM suppress comment with no linked issue
Missing type guard (is) MEDIUM boolean check function used as narrowing
Unhandled Promise rejection HIGH async called without await or .catch()
Floating promise HIGH Promise expression with no await or handler
async in forEach HIGH arr.forEach(async (x) => ...) — errors swallowed
Promise.all swallows partial failure MEDIUM use allSettled when partial success matters
Stale closure in useEffect HIGH captured variable missing from dependency array
Missing dep in dependency array HIGH useEffect(() => { fn(x) }, [])x missing
Conditional hook call CRITICAL if (cond) { useState(...) } inside component
useCallback/useMemo overuse NIT wrapping cheap callbacks without referential need
Barrel export blocking tree-shaking MEDIUM export * from './utils' in public library API
Missing import type NIT value import used only as a type
Mutable reducer state HIGH direct state.items.push(...) in reducer function
Object or Function type MEDIUM param: Object instead of typed interface
Numeric enum footguns LOW numeric enum used in serialized or flag context

Read the full file on GitHub · 422 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 422 lines · 88 tokens per session scan A 649898c792a8

Subscribe to this mod's changes

typescript-review-patterns is a skill published in the GitHub repository mickeyyaya/refactoring-skills (6 stars, last pushed 5mo ago), licensed MIT. It adds 88 tokens to every session and 3,724 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

coding-standards

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

hashgraph-online/awesome-codex-plugins · 28 tokens

splitting-oversized-modules

Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…

PostHog/posthog · 197 tokens

plankton-code-quality

Write-time code quality enforcement using Plankton — auto-formatting, linting, and Claude-powered fixes on every file edit via hooks.

loulanyue/awesome-claude-notes · 34 tokens

typescript-style-guide

Apply, review, and explain the opinionated conventions in the TypeScript Style Guide. Use automatically only when TypeScript conventions are part of the requested task, including type modelling, discriminated unions, function APIs, variables and state, naming, source organization, React props, component APIs, state…

mkosir/typescript-style-guide · 79 tokens

architecture-audit

Systematic architecture audit and refactoring methodology for Rust + TypeScript codebases. Use when performing refactoring, cleanup, unification, code review, dead code removal, module reorganization, or tech debt elimination. Ensures no naming confusion, semantic overloading, hidden defaults, duplicate logic, or…

org2AI/ORG2 · 70 tokens