Provides 33 TypeScript rules for type-safe React development: component props, hooks, events, refs, generics, context, and utility types.
Ships in asyrafhussin-agent-skills-1. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Type-safe React with TypeScript. Contains 33 rules across 7 categories covering component typing, hooks, event handling, refs, generics, context, and utility types.
Reference these guidelines when:
| 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- |
comp-props-interface - Use interface for props, type for unionscomp-children-types - Correct children typing (ReactNode, ReactElement)comp-default-props - Default props with destructuring defaultscomp-forward-ref - Typing forwardRef componentscomp-polymorphic - Polymorphic "as" prop typingcomp-fc-vs-function - Function declaration vs React.FCcomp-display-name - Display names for debuggingcomp-rest-props - Spreading rest props with proper typeshook-usestate - useState with proper generic typeshook-useref - useRef for DOM elements and mutable valueshook-use-reducer - useReducer with discriminated union actionshook-use-callback - useCallback with typed parametershook-use-memo - useMemo with typed return valueshook-use-context - useContext with null checkinghook-custom-hooks - Custom hook return typeshook-generic-hooks - Generic custom hooksevent-handler-types - Event handler type patternsevent-click-handler - Click event typingevent-form - Form event handling (submit, change, select)event-keyboard - Keyboard event typesref-dom-elements - useRef with specific HTML element typesref-callback - Callback ref pattern for DOM measurementref-imperative-handle - useImperativeHandle typinggeneric-list - Generic list componentsgeneric-select - Generic select/dropdowngeneric-table - Generic table with typed columnsgeneric-constraints - Generic constraints with extendsctx-create - Creating typed contextctx-provider - Provider pattern with null check hookctx-reducer - Context with useReducerutil-component-props - ComponentPropsWithoutRef for HTML propsutil-pick-omit - Pick, Omit, Partial for prop derivationutil-discriminated-unions - Discriminated unions for state machinesinterface ButtonProps {
variant: 'primary' | 'secondary' | 'danger'
size?: 'sm' | 'md' | 'lg'
children: React.ReactNode
onClick?: () => void
}
function Button({ variant, size = 'md', children, onClick }: ButtonProps) {
return (
<button className={`btn-${variant} btn-${size}`} onClick={onClick}>
{children}
</button>
)
}
interface AuthContextType {
user: User | null
login: (credentials: Credentials) => Promise<void>
logout: () => void
}
const AuthContext = createContext<AuthContextType | null>(null)
function useAuth() {
const context = useContext(AuthContext)
if (!context) throw new Error('useAuth must be used within AuthProvider')
return context
}
interface ListProps<T> {
items: T[]
renderItem: (item: T) => React.ReactNode
keyExtractor: (item: T) => string
}
function List<T>({ items, renderItem, keyExtractor }: ListProps<T>) {
return <ul>{items.map(item => <li key={keyExtractor(item)}>{renderItem(item)}</li>)}</ul>
}
Read individual rule files for detailed explanations:
rules/comp-props-interface.md
rules/hook-usestate.md
rules/event-form.md
rules/ref-dom-elements.md
rules/util-discriminated-unions.md
For the complete guide with all rules expanded: AGENTS.md
AGENTS.md (opens in a new tab)README.md (opens in a new tab)metadata.json (opens in a new tab)rules/_sections.md (opens in a new tab)rules/_template.md (opens in a new tab)rules/comp-children-types.md (opens in a new tab)rules/comp-default-props.md (opens in a new tab)rules/comp-display-name.md (opens in a new tab)rules/comp-fc-vs-function.md (opens in a new tab)rules/comp-forward-ref.md (opens in a new tab)rules/comp-polymorphic.md (opens in a new tab)rules/comp-props-interface.md (opens in a new tab)rules/comp-rest-props.md (opens in a new tab)rules/ctx-create.md (opens in a new tab)rules/ctx-provider.md (opens in a new tab)rules/ctx-reducer.md (opens in a new tab)rules/event-click-handler.md (opens in a new tab)rules/event-form.md (opens in a new tab)rules/event-handler-types.md (opens in a new tab)rules/event-keyboard.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/asyrafhussin-agent-skills-1:typescript-react-patternsfrom asyrafhussin-agent-skills-1
asyrafhussin-agent-skills-1@cascade-code-languages-misc-1 is listed by joshuarweaver/cascade-code-languages-misc-1 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin asyrafhussin-agent-skills-124 skills in this plugin
/api-design-patternsRESTful API design, error handling, versioning, and best practices. Use when designing APIs, reviewing endpoints, implementing error responses, or setting up API structure. Triggers on "design API", "review API", "REST best practices", or "API patterns"./clean-code-principlesSOLID principles, design patterns, DRY, KISS, and clean code fundamentals. Use when reviewing architecture, checking code quality, refactoring, or discussing design decisions. Triggers on "review architecture", "check code quality", "SOLID principles", "design patterns", or "clean code"./code-slopDetect AI-generated code patterns ("slop") in PHP/Laravel and TypeScript/React source — comment narration, generic naming, premature interfaces, defensive overdose, mock-everything tests, and the absence of human "scars". Use when reviewing AI-assisted PRs, auditing code for taste/quality (not metrics — that's technical-debt), or hardening a code-review checklist. Triggers on "review for AI slop", "find AI patterns", "check code feels human", "audit code-quality taste"./e2e-playwright-testingEnd-to-end testing with Playwright for web applications. Use when writing E2E tests, browser automation, form submission testing, or user flow testing. Triggers on "playwright", "e2e test", "browser test", "end-to-end", "form flow testing", or test files in tests/e2e/./git-workflowGit best practices, branching strategies, commit conventions, and PR workflows. Use when reviewing git history, writing commits, setting up branching strategy, or improving git practices. Triggers on "git best practices", "commit message", "branching strategy", or "PR workflow"./laravel-ai-sdkLaravel AI SDK for building AI-powered features. Use when creating agents, generating images or audio, working with embeddings, vector search, or testing AI features. Triggers on tasks involving laravel/ai, AI agents, tool-calling, structured output, streaming, embeddings, reranking, or AI faking in tests.Other plugins' skills for the same job