Ways to Contribute
There are many ways to contribute to Cap:- Report a bug: Open an issue
- Suggest a feature: Join our Discord
- Submit a pull request: Fix bugs or add features
- Improve documentation: Help make the docs better
Development Requirements
Before contributing, make sure you have:- Node.js 20+
- Rust 1.88.0+
- pnpm 8.10.5+ (recommended: 10.5.2)
- Docker (OrbStack recommended)
Code Style
TypeScript/JavaScript
- Indentation: 2 spaces
- Formatter: Biome (via
pnpm format) - Linter: Biome (via
pnpm lint) - File naming: kebab-case (
user-menu.tsx) - Components: PascalCase
Rust
- Formatter:
cargo fmt - Linter: Clippy with workspace lints
- Module naming: snake_case
- Crate naming: kebab-case
Critical Rule: No Comments
Rust Workspace Lints
All Rust code must respect these workspace-level lints:Compiler Lints
unused_must_use = "deny"- Always handleResult/Optionor types marked#[must_use]
Clippy Lints (All Denied)
View All Clippy Rules
View All Clippy Rules
dbg_macro- Never usedbg!(); use proper logginglet_underscore_future- Never writelet _ = async_fn()unchecked_duration_subtraction- Usesaturating_subfor Durationcollapsible_if- Merge nested if statementsclone_on_copy- Don’t call.clone()onCopytypesredundant_closure- Use function references directlyptr_arg- Accept&[T]or&strinstead of&Vec<T>or&Stringlen_zero- Use.is_empty()instead of.len() == 0let_unit_value- Don’t assign()to a variableunnecessary_lazy_evaluations- Use.unwrap_or(val)for cheap valuesneedless_range_loop- Usefor item in &collectionmanual_clamp- Use.clamp(min, max)
Testing
TypeScript/JavaScript
- Framework: Vitest
- Location:
*.test.ts(x)files near sources - Run:
pnpm testorpnpm test:web
Rust
- Framework: Built-in
cargo test - Location:
src/ortests/directory - Run per crate:
cargo test -p <crate>
Testing Philosophy
- Prefer unit tests for logic
- Light smoke tests for flows
- No strict coverage requirements yet
Commit Messages
Use conventional commit style:feat:- New featuresfix:- Bug fixesimprove:- Enhancements to existing featuresrefactor:- Code refactoringdocs:- Documentation changeschore:- Maintenance tasks
Examples
Pull Request Guidelines
Before Submitting
-
Run quality checks:
-
For Rust changes:
- Test your changes locally
PR Content
- Clear description: Explain what and why
- Linked issues: Reference related issues
- Screenshots/GIFs: For UI changes
- Environment notes: Document any
.envchanges - Migration notes: Document database changes
- Keep scope tight: One feature/fix per PR
PR Checklist
Code follows style guidelines
Tests added/updated if needed
Documentation updated if behavior changes
No auto-generated files edited
Database migrations tested
Development Best Practices
Do Not
- Start extra servers (use
pnpm dev:weborpnpm dev:desktop) - Edit auto-generated files (
**/tauri.ts,**/queries.ts,apps/desktop/src-tauri/gen/**) - Skip database flow: always
db:generate→db:push - Commit secrets to VCS
- Use
gitcommands with-iflag (interactive not supported)
Do
- Use existing scripts and Turbo filters
- Clear
.turboonly when necessary - Configure via
.envfrompnpm env-setup - Run
pnpm formatandcargo fmtbefore committing - Keep documentation in sync with code
Effect.ts Patterns
When working with Effect in API routes:- Use
Effect.genfor effectful code - Acquire services with
yield* - Translate domain errors to
HttpApiError - Never call
runPromisein route files
Code Formatting
Getting Help
If you need help:- Discord: Join our community
- Issues: GitHub Issues
- Docs: This documentation
Recognition
Contributors are recognized through:- GitHub contributors page
- Open bounties via Algora
Next Steps
Setup
Set up your development environment
Architecture
Learn about the codebase structure