e90d412956
Document new GUIDE.md expectations for src-layer edits and add index entries for models and shared types. Clarify layout usage, composable placement, error page conventions, and model/type ownership so future changes follow the intended layer boundaries.docs: update LLM guides for models and layout rules Document new GUIDE.md expectations for src-layer edits and add index entries for models and shared types. Clarify layout usage, composable placement, error page conventions, and model/type ownership so future changes follow the intended layer boundaries.
60 lines
4.0 KiB
Markdown
60 lines
4.0 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.
|
|
- Before modifying or adding files in a `src/` subdirectory, read the corresponding `src/**/GUIDE.md` to understand the layer's constraints and conventions. Use `docs/llm-development-guide.md` as the index to find which GUIDE applies.
|
|
- When the change introduces a new pattern, directory, or convention that affects layer boundaries, create or update the relevant `src/**/GUIDE.md` and ensure `docs/llm-development-guide.md` indexes it.
|
|
- When refactoring or creating new components, review `docs/architecture-strategy.md` first and follow its layering and responsibility guidelines.
|
|
- 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。
|