# Development Guidelines This document defines project-level development rules for Hermes Web UI. It is tool-agnostic and applies to all contributors and coding agents. ## Commands ```bash npm install npm run dev npm run test npm run test:coverage npm run test:e2e npm run build ``` - `npm run dev` starts the Vite client and Koa server together. - `npm run test` runs Vitest unit tests. - `npm run test:coverage` is what the Build workflow runs before `npm run build`. - `npm run test:e2e` runs Playwright browser tests against a mocked BFF API. - `npm run build` type-checks and builds both client and server. ## Architecture - Frontend code lives under `packages/client/src`. - Server code lives under `packages/server/src`. - Hermes-specific client code stays under `hermes` namespaces: API modules, views, stores, and components. - Server routes should stay thin. Put request handling in controllers and reusable behavior in services. - The chat runtime is Socket.IO based and lives under `packages/server/src/services/hermes/run-chat`. - Web UI state lives under `HERMES_WEB_UI_HOME` or `HERMES_WEBUI_STATE_DIR`, defaulting to `~/.hermes-web-ui`. ## Coding Rules - Prefer existing local patterns over new abstractions. - Keep changes scoped to the requested behavior. - Do not mix unrelated refactors into feature or bugfix commits. - Do not reintroduce deprecated compatibility switches without a current caller. - Use structured APIs and parsers for structured data instead of ad hoc string edits when possible. - Add comments only where they explain non-obvious behavior or constraints. ## Frontend Rules - Use Vue 3 Composition API with `