- Root
pnpmworkspace with packages:main/(Electron main process, TypeScript),frontend/(React + Vite),shared/(shared types), andtests/(Playwright E2E). - Key paths:
main/src/{services,ipc,utils}/,frontend/src/{components,hooks,stores,utils}/,main/assets/,scripts/. - Build artifacts:
frontend/dist/,main/dist/, packaged outputdist-electron/.
- Dev app:
pnpm dev(spawns frontend + Electron). - Build all:
pnpm build(frontend, main, then electron package). - Package (examples):
pnpm build:mac,pnpm build:linux. - Lint:
pnpm lint; Type-check:pnpm typecheck(runs per package). - Tests (E2E):
pnpm test,pnpm test:ui, CI configs inplaywright.ci*.config.ts. - Main unit tests (if added):
pnpm --filter main test, coverage:pnpm --filter main run test:coverage.
- Use TypeScript throughout; follow ESLint configs in
frontend/eslint.config.jsandmain/eslint.config.js. - Indentation 2 spaces; prefer explicit types at module boundaries.
- Naming:
camelCasefor variables/functions,PascalCasefor React components/types,kebab-casefor filenames (React files may match component name). - Run
pnpm lint && pnpm typecheckbefore sending PRs.
- E2E tests live in
tests/*.spec.ts(Playwright). Example:pnpm test -- tests/smoke.spec.ts. - Add Playwright tests for user-visible flows; mock external services where possible.
- For backend logic in
main/, use Vitest colocated undermain/src/**/__tests__or*.spec.ts.
- Commits: present tense, focused, reference issues (e.g., "Fix session diff flicker, closes #123").
- PRs must include: clear description, linked issues, testing notes; screenshots/GIFs for UI changes.
- If dependencies change, run
pnpm run generate-noticesand commit updatedNOTICES.
- Node >=
22.14;pnpm>=8. Usepnpmonly. - Secrets via
.env(dotenv) for local dev; never commit secrets. - To avoid clobbering local data when hacking on Crystal with Crystal:
CRYSTAL_DIR=~/.crystal_test pnpm dev.
- Keep changes minimal and scoped; prefer small patches.
- Update docs alongside code; do not alter build targets without discussion.
- Use repository scripts (pnpm) and keep formatting consistent with existing files.
- Always review the root
CLAUDE.mdbefore beginning any work. - Scan the repository for every
CLAUDE.md, and when working in a folder or any of its subfolders that has one, read and follow that file too.