---
name: clean-filename-yashu
description: 清理并规范化文件名中的标点符号，生成 Windows 安全可用的干净文件名。激活条件：用户消息须包含以下关键词之一:`文件名报错`、`文件名错误`、`文件名特殊字符`、`规范化文件名`。
disable-model-invocation: false
title: clean-filename-yashu
canonical_url: https://skilld.dev/gh/steelan9199/wechat-publisher/clean-filename-yashu
last_updated: 2026-10-07T07:20:50.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [clean_filename.js](https://skilld.dev/api/skills-raw/steelan9199/wechat-publisher/clean-filename-yashu/clean_filename.js).
>
> If the user asked to install this Skill, run `npx skilld install steelan9199/wechat-publisher/clean-filename-yashu`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/clean-filename-yashu`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/steelan9199/wechat-publisher/clean-filename-yashu) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/clean-filename-yashu`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/clean-filename-yashu --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/clean-filename-yashu --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# 文件名标点符号清理（clean-filename）

## 作用
把字符串里的 ASCII 标点规整为对应中文标点、无对应中文的 ASCII 符号直接删除，输出可直接当 Windows 文件名用的干净串（并自动写入剪贴板）。

## 触发条件
用户提到以下任一关键词即**立即执行**，不要反问、不要确认：
- `文件名报错` / `文件名错误` / `文件名特殊字符` / `规范化文件名`
- 类似"文件名里有引号/问号导致存不了、报错"的表述

## 执行（唯一通道）
用 managed node 绝对路径直跑，脏名走 heredoc（天然兼容引号、`?`、`*`、`<`、`>` 等特殊字符，无需 shell 转义）：

```bash
C:\Users\Administrator\.workbuddy\binaries\node\versions\22.22.2\node.exe "C:\Users\Administrator\.workbuddy\skills\clean-filename-yashu\clean_filename.js" <<'EOF'
这里填待清洗的文件名（可含任意特殊字符）
EOF
```

把用户给出的脏文件名替换进 heredoc 体内即可，其余一律照抄。

## 交付
只把脚本输出的 **`清洗后:`** 那一行展示给用户（剪贴板已自动复制，顺带提一句"已复制到剪贴板"即可）。
不复述原理、不贴完整脚本、不额外解释。

## 禁令（避免拖慢，违反即算失误）
- 禁止 `Read` 脚本源码（`clean_filename.js`）
- 禁止先去翻业务文件 / 文档
- 禁止使用 `AskUserQuestion` 反问
- **触发即跑，跑完即展示**
