Files
portal-mini-front/.codebuddy/rules/05-workflow.md
T
2026-10-25 23:14:53 +08:00

30 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: 需求到交付的协作流程 —— 新增功能、修改代码、联调与自测时的执行顺序
globs: ["**/*"]
---
# 协作流程
## 接到需求后的执行顺序
1. **先确认契约**:与后端确认接口路径、请求/响应字段、分页结构、错误码;未确认前不得凭猜测写页面。
2. **先写类型**:在 `src/types/{module}/` 下定义 `Query / VO / Form`。
3. **再写 API**:`src/api/{module}/index.ts`。
4. **最后写页面**:列表 → 表单弹窗 → 详情(按需)。
5. **自测**:`pnpm type-check` 与 `pnpm lint` 必须通过;再手动走通「空数据 / 查询 / 新增 / 编辑 / 删除 / 无权限 / 接口报错」七条路径。
## 代码修改原则
- 修改前先读完整文件与相关调用方,禁止盲目整文件重写。
- 优先用局部小改动( targeted edit )解决;确需重构时先说明影响面。
- 不要顺手重构无关代码、不要调整无关格式、不要删除他人注释。
- 不要新增未被要求的功能、文档文件(README/md)或测试用例。
## 产出要求
- 生成的代码必须可直接运行:补齐 import、类型、路由注册、store 注册等所有必要接线。
- 新增页面必须在对应路由/菜单中注册,并保证能真实访问。
- 新增依赖需说明用途与体积影响,优先选择已在技术栈内的方案。
## 禁止事项
- 提交前遗留 `console.log`、调试代码、TODO 未处理项。
- 使用已废弃 API(Vue 2 写法、`$refs` 字符串、`filters`、Element UI 组件名)。
- 为了跑通而放宽类型、加 `any`、`@ts-ignore`、关闭 ESLint 规则。