Skip to content

Contributing

We welcome contributions to Cosella! This guide will help you get started.

Terminal window
# Fork on GitHub, then clone
git clone https://github.com/YOUR_USERNAME/cosella.git
cd cosella
Terminal window
# Install dependencies
pnpm install
# Verify setup
pnpm typecheck
pnpm test
Terminal window
git checkout -b feature/my-feature
  • TypeScript: Strict mode enabled
  • ESLint: Enforced via pre-commit hooks
  • Prettier: Automatic formatting on save

Follow Conventional Commits:

feat(package-name): short description under 72 chars

Examples:

  • feat(ui): add new Button variant
  • fix(api-client): handle network errors
  • docs(readme): update installation guide

Run tests before committing:

Terminal window
# Unit tests
pnpm test
# Type checking
pnpm typecheck
# Linting
pnpm lint

Use the Plop generator:

Terminal window
pnpm gen package

This creates:

  • packages/my-package/
  • package.json with proper dependencies
  • tsconfig.json extending shared config
  • src/index.ts with exports

Hard constraints (enforced by ESLint):

  1. Apps may depend on packages — never the reverse
  2. Packages may not depend on sibling apps
  3. packages/uipackages/tokens only

Use the Plop generator:

Terminal window
pnpm gen component

This creates:

  • packages/ui/src/my-component/MyComponent.tsx
  • packages/ui/src/my-component/MyComponent.test.tsx
  • Export in packages/ui/src/index.ts
  1. Accessibility: Follow WAI-ARIA patterns
  2. TypeScript: Full type safety
  3. Styling: Use Tailwind classes with design tokens
  4. Testing: Unit tests + Storybook stories
Terminal window
# Make changes
git add .
git commit -m "feat(ui): add new Button variant"
Terminal window
git push origin feature/my-feature
  • Title: Follow Conventional Commits
  • Description: Clear explanation of changes
  • Tests: Include test results
  • Screenshots: For UI changes
  • Address reviewer feedback
  • Ensure CI passes
  • Get approval from maintainers

Squash and merge to keep history clean.

Documentation lives in apps/docs/:

Terminal window
# Add new page
apps/docs/src/content/docs/my-page.mdx
  • Clear: Simple, concise language
  • Examples: Code examples for every feature
  • Structure: Logical hierarchy
  • Issues: Report bugs or request features
  • Discussions: Ask questions or share ideas
  • Discord: Real-time chat with the community
  • Be respectful and inclusive
  • Welcome newcomers
  • Focus on constructive feedback

If you want to improve the look and feel of Cosella without touching business logic, see the Vibecoder UI Guide. This guide defines exactly which files are safe to modify and provides step-by-step instructions for common UI tasks.

If you are an AI agent (Claude, Copilot, Cursor, Codex, etc.) contributing to Cosella, see the AI Agent Guide. This guide covers architecture constraints, TypeScript rules, testing requirements, and commit conventions that every agent must follow.