mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 13:32:23 +00:00
- Introduced AGENTS.md to outline project structure, build commands, coding style, testing guidelines, and commit/pull request practices. - Included detailed sections on module organization and naming conventions to enhance developer onboarding and consistency.
2.5 KiB
2.5 KiB
Repository Guidelines
Project Structure & Module Organization
src/: React + TypeScript frontend (pages, components, hooks, store, services, lib).src-tauri/: Rust backend and Tauri desktop integration.test/: Vitest config and E2E/WebDriverIO setup (test/e2e,test/wdio.conf.ts).skills/: Skill runtime/build artifacts and manifests.scripts/: build/test automation (E2E helpers, tool generation).docs/: architecture and product documentation.public/andsrc/assets/: static assets.
Build, Test, and Development Commands
yarn dev: run Vite web dev server.yarn dev:app(oryarn tauri:dev): run desktop app with Tauri + TDLib bootstrap.yarn build: type-check and build web bundle.yarn build:app: build app bundle plus skills/tools generation.yarn compile: TypeScript check only (tsc --noEmit).yarn test/yarn test:coverage: run unit tests and coverage.yarn test:rust: run Rust tests insrc-tauri.yarn test:e2e: run E2E suite (login/auth/payment/telegram/notion/gmail).yarn lint/yarn lint:fix,yarn format:check/yarn format: quality and formatting checks.
Coding Style & Naming Conventions
- TypeScript-first; keep all app code under
src/. - Prettier is authoritative: 2 spaces, semicolons, single quotes, max width 100.
- Imports are auto-sorted via
@trivago/prettier-plugin-sort-imports. - ESLint (flat config) enforces React hooks rules, no duplicate imports,
prefer-const, and TS-aware unused var checks. - Naming: React components
PascalCase.tsx; hooksuseX.ts; slices/services/helperscamelCase.ts; tests*.test.ts(x).
Testing Guidelines
- Framework: Vitest + Testing Library (
jsdom), with MSW utilities insrc/test/. - Unit tests live beside code (
__tests__) or as*.test.ts(x)insrc/. - Coverage thresholds (global minimum): lines 15%, statements 15%, functions 15%, branches 12%.
- Run
yarn test:coveragebefore opening non-trivial PRs.
Commit & Pull Request Guidelines
- Prefer concise conventional-style subjects:
feat:,fix:,refactor:,docs:,chore:. - Keep commits scoped and descriptive (e.g.,
fix: handle socket reconnect on auth expiry). - If contributing upstream, branch from
developand open PRs againstdevelop. - PRs should include: purpose, key changes, test evidence (commands run), linked issue (
Fixes #123), and screenshots/videos for UI changes. - Hooks exist but are lightweight; run lint, format, compile, and relevant tests manually before push.