xlcp/.claude/agents/subagent-area.md
tangweijie d1c9f356d6 chore: 更新 Claude Code 配置和 Agent 文档
- 添加各模块代码审查 Agent 配置
- 添加 API 一致性审查命令
- 添加工作流配置

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 23:19:47 +08:00

64 lines
2.2 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.

---
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
```