--- name: mas-frontend-standards description: Use when working on AUTO-MAS frontend Vue, TypeScript, Vite, Electron renderer, routing, API composables, state, styles, forms, validation, or frontend verification tasks. --- # MAS Frontend Standards ## Objective Keep AUTO-MAS frontend changes aligned with the current Vue 3, TypeScript, Vite, Electron, Ant Design Vue, Vue Router, OpenAPI, ESLint, Prettier, and Yarn 4 project conventions. ## Dependency Installation 1. Run frontend dependency commands from the `frontend/` directory. 2. Use `yarn install` by default. 3. If the Electron binary download is slow or fails, use the one-shot mirror command: `yarn cross-env ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" yarn install`. ## Authority This skill is self-contained for frontend engineering rules. If local code differs from this summary, inspect neighboring implementations and prefer the current module pattern unless it violates a red line here. ## Mandatory Intake Before editing frontend code: 1. Confirm branch, remote, and working tree status. 2. Inspect the target page, adjacent pages, related components, composables, API wrappers, router entries, and styles. 3. Classify the task as new page, fix, refactor, style/UI adjustment, API integration, route change, or documentation-only. 4. Select `mas-frontend-ui` as a required companion for any UI, layout, component, form, table, modal, feedback, or visual-state change. 5. Keep changes limited to files directly required by the task. ## Directory And Ownership | Code type | Place it here | Do not place it here | | --- | --- | --- | | Route page | `src/views//index.vue` or `src/views/Xxx.vue` | `src/components` | | Single-module component | `src/views//components` | `src/components` root | | Cross-module component | `src/components` | Copied across page folders | | Business API wrapper | `src/composables/useXxxApi.ts` | Vue page or `src/api` | | Reusable page flow | `src/views//useXxxLogic.ts` or composable | Template expressions | | Pure utility | `src/utils` | Copied inside components | | Domain type | `src/types` or generated `src/api/models` | Repeated local component types | | Shared reactive application state | `src/stores` with Pinia | Page-level `localStorage` access | | Global style token | `src/style.css` or future `src/styles` | Repeated page-local variables | | Global browser UI style such as scrollbars | `src/styles`, imported once by the renderer entry | Repeated component-level browser pseudo-elements | | Electron capability | `electron` and preload types | Direct renderer Node access | Use the narrowest module boundary first. Promote to shared directories only after real cross-module reuse. ## Vue Component Rules 1. Use `