Skip to content
Back to skills

Field Consistency Check

ASecurity

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

  • 755 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 8, 2026
developmentjavabashapifrontendbackend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill field-consistency-check --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Field Consistency Check?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Field Consistency Check
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-field-consistency-check/badge)](https://www.skillsdirectory.com/skills/majiayu000-field-consistency-check)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
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 |

## 快速检查命令

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

## 修复流程

1. 查看后端字段: `grep -E "private" entity/XXX.java`
2. 更新前端 Interface 与后端一致
3. 编译检查: `npx tsc --noEmit --skipLibCheck`

## 相关路径

- 后端 Entity: `backend-java/src/main/java/com/cretas/aims/entity/`
- 前端 API: `frontend/CretasFoodTrace/src/services/api/`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.