mirror of https://github.com/openclaw/clawhub.git
2.5 KiB
2.5 KiB
Repository Guidelines
Project Structure & Module Organization
src/— TanStack Start app code (routes, components, styles).convex/— Convex backend (schema, queries/mutations/actions, HTTP routes).convex/_generated/— generated Convex API/types; committed for builds.docs/— product/spec docs (seedocs/spec.md).public/— static assets.
Build, Test, and Development Commands
bun run dev— local app server athttp://localhost:3000.bun run build— production build (Vite + Nitro).bun run preview— preview built app.bunx convex dev— Convex dev deployment + function watcher.bunx convex codegen— regenerateconvex/_generated.bun run lint— Biome + oxlint (type-aware).bun run test— Vitest (unit tests).bun run coverage— coverage run; keep global >= 80%.
Coding Style & Naming Conventions
- TypeScript strict; ESM.
- Indentation: 2 spaces, single quotes (Biome).
- Lint/format: Biome + oxlint (type-aware).
- Convex function names: verb-first (
getBySlug,publishVersion).
Testing Guidelines
- Framework: Vitest 4 + jsdom.
- Tests live in
src/**andconvex/lib/**. - Coverage threshold: 80% global (lines/functions/branches/statements).
- Example:
convex/lib/skills.test.ts.
Commit & Pull Request Guidelines
- Commit messages: Conventional Commits (
feat:,fix:,chore:,docs:…). - Keep changes scoped; avoid repo-wide search/replace.
- PRs: include summary + test commands run. Add screenshots for UI changes.
- Reject PRs that add skills into source code/repo content directly (for example under
skills/or seed-only additions intended as published skills). Skills must be uploaded/published via CLI.
Git Notes
- If
git branch -d/-D <branch>is policy-blocked, delete the local ref directly:git update-ref -d refs/heads/<branch>.
Configuration & Security
- Local env:
.env.local(never commit secrets). - Convex env holds JWT keys; Vercel only needs
VITE_CONVEX_URL+VITE_CONVEX_SITE_URL. - OAuth: GitHub OAuth App credentials required for login.
Convex Ops (Gotchas)
- New Convex functions must be pushed before
convex run: usebunx convex dev --once(dev) orbunx convex deploy(prod). - For non-interactive prod deploys, use
bunx convex deploy -yto skip confirmation. - If
bunx convex run --env-file .env.local ...returns401 MissingAccessTokendespitebunx convex login, workaround: omit--env-fileand use--deployment-name <name>/--prod.