field-aligner

A field-name fuzzy matching and alignment tool. Maps field names from any source (Chinese/English/camelCase/underscores mixed) to canonical field keys, supporting exact alias matching and substring fuzzy matching, with an injectable vocabulary. Trigger terms include field name matching, field alignment, field mapping, alias matching, Chinese-English fields, field normalization, and schema alignment.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "field-aligner" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-0b27620de8180a4e8e812e57d1e12ca4593491f7de03c858a7bd0b856cdb95ba. Verify the upstream source and version against https://skillhub.cn/skills/user_3ff3c268/field-aligner before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A field-name fuzzy matching and alignment tool. Maps field names from any source (Chinese/English/camelCase/underscores mixed) to canonical field keys, supporting exact alias matching and substring fuzzy matching, with an injectable vocabulary. Trigger terms include field name matching, field alignment, field mapping, alias matching, Chinese-English fields, field normalization, and schema alignment.

0 Downloads

Introduction source: third_party · user_3ff3c268 · 1.2.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter


name: field-aligner
display_name: 中英文字段名对齐映射工具
description: 字段名模糊匹配与对齐工具。将任意来源的字段名(中文/英文/驼峰/下划线混用)映射到规范字段 key,支持精确别名匹配与子串模糊匹配,词汇表可注入。触发词:字段名匹配、字段对齐、字段映射、别名匹配、中英文字段、字段归一化、schema 对齐。
market_desc: 对接第三方系统时为字段名对不上头疼?把杂乱字段名(中文、英文、驼峰、下划线混用)一键映射到规范字段 key——精确别名匹配+子串模糊兜底,词表可注入。适合对接第三方接口、ERP 字段整理、数据清洗,告别手工对字段。 【闭环归属】本技能是「API/数据接入管线闭环」的第 2 步(共 5 步:解析→对齐→合并→换算→导出)。要可交付的数据资产,配齐这 5 个技能即可;总控入口:api-data-pipeline。
version: 1.2.0
changelog: 升级 v1.2.0:中性化署名、场景拓宽、补充闭环归属交叉引用。

field-aligner —— 字段名模糊匹配与对齐

把任意来源的字段名,映射到你定义的规范字段 key。中文/英文/驼峰/下划线混用都认得。 纯函数实现(Node ESM,零依赖)。词汇表可注入,默认带一份通用示例词表。

适用场景

  • 对接 ERP / 开放平台 / 内部中台:对方字段名和你库里的字段名不一致
  • 多数据源合并:不同系统同一含义字段叫法不同
  • 文档 / 表格结构化:把表头映射到标准字段

提供的函数

函数 说明
normalize(name) 归一化:小写 + 去 _-空格
buildVocabulary(input) 把 {key:[aliases]} 或 [{key,aliases}] 规范为统一结构
matchField(name, vocabulary, opts?) 单字段匹配,返回 {key, matched, score, via}
batchMatchFields(names, vocabulary, opts?) 批量匹配
DEFAULT_VOCABULARY 通用示例词表(电商/通用字段)

匹配策略:

  1. 精确:归一化后 key 或任一别名完全相等 → via:'exact'
  2. 模糊:子串包含(重叠越长分越高),分数 ≥ fuzzyThreshold(默认 0.6)→ via:'fuzzy'
  3. 都不中 → {key:null, matched:false, via:'none'}

用法

import { matchField, batchMatchFields, DEFAULT_VOCABULARY } from './scripts/field-aligner.mjs';

// 1) 用默认词表
const r = matchField('商品标题', DEFAULT_VOCABULARY);
// => { key: 'title', matched: true, score: 1, via: 'exact' }

// 2) 注入你自己的词表
const myVocab = {
  order_no:   ['订单号', '单号', 'orderNumber'],
  buyer_name: ['买家', '收货人', 'buyer'],
};
batchMatchFields(['订单号', '买家', '备注'], myVocab);
// => { 订单号:{key:'order_no',...}, 买家:{key:'buyer_name',...}, 备注:{key:null,...} }

自测

node scripts/field-aligner.mjs --selftest

Current listing version

1.2.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 解决字段名对齐这一明确痛点,适用于对接第三方系统、数据清洗、多源合并等实际场景
  • 提供默认词表和自定义注入机制,兼顾开箱即用与灵活性
Trigger Precision92/100

Highlights

  • 触发词覆盖全面且精准,包括字段名匹配、字段对齐、字段映射、别名匹配等核心关键词
  • 边界清晰,能有效命中目标用户搜索意图
Structure and Standards95/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层 frontmatter 中 description 字段为空,实际描述内容位于 skill_body 内部

    Recommendation: 建议将 description 内容移至顶层 frontmatter,保持规范统一

  • 缺少When to Use显式章节 Reported severity: Minor

    文档未显式标注 When to Use 章节,尽管适用场景已覆盖相关内容

    Recommendation: 建议增加 When to Use 显式章节以提升规范性

Highlights

  • 文档结构完整,包含适用场景、函数说明、匹配策略、用法示例、自测方法
  • frontmatter 完整,版本信息与变更日志清晰
Execution Reliability90/100

Highlights

  • 工具来源明确(Node ESM,零依赖),参数说明清晰
  • 匹配策略分层合理(精确匹配→模糊匹配→兜底),提供默认词表和自定义注入机制
  • 自测脚本完备,支持 --selftest 验证功能
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.