paste-text-clean

Clean zero-width characters and fullwidth symbols from corporate WeChat or Word paste content while preserving line breaks. Used when users need to clean pasted text, remove invisible characters, or convert fullwidth to halfwidth characters before pasting.

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 "paste-text-clean" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-93226f0202cae992eb3e9cb48abb7c7bc99f6790e28490bff85ed2cf784b2cc9. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/qhfw2026638 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

Clean zero-width characters and fullwidth symbols from corporate WeChat or Word paste content while preserving line breaks. Used when users need to clean pasted text, remove invisible characters, or convert fullwidth to halfwidth characters before pasting.

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: paste-text-clean
slug: qhfw2026638
displayName: 粘贴文本清洗
version: 1.0.0
summary: 清洗企微/Word 粘贴中的零宽字符与全角符号,保留换行。
license: MIT
description: 清洗企微/Word 粘贴中的零宽字符与全角符号,保留换行。当用户要粘贴清洗、去不可见字符、全角转半角时使用。

粘贴文本清洗

灵感:能力工具箱 paste-clean(自研清洗,无接口)。

从企微、Word、网页粘贴到 CRM 时,去掉零宽字符/BOM,全角空格与全角字母数字转半角,合并多余空白,保留换行结构。

何时使用

  • 粘贴跟进笔记出现「看不见的字符」
  • 全角数字导致手机号校验失败

硬约束

  1. 纯字符串处理,无网络。
  2. 处理:\u200B-\u200D、\uFEFF、\u00A0、全角空格 \u3000;全角 !~~ 段转半角。
  3. 行内多空格压成单个;连续空行最多保留 1 个空行;首尾 trim。
  4. 提供 cleanStats(before, after):前后长度与减少量。
  5. 不删除用户有意义的标点内容(仅规范空白与全角兼容字符)。

推荐实现要点

export function cleanPasteText(raw: string): string {
  let s = String(raw || '')
  s = s.replace(/[\u200B-\u200D\uFEFF\u00A0]/g, ' ')
  s = s.replace(/\u3000/g, ' ')
  s = s.replace(/[\uFF01-\uFF5E]/g, (ch) =>
    String.fromCharCode(ch.charCodeAt(0) - 0xfee0),
  )
  return s
    .split('\n')
    .map((line) => line.replace(/[ \t]+/g, ' ').trim())
    .join('\n')
    .replace(/\n{3,}/g, '\n\n')
    .trim()
}

export function cleanStats(before: string, after: string) {
  return {
    beforeLen: before.length,
    afterLen: after.length,
    removed: Math.max(0, before.length - after.length),
  }
}

Agent 步骤

  1. 实现清洗;粘贴事件 paste 后可自动替换。
  2. 自测:含零宽与全角数字的串,清洗后手机号可匹配 \d{11}。
  3. UI 可展示「已去除 N 个异常字符」。

附加

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 Value72/100

Highlights

  • 解决企微/Word/网页粘贴文本时的零宽字符、全角符号、多余空白等实际问题
  • 适用于 CRM 跟进笔记、手机号校验等高频办公场景,具有明确实用价值
Trigger Precision85/100

Highlights

  • description 明确描述使用场景(粘贴清洗、去不可见字符、全角转半角),覆盖合理
Structure and Standards78/100

Areas to improve

  • When to Use 章节命名不规范 Reported severity: Minor

    使用「何时使用」而非标准「When to Use」命名,虽内容存在但不符合规范

    Recommendation: 建议将「何时使用」章节标题改为「When to Use」以符合规范

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

    引用了 README.md、reference.md、templates/usage.md 但未验证这些文件是否存在及内容完整性

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

Highlights

  • Phase/步骤清晰(Agent 步骤),有硬约束与推荐实现要点
  • 含端到端 TypeScript 示例,frontmatter 完整,单文件未超 500 行
Execution Reliability88/100

Highlights

  • 工具来源明确(纯字符串处理,无网络),参数正确,覆盖主要异常(空输入处理)
  • 不可逆操作有确认机制(UI 展示清洗统计)
Evidence Verifiability (mean of the first four)81/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.