Type-safe React with TypeScript. Contains 33 rules across 7 categories covering component typing, hooks, event handling, refs, generics, context, and utility types.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiontypescript-react-patternsExecute the skills CLI command in your project's root directory to begin installation:
Fetches typescript-react-patterns from asyrafhussin/agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate typescript-react-patterns. Access via /typescript-react-patterns in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
4
total installs
4
this week
24
GitHub stars
0
upvotes
Run in your terminal
4
installs
4
this week
24
stars
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
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
asyrafhussin/agent-skills
asyrafhussin/agent-skills
jwynia/agent-skills
anthropics/claude-code
mblode/agent-skills
github/awesome-copilot
We added typescript-react-patterns from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Keeps context tight: typescript-react-patterns is the kind of skill you can hand to a new teammate without a long onboarding doc.
I recommend typescript-react-patterns for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Keeps context tight: typescript-react-patterns is the kind of skill you can hand to a new teammate without a long onboarding doc.
Registry listing for typescript-react-patterns matched our evaluation — installs cleanly and behaves as described in the markdown.
Useful defaults in typescript-react-patterns — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Solid pick for teams standardizing on skills: typescript-react-patterns is focused, and the summary matches what you get after install.
Registry listing for typescript-react-patterns matched our evaluation — installs cleanly and behaves as described in the markdown.
typescript-react-patterns reduced setup friction for our internal harness; good balance of opinion and flexibility.
typescript-react-patterns reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 40