2b780a12c2
Update agent and LLM guidance to reference the architecture strategy and add a template naming rule that keeps reusable abstractions domain-neutral. Mark maintenance Phase 3 as complete and document the page driver/page component refactors for EditableGrid and MasterDetail variants.docs: document template naming and maintenance refactor Update agent and LLM guidance to reference the architecture strategy and add a template naming rule that keeps reusable abstractions domain-neutral. Mark maintenance Phase 3 as complete and document the page driver/page component refactors for EditableGrid and MasterDetail variants.
59 lines
3.7 KiB
Markdown
59 lines
3.7 KiB
Markdown
# Project Rules
|
|
|
|
## General
|
|
- Follow the existing code style and patterns.
|
|
- Use pnpm for running project commands.
|
|
- Keep code in TypeScript unless migration is required.
|
|
- When refactoring or creating new components, review `docs/architecture-strategy.md` first and follow its layering and responsibility guidelines.
|
|
- When a change affects LLM editing boundaries, page creation flow, layout usage, login-page boundaries, or frontend layering rules, update `docs/llm-development-guide.md` in the same change.
|
|
- For UI debugging that spans implementation, state flow, and live browser behavior, use subagents deliberately: one for component contracts and event flow, one for data sources / routing / integration, and one for live browser verification. Do not edit files until the evidence from those threads converges on a root cause.
|
|
- Treat subagent output as scoped evidence, not as a final answer. Use subagents to narrow the search space, confirm or eliminate hypotheses, and reduce local context load before making edits.
|
|
- When a problem is directly tied to Vuetify component behavior, props, slots, accessibility output, or generated DOM, consult Vuetify MCP and official Vuetify API documentation before changing the implementation. Prefer supported Vuetify props, slots, and documented extension points over custom replacements unless the documented API is insufficient.
|
|
|
|
## Naming Generalization Rule
|
|
- This project is a **template** intended to be reused across different data domains (student, course, teacher, etc.).
|
|
- **Reusable abstractions** (Page Components, Sections, Items, generic composables, base components) **must not contain domain-specific names** (e.g., `Student`, `Course`) in their file names, type names, or export names.
|
|
- Domain-specific names are **only allowed** in:
|
|
- `src/models/<domain>.ts` — domain models
|
|
- `src/stores/<domain>.ts` — domain stores
|
|
- `src/services/modules/<domain>.ts` — service modules
|
|
- Examples of correct vs. incorrect naming:
|
|
- ❌ `PageStudentMaintenance.vue` → ✅ `PageMaintenance.vue`
|
|
- ❌ `useStudentMaintenancePage.ts` → ✅ `useMaintenancePage.ts`
|
|
- ❌ `ItemStudentRow.vue` → ✅ `ItemDataRow.vue`
|
|
- ❌ `useStudentCrudCommands.ts` → ✅ `useCrudCommands.ts`
|
|
- ✅ `models/student.ts`, `stores/students.ts` — domain layer, specific names are correct
|
|
|
|
## Stack
|
|
- Framework: Vue 3 + Vite
|
|
- UI Library: Vuetify
|
|
- Enabled Features: Vuetify MCP, Pinia, Vue I18n, Vue Router
|
|
|
|
## Icon Usage
|
|
```js
|
|
<script setup>
|
|
import { mdiAccount } from '@mdi/js'
|
|
</script>
|
|
|
|
<template>
|
|
<v-icon :icon="mdiAccount" />
|
|
</template>
|
|
```
|
|
|
|
## Vuetify MCP
|
|
|
|
- When looking up Vuetify versions, release notes, component APIs, directive APIs, installation guides, FAQs, feature guides, or package exports, use Vuetify MCP first.
|
|
- When a question involves Vuetify component props, events, slots, exposed methods, generated DOM, accessibility output, or officially supported extension points, verify with Vuetify MCP before changing the implementation.
|
|
- Prefer the official API and documentation information returned by MCP. Do not infer Vuetify behavior.
|
|
|
|
### 常用工具
|
|
|
|
- `get_release_notes_by_version`: 查詢指定版本或 latest 的 release notes。
|
|
- `get_component_api_by_version`: 查詢指定 Vuetify 元件的 props、events、slots、exposed methods。
|
|
- `get_directive_api_by_version`: 查詢指定 Vuetify directive 的 API。
|
|
- `get_vuetify_api_by_version`: 下載並快取指定版本的 Vuetify API types。
|
|
- `get_installation_guide`: 查詢 Vite、Nuxt、Laravel、CDN 等安裝方式。
|
|
- `get_feature_guide`: 查詢 theme、icons、i18n、display、layout 等功能指南。
|
|
- `get_exposed_exports`: 查詢 Vuetify npm package 可匯出的項目。
|
|
- `get_frequently_asked_questions`: 查詢 Vuetify FAQ。
|