Hlzd trade compliance
Skill Alexxiang2008/hlzd-b2b-export-skills/skills/hlzd-trade-compliance
B2B 工业品贸易合规护栏 —— 4 + 1 道检查 (OFAC SDN / EU Consolidated / BIS Entity List / Country-Based Embargo + ECCN 双用途粗筛),输出 3 态 clearance (CLEARED / PENDING_REVIEW / BLOCKED) + 完整 audit_trail + Markdown 报告。Use when 用户说'合规'、'OFAC 制裁'、'出口管制'、'SDN 检索'、'贸易合规'、'sanctions screen'、'dual-use check'、'export compliance'。From its SKILL.md
npx -y skills add Alexxiang2008/hlzd-b2b-export-skills --skill hlzd-trade-complianceAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 26 days oldThe repository was created 26 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
9.0 KB, ~2.7k tokens by cl100k_base, as published. Nobody here has run it
HLZD Trade Compliance
5 道检查 (4 buyer-side + 1 product-side) + 三态路由,挡住 V0.1 已知的常见制裁实体 / 禁运国家 / 双用途品类。
When to use
调用本 Skill 当用户:
- 每次收海外询盘 —— 一票询盘进来,先跑 compliance,再决定报价 / 屏蔽
- 任何"B 类"以上客户的新询盘 —— 不让 Hezbollah 命中 → 你填了 DHL 单子被海关扣货
- 任何产品涉及 ECCN(加密 / 高端材料 / 化学武器前体)
- 内部合规审计:每月底跑一次全量 buyer/country 抽查
不要调用本 Skill 当:
- 询盘评级 D(已经在
hlzd-inquiry-qualify拦截) - 卖家是您的复购客户(已知合规过)
- 法规授权:通过商务部 / 银行 / 律所做正式验证(v0.1 是粗筛,绝对不是法律意见)
How this skill is invoked
# 1. 准备 transaction JSON
cat << 'EOF' > tx.json
{
"buyer_name": "Aramco Trading Co.",
"buyer_country": "Saudi Arabia",
"product": "OCTG casing",
"hs_code": "730429",
"end_use_country": "Saudi Arabia",
"incoterm": "CIF",
"value_usd": 850000
}
EOF
# 2. 跑合规检查
py scripts/cli.py --input tx.json --pretty
# 3. 生成 Markdown 报告
py scripts/render_report.py < report.json > report.md
输出结构:
{
"clearance": "CLEARED" | "PENDING_REVIEW" | "BLOCKED",
"final_action": "Proceed with documentation; periodic re-check required.",
"rationale": "...",
"check_results": [...],
"audit_trail": [...],
"data_versions": {...},
"data_source_attribution": [...]
}
cli.py 的 exit code 也作为机器可读的信号:0 = CLEARED / 1 = PENDING_REVIEW / 2 = BLOCKED,方便 CI 拦截。
5 道检查
| # | Check | Source | What it does | Default severity |
|---|---|---|---|---|
| 1 | ofac_sdn_name_match | data/ofac_sdn.csv (33 entries) | OFAC Specially Designated Nationals 实体的模糊匹配 | BLOCK |
| 2 | eu_consolidated_name_match | data/eu_consolidated.csv (17 entries) | EU Council Consolidated List (CFSP Decisions) | BLOCK |
| 3 | bis_entity_name_match | data/bis_entity.csv (15 entries) | BIS Entity List / Denied Persons List | REVIEW |
| 4 | country_embargo_match | lib.COUNTRY_EMBARGOES (12 countries) | Country-Based Sanctions (Iran / NK / Syria / Cuba / Crimea / Donetsk / Luhansk / Venezuela / Belarus / Russia / Myanmar / Zimbabwe) | BLOCK or REVIEW |
| 5 | eccn_dual_use_keyword | lib.DUAL_USE_KEYWORDS (15 keywords) + eccn_map (HS→ECCN) | 双用途商品粗筛 (加密 / 高端材料 / UAV / 化学武器前体) | REVIEW |
每条 check 都生成一条 audit_trail entry(timestamp + version + matched + flags_count),便于合规审计。
v0.1 vs production
| v0.1 (现在) | v0.2 (target) |
|---|---|
| 33 OFAC SDN 静态子集 | 完整 SDN_ENHANCED (1.5 万行) via Treasury API |
| 17 EU Consolidated 静态子集 | 完整 EU FSF via CFSP RSS feed |
| 15 BIS Entity List 静态子集 | 完整 BIS via commerce.gov CSV |
| 12 Country Embargo 综合 OFAC + EU | 接 OFAC + EU 双独立 feed |
| 15 dual-use 关键词 | 接 BIS Commerce Control List ECCN 编码库 |
Clearance 三态路由
all_flags 有一 BLOCK?
/ \
yes / \ no
/ \
BLOCKED all_flags 有一 REVIEW?
"DO NOT ship, / \
escalate to officer" yes / \ no
/ \
PENDING_REVIEW CLEARED
"HOLD + legal review" "Proceed with documentation"
代码:scripts/check.py:run_compliance_check 内 if any(f.severity == "BLOCK") ... elif REVIEW ... else CLEARED。
Output schema
Top-level
{
"$schema": "hlzd/trade-compliance/v1",
"product": "OCTG casing",
"hs_code": "730429",
"buyer_name": "Aramco Trading Co.",
"buyer_country": "Saudi Arabia",
"end_use_country": "Iran",
"incoterm": "CIF",
"timestamp_utc": "2026-07-15T03:43:00Z",
"clearance": "BLOCKED",
"final_action": "DO NOT ship; US/EU/UN sanctions apply.",
"rationale": "At least one BLOCK-level finding.",
"check_results": [...],
"audit_trail": [
{ "check": "ofac_sdn_name_match", "data_version": "static_2026_q3",
"matched": true, "flags_count": 1, "timestamp_utc": "..." },
...
],
"data_versions": {
"ofac_sdn_name_match": "static_2026_q3",
...
},
"data_source_attribution": ["ofac_sdn_name_match:static_2026_q3", ...]
}
Check result schema
每个 check_results[] 元素:
{
"check_name": "ofac_sdn_name_match",
"source_version": "static_2026_q3",
"matched": true,
"flags": [
{
"rule_id": "OFAC-SDN-SDGT",
"severity": "BLOCK",
"source": "ofac_sdn",
"evidence": "Hezbollah",
"rationale": "Buyer name fuzzy-matches OFAC SDN entry (program: SDGT).",
"recommended_action": "HALT + escalate to compliance officer + transaction freeze."
}
],
"metadata": { "rows_loaded": 33, "matches": [...] }
}
Fuzzy matching algorithm
O(n) 简单匹配 — 每个候选 CSV 行做 4 级:
- Exact normalized (
normalize_name后完整相等) - Bidirectional substring (任一方含另一方 ≥ 6 chars)
- Token-level share (共享 token 中有 ≥ 1 个 ≥ 6 chars, e.g. "Huawei")
- Stopword-filtered (去除
industrial/group/company等泛词避免误命中)
例:
- "Hezbollah Procurement" 匹配 OFAC SDN → "Hezbollah"(exact)→ BLOCK
- "Wagner Military Group" 匹配 OFAC SDN → "Wagner Group"(substring)→ BLOCK
- "Huawei Procurement LLC" 匹配 OFAC + EU + BIS → "Huawei Technologies"(token)→ BLOCK
- "ACME Industrial Imports" 不应命中 "Iran Aircraft Manufacturing Industrial Co"(industrial 被 stopword 过滤)→ clean
Sample integration
嵌入 hlzd-inquiry-qualify (从 5 维评分升级)
把 inquiry-qualify 的合规粗筛替换/补充为正式 hlzd-trade-compliance:
# 在 inquiry-qualify 的 evaluation step 加
import trade_compliance
tx = {"buyer_name": parsed_customer.company_name,
"buyer_country": parsed_customer.country,
"product": parsed_product.name,
"hs_code": parsed_product.hs_code,
"incoterm": parsed_inquiry.incoterm}
compliance_report = trade_compliance.run_compliance_check(tx)
if compliance_report.clearance == "BLOCKED":
return "halt_to_compliance_officer"
elif compliance_report.clearance == "PENDING_REVIEW":
return "review_required"
嵌入 hlzd-customer-due-diligence (替换 OFAC 静态子集)
diligence 当前的 OFAC 用 20 条静态,应替换为合规 Skill:
# diligence 的 evaluate_buyer 加:合规检查
from hlzd_trade_compliance import run_compliance_check
tx = {"buyer_name": buyer["importer_name"], ...}
cr = run_compliance_check(tx)
if cr.clearance == "BLOCKED":
return halt_result # 比 5 维评分更暴力
(v0.1 已留接口,v0.2 替换。)
Anti-pattern / Limitations
| 限制 | 处置 |
|---|---|
| 静态 CSV 仅 80 行 | v0.2 接 OFAC/EU/BIS 实时 API |
| Fuzzy match 可能误判 (e.g. shared "Industrial" 单词) | 已用 stopword 过滤;建议复核 BLOCKED 后再用人工致电 buyer |
| v0.1 不审计 OFAC 50% Rule | 提醒客户 ship to 3rd country 时 50% 规则可能触发 |
| 没有「de minimis exception」检查 | 比特币 / 灰关品类需手工 |
| 不报 EAR99 vs ECCN 分类本身 | ECCN 分类是律师工作 |
Related Skills
hlzd-inquiry-qualify (合规粗筛升级)
|
v
★ hlzd-trade-compliance ★ ← 本 Skill - 完整 5 道检查
|
v
hlzd-customer-due-diligence (应为下游 — 替换 OFAC 静态子集)
hlzd-cold-outreach (CLEARED 后才允许发邮件)
前置:客户的 buyer name + country + product + HS code 后继:CLEARED → 报价 + 发邮件;PENDING_REVIEW → 法务 review;BLOCKED → 整票冻结
Versioning
| 版本 | 说明 |
|---|---|
| 0.1.0 | 首版:5 道检查 + 三态路由 + 80 行静态 CSV |
Crafted for B2B industrial exporters — HLZD Cross-Border AI Platform · 2026
What ships with it: 14 files
52.0 KB alongside SKILL.md, 11 of them executable
data/
- bis_entity.csv1.2 KB
- eu_consolidated.csv1.0 KB
- ofac_sdn.csv2.3 KB
scripts/
- check.pyruns3.2 KB
- cli.pyruns2.6 KB
- lib.pyruns12.1 KB
- render_report.pyruns3.8 KB
- sources/bis_entity.pyruns3.2 KB
- sources/country_embargo.pyruns2.4 KB
- sources/dual_use.pyruns2.5 KB
- sources/eu_consolidated.pyruns3.1 KB
- sources/__init__.pyruns53 B
- sources/ofac_sdn.pyruns3.4 KB
tests/
- test_compliance.pyruns11.3 KB
Gives 1 of the 12 instructions most audit compliance skills give in ~2.7k tokens
Counted across 937 of the 1,487 authors here whose files we hold, read 2026-08-07
- Fetch latest guidelines before each reviewin 43 of 937, across 3 files
- Group findings by severityin 43 of 937
- Check files against all fetched rulesin 42 of 937, across 2 files
- Output findings in terse file:line formatin 41 of 937, across 3 files
- Ask user which files to review if none specifiedin 41 of 937, across 3 files
- Read specified files or prompt user for filesin 39 of 937, across 1 file
- Generate the audit reportin 33 of 937, across 30 files
- Assign a severity to every findingin 25 of 937
- Run automated accessibility scansin 23 of 937, across 13 files
- Output a markdown audit reporthere, and in 22 of 937
- Map findings to WCAG criteriain 20 of 937, across 10 files
- Confirm audit scopein 19 of 937, across 9 files
Said here and by no other author read
- run compliance checks before proceeding with an inquiry
- run compliance checks on all new class b inquiries
- screen all products involving eccn codes
- prepare transaction input as json
- run the compliance check script
- halt and escalate if clearance is blocked
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.