uscc-code-check

uscc-code-check: Locally verify the check digit of the Unified Social Credit Code (USCC) without backend requests; used for validating USCC, preventing entry errors for company codes, or when referencing the uscc-validate toolbox.

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 "uscc-code-check" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-93a0a56b5d67310af90acdb1dffec702b42a29baa8e801907a4aa264780bc070. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/qxuw2026742 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

uscc-code-check: Locally verify the check digit of the Unified Social Credit Code (USCC) without backend requests; used for validating USCC, preventing entry errors for company codes, or when referencing the uscc-validate toolbox.

0 Downloads

Introduction source: third_party · user_f1b049da · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: uscc-code-check
slug: qxuw2026742
displayName: 信用代码校验
version: 1.0.0
summary: 统一社会信用代码校验位本地验算,不请求后端。
license: MIT
description: 统一社会信用代码校验位本地验算,不请求后端。当用户需要校验 USCC/统一社会信用代码、录入企业代码防错,或提到工具箱 uscc-validate 时使用。

信用代码校验(USCC)

灵感:能力工具箱 uscc-validate(轻量、纯本地)。

何时使用

  • 录入/粘贴 18 位统一社会信用代码时做格式与校验位检查。
  • CRM 客户建档、工商信息核对,且不能依赖联网接口。

硬约束

  1. 仅本地算法:不得调用工商/企查类 API;以校验位公式为准。
  2. 长度与字符集:去空白后转大写,须恰好 18 位;字符集为 0-9A-Z 中的 GB 32100 允许字符(无 I/O/Z/S/V)。
  3. 输出:valid + 可读 message;可选给出登记管理部门粗分类(首字符),勿编造企业名称。
  4. 校验位为 0 的情况:取模后映射字符时用 (31 - sum%31) % 31,避免索引越界。
  5. 交付:给出可运行 JS/TS 片段;说明「通过≠工商登记仍有效」。

推荐算法要点

const CODE_CHARS = '0123456789ABCDEFGHJKLMNPQRTUWXY'
const WEIGHTS = [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28]

export function validateUscc(code: string) {
  const raw = String(code || '').trim().toUpperCase()
  if (!/^[0-9A-Z]{18}$/.test(raw)) {
    return { valid: false, message: '格式错误:须 18 位数字或大写字母' }
  }
  let sum = 0
  for (let i = 0; i < 17; i++) {
    const idx = CODE_CHARS.indexOf(raw[i])
    if (idx < 0) return { valid: false, message: `含非法字符:${raw[i]}` }
    sum += idx * WEIGHTS[i]
  }
  const expect = CODE_CHARS[(31 - (sum % 31)) % 31]
  if (expect !== raw[17]) {
    return { valid: false, message: `校验位错误,期望 ${expect}` }
  }
  return { valid: true, message: '校验通过' }
}

Agent 执行步骤

  1. 实现 validateUscc;输入框失焦或提交前调用。
  2. 用已知样例与故意改错末位各测 1 次。
  3. 在 UI/说明中标注:校验通过只表示编码合规,不代表主体存续。

附加

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供统一社会信用代码本地校验能力,适用于企业信息录入防错、CRM 建档等明确场景
  • 不依赖后端接口,符合离线校验需求,具有实际工具价值
Trigger Precision85/100

Highlights

  • 触发词覆盖完整,包括 USCC、统一社会信用代码、录入防错、工具箱 uscc-validate 等关键词
  • 边界清晰,不易与其他 Skill 重叠
Structure and Standards72/100

Areas to improve

  • 文档长度略长 Reported severity: Minor

    SKILL.md 内容约 180 行,超出理想长度(≤500 行虽未超,但建议精简)

    Recommendation: 可考虑将部分参考内容移至 README.md 或 reference.md,主文档保留核心流程

  • 缺少端到端完整示例 Reported severity: Minor

    有代码片段和执行步骤,但缺少完整 UI 集成或端到端使用示例

    Recommendation: 补充一个完整的前端输入校验示例,展示从输入到结果展示的完整流程

  • 引用文件未验证完整性 Reported severity: Minor

    主文档引用了 README.md、reference.md、templates/usage.md,但未确认这些文件是否存在且内容完整

    Recommendation: 确保所有引用文件均已提供且内容完整,或移除无效引用

Highlights

  • 结构清晰,包含何时使用、硬约束、推荐算法、执行步骤等必要章节
  • frontmatter 完整,包含 name、slug、version、license 等必要字段
Execution Reliability75/100

Areas to improve

  • 输入类型处理说明不足 Reported severity: Minor

    未显式说明如何处理非字符串输入(如数字、null、undefined)

    Recommendation: 在文档中补充输入类型处理说明,明确支持 string | number | null | undefined 等类型

  • 缺少极端异常处理说明 Reported severity: Minor

    未说明在极端情况下(如超大字符串、特殊字符)的处理策略

    Recommendation: 补充对极端输入的处理说明,增强鲁棒性

Highlights

  • 算法来源明确,基于 GB 32100 标准,参数正确
  • 覆盖主要异常场景(格式错误、非法字符、校验位错误)
  • 提供了测试建议和已知样例验证方法
Evidence Verifiability (mean of the first four)78/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.