From f368ae163e8835ad29738c97d1b31be2e1a16aa2 Mon Sep 17 00:00:00 2001 From: "gary.fu" Date: Fri, 28 Aug 2026 16:18:49 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20Agent=E5=86=85=E7=BD=AE=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=BB=A3=E7=A0=81=E6=A3=80=E7=B4=A2=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E4=B8=8E=E4=BC=98=E5=8C=96=E8=A7=84=E5=88=99=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agents/rules/rules.md | 14 ++++++++++++++ AGENTS.md | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .agents/rules/rules.md create mode 100644 AGENTS.md diff --git a/.agents/rules/rules.md b/.agents/rules/rules.md new file mode 100644 index 0000000..f76f56d --- /dev/null +++ b/.agents/rules/rules.md @@ -0,0 +1,14 @@ +--- +trigger: always_on +--- + +# 通用规范 +1. 生成提交日志时,请使用中文,日志主要包括本次修改实现的功能的信息。 +2. 默认不自动提交 (git commit),除非在提示词中明确要求提交。 +3. **内置工具与文件检索规范**:阅读、分析和检索代码与项目文件时,必须优先使用内置专有工具(如 `view_file`、`grep_search`、`find_by_name`、`list_dir` 等),严禁随意通过终端执行 `Get-Content`、`cat`、`type`、`dir` 等 shell 命令读取文件。仅在执行项目构建、测试验证、Git 提交等必须依赖宿主环境的任务时才调用终端命令,避免触发多余的命令确认拦截。 + +# 前端代码规范 (Vue 3 + JavaScript + Element Plus) +1. **组件优先**:优先使用 `common-*` 等自定义通用组件(如 ``, ``, ``, ``, ``, `` 等),图标展示必须优先使用 ``。 +2. **静态校验**:修改前端 JS 或 Vue 等文件时使用 ESLint 规则验证并通过后继续(`npm run lint` 0 错误 0 警告)。 +3. **通用交互**:通用交互(加载提示、确认弹窗、日期格式化)优先调用挂载在全局的 `$coreShowLoading`、`$coreConfirm`、`$date` 等工具方法。 +4. **国际化与多主题**:界面文案考虑支持中英文国际化,适配明亮与暗黑主题。 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..e4d4220 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,23 @@ +# Simple Element Plus Template - AGENTS.md + +## 1. 项目概览 (Project Overview) +基于 Vue 3 + JavaScript + Vite + Element Plus 的中后台前端通用模版。 + +- **主要仓库**: [fugary/simple-element-plus-template](https://github.com/fugary/simple-element-plus-template) + +## 2. 技术栈 (Tech Stack) +- **框架/构建**: Vue 3 + Vite + JavaScript +- **组件库**: Element Plus, @element-plus/icons-vue +- **状态管理**: Pinia, pinia-plugin-persistedstate +- **路由**: Vue Router +- **工具库**: Axios, Lodash-es, VueUse, Vue I18n + +## 3. 项目规则 (Project Rules) +为了保证项目的开发一致性和质量,AI 代理在协作时需遵循项目内置的规则: + +详细规则请参考:[.agents/rules/rules.md](.agents/rules/rules.md) + +主要包含: +1. **提交日志**: 生成提交日志时请使用 **中文**。 +2. **前端开发**: 修改前端 JS、Vue 等文件时需通过 **ESLint** 验证(`npm run lint`)。 +3. **内置工具与文件检索**: 阅读、分析和检索代码与项目文件时,必须优先使用内置专有工具(如 `view_file`、`grep_search` 等),避免随意通过终端执行 `Get-Content`/`cat`/`type` 等 shell 命令读取文件。