All skills
asyrafhussin avatar

/typescript-react-patterns

@e60e907

TypeScript best practices for React development. Use when writing typed React components, hooks, events, refs, or generic components. Triggers on tasks involving TypeScript errors, type definitions, props typing, or type-safe React patterns.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/typescript-react-patterns

This session only. Nothing lands on disk.

README.md

≈434 tokens on demand. Your agent reads this file only when SKILL.md points to it.

TypeScript React Patterns v2.0.0

Type-safe React with TypeScript.

Overview

  • Component typing (props interface, children, forwardRef, polymorphic, rest props)
  • Hook typing (useState, useRef, useReducer, useCallback, useMemo, custom hooks)
  • Event handling (form, click, keyboard events)
  • Ref typing (DOM elements, callback refs, useImperativeHandle)
  • Generic components (list, select, table, constraints)
  • Context & state (typed provider, useReducer with discriminated unions)
  • Utility types (ComponentProps, Pick/Omit, discriminated unions)
  • 33 rules across 7 categories

Categories

1. Component Typing (Critical)

Props interface, children types, default props, forwardRef, polymorphic, FC vs function, display name, rest props.

2. Hook Typing (Critical)

useState, useRef, useReducer, useCallback, useMemo, useContext, custom hooks, generic hooks.

3. Event Handling (High)

Handler types, click events, form events, keyboard events.

4. Ref Typing (High)

DOM element refs, callback refs, useImperativeHandle.

5. Generic Components (Medium)

Generic list, select, table, constraints with extends/keyof.

6. Context & State (Medium)

Typed context creation, provider pattern, context with useReducer.

7. Utility Types (Low)

ComponentPropsWithoutRef, Pick/Omit/Partial, discriminated unions.

Usage

Type this React component properly
Fix TypeScript errors in my React code
Create a generic table component
Set up typed Context with useReducer

References

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill contains educational reference material and code documentation for TypeScript React development patterns. No security risks or malicious vectors were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    30 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at e60e907. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago
metadata
{
  "author": "agent-skills",
  "version": "2.0.0"
}

README badge

README badge for asyrafhussin/agent-skills/typescript-react-patterns