typescript-react-patterns

typescript-react-patterns is a skill for Claude Code, Codex from AsyrafHussin/agent-skills. It costs 51 tokens per session (1,565 once invoked), scanned A, original, MIT.

A set of TypeScript guidelines for writing React components and related code with checked types.

In plain words
What is it for?
Use it when building or debugging typed React components, hooks, event handlers, refs, reusable generics, or context providers.
Why use it?
It helps prevent common typing errors in props, hooks, events, refs, generic components, context, and utility types.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it when building or debugging typed React components, hooks, event handlers, refs, reusable generics, or context providers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/asyrafhussin/agent-skills/typescript-react-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 AsyrafHussin/agent-skills --skill typescript-react-patterns
Clone the repo
git clone --depth 1 https://github.com/AsyrafHussin/agent-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-react-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/typescript-react-patterns/github.svg)](https://agentmods.dev/skills/asyrafhussin/agent-skills/typescript-react-patterns)
Your own site
<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/typescript-react-patterns"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/typescript-react-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-react-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/typescript-react-patterns"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/typescript-react-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,565 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. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 30 Nov 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00051 $0.01565
Opus 5.5 $0.00020 $0.00626
Sonnet 5.5 $0.00010 $0.00313
Haiku 4.5 $0.00005 $0.00156

Measured 2d ago against content hash 83fec60fa27d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

typescript-react-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 2d 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-react-patterns/SKILL.md · 182 lines

How it starts

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

TypeScript React Patterns

Type-safe React with TypeScript. Contains 36 rules across 7 categories covering component typing, hooks, event handling, refs, generics, context, and utility types. Targets React 19.x (@types/react 19) and TypeScript 5.x–7.x.

Metadata

  • Version: 2.1.0
  • Updated: November 2026
  • Targets: React 19.x, @types/react 19, TypeScript 5.x–7.x
  • Rule Count: 36 rules across 7 categories
  • License: MIT

When to Apply

Reference these guidelines when:

  • Typing React component props
  • Creating custom hooks with TypeScript
  • Handling events with proper types
  • Working with refs (DOM, mutable, imperative)
  • Building generic, reusable components
  • Setting up typed Context providers
  • Fixing TypeScript errors in React code
  • Typing React 19 Actions (useActionState, useOptimistic, use) and useEffectEvent
  • Migrating React 18 types (forwardRef, defaultProps, global JSX, useRef()) or a tsconfig to TypeScript 7

Rule Categories by Priority

Priority Category Impact Prefix
1 Component Typing CRITICAL comp-
2 Hook Typing CRITICAL hook-
3 Event Handling HIGH event-
4 Ref Typing HIGH ref-
5 Generic Components MEDIUM generic-
6 Context & State MEDIUM ctx-
7 Utility Types LOW util-

Quick Reference

1. Component Typing (CRITICAL)

  • comp-props-interface - Use interface for props, type for unions
  • comp-children-types - Correct children typing (ReactNode, ReactElement)
  • comp-default-props - Default props with destructuring defaults
  • comp-forward-ref - Ref as a prop in React 19 (forwardRef only for React 18 libraries)
  • comp-polymorphic - Polymorphic "as" prop typing
  • comp-fc-vs-function - Function declaration vs React.FC
  • comp-display-name - Display names for debugging
  • comp-rest-props - Spreading rest props with proper types

2. Hook Typing (CRITICAL)

  • hook-usestate - useState with proper generic types
  • hook-useref - useRef for DOM elements and mutable values
  • hook-use-reducer - useReducer with discriminated union actions
  • hook-use-callback - useCallback with typed parameters
  • hook-use-memo - useMemo with typed return values
  • hook-use-context - useContext with null checking
  • hook-custom-hooks - Custom hook return types
  • hook-generic-hooks - Generic custom hooks
  • hook-use-action-state - useActionState, useOptimistic and use() typing
  • hook-use-effect-event - useEffectEvent typing (React 19.2)

Read the full file on GitHub · 182 lines

Files

What ships with it

41 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago Changed · +9 lines 83fec60fa27d
  2. 3mo ago First seen · 173 lines · 51 tokens per session scan A c36b24820648

Subscribe to this mod's changes

typescript-react-patterns is a skill published in the GitHub repository AsyrafHussin/agent-skills (114 stars, last pushed yesterday), licensed MIT. It adds 51 tokens to every session and 1,565 once invoked, about $0.0002 per session on Opus 5.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-08-30.

Related

typescript-react-patterns compared with skills from other repositories

typescript-react-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
typescript-react-patternsAsyrafHussin/agent-skillsSkill114yesterdayMITA51Claude Code, Codex
splitting-oversized-modulesPostHog/posthogSkill41ktodaynoneA197Claude Code, Codex
verify-languageAurite-ai/agent-verifierSkill473d agoMITA48Claude Code
react-frontendiliaal/whetstoneSkill37yesterdayMITA57Claude Code, Codex
fe-buildsh5623/fe-railSkill13d agoMITA57Claude Code
flockion_engineering_typescript_reacterror505/Flockion_AI_EngineeringSkill51mo agoMITA202Claude Code
migratevikisingh23/neuraforge-aiSkill47d agoApache-2.0A16Claude Code