---
name: skill-doc-dedup-yashu
description: 本技能用于检查目标技能文档（SKILL.md）中的重复冗余内容并输出精简诊断报告（只体检不动刀，不修改原文）。激活条件：用户消息须包含以下关键词之一:`检查技能文档冗余`、`精简技能文档`、`技能文档体检`、`检查技能文档重复`、`诊断技能文档冗余`、`技能文档瘦身`、`技能文档去重`。
metadata:
  author: "AI Assistant"
  updated: "2026-08-06 00:00:00"
  version: "1.1.0"
title: skill-doc-dedup-yashu
canonical_url: https://skilld.dev/gh/steelan9199/wechat-publisher/skill-doc-dedup-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.
>
> If the user asked to install this Skill, run `npx skilld install steelan9199/wechat-publisher/skill-doc-dedup-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/skill-doc-dedup-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/skill-doc-dedup-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/skill-doc-dedup-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/skill-doc-dedup-yashu --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/skill-doc-dedup-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.

# 技能文档冗余体检

## 功能概述

对目标技能的 `SKILL.md` 主文档进行语义级冗余分析，识别跨章节重复、表格信息重叠、概念反复阐述、流程步骤重叠等问题，输出结构化诊断报告（含重复点定位、严重度、精简建议、优先级排序、预计缩减比例）。

## 核心特性与边界

| 特性         | 说明                                                                                       |
| ------------ | ------------------------------------------------------------------------------------------ |
| 检查范围     | 默认仅扫描目标技能的 `SKILL.md` 主文档；`references/` 目录按需扫描（用户主动提及才扫）     |
| 成果形态     | 仅诊断报告（重复点定位 + 精简建议），**禁止调用 Edit/Write 修改目标文档**                  |
| 分析方式     | 纯 AI 专家语义分析，无脚本；能识别"5 个小节反复讲同一件事"等深层语义重复，而非机械文本比对 |
| 扫描对象限制 | 仅扫描 `.md` 文档，不读取 `.js` 脚本、`.json` 配置及二进制文件                             |
| 短文档处理   | 若目标 SKILL.md 过短（< 50 行），冗余空间有限，报告中如实说明                              |

## 标准工作流程

| 步骤 | 执行动作                                                                       |
| ---- | ------------------------------------------------------------------------------ |
| 1    | 确认目标技能路径（若用户未提供，主动询问"请提供目标技能的 SKILL.md 绝对路径"） |
| 2    | 使用 Read 工具读取目标 `SKILL.md` 全文                                         |
| 3    | 按「冗余检测维度清单」逐项扫描，识别所有重复/冗余点                            |
| 4    | 按「诊断报告输出规范」生成结构化报告                                           |
| 5    | 输出报告并附固定尾部提示（见「诊断报告输出规范」第四部分）                     |

## 冗余检测维度清单（分析 rubric）

每发现一处冗余，记录其【定位 / 重复内容摘要 / 严重度 / 精简建议】。

### 维度 1：跨章节内容重复

同一段能力描述、同一规则、同一说明在多个章节反复出现。

- 典型：「功能概述」罗列所有能力，「脚本索引清单」又列一遍，「触发映射」第三次列举
- 检测信号：同义句群在不同 H2/H3 标题下重复

### 维度 2：表格信息重叠

两张或多张表的内容高度重叠，仅表述角度略异。

- 典型：身份对比表 A（身份/Token/操作范围/默认）与凭证类型表 B（凭证类型/归属身份/作用/有效期）实质重复
- 检测信号：多张表出现相同列或同义列，行数据可互相推导

### 维度 3：概念反复阐述

同一概念在多个小节反复解释，未做增量信息。

- 典型：「应用 vs 用户隔离」「两种 token 对比」「默认用 tenant」在 5 个小节里反复出现
- 检测信号：同一核心信息点在 3+ 个小节出现，且后文未补充新约束

### 维度 4：流程步骤重叠

「标准执行流程」「公共规则」「前置条件」三类章节相互覆盖。

- 典型：标准流程的"读参考文档/写参数文件/清理 temp"步骤与公共规则完全重叠
- 检测信号：步骤型章节的条目能在规则型章节找到一一对应

### 维度 5：触发词与索引重复

「触发映射表」与「文档索引表」逐行对应，信息高度冗余。

- 典型：左列触发词+脚本，右列又把同样的 references 文档列一遍
- 检测信号：两张表的行数、文档链接高度一致，可合并为一张表

### 维度 6：命令/代码块重复

同一条流程性命令、同一段代码在多处出现（区别于维度 8 的数据型示例）。

- 典型：`npm install` 命令在「环境说明」「全局前置条件」两处出现
- 检测信号：相同命令字符串重复 ≥ 2 次

### 维度 7：定义性内容重复

同一术语/缩写在多处重复定义。

- 典型："$SKILL_DIR 是占位符不是环境变量"在多个章节反复提醒
- 检测信号：同一术语定义出现 ≥ 2 次

### 维度 8：示例重复

同一 JSON 数据示例、同一配置片段多次出现。

- 典型：config 修改示例在「切换身份」和「token 获取」中重复
- 检测信号：相同代码块内容重复

### 维度 9：前置条件与环境说明重复

「环境说明表」与「全局前置条件表」的条目交叉重叠。

- 典型：依赖安装、目录说明在两张表都出现
- 检测信号：两表存在同义行

### 维度 10：章节内冗余表述

单个小节内同一信息用不同措辞重复表达，无新增信息。

- 典型：先表格说明，再用段落把表格内容复述一遍
- 检测信号：段落内容可由同节表格完全推导

## 诊断报告输出规范

报告必须严格遵循以下结构与格式。

### 报告标题

```
# 技能文档冗余诊断报告：<目标技能名>
```

### 第一部分：总览

```
## 总览

| 项目             | 值                              |
| ---------------- | ------------------------------- |
| 扫描文件         | <SKILL.md 绝对路径>             |
| 文档总行数       | <N> 行                          |
| 发现冗余点       | <M> 处                          |
| 预计可缩减       | 约 <X>%（<Y> 行）               |
| references 扫描  | 未扫描 / 已扫描 <Z> 个文件      |
```

### 第二部分：冗余点详情（按维度分组）

按维度 1~10 分组，每个维度下列出具体冗余点。每条格式：

```
### 维度 X：<维度名>

#### 冗余点 X.1：<简短标题>
- **定位**：<章节名>（L起-L止） + <对比章节名>（L起-L止）
- **重复内容摘要**：<哪些内容在重复>
- **严重度**：🔴 高 / 🟡 中 / 🟢 低
- **精简建议**：<具体怎么合并/删除/改写>
```

严重度判定标准：

- 🔴 高：整段/整表重复，删除后信息零损失
- 🟡 中：部分重复，合并后需少量改写保完整
- 🟢 低：表述重复但各有少量增量，需谨慎合并

### 第三部分：精简优先级排序

```
## 精简优先级排序

按"收益/风险比"从高到低排序，建议按此顺序处理：

| 优先级 | 冗余点       | 预计缩减 | 风险 |
| ------ | ------------ | -------- | ---- |
| P0     | <冗余点标题> | <N 行>   | 低   |
| P1     | ...          | ...      | ...  |
```

### 第四部分：尾部提示（固定输出）

```
## 后续选项

- 本报告**仅诊断，未修改原文档**。
- 如需扫描 `references/` 目录下的参考文档（检测文档间交叉重复），请回复"扫描 references"。
- 如需我**直接动手精简**目标文档（按本报告的建议执行），请在主对话中确认，将由主对话执行。
```

## 分析原则

| 原则       | 说明                                                                                                          |
| ---------- | ------------------------------------------------------------------------------------------------------------- |
| 语义优先   | 以"语义是否重复"为判断依据；同一信息换措辞重述也算冗余                                                        |
| 信息零损失 | 精简建议必须保证删除/合并后信息无损失。若合并会丢失增量信息，标注为"需谨慎合并"并说明哪些增量需保留           |
| 客观定量   | 定位必须给行号范围，缩减比例必须给数字，避免"有不少重复"这类模糊表述                                          |
| 区分增量   | 当某处在重复之外还补充了新约束/新细节，报告中需明确指出"该处除重复外还含增量信息：<具体增量>"，不可一刀切删除 |

## 与主对话的协作边界

| 场景                         | 本技能动作         | 主对话动作                 |
| ---------------------------- | ------------------ | -------------------------- |
| 用户要求"检查冗余"           | 输出诊断报告       | —                          |
| 用户看完报告后要求"直接精简" | —（技能已结束）    | 由主对话调用 Edit 执行精简 |
| 用户要求"扫描 references"    | 追加扫描并补充报告 | —                          |
| 用户要求"精简后重新检查"     | 重新扫描并出报告   | —                          |
