Skip to main content

Contributing

Development Setup

Clone the Repository

git clone <repository-url>
cd contop

Install Dependencies

Each package has its own dependency management:

# Server (Python)
cd contop-server
uv sync

# Mobile (React Native)
cd contop-mobile
npm install

# Desktop (Tauri)
cd contop-desktop
npm install

Run in Development

# Server
cd contop-server && uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload

# Mobile
cd contop-mobile && npx expo run:android # or npx expo run:ios

# Desktop
cd contop-desktop && npm run tauri dev

Naming Conventions

TypeScript (Mobile Client)

ElementConventionExample
Component filesPascalCase.tsxExecutionThread.tsx
Hooks & storescamelCase with use prefixuseWebRTC.ts, useAIStore.ts
Types / InterfacesPascalCase, no I prefixCommandEntry, not ICommandEntry
ConstantsSCREAMING_SNAKE_CASEPROCESSING_TIMEOUT_MS
Zustand actionsverb + Noun camelCasesetAIState()
Data channel typessnake_case strings"tool_call", "state_update"
Layout type valueskebab-case strings"video-focus", "split-view"

Python (Contop Server)

ElementConventionExample
Files / Modulessnake_case.pydual_tool_evaluator.py
ClassesPascalCaseDualToolEvaluator
Functions / Methodssnake_case()classify()
ConstantsSCREAMING_SNAKE_CASEMAX_ITERATIONS
Tool namessnake_case"execute_cli"
FastAPI route pathskebab-case segments/api/away-mode/status
JSONL log keyssnake_caseuser_prompt, duration_ms

Rust (Desktop App)

ElementConventionExample
Tauri commandssnake_case with async_runtimestart_server, get_settings
HTTP callsureq (bypasses Tauri network restrictions)ureq::get(url).call()
Process managementPlatform-specific group creationCREATE_NEW_PROCESS_GROUP (Windows)

Code Quality Rules

  • TypeScript: Strict mode mandatory. All components use NativeWind v4 utility classes.
  • Python: Async asyncio logic mandatory throughout. Use asyncio.to_thread() for blocking calls. Never fail silently — all exceptions logged and returned as ToolResult with status="error".
  • Rust: All Tauri IPC commands use tauri::async_runtime::spawn_blocking for HTTP calls.
  • Documentation: JSDoc/docstrings at core module boundaries (WebRTC, OmniParser, UI tools).
  • Data shapes: WebRTC data channel messages must use the canonical envelope format (type, id, payload).

PR Workflow

  1. Create a feature branch from main
  2. Implement changes following the conventions above
  3. Run tests for affected packages
  4. Create a PR with a clear description of changes
  5. Address review feedback

Related: Project Structure · Testing · Build & Release