From d1c9f356d6b848f58d861bf38a4e20dd27e537df Mon Sep 17 00:00:00 2001 From: tangweijie <877588133@qq.com> Date: Mon, 19 Jan 2026 23:19:47 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20Claude=20Code=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=20Agent=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加各模块代码审查 Agent 配置 - 添加 API 一致性审查命令 - 添加工作流配置 Co-Authored-By: Claude --- .claude/agents/subagent-area.md | 64 +++++++++++ .claude/agents/subagent-batch-review.md | 100 ++++++++++++++++++ .claude/agents/subagent-cell.md | 44 ++++++++ .claude/agents/subagent-consumption.md | 44 ++++++++ .claude/agents/subagent-question.md | 44 ++++++++ .../agents/subagent-questionnaire-record.md | 44 ++++++++ .claude/agents/subagent-questionnaire.md | 44 ++++++++ .../agents/subagent-report-consolidation.md | 56 ++++++++++ .claude/agents/subagent-risk-assessment.md | 44 ++++++++ .claude/agents/subagent-score.md | 44 ++++++++ .claude/commands/my-workflow.md | 60 +++++++++++ .../prison-module-api-consistency-review.md | 98 +++++++++++++++++ backend | 2 +- frontend | 2 +- 14 files changed, 688 insertions(+), 2 deletions(-) create mode 100644 .claude/agents/subagent-area.md create mode 100644 .claude/agents/subagent-batch-review.md create mode 100644 .claude/agents/subagent-cell.md create mode 100644 .claude/agents/subagent-consumption.md create mode 100644 .claude/agents/subagent-question.md create mode 100644 .claude/agents/subagent-questionnaire-record.md create mode 100644 .claude/agents/subagent-questionnaire.md create mode 100644 .claude/agents/subagent-report-consolidation.md create mode 100644 .claude/agents/subagent-risk-assessment.md create mode 100644 .claude/agents/subagent-score.md create mode 100644 .claude/commands/my-workflow.md create mode 100644 .claude/commands/prison-module-api-consistency-review.md diff --git a/.claude/agents/subagent-area.md b/.claude/agents/subagent-area.md new file mode 100644 index 0000000..67c6a6c --- /dev/null +++ b/.claude/agents/subagent-area.md @@ -0,0 +1,64 @@ +--- +name: subagent-area +description: 审查监区管理(Area)模块 +model: sonnet +color: blue +--- +## 审查任务:Area(监区管理)模块 + +请对 Area 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/area/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/area/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在: +1. 读取前端 `AreaApi` 中的 `createArea` / `updateArea` 方法的请求参数类型 +2. 提取前端请求对象的所有字段(注意区分必填/可选字段) +3. 对比后端 `AreaSaveReqVO.java` 中 `@Schema` 或 `@TableField` 标注的所有字段 +4. 报告差异: + - 前端有但后端缺失的字段 + - 后端有但前端缺失的字段 + - 字段命名不一致(camelCase vs snake_case) + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段(如关联查询的name字段)是否在Service层正确填充: +1. 识别RespVO中的关联字段(`*Name`, `*Code`等) +2. 检查 `AreaServiceImpl` 中是否调用关联Service查询并填充 +3. 验证填充时机(分页查询时批量查询 vs 单条查询时单独查询) +4. 报告差异: + - 关联字段未填充 + - N+1查询性能问题 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范: +1. 提取SaveReqVO中所有日期/时间类型字段 +2. 检查Controller层是否使用 `@JsonFormat` 注解指定时区 `Asia/Shanghai` +3. 检查Service层日期字段的自动维护逻辑 +4. 报告差异: + - 缺少 `@JsonFormat` 注解 + - 时区配置不正确 + - 日期字段未设置默认值 + +### 输出要求 +```markdown +## 审查报告 - Area(监区管理) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-batch-review.md b/.claude/agents/subagent-batch-review.md new file mode 100644 index 0000000..c0a6487 --- /dev/null +++ b/.claude/agents/subagent-batch-review.md @@ -0,0 +1,100 @@ +--- +name: subagent-batch-review +description: 批量模块审查引擎 +model: sonnet +color: cyan +--- +## 批量模块接口一致性审查任务 + +请对项目中的模块进行批量接口一致性审查。 + +### 任务说明 +你需要进行以下步骤: + +#### 步骤1:模块发现 +1. 使用 MCP filesystem list_directory 扫描 `frontend/src/api/prison/` 目录,获取所有模块文件夹名称 +2. 使用 MCP filesystem list_directory 扫描 `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/` 目录,获取所有模块文件夹名称 +3. 合并两个列表,确保模块名称一致性 + +#### 步骤2:批量审查 +对每个发现的模块,执行以下审查: + +**对于每个模块 {moduleName}:** + +1. **字段完整性校验** + - 读取前端 `frontend/src/api/prison/{moduleName}/index.ts` 中的 `create{ModuleName}` / `update{ModuleName}` 方法的请求参数类型 + - 读取后端 `backend/.../controller/admin/{moduleName}/vo/*{ModuleName}SaveReqVO.java` 的所有字段 + - 对比并报告差异: + - 前端有但后端缺失的字段 + - 后端有但前端缺失的字段 + - 字段命名不一致(camelCase vs snake_case) + +2. **非实体字段填充校验** + - 检查 `backend/.../service/{moduleName}/impl/*{ModuleName}ServiceImpl.java` 中关联字段的填充逻辑 + - 检查 RespVO 中的关联字段(`*Name`, `*Code`等)是否正确填充 + - 报告 N+1 查询性能问题 + +3. **日期字段处理校验** + - 检查 SaveReqVO 中日期字段的 `@JsonFormat` 注解配置 + - 检查时区是否为 `Asia/Shanghai` + - 检查日期格式是否为 `yyyy-MM-dd HH:mm:ss` 或 `yyyy-MM-dd` + +#### 步骤3:生成汇总报告 + +```markdown +## 批量审查报告 + +### 发现模块列表 +| 序号 | 模块名称 | 前端路径 | 后端路径 | 审查状态 | +|------|----------|----------|----------|----------| +| 1 | area | frontend/src/api/prison/area/ | .../controller/admin/area/ | 已审查 | +| ... | ... | ... | ... | ... | + +### 模块详细审查结果 + +#### {模块名称1} +[按下方格式输出详细报告] + +#### {模块名称2} +[按下方格式输出详细报告] + +...(每个模块都需详细报告) + +### 总体统计 +- 总模块数: X +- 成功审查: X +- 审查失败: X +- 发现问题总数: X + - 字段完整性问题: X + - 字段填充问题: X + - 日期处理问题: X +``` + +### 各模块详细报告格式 + +对于每个模块,输出: + +```markdown +## 审查报告 - {模块名称} + +### 模块路径 +- 前端: `frontend/src/api/prison/{moduleName}/` +- 后端: `backend/.../controller/admin/{moduleName}/` + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-cell.md b/.claude/agents/subagent-cell.md new file mode 100644 index 0000000..8ebb146 --- /dev/null +++ b/.claude/agents/subagent-cell.md @@ -0,0 +1,44 @@ +--- +name: subagent-cell +description: 审查监室管理(Cell)模块 +model: sonnet +color: blue +--- +## 审查任务:Cell(监室管理)模块 + +请对 Cell 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/cell/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/cell/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在。 + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段是否在Service层正确填充。 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范。 + +### 输出要求 +```markdown +## 审查报告 - Cell(监室管理) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-consumption.md b/.claude/agents/subagent-consumption.md new file mode 100644 index 0000000..19f345b --- /dev/null +++ b/.claude/agents/subagent-consumption.md @@ -0,0 +1,44 @@ +--- +name: subagent-consumption +description: 审查消费记录(Consumption)模块 +model: sonnet +color: blue +--- +## 审查任务:Consumption(消费记录)模块 + +请对 Consumption 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/consumption/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/consumption/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在。 + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段是否在Service层正确填充。 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范。 + +### 输出要求 +```markdown +## 审查报告 - Consumption(消费记录) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-question.md b/.claude/agents/subagent-question.md new file mode 100644 index 0000000..db4ce42 --- /dev/null +++ b/.claude/agents/subagent-question.md @@ -0,0 +1,44 @@ +--- +name: subagent-question +description: 审查问卷问题(Question)模块 +model: sonnet +color: blue +--- +## 审查任务:Question(问卷问题)模块 + +请对 Question 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/question/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/question/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在。 + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段是否在Service层正确填充。 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范。 + +### 输出要求 +```markdown +## 审查报告 - Question(问卷问题) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-questionnaire-record.md b/.claude/agents/subagent-questionnaire-record.md new file mode 100644 index 0000000..56fc09b --- /dev/null +++ b/.claude/agents/subagent-questionnaire-record.md @@ -0,0 +1,44 @@ +--- +name: subagent-questionnaire-record +description: 审查问卷答题记录(QuestionnaireRecord)模块 +model: sonnet +color: blue +--- +## 审查任务:QuestionnaireRecord(问卷答题记录)模块 + +请对 QuestionnaireRecord 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/questionnairerecord/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/questionnairerecord/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在。 + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段是否在Service层正确填充。 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范。 + +### 输出要求 +```markdown +## 审查报告 - QuestionnaireRecord(问卷答题记录) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-questionnaire.md b/.claude/agents/subagent-questionnaire.md new file mode 100644 index 0000000..c80b8dd --- /dev/null +++ b/.claude/agents/subagent-questionnaire.md @@ -0,0 +1,44 @@ +--- +name: subagent-questionnaire +description: 审查问卷模板(Questionnaire)模块 +model: sonnet +color: blue +--- +## 审查任务:Questionnaire(问卷模板)模块 + +请对 Questionnaire 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/questionnaire/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/questionnaire/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在。 + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段是否在Service层正确填充。 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范。 + +### 输出要求 +```markdown +## 审查报告 - Questionnaire(问卷模板) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-report-consolidation.md b/.claude/agents/subagent-report-consolidation.md new file mode 100644 index 0000000..8aba2e7 --- /dev/null +++ b/.claude/agents/subagent-report-consolidation.md @@ -0,0 +1,56 @@ +--- +name: subagent-report-consolidation +description: 审查报告汇总生成 +model: sonnet +color: green +--- +## 审查报告汇总任务 + +请汇总所有模块的审查结果,生成最终报告。 + +### 输入 +- 上一步批量审查的详细报告 +- 模块发现结果(模块列表) + +### 输出要求 + +```markdown +## 审查报告汇总 + +### 执行摘要 +- 审查时间: {timestamp} +- 审查范围: 前端/后端接口一致性校验 +- 扫描模块数: X +- 发现问题总数: X + +### 问题分类统计 +| 问题类型 | 数量 | 严重程度 | +|----------|------|----------| +| 字段缺失 | X | 高 | +| 类型不匹配 | X | 中 | +| 命名不一致 | X | 低 | +| 关联字段未填充 | X | 高 | +| N+1查询 | X | 性能 | +| 日期格式缺失 | X | 中 | +| 时区配置错误 | X | 高 | + +### 各模块审查结果 + +| 模块 | 字段完整性 | 字段填充 | 日期处理 | 问题数 | 状态 | +|------|------------|----------|----------|--------|------| +| area | ✅ | ⚠️ | ❌ | 3 | 待修复 | +| cell | ✅ | ✅ | ✅ | 0 | 通过 | +| ... | ... | ... | ... | ... | ... | + +### 高优先级问题(需立即修复) +1. [{模块}] {问题描述} +2. [{模块}] {问题描述} + +### 优化建议 +1. 建议统一使用 `@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")` +2. 建议批量查询关联字段,避免 N+1 查询 +3. 建议建立前后端字段映射表,确保一致性 + +### 审查完成 +审查报告生成完毕,请查阅各模块详细问题。 +``` \ No newline at end of file diff --git a/.claude/agents/subagent-risk-assessment.md b/.claude/agents/subagent-risk-assessment.md new file mode 100644 index 0000000..33f3f03 --- /dev/null +++ b/.claude/agents/subagent-risk-assessment.md @@ -0,0 +1,44 @@ +--- +name: subagent-risk-assessment +description: 审查危险评估(RiskAssessment)模块 +model: sonnet +color: blue +--- +## 审查任务:RiskAssessment(危险评估)模块 + +请对 RiskAssessment 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/riskassessment/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/riskassessment/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在。 + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段是否在Service层正确填充。 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范。 + +### 输出要求 +```markdown +## 审查报告 - RiskAssessment(危险评估) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/agents/subagent-score.md b/.claude/agents/subagent-score.md new file mode 100644 index 0000000..6e6750b --- /dev/null +++ b/.claude/agents/subagent-score.md @@ -0,0 +1,44 @@ +--- +name: subagent-score +description: 审查计分考核(Score)模块 +model: sonnet +color: blue +--- +## 审查任务:Score(计分考核)模块 + +请对 Score 模块进行前端/后端接口一致性审查: + +### 模块路径 +- 前端: `frontend/src/api/prison/score/` +- 后端: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/score/` + +### 规则1:字段完整性校验 +检查前端API接口参数是否在后端SaveReqVO中全部存在。 + +### 规则2:非实体字段填充校验 +检查RespVO中非DO字段是否在Service层正确填充。 + +### 规则3:日期字段处理校验 +检查Create/Update接口中日期字段的处理规范。 + +### 输出要求 +```markdown +## 审查报告 - Score(计分考核) + +### 1. 字段完整性检查 +| 状态 | 位置 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 2. 非实体字段填充检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 3. 日期字段处理检查 +| 状态 | 字段 | 问题描述 | 建议修复 | +|------|------|----------|----------| + +### 4. 审查总结 +- 检查通过项: X +- 警告项: X +- 错误项: X +``` \ No newline at end of file diff --git a/.claude/commands/my-workflow.md b/.claude/commands/my-workflow.md new file mode 100644 index 0000000..067e07a --- /dev/null +++ b/.claude/commands/my-workflow.md @@ -0,0 +1,60 @@ +--- +description: my-workflow +--- +```mermaid +flowchart TD + start_node_default([开始]) + prompt_review_instructions[## 代码审查任务] + subagent_area[subagent-area] + subagent_cell[subagent-cell] + subagent_consumption[subagent-consumption] + subagent_question[subagent-question] + subagent_questionnaire[subagent-questionnaire] + subagent_questionnaire_record[subagent-questionnaire-record] + subagent_risk_assessment[subagent-risk-assessment] + subagent_score[subagent-score] + end_node_default([结束]) + + start_node_default --> prompt_review_instructions + prompt_review_instructions --> subagent_area + subagent_area --> subagent_cell + subagent_cell --> subagent_consumption + subagent_consumption --> subagent_question + subagent_question --> subagent_questionnaire + subagent_questionnaire --> subagent_questionnaire_record + subagent_questionnaire_record --> subagent_risk_assessment + subagent_risk_assessment --> subagent_score + subagent_score --> end_node_default +``` + +## 工作流执行指南 + +按照上方的Mermaid流程图执行工作流。每种节点类型的执行方法如下所述。 + +### 各节点类型的执行方法 + +- **矩形节点**:使用Task工具执行子代理 +- **菱形节点(AskUserQuestion:...)**:使用AskUserQuestion工具提示用户并根据其响应进行分支 +- **菱形节点(Branch/Switch:...)**:根据先前处理的结果自动分支(参见详细信息部分) +- **矩形节点(Prompt节点)**:执行下面详细信息部分中描述的提示 + +### Prompt节点详细信息 + +#### prompt_review_instructions(## 代码审查任务) + +``` +## 代码审查任务 + +请按照以下规则对指定模块进行前端/后端接口一致性审查: + +### 审查目标 +1. 校验前端请求参数与后端VO字段的完整性匹配 +2. 检查非实体字段(关联查询字段)的Service层填充逻辑 +3. 验证Create/Update接口的日期字段处理规范 + +### 审查范围 +- **前端模块**: `frontend/src/api/prison/{module}/index.ts` +- **后端模块**: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/{module}/` +- **VO定义**: `controller/admin/{module}/vo/*ReqVO.java`, `*RespVO.java` +- **Service层**: `service/{module}/impl/*ServiceImpl.java` +``` diff --git a/.claude/commands/prison-module-api-consistency-review.md b/.claude/commands/prison-module-api-consistency-review.md new file mode 100644 index 0000000..8a97ad5 --- /dev/null +++ b/.claude/commands/prison-module-api-consistency-review.md @@ -0,0 +1,98 @@ +--- +description: prison-module-api-consistency-review +--- +```mermaid +flowchart TD + start_node_default([开始]) + prompt_review_instructions[## 通用代码审查工作流] + mcp_discover_frontend[[MCP: list_directory]] + mcp_discover_backend[[MCP: list_directory]] + subagent_batch_review[subagent-batch-review] + subagent_report_consolidation[subagent-report-consolidation] + end_node_default([结束]) + + start_node_default --> prompt_review_instructions + prompt_review_instructions --> mcp_discover_frontend + prompt_review_instructions --> mcp_discover_backend + mcp_discover_frontend --> subagent_batch_review + mcp_discover_backend --> subagent_batch_review + subagent_batch_review --> subagent_report_consolidation + subagent_report_consolidation --> end_node_default +``` + +## 工作流执行指南 + +按照上方的Mermaid流程图执行工作流。每种节点类型的执行方法如下所述。 + +### 各节点类型的执行方法 + +- **矩形节点**:使用Task工具执行子代理 +- **菱形节点(AskUserQuestion:...)**:使用AskUserQuestion工具提示用户并根据其响应进行分支 +- **菱形节点(Branch/Switch:...)**:根据先前处理的结果自动分支(参见详细信息部分) +- **矩形节点(Prompt节点)**:执行下面详细信息部分中描述的提示 + +## MCP工具节点 + +#### mcp_discover_frontend(list_directory) + +**描述**: Discover frontend module directories + +**MCP服务器**: filesystem + +**工具名称**: list_directory + +**验证状态**: valid + +**已配置参数**: + +- `path` (string): frontend/src/api/prison + +**可用参数**: + +- `path` (string) (必需): Frontend API modules directory path + +此节点调用MCP(Model Context Protocol)工具。执行此工作流时,请使用已配置的参数通过MCP服务器调用该工具。 + +#### mcp_discover_backend(list_directory) + +**描述**: Discover backend module directories + +**MCP服务器**: filesystem + +**工具名称**: list_directory + +**验证状态**: valid + +**已配置参数**: + +- `path` (string): backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin + +**可用参数**: + +- `path` (string) (必需): Backend controller modules directory path + +此节点调用MCP(Model Context Protocol)工具。执行此工作流时,请使用已配置的参数通过MCP服务器调用该工具。 + +### Prompt节点详细信息 + +#### prompt_review_instructions(## 通用代码审查工作流) + +``` +## 通用代码审查工作流 + +本工作流将对指定范围内的模块进行前端/后端接口一致性审查。 + +### 审查目标 +1. 校验前端请求参数与后端VO字段的完整性匹配 +2. 检查非实体字段(关联查询字段)的Service层填充逻辑 +3. 验证Create/Update接口的日期字段处理规范 + +### 审查范围 +- 前端 API 目录: `frontend/src/api/prison/` +- 后端 Controller 目录: `backend/yudao-module-prison/src/main/java/cn/iocoder/yudao/module/prison/controller/admin/` +- 默认扫描范围: prison 模块下所有子模块 + +### 使用方式 +- **自动扫描**: 工作流将自动发现所有模块并逐一审查 +- **指定模块**: 通过 targetModules 参数指定审查特定模块 +``` diff --git a/backend b/backend index 877e691..0d46e00 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 877e691792daf30ddba3881d00e45f6f13bda475 +Subproject commit 0d46e00ba7a8d58045514dc95b1e6977ab4ea890 diff --git a/frontend b/frontend index 4bac142..934f293 160000 --- a/frontend +++ b/frontend @@ -1 +1 @@ -Subproject commit 4bac14276a6e483d2d648bdf79c4b9129c6520f9 +Subproject commit 934f2935ac97f2bec4c5aaf954c582fcbb882a3d