field-mapping-normalization

用于异构字段统一的字段映射与标准化原子 skill,适用于通用行业数据接入场景。

105 stars

Best use case

field-mapping-normalization is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

用于异构字段统一的字段映射与标准化原子 skill,适用于通用行业数据接入场景。

Teams using field-mapping-normalization should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/field-mapping-normalization/SKILL.md --create-dirs "https://raw.githubusercontent.com/aifinlab/FinClaw/main/skills/archive/field-mapping-normalization/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/field-mapping-normalization/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How field-mapping-normalization Compares

Feature / Agentfield-mapping-normalizationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

用于异构字段统一的字段映射与标准化原子 skill,适用于通用行业数据接入场景。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 字段映射与标准化 Skill

## 数据来源

本 Skill 支持多种异构数据输入格式,核心数据来源包括:

### 1. 数据源类型
- **数据库**:多个不同结构的数据库
- **API接口**:多个不同格式的API接口
- **文件数据**:多个不同格式的文件
- **系统数据**:多个不同系统的数据

### 2. 字段特征
- **字段名称**:不同命名规则的字段名称
- **字段类型**:不同数据类型的字段
- **字段格式**:不同格式的字段值
- **字段单位**:不同单位的字段值

### 3. 数据格式要求
- **源数据**:需要映射的源数据
- **目标数据**:目标数据格式和结构
- **映射规则**:字段映射规则和转换规则
- **标准规范**:字段标准规范定义

### 4. 映射特征
- **映射类型**:一对一映射、一对多映射、多对一映射
- **映射复杂度**:简单映射、复杂映射
- **映射规则**:规则映射、自定义映射
- **映射范围**:部分字段映射、全字段映射

> 说明:本 Skill 不包含数据采集功能,需要用户提供源数据和映射规则。建议映射规则清晰明确,以便进行准确的字段映射和标准化。

---

## 功能

本 Skill 提供全面的字段映射与标准化能力,涵盖多种映射功能:

### 1. 字段映射
- **字段名称映射**:映射不同名称的字段
- **字段类型映射**:映射不同类型的字段
- **字段格式映射**:映射不同格式的字段
- **字段单位映射**:映射不同单位的字段

### 2. 字段标准化
- **字段名称标准化**:标准化字段名称
- **字段类型标准化**:标准化字段类型
- **字段格式标准化**:标准化字段格式
- **字段值标准化**:标准化字段值

### 3. 数据转换
- **格式转换**:转换数据格式
- **类型转换**:转换数据类型
- **单位转换**:转换数据单位
- **编码转换**:转换数据编码

### 4. 映射规则管理
- **规则定义**:定义字段映射规则
- **规则验证**:验证映射规则的有效性
- **规则应用**:应用映射规则到数据
- **规则优化**:优化映射规则性能

### 5. 数据验证
- **映射完整性验证**:验证映射的完整性
- **映射准确性验证**:验证映射的准确性
- **数据一致性验证**:验证数据的一致性
- **标准化结果验证**:验证标准化结果

### 6. 高级处理功能
- **批量映射**:批量处理多个字段映射
- **增量映射**:增量更新字段映射
- **映射报告**:生成字段映射报告
- **映射监控**:监控映射过程和结果

---

## 使用示例

### 输出示例
```json
{
  "source_info": {
    "source_data": "financial_data.csv",
    "source_format": "csv",
    "field_count": 20
  },
  "target_info": {
    "target_format": "standard_financial",
    "target_schema": "financial_schema_v1"
  },
  "mapping_rules": [
    {
      "source_field": "revenue",
      "target_field": "营业收入",
      "standard_field": "revenue",
      "mapping_type": "direct",
      "transformation": {
        "type": "unit_conversion",
        "from_unit": "USD",
        "to_unit": "CNY",
        "exchange_rate": 7.2
      }
    },
    {
      "source_field": "profit",
      "target_field": "净利润",
      "standard_field": "net_income",
      "mapping_type": "direct",
      "transformation": null
    }
  ],
  "mapping_results": {
    "total_fields": 20,
    "mapped_fields": 18,
    "unmapped_fields": 2,
    "mapping_time": "2024-03-15T10:00:00",
    "duration": "5s"
  },
  "normalized_data": {
    "sample_records": [
      {
        "revenue": 7200000000,
        "net_income": 200000000,
        "standard_format": true
      }
    ]
  },
  "statistics": {
    "fields_mapped": 18,
    "fields_normalized": 18,
    "mapping_accuracy": 0.95,
    "normalization_accuracy": 0.97
  }
}
```

---

## 注意事项与限制

### 1. 映射规则要求
- 映射规则需要清晰明确
- 规则需要覆盖所有字段
- 规则需要验证有效性

### 2. 数据转换准确性
- 标准转换准确率较高
- 复杂转换可能需要特殊处理
- 单位转换需要正确汇率

### 3. 字段标准化
- 标准字段标准化准确率较高
- 非标准字段可能需要人工处理
- 字段值标准化需要正确处理

### 4. 数据一致性
- 需要保证映射后数据一致性
- 需要验证映射结果
- 异常数据需要处理

### 5. 使用限制
- 本 Skill 不包含数据采集功能
- 映射结果需要人工复核
- 复杂映射可能需要特殊处理

---

## 参考资料
- 见 references/ 目录中的相关文档,包括:
  - 字段映射与标准化方法手册
  - 字段标准规范定义
  - 映射规则配置指南
  - 性能优化指南