Getting Started
Prerequisites
- Node.js 20+ and npm
- Git for version control
- Rust toolchain (for desktop development)
- Tauri prerequisites (for desktop builds)
Setup
Development Workflow
1. Create a Branch
2. Make Changes
- Write clean, documented code
- Follow existing code style
- Add tests for new features
- Update documentation as needed
3. Test Your Changes
4. Commit Changes
Follow the Baby-Step Commit principle from AGENTS.md:55-64.5. Create Pull Request
From AGENTS.md:20:When plan to create a PR, should attach screenshot with Playwright in GitHub PR bodyInclude visual evidence of UI changes using Playwright screenshots.
Commit Guidelines
From AGENTS.md, follow these commit practices:Baby-Step Commits
- Keep commits small but not excessively granular
- One logical change per commit
- Tests pass before committing
Commit Message Format
Co-authorship
From AGENTS.md:59-64, append co-author attribution:Claude <[email protected]>Auggie <[email protected]>Kiro <[email protected]>GitHub Copilot Agent <[email protected]>
Issue Management
From AGENTS.md:23-52, Routa uses structured issue files for context handoff.When to Create an Issue
- Encountered unexpected error during task
- Observed behavior that deviates from API contract
- Found potential bug not blocking current work
- Need to hand off investigation to another developer
Issue File Format
Create files inissues/ directory:
issues/_template.md as base with required front-matter:
Issue Lifecycle
Code Quality Standards
TypeScript Guidelines
- Strict mode enabled
- Type everything — avoid
any - Document public APIs with JSDoc
- Prefer interfaces over types for objects
React Best Practices
- Functional components with hooks
- Memoize expensive calculations with
useMemo - Extract reusable logic into custom hooks
- Use Server Components when possible (Next.js)
Rust Guidelines
- Follow Rust API guidelines
- Use clippy for linting
- Document public APIs with
///comments - Prefer Result over panics
Testing Requirements
Unit Tests
- Test business logic and utilities
- Mock external dependencies
- Aim for >80% coverage on core modules
E2E Tests
From AGENTS.md:14:Use playwright testing e2eAdd E2E tests for:
- New user-facing features
- Critical user workflows
- Cross-browser compatibility
API Contract Tests
When modifying APIs:- Update both Next.js and Rust implementations
- Run
npm run api:checkto validate parity - Add contract tests in
tests/api-contract/ - Ensure tests pass against both backends
Pull Request Process
1. Pre-submission Checklist
- Tests pass (
npm run test:run) - E2E tests pass (
npm run test:e2e) - Linting passes (
npm run lint) - API parity verified (
npm run api:check) - Documentation updated
- Commit messages follow guidelines
- Co-authors attributed
2. PR Description Template
3. Review Process
- Address review comments
- Keep discussion focused and respectful
- Update PR based on feedback
- Resolve merge conflicts
4. Merging
- Squash commits if many small commits
- Rebase to keep linear history
- Ensure CI passes before merge
- Delete branch after merge
Architecture Guidelines
Dual Backend Parity
When modifying backend logic:- Update Next.js implementation in
src/app/api/ - Update Rust implementation in
crates/routa-server/ - Verify identical behavior with contract tests
- Document differences (if any) in comments
Database Migrations
When changing database schema:- Update both schemas:
src/core/db/schema.ts(Postgres)src/core/db/sqlite-schema.ts(SQLite)
- Generate migrations:
- Test migrations on both databases
- Document breaking changes
Protocol Extensions
When extending MCP/ACP/A2A protocols:- Follow protocol specifications
- Update TypeScript types
- Update Rust types (if applicable)
- Add integration tests
- Document new capabilities
Documentation
Code Documentation
- Document why, not just what
- Use JSDoc for public APIs
- Include usage examples
- Link to relevant resources
User Documentation
When adding features:- Update relevant docs pages
- Add examples and code snippets
- Include screenshots or diagrams
- Link related documentation
Community
Communication
- Be respectful and constructive
- Ask questions in GitHub Discussions
- Report bugs in GitHub Issues
- Share ideas and proposals
Getting Help
- Check existing documentation
- Search GitHub Issues
- Ask in GitHub Discussions
- Review AGENTS.md for architecture details
License
By contributing to Routa, you agree that your contributions will be licensed under the MIT License.Related Resources
- Dual Backend Architecture — Understanding the architecture
- Database Configuration — Database setup and migrations
- Testing Guide — Testing strategies and tools
- AGENTS.md — Detailed architecture guide