# Coding Guidelines — BilHej > **Note:** This file is loaded by OpenCode via `AGENTS.md` as an external > instruction source. It is referenced by `opencode.json` instructions. > Keep it current — OpenCode uses it for decision-making. Conventions and standards for the BilHej codebase. These exist to keep the project consistent — especially important as a solo developer returning to the code after weeks or months away. --- ## 1. General Principles - **Readability over cleverness.** Write code you can understand at 2 AM six months from now. - **English for code, Swedish for user-facing strings.** Variable names, comments, commit messages: English. UI text, error messages shown to users, templates: Swedish. - **No commented-out code.** Delete it. Git history keeps it if needed. - **Keep functions small.** A function should do one thing. If it's over 30 lines, it probably does too much. - **No magic numbers.** Use named constants or enums. --- ## 2. Git ### Branch Naming ``` feature/plate-lookup fix/stripe-webhook-timeout chore/upgrade-spring-boot-3.3 ``` ### Commit Messages ``` : feat: add license plate input component with validation fix: handle empty response from Transportstyrelsen lookup refactor: extract letter preview into composable chore: bump vue to 3.5 ``` Types: `feat`, `fix`, `refactor`, `chore`, `docs`, `test`, `style` ### Workflow - Work directly on `main` until you have a reason not to (MVP phase). - Squash trivial fix commits before pushing. - Never commit `.env`, credentials, or secrets. `.env.example` only. --- ## 3. Frontend — Vue.js 3 ### File Naming | Type | Convention | Example | |--------------|-----------------------------|----------------------------------| | Page | PascalCase, in `pages/` | `HomePage.vue`, `OrderHistoryPage.vue` | | Component | PascalCase, in `components/`| `PlateInput.vue`, `LetterPreview.vue` | | Composable | camelCase, `use` prefix | `useAuth.js`, `usePayment.js` | | Store | camelCase, in `stores/` | `authStore.js`, `orderStore.js` | | API module | camelCase, in `api/` | `orders.js`, `templates.js` | ### Component Structure ```vue ``` ### Conventions - Use `