Skip to content
Development
Skill

/react-skills

React 18 patterns for LlamaFarm Designer. Covers components, hooks, TanStack Query, and testing.

From plugin
llamafarm
83619 skills1 MCP

Claude Code

$ npx -y skills add llama-farm/llamafarm --skill react-skills --agent claude-code

SKILL.md

react-skills.SKILL.md
name: react-skills
description: React 18 patterns for LlamaFarm Designer. Covers components, hooks, TanStack Query, and testing.
allowed-tools: Read, Grep, Glob
user-invocable: false

React Skills for LlamaFarm Designer

Best practices and patterns for React 18 development in the Designer subsystem.

Tech Stack

  • **React 18.2** with StrictMode
  • **TypeScript 5.2+** for type safety
  • **TanStack Query v5** for server state management
  • **React Router v7** for client-side routing
  • **TailwindCSS** with `tailwind-merge` and `clsx` for styling
  • **Radix UI** primitives for accessible components
  • **Vite** for build tooling
  • **Vitest** + React Testing Library for testing

Directory Structure

designer/src/
  api/          # API service functions
  components/   # React components (feature-organized)
  contexts/     # React context providers
  hooks/        # Custom hooks
  lib/          # Utility functions (cn, etc.)
  types/        # TypeScript type definitions
  utils/        # Helper functions
  test/         # Test utilities and mocks

Core Patterns

Component Composition

  • Use composition over inheritance
  • Prefer small, focused components
  • Use `forwardRef` for components that wrap DOM elements
  • Apply `displayName` to forwardRef components for DevTools

State Management

  • **Local UI state**: `useState`, `useReducer`
  • **Server state**: TanStack Query (`useQuery`, `useMutation`)
  • **Shared UI state**: React Context with custom hooks
  • **Form state**: Controlled components with validation

Hooks

  • Follow Rules of Hooks (top-level, consistent order)
  • Create custom hooks for reusable logic
  • Use query key factories for TanStack Query
  • Memoize expensive computations with `useMemo`
  • Stabilize callbacks with `useCallback`

Styling

  • Use `cn()` from `lib/utils` to merge Tailwind classes
  • Use `cva` (class-variance-authority) for component variants
  • Follow dark mode conventions with `dark:` prefix

Related Guides

  • [components.md](./components.md) - Component patterns
  • [hooks.md](./hooks.md) - Hook patterns and rules
  • [state.md](./state.md) - State management patterns
  • [performance.md](./performance.md) - Performance optimization
  • [security.md](./security.md) - Security best practices

Quick Reference

// Utility for merging Tailwind classes
import { cn } from '@/lib/utils'
cn('base-class', condition && 'conditional-class', className)

// Query key factory pattern
export const projectKeys = {
  all: ['projects'] as const,
  lists: () => [...projectKeys.all, 'list'] as const,
  list: (ns: string) => [...projectKeys.lists(), ns] as const,
}

// Context with validation hook
const MyContext = createContext<MyContextType | undefined>(undefined)
export function useMyContext() {
  const ctx = useContext(MyContext)
  if (!ctx) throw new Error('useMyContext must be within MyProvider')
  return ctx
}

Testing

import { renderWithProviders } from '@/test/utils'
import { screen } from '@testing-library/react'

test('renders component', () => {
  renderWithProviders(<MyComponent />)
  expect(screen.getByText('Hello')).toBeInTheDocument()
})
Read more
@llama-farm
Ships withllamafarm

Enterprise AI capabilities on your own hardware. No cloud required. LlamaFarm is an open-source AI platform that runs entirely on your hardware.

83619 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
836
Star history of llama-farm/llamafarm on GitHub, a chart by star-history.com

Other skills on llamafarm.

cli-skills

cli-skills

CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.

code-review

code-review

Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues.…

commit-push-pr

commit-push-pr

Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip…

common-skills

common-skills

Best practices for the Common utilities package in LlamaFarm. Covers HuggingFace Hub integration, GGUF model management, and…

config-skills

config-skills

Configuration module patterns for LlamaFarm. Covers Pydantic v2 models, JSONSchema generation, YAML processing, and validation.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about react-skills.

Which coding agents can use react-skills?
react-skills installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.