Skip to content
cccskills
FreePublished on GitHub

react-skills

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

The English summary is being prepared. Showing the original description.

See how to install

Files included (6)

  • SKILL.md3.1 KB
  • components.md5.9 KB
  • hooks.md6.8 KB
  • performance.md7.0 KB
  • security.md8.4 KB
  • state.md6.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

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()
})

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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

The English summary is being prepared. Showing the original description.

llama-farm/llamafarm836Updated Jun 10, 2026

Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain (frontend/backend) from file paths.

The English summary is being prepared. Showing the original description.

llama-farm/llamafarm836Updated Jun 10, 2026

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

The English summary is being prepared. Showing the original description.

llama-farm/llamafarm836Updated Jun 10, 2026

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

The English summary is being prepared. Showing the original description.

llama-farm/llamafarm836Updated Jun 10, 2026

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

The English summary is being prepared. Showing the original description.

llama-farm/llamafarm836Updated Jun 10, 2026

Designer subsystem patterns for LlamaFarm. Covers React 18, TanStack Query, TailwindCSS, and Radix UI.

The English summary is being prepared. Showing the original description.

llama-farm/llamafarm836Updated Jun 10, 2026

See all skills by llama-farm

Report a problem with this skill