OneCoach UI - Agent Guide
Documents the structure, packages, and development conventions for a React/React Native UI component library built with Radix UI and Tailwind CSS.
What this file does
Documents the structure, packages, and development conventions for a React/React Native UI component library built with Radix UI and Tailwind CSS.
When to use it
- Onboarding to a monorepo with a shared UI package
- Setting up a component library with Radix UI and Tailwind
- Establishing design token and styling conventions for a team
- Learning the package layout of an existing OneCoach project
Assumes this stack
OneCoach UI - Agent Guide
Meta: UI component library for OneCoach. React/React Native compatible using Radix UI, Tailwind CSS, and design tokens.
Quick Reference
| Attribute | Value |
|---|---|
| Monorepo | submodules/onecoach-ui |
| Styling | Tailwind CSS v4 |
| Components | Radix UI primitives |
| Icons | Lucide React |
| Animations | Framer Motion |
Package Structure
submodules/onecoach-ui/
├── packages/
│ ├── ui/ # @onecoach/ui - Component library
│ ├── hooks/ # @onecoach/hooks - Shared React hooks
│ ├── design-system/ # Design system integration
│ └── lib-design-system/ # @onecoach/lib-design-system - Tokens
├── package.json
└── pnpm-workspace.yaml
Key Packages
@onecoach/ui (packages/ui)
Main component library:
- Components in
src/components/ - Entry point:
src/index.ts - Radix UI + Tailwind + cva (class-variance-authority)
@onecoach/hooks (packages/hooks)
Shared React hooks:
- Form handling
- Feature flags
- UI state management
@onecoach/lib-design-system (packages/lib-design-system)
Design tokens & theme:
- Colors, spacing, typography
- Animation utilities
- Theme configuration
Development Guidelines
Styling
// ✅ Use design tokens
className = 'bg-primary text-primary-foreground';
// ❌ Never hardcode values
className = 'bg-[#1a1a1a]';
- Always use Tailwind utility classes
- Prefer tokens from
@onecoach/lib-design-system - Support dark mode with
dark:variants
Creating Components
- Location:
packages/ui/src/components/ - Use Radix UI for accessible primitives
- Use cva for variants:
import { cva } from 'class-variance-authority';
const buttonVariants = cva('inline-flex items-center justify-center rounded-md', {
variants: {
variant: {
default: 'bg-primary text-primary-foreground',
outline: 'border border-input bg-background',
},
size: {
default: 'h-10 px-4 py-2',
sm: 'h-9 px-3',
lg: 'h-11 px-8',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
});
Navigation Guide
| Task | Location |
|---|---|
| Add component | packages/ui/src/components/ |
| Add hook | packages/hooks/ |
| Modify tokens | packages/lib-design-system/ |
| Check exports | packages/ui/src/index.ts |
Technology Stack
| Layer | Technology |
|---|---|
| Framework | React 19 / React Native |
| Language | TypeScript |
| Styling | Tailwind CSS v4 |
| Icons | Lucide React |
| Motion | Framer Motion |
| Build | Turborepo / pnpm workspaces |
What's inside
1 quick reference table, 1 directory tree, 4 package descriptions, 2 code examples, 1 navigation table, 1 technology stack table
Change this for your project
- Replace
submodules/onecoach-uiwith your monorepo path - Replace
@onecoach/ui,@onecoach/hooks,@onecoach/lib-design-systemwith your package names - Replace
OneCoachin the meta description with your project name
Where it goes
Save as AGENTS.md in your repository root. Read by Codex, Cursor and other agents that follow the AGENTS.md convention.
Worth borrowing
- Using cva (class-variance-authority) for component variant definitions
- Separating design tokens into a dedicated package for cross-platform consistency
Related Documents
Browser-only development
Guides AI assistants on an Electron + React + TypeScript desktop app for browsing and organizing AI-generated images locally.
Claude Agents — Reference & Recommendations
Catalogues 40+ Claude agents and marketing skills for building a cat adoption charity landing page, with a ready-to-paste prompt and backend API reference.
Golden DKG Prototype -- Master Plan
Defines an 8-phase implementation plan for a Rust prototype of the Golden non-interactive DKG protocol using BLS12-381 and tokio.
Swarms Examples Index
Lists 60+ example scripts for building single and multi-agent systems with the Swarms framework, organized by category and use case.