← スキル一覧に戻る

field-consistency-check
by j4xie
⭐ 0🍴 1📅 2026年1月23日
SKILL.md
name: field-consistency-check description: 检查前后端字段名一致性。自动比较后端 Entity 与前端 Interface 的所有字段,发现缺失或不一致的字段。使用此 Skill 确保数据模型统一。 allowed-tools:
- Read
- Grep
- Glob
- Bash
字段一致性检查 Skill
Entity/Interface 映射表
| 后端 Entity | 前端文件 | Interface 名 |
|---|---|---|
| Customer | customerApiClient.ts | Customer |
| Supplier | supplierApiClient.ts | Supplier |
| User | userApiClient.ts | UserDTO |
| Factory | platformApiClient.ts | FactoryDTO |
| FactoryEquipment | equipmentApiClient.ts | Equipment |
| MaterialBatch | materialBatchApiClient.ts | MaterialBatch |
| RawMaterialType | materialTypeApiClient.ts | MaterialType |
| ProductType | productTypeApiClient.ts | ProductType |
| QualityInspection | qualityInspectionApiClient.ts | QualityInspection |
| ShipmentRecord | shipmentApiClient.ts | ShipmentRecord |
| DisposalRecord | disposalRecordApiClient.ts | DisposalRecord |
快速检查命令
cd /Users/jietaoxie/my-prototype-logistics
# 提取后端字段
grep -E "private (String|Long|Boolean|Integer|BigDecimal|LocalDateTime)" \
backend-java/src/main/java/com/cretas/aims/entity/Customer.java | \
grep -v "//" | awk '{print $3}' | sed 's/;//' | sort
# 提取前端字段
awk '/export interface Customer \{/,/^\}/' \
frontend/CretasFoodTrace/src/services/api/customerApiClient.ts | \
grep -E "^\s+\w+[\?:]" | awk '{print $1}' | sed 's/[?:]//' | sort
# 对比差异
comm -23 /tmp/be.txt /tmp/fe.txt # 只在后端
comm -13 /tmp/be.txt /tmp/fe.txt # 只在前端
字段命名差异表
| Entity | 电话字段 | 地址字段 |
|---|---|---|
| Factory | contactPhone | address |
| Supplier | contactPhone + phone | address |
| Customer | contactPhone + phone | shippingAddress + billingAddress |
| User | phone | - |
修复流程
- 查看后端字段:
grep -E "private" entity/XXX.java - 更新前端 Interface 与后端一致
- 编译检查:
npx tsc --noEmit --skipLibCheck
相关路径
- 后端 Entity:
backend-java/src/main/java/com/cretas/aims/entity/ - 前端 API:
frontend/CretasFoodTrace/src/services/api/
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です