Contribution Guidelines
Relevant source files
The following files were used as context for generating this wiki page:
This guide outlines the standards, workflows, and technical requirements for contributing to OS Chat. As a full-stack AI personal assistant built with TanStack Start and Convex, maintaining code quality and architectural consistency is critical for scalability and reliability.
Sources: README.md:1-20, CLAUDE.md:65-75
Development Workflow
Contributors are expected to follow a structured development process that includes local environment setup, adherence to specific coding standards, and rigorous testing before submission.
Environment Setup
OS Chat uses Bun as the primary package manager and runtime. Developers must install dependencies and configure the Convex backend to begin development.
| Command | Description |
|---|---|
bun install | Install all project dependencies |
bun dev | Start the local development server on port 3000 |
bunx convex dev | Run the Convex development server for real-time backend updates |
bun run lint | Execute oxlint with type-aware checks and auto-fixes |
bun run format | Format the codebase using oxfmt |
bun run typecheck | Perform TypeScript type checking via tsgo |
Sources: CLAUDE.md:131-143, README.md:105-115
Coding Standards
OS Chat enforces strict TypeScript and React 19 patterns to minimize technical debt and runtime errors.
- TypeScript: Strict mode is mandatory. Avoid using
anyorunknown. Prefer explicit interfaces and types. - React Components: Use functional components with hooks at the top level. Avoid default exports for components.
- State Management: Use Zustand for complex persisted state and TanStack Query (via
convexQuery) for server state. - Styling: Use Tailwind CSS v4 utility classes exclusively; inline styles are prohibited.
- Linting/Formatting: Do not use ESLint or Prettier. Use oxlint and oxfmt as defined in the project scripts.
Sources: CLAUDE.md:85-110, AGENTS.md:105-120
Version Control and Commits
The project follows a rigorous commit process to ensure the history remains readable and atomic. Commits must follow the Conventional Commits specification.
Commit Process Flow
The following diagram illustrates the required steps before executing a commit:
This flow ensures that no broken or unformatted code enters the repository.
Sources: agent_rules/commit.md:1-35
Commit Types
Contributors should categorize their changes using the following types:
- feat: New functionality or features.
- fix: Bug fixes.
- docs: Documentation updates.
- refactor: Code changes that neither fix a bug nor add a feature.
- perf: Performance improvements.
- style: Changes that do not affect the meaning of the code (formatting).
- chore: Maintenance tasks, configuration, or tooling updates.
Sources: agent_rules/commit.md:12-25
UI/UX Design Guidelines
OS Chat emphasizes accessibility and performance. All UI contributions must adhere to the design rules defined in the project.
Interaction Requirements
- Accessibility: Full keyboard support per WAI-ARIA APG is mandatory. Use semantic HTML elements (e.g.,
<button>,<a>) over ARIA whenever possible. - Focus Management: Focus rings must be visible using
:focus-visible. - Touch Targets: Hit targets must be at least 24px (44px for mobile).
- Input Behavior: Do not block paste in textareas or inputs. Submit buttons must show a spinner and be disabled during active requests.
Sources: agent_rules/design_guidelines.md:3-35
Visual and Performance Standards
- Animation: Prefer CSS animations over JS libraries. Honor
prefers-reduced-motionsettings. - Performance: Mutations (POST/PATCH/DELETE) should target sub-500ms response times. Large lists must be virtualized using tools like
virtua. - Images: Preload above-the-fold images and lazy-load the rest to prevent CLS (Cumulative Layout Shift).
Sources: agent_rules/design_guidelines.md:85-105, agent_rules/design_guidelines.md:125-135
Backend Development (Convex)
The backend relies on Convex for real-time data and serverless logic. Contributors must follow specific registration patterns for functions.
The diagram shows that public functions can invoke internal functions, but internal functions are private to the app's API.
Sources: agent_rules/convex_rules.md:55-80
Database Operations
- Queries: Do not use
filterin production queries; define an index inconvex/schema.tsand usewithIndex. - Mutations: Use
ctx.db.patchfor shallow merges andctx.db.replacefor full document replacement. - Validators: Every Convex function MUST include argument and return validators (e.g.,
v.string(),v.id("table")).
Sources: agent_rules/convex_rules.md:145-160, agent_rules/convex_rules.md:190-205
Testing Practices
Before submitting a Pull Request, contributors must verify their changes through Vitest.
- Create Tests: Add a test file in the appropriate directory (e.g.,
src/lib/config/__tests__/). - Coverage: Tests should cover the "happy path" (normal use), edge cases (boundaries), and error cases.
- Verification: Ensure that the specific fix works and that no existing functionality is regressed.
Sources: CLAUDE.md:145-160, src/lib/config/tests/suggestions.test.ts:1-20
Summary
By following these guidelines, contributors ensure that OS Chat remains a high-performance, accessible, and maintainable open-source AI platform. Adherence to commit standards and backend patterns is essential for seamless integration into the core repository.