Agent Skill
2/7/2026

field-consistency-check

检查前后端字段名一致性。自动比较后端 Entity 与前端 Interface 的所有字段,发现缺失或不一致的字段。使用此 Skill 确保数据模型统一。

J
j4xie
0GitHub Stars
1Views
npx skills add j4xie/my-prototype-logistics

SKILL.md

Namefield-consistency-check
Description检查前后端字段名一致性。自动比较后端 Entity 与前端 Interface 的所有字段,发现缺失或不一致的字段。使用此 Skill 确保数据模型统一。

name: field-consistency-check description: 检查前后端字段名一致性。自动比较后端 Entity 与前端 Interface 的所有字段,发现缺失或不一致的字段。使用此 Skill 确保数据模型统一。 allowed-tools:

  • Read
  • Grep
  • Glob
  • Bash

字段一致性检查 Skill

Entity/Interface 映射表

核心业务实体

后端 Entity前端文件Interface 名
CustomercustomerApiClient.tsCustomer
SuppliersupplierApiClient.tsSupplier
UseruserApiClient.tsUserDTO
FactoryplatformApiClient.tsFactoryDTO
FactoryEquipmentequipmentApiClient.tsEquipment
MaterialBatchmaterialBatchApiClient.tsMaterialBatch
RawMaterialTypematerialTypeApiClient.tsMaterialType
ProductTypeproductTypeApiClient.tsProductType
QualityInspectionqualityInspectionApiClient.tsQualityInspection
ShipmentRecordshipmentApiClient.tsShipmentRecord
DisposalRecorddisposalRecordApiClient.tsDisposalRecord

SmartBI 实体 (PostgreSQL)

后端 Entity数据库表说明
SmartBIPgUploadsmart_bi_pg_uploads上传记录
SmartBIPgFieldDefinitionsmart_bi_pg_field_definitions字段定义
SmartBIPgDynamicDatasmart_bi_pg_dynamic_data动态数据

快速检查方法

使用 Grep/Glob 工具而非 bash 命令进行检查:

  1. 提取后端字段: 用 Read 工具读取 Entity 文件

    • Entity 路径: backend/java/cretas-api/src/main/java/com/cretas/aims/entity/
    • 查找 private 字段声明
  2. 提取前端字段: 用 Read 工具读取 Interface 文件

    • RN 前端 API: frontend/CretasFoodTrace/src/services/api/
    • Vue Web Admin: web-admin/src/api/
  3. 对比差异: 比较两侧字段名列表

字段命名差异表

Entity电话字段地址字段
FactorycontactPhoneaddress
SuppliercontactPhone + phoneaddress
CustomercontactPhone + phoneshippingAddress + billingAddress
Userphone-

命名规范

层级命名风格示例
Java EntitycamelCasebatchNumber
数据库列snake_casebatch_number
JSON APIcamelCase"batchNumber"
TypeScriptcamelCasebatchNumber

修复流程

  1. 用 Grep 查找后端字段: private in entity/XXX.java
  2. 用 Read 查看前端 Interface
  3. 更新前端 Interface 与后端一致
  4. 编译检查: npx tsc --noEmit --skipLibCheck

相关路径

  • 后端 Entity: backend/java/cretas-api/src/main/java/com/cretas/aims/entity/
  • 前端 RN API: frontend/CretasFoodTrace/src/services/api/
  • 前端 Vue API: web-admin/src/api/
Skills Info
Original Name:field-consistency-checkAuthor:j4xie