Skip to content
asyrafhussin avatar

Typescript React Patterns

A reference catalog of 33 TypeScript typing rules for React components, hooks, events, refs, and generics.

CCM score
61 of 100
skills.sh installs
1.2K
GitHub stars
109
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers 7 categories: component typing, hook typing, event handling, ref typing, generic components, context and state, and utility types
  • Lists rules by prefix (comp-, hook-, event-, ref-, generic-, ctx-, util-) with a priority ranking from CRITICAL to LOW
  • Includes typed patterns for props interfaces, null-checked context hooks, and generic list components, with individual rule files for detailed reading
  • Designed for writing typed React components or fixing TypeScript errors in React code

Install

$ npx -y skills add asyrafhussin/agent-skills --skill typescript-react-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

TypeScript React Patterns

Type-safe React with TypeScript. Contains 33 rules across 7 categories covering component typing, hooks, event handling, refs, generics, context, and utility types.

Metadata

  • Version: 2.0.0
  • Rule Count: 33 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

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Component TypingCRITICALcomp-
2Hook TypingCRITICALhook-
3Event HandlingHIGHevent-
4Ref TypingHIGHref-
5Generic ComponentsMEDIUMgeneric-
6Context & StateMEDIUMctx-
7Utility TypesLOWutil-

Quick Reference

1. Component Typing (CRITICAL)

Details

Repository
github.com/asyrafhussin/agent-skills
Category
Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the typescript-react-patterns skill do?

typescript-react-patterns gives an agent TypeScript best practices for React, covering typed components, hooks, events, refs, and generic components. It contains 33 rules across 7 categories, from component typing to utility types.

How do I install the typescript-react-patterns skill?

Run npx -y skills add asyrafhussin/agent-skills --skill typescript-react-patterns -y in your project. Once installed, typescript-react-patterns lets the agent follow its rules when typing props, hooks, and events.

Which tasks should I use typescript-react-patterns for?

Use typescript-react-patterns when writing typed React components, custom hooks, or generic components, or when fixing TypeScript errors in React code. It also covers typed Context providers and discriminated unions for state.

Where does typescript-react-patterns sit in the Frontend & UI Code category?

typescript-react-patterns is in the Frontend & UI Code category, next to vercel-react-best-practices and web-design-guidelines. Its focus is type safety in React rather than general React or design guidance.

More from asyrafhussin/agent-skills

All 14

Similar to Typescript React Patterns

More Frontend & UI Code