skills/barnhardt-enterprises-inc/react-19-patterns/SKILL.md
Comprehensive React 19 patterns including all hooks, Server/Client Components, Suspense, streaming, and transitions. Ensures correct React 19 usage with TypeScript.
npx skillsauth add aiskillstore/marketplace react-19-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when:
use() - For async data in componentsuseOptimistic() - For optimistic UI updatesuseFormStatus() - For form submission stateuseActionState() - For Server Action stateuseTransition() - Better performance// ✅ Default - async data fetching
export default async function ProjectsPage() {
const projects = await db.project.findMany()
return <ProjectList projects={projects} />
}
// ✅ Use 'use client' for interactivity
'use client'
import { useState } from 'react'
export function InteractiveComponent() {
const [count, setCount] = useState(0)
return <button onClick={() => setCount(count + 1)}>{count}</button>
}
'use client'
import { useOptimistic } from 'react'
export function TodoList({ todos }: Props) {
const [optimisticTodos, addOptimisticTodo] = useOptimistic(
todos,
(state, newTodo: string) => [...state, { id: 'temp', text: newTodo, pending: true }]
)
return (
<form action={async (formData) => {
addOptimisticTodo(formData.get('todo'))
await createTodo(formData)
}}>
<input name="todo" />
<button type="submit">Add</button>
</form>
)
}
This skill is organized into detailed guides:
START: Creating new component
│
├─ Does it need interactivity (onClick, onChange)?
│ ├─ YES → Read client-components-complete.md
│ └─ NO → Continue
│
├─ Does it need React hooks (useState, useEffect)?
│ ├─ YES → Read client-components-complete.md + hooks-complete.md
│ └─ NO → Continue
│
├─ Does it fetch data?
│ ├─ YES → Read server-components-complete.md
│ └─ NO → Continue
│
└─ Default → Server Component (read server-components-complete.md)
Need specific hook help?
└─ Read hooks-complete.md (complete reference)
Need Suspense/streaming?
└─ Read suspense-patterns.md + streaming-patterns.md
Need optimistic UI?
└─ Read hooks-complete.md (useOptimistic section)
Need form handling?
└─ Read hooks-complete.md (useFormStatus, useActionState)
Migrating from React 18?
└─ Read migration-guide.md
'use client'
export default async function Bad() {} // ERROR!
// Option 1: Server Component
export default async function Good() {} // ✅
// Option 2: Client with useEffect
'use client'
export default function Good() {
useEffect(() => {
fetchData()
}, [])
}
if (condition) {
useState(0) // ERROR: Rules of Hooks violation
}
const [value, setValue] = useState(0)
if (condition) {
// Use the hook result here
}
export default function Bad() {
const data = localStorage.getItem('key') // ERROR!
return <div>{data}</div>
}
'use client'
export default function Good() {
const [data, setData] = useState(() =>
localStorage.getItem('key')
)
return <div>{data}</div>
}
Use validate-react.py to check your React code:
# Validate single file
python .claude/skills/react-19-patterns/validate-react.py src/components/Button.tsx
# Validate directory
python .claude/skills/react-19-patterns/validate-react.py src/components/
# Auto-fix (where possible)
python .claude/skills/react-19-patterns/validate-react.py --fix src/components/
Checks for:
Default to Server Components
Use Client Components Sparingly
Compose Server + Client
Use New React 19 Hooks
use() for async datauseOptimistic() for instant feedbackuseFormStatus() for form statesuseActionState() for Server ActionsLeverage Suspense
Last Updated: 2025-11-23 React Version: 19.2.0 Next.js Version: 15.5
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.