mirror of
https://github.com/crabwise-ai/crabwalk.git
synced 2026-08-14 00:57:52 +00:00
* fix(openclaw): support device-auth handshake for gateway 2026.2.14+ * added agents.md for cross-agent compatibility
2.8 KiB
2.8 KiB
Repository Guidelines
Project Structure & Module Organization
src/routes/: TanStack Start file-based routes (/monitor,/workspace, API handlers undersrc/routes/api/).src/components/: UI by domain (monitor/,workspace/,navigation/,ani/).src/integrations/: external/system integrations (openclaw/,trpc/,query/).src/lib/: shared utilities (graph layout, workspace FS helpers, demo data).public/: static assets (images, fonts, skill metadata).- Runtime and packaging files:
Dockerfile,docker-compose.yml,bin/crabwalk.
Architecture Overview
- Stack: TanStack Start + Router, tRPC, TanStack Query/DB, ReactFlow, Tailwind v4, React 19.
- Monitor flow: OpenClaw gateway WebSocket -> server integration (
src/integrations/openclaw/) -> tRPC router (src/integrations/trpc/router.ts) -> client collections/graph UI. - API entrypoint:
src/routes/api/trpc.$.ts; router setup insrc/router.tsx.
Build, Test, and Development Commands
npm run dev: starts local dev server onhttp://localhost:3000.npm run build: creates production build with Vite/TanStack Start.npm start: runs the built server from.output/server/index.mjs.docker-compose up -d: run containerized app (setCLAWDBOT_API_TOKENfirst).
Coding Style & Naming Conventions
- Language: TypeScript + React function components.
- Style in current codebase: 2-space indentation, single quotes, semicolon-light formatting.
- Components/files:
PascalCasefor React components (example:SessionNode.tsx). - Hooks/utilities:
camelCaseexports, hooks prefixed withuse(example:useIsMobile.ts). - Route files follow TanStack conventions, e.g.
src/routes/monitor/index.tsx,src/routes/api/trpc.$.ts. - Use path alias
~/for imports fromsrc.
Testing Guidelines
- No dedicated automated test script is currently defined in
package.json. - Minimum pre-PR validation: run
npm run build, then verify/monitorconnectivity and/workspacefile operations innpm run dev. - If adding tests, colocate as
*.test.ts/*.test.tsxnear the feature and prefer fast unit tests for parsing/state logic.
Commit & Pull Request Guidelines
- Follow Conventional Commit style used in history:
feat(scope): ...,fix(scope): ...,docs: ...,chore: .... - Keep scopes aligned with feature areas (
monitor,workspace,nav,openclaw). - PRs should include:
- clear summary of behavior changes,
- linked issue(s) when applicable,
- screenshots/GIFs for UI changes,
- notes on env/config changes (tokens, gateway URL, workspace mounts).
Security & Configuration Tips
- Never commit secrets. Use
.envor runtime env vars (CLAWDBOT_API_TOKEN,CLAWDBOT_URL). - Keep
.env.exampleupdated when introducing new required configuration.