This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
The Vibe Design System is monday.com's official React component library, managed as a Lerna monorepo with Yarn Workspaces. The main package @vibe/core provides the primary component library, while specialized packages handle icons, testing utilities, codemods, and more.
# Build all packages
yarn build
# Build with dependencies for specific package
sh scripts/build-dependencies.sh @vibe/core
# Run tests
yarn test
lerna run test # All packages
yarn workspace @vibe/core test # Specific package
# Watch mode for testing
yarn workspace @vibe/core test:watch# Lint all packages
yarn lint
lerna run lint
# Fix lint issues
yarn workspace @vibe/core lint:fix
# Style linting
yarn workspace @vibe/core stylelint# Install dependencies (creates workspace symlinks)
yarn install
# Add dependency to specific package
yarn workspace @vibe/core add <dependency>
yarn workspace @vibe/core add -D <dev-dependency>
# Add dependency to root (for global tools)
yarn add -W <dependency># Run Storybook for all packages
yarn storybookpackages/- Core packages (core, icons, testkit, style, etc.)packages/components/- Standalone component packages (button, tooltip, dialog, etc.)components/- Legacy component structure (deprecated)
@vibe/core- Main component library, depends on standalone component packages@vibe/icons- SVG icon library@vibe/testkit- Playwright testing utilities@vibe/codemod- Code transformation tools@vibe/hooks- Shared React hooks@vibe/shared- Shared utilities and types
Components follow a systematic structure:
Component/
├── Component.tsx # Main implementation
├── Component.types.ts # TypeScript interfaces
├── Component.module.scss # CSS Modules styles
├── ComponentConstants.ts # Deprecated enums (if needed)
├── consts/ # Component-specific constants (organized by purpose)
├── __tests__/ # Vitest tests
├── __stories__/ # Storybook stories
└── index.ts # Exports
Components are extracted from @vibe/core into standalone packages under packages/components/. This follows a specific workflow:
- Enum Handling: Deprecated enums are exported with "Enum" suffix to avoid conflicts with string union types
- Export Strategy: Core package imports from standalone packages and re-exports selectively
- Workspace Linking: Yarn Workspaces automatically creates symlinks for local package dependencies
- Types first - Define interfaces in
*.types.tsextendingVibeComponentProps - Core component - Use
forwardRefpattern, mandatory[data-vibe]attribute - Styles - CSS Modules, use design tokens, no imports in SCSS files
- Tests - Test actual behavior, verify accessibility attributes
- Stories - Comprehensive Storybook examples
- Integration - Add to global exports and
ComponentVibeIdenum
[data-vibe]attribute: Every component must include this on the root element- ComponentVibeId enum: Add entry to
packages/core/src/tests/constants.ts - No static properties: Use string literals for prop values, not static properties
- CSS Modules: No imports allowed in
.module.scssfiles
- Vitest for unit tests with Testing Library
- Playwright for E2E tests (via
@vibe/testkit) - Test actual DOM behavior and accessibility attributes
- Use established test ID patterns from constants
When extracting components from @vibe/core:
- Use templates from
.cursor/templates/package-separation/ - Handle enum exports carefully (rename with "Enum" suffix)
- Update dependencies in both packages
- Run
yarn installto create workspace symlinks - Clear TypeScript cache (
rm -rf .rpt2_cache)
The repository includes an MCP (Model Context Protocol) server (@vibe/mcp) that provides intelligent assistance for working with Vibe components. Reference the MCP documentation for API discovery and usage examples.
- Rollup for bundling with TypeScript support
- Independent versioning via Lerna
- Metadata generation for component documentation
- CSS token handling via
@vibe/stylepackage
lerna.json- Lerna configuration with independent versioning.cursor/rules/- Comprehensive development guidelines and patternsscripts/build-dependencies.sh- Build specific package with dependencies
packages/core/src/components/index.ts- Main component exportspackages/core/src/tests/constants.ts- Test IDs and component identifierspackages/core/src/types/VibeComponentProps.ts- Base component props interface
- Vibe 2 → 3: Migration guide available in documentation
- Legacy package:
monday-ui-react-core(deprecated) - String unions preferred over enum constants in new components
- Modern React patterns - hooks, forwardRef, functional components