---
name: General
description: Workspace-wide guidance and workflows.
applyTo: "**/*"
---

# General

## Code Style & Conventions

- Look in the problems tab for any errors or warnings in the code
- Follow the existing code style and conventions used in the project
- Write clear and concise comments where necessary to explain complex logic
- Ensure code is modular and reusable where possible
- Avoid introducing new dependencies unless absolutely necessary, but ask the user if there is a specific library they want to use
- If you are unsure about any requirements or details, ask the user for clarification before proceeding
- Respect a11y and localization best practices if applicable, optimize for WCAG AA standards

## Development Workflow

- Default dev flow is Docker/Makefile: `make docker-up`, `make docker-start`, `make docker-logs`, `make docker-restart-frontend` (see Makefile).
- Local dev is secondary: `yarn dev` for watch, `yarn build` and `yarn build:server` for production builds (see package.json).
- Frontend code is automatically built by watcher and browser-sync; backend code is automatically built and reloaded by extension, so no manual restarts needed during development.
- Read `.env` for environment URLs and secrets.
- Keep `tibi-types/` read-only unless explicitly asked.
- `webserver/` is for staging/ops only; use BrowserSync/esbuild for day-to-day dev.

## API Access

- API access to collections uses the reverse proxy: `CODING_URL/api/<collection>` (e.g. `CODING_URL/api/content`).
- Auth via `Token` header with ADMIN_TOKEN from `api/config.yml.env`.

## Testing

- Write unit tests for new functionality and ensure existing tests pass.
- Playwright is configured for E2E, API, mobile, and visual regression tests.
- Run tests via `yarn test` (all), `yarn test:e2e`, `yarn test:api`, `yarn test:visual`.
- After code changes, run only affected spec files: `npx playwright test tests/e2e/filename.spec.ts`.
