# Development Guidelines This document defines project-level development rules for hermes-ui. It is tool-agnostic and applies to all contributors and coding agents. ## Prerequisites - Node.js `>=23` (see `engines` in `package.json`). - Python with `hermes-agent` installed. The Hermes CLI is not bundled; point `HERMES_BIN` at the executable or make `hermes` resolvable from `PATH`. ## Commands ```bash npm ci --ignore-scripts npm run dev npm run test npm run test:coverage npm run test:e2e npm run build ``` - `npm ci --ignore-scripts` installs exactly what `package-lock.json` pins. Do not upgrade dependencies. - `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`. - Hermes `state.db` is read-only. Never open it from Node-side code. ## 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 `