70 lines
4.1 KiB
Markdown
70 lines
4.1 KiB
Markdown
# Windsurf Project Rules
|
|||
|
|
|
||
|
|
以提升代码质量和开发效率为宗旨,持续保证代码的易读性、可维护性和规范性。
|
||
|
|
|
||
|
|
When a user request matches a Madong framework task, automatically use the relevant workspace skill from `.windsurf/skills/`.
|
||
|
|
|
||
|
|
Prefer these skill groups by intent:
|
||
|
|
|
||
|
|
- `backend-gen-*` for backend code generation tasks such as CRUD, model, DAO, service, controller, validate, schema, migrate, route, event, and listener generation.
|
||
|
|
- `backend-*` for backend conventions such as config, bootstrap, middleware, exception, swagger, command, queue, cache, upload, logger, and tests.
|
||
|
|
- `frontend-admin-*` for Admin frontend tasks in Vue 3, Element Plus, routing, stores, API calls, i18n, views, and generated pages.
|
||
|
|
- `frontend-web-*` for Nuxt web frontend tasks, including pages, components, layouts, stores, and API calls.
|
||
|
|
- `cross-*` for cross-layer API conventions, database design, and app skeleton decisions.
|
||
|
|
|
||
|
|
If multiple skills match, use the most specific generation skill first, then supporting convention skills as needed.
|
||
|
|
|
||
|
|
When a skill conflicts with the actual project implementation, treat the existing project code as authoritative. First verify the real routes, directory structure, naming conventions, base classes, APIs, and runtime behavior from the current project, then update the relevant `.windsurf/skills/` skill content to match the existing project before using it again.
|
||
|
|
|
||
|
|
## Skill Auto-Evolution Rule
|
||
|
|
|
||
|
|
Skills must evolve with the current project. When using any `.windsurf/skills/` skill, always compare the skill instructions with the actual project implementation. If you discover newer or more accurate conventions in the project, proactively update the corresponding skill so future tasks follow the corrected convention.
|
||
|
|
|
||
|
|
Auto-evolve skills when any of the following mismatches are found:
|
||
|
|
|
||
|
|
- Real backend routes, controller paths, OpenAPI attributes, or permission codes differ from the skill.
|
||
|
|
- Real frontend API base URLs, request/response formats, component usage, or route conventions differ from the skill.
|
||
|
|
- Real directory structure, file naming, namespaces, base classes, traits, stores, hooks, or schemas differ from the skill.
|
||
|
|
- Real runtime behavior, validation rules, middleware, config loading, or generated code patterns differ from the skill.
|
||
|
|
|
||
|
|
Auto-evolution workflow:
|
||
|
|
|
||
|
|
1. Verify the real implementation from source files, route lists, configs, and runtime behavior.
|
||
|
|
2. Treat the verified project implementation as the source of truth.
|
||
|
|
3. Update the relevant `.windsurf/skills/` file with the corrected convention before relying on that skill again.
|
||
|
|
4. Keep the skill update focused on the verified mismatch and avoid unrelated rewrites.
|
||
|
|
5. Mention the skill evolution briefly in the final task summary.
|
||
|
|
|
||
|
|
# 中文回答设置
|
||
|
|
|
||
|
|
请始终使用中文回答用户的所有问题和请求。无论用户使用什么语言提问,都应该用中文进行回复。
|
||
|
|
|
||
|
|
## 语言规则
|
||
|
|
|
||
|
|
- 所有回答都使用简体中文
|
||
|
|
- 技术术语可以保留英文,但要提供中文解释
|
||
|
|
- 代码注释使用中文
|
||
|
|
- 错误信息和提示使用中文
|
||
|
|
- 文档和说明使用中文
|
||
|
|
|
||
|
|
## 例外情况
|
||
|
|
|
||
|
|
- 代码本身(变量名、函数名等)可以使用英文
|
||
|
|
- 命令行指令保持原样
|
||
|
|
- 配置文件内容根据实际需要决定语言
|
||
|
|
|
||
|
|
# 编辑安全规则
|
||
|
|
|
||
|
|
- 从不删除未经编辑的内容
|
||
|
|
- 在删除任何内容之前必须先确认
|
||
|
|
- 专注于更新和添加,而不是删除
|
||
|
|
- 无论开发还是修改,都需要经过上下文思考后再来根据问题精准修改
|
||
|
|
- 插件相关前端内容必须先修改并核对 `backend/plugin/{plugin}/resource/template/admin` 下的模板源文件;模板源修改完成后,必须同步修改对应的 `frontend/admin/src/apps/{plugin}` 运行目录,并核对两者实现一致
|
||
|
|
- 避免将未更改的内容总结为"文件其余部分保持不变"
|
||
|
|
|
||
|
|
# 本地项目与版本控制
|
||
|
|
|
||
|
|
- 本项目为本地项目,不使用 Git 进行状态检查、差异比较、提交或任何其他操作。
|
||
|
|
- 后续回答、验证命令和开发说明中不出现 Git 或 Git 命令。
|
||
|
|
- 如需确认文件改动,以实际文件内容、语法检查、自动化测试或运行时验证为准。
|