---
name: contradiction-fixer-yashu
description: "本技能检测 SKILL.md 中通过打补丁消解的矛盾，展示后经用户确认从根源修复，修复前自动备份。激活条件：用户消息须包含以下关键词之一:`检测SKILL矛盾`、`找文档矛盾`、`诊断补丁矛盾`、`修复文档矛盾`。"
title: contradiction-fixer-yashu
canonical_url: https://skilld.dev/gh/steelan9199/wechat-publisher/contradiction-fixer-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/contradiction-fixer-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/contradiction-fixer-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/contradiction-fixer-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/contradiction-fixer-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/contradiction-fixer-yashu --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/contradiction-fixer-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 时，作者有时会先写出自相矛盾的论述，再用一句补充说明（补丁）去消解矛盾。这种做法使文档冗长、逻辑松散，且补丁本身往往也经不起推敲。本技能自动检测这类"打补丁式矛盾"，展示给用户，确认后从根源消除矛盾。

---

## 什么是"打补丁式矛盾"

打补丁式矛盾是指：文档中存在自相矛盾的论述，作者没有修正原始论述，而是追加一句补充说明来"圆回来"。补丁消解了表面冲突，但原始论述的问题依然存在。

典型结构：**原始论述 A** -> **（与 A 矛盾的论述 B）** -> **补丁句 C：解释为什么 A 和 B "不冲突"**

---

## 检测模式

检测以下 5 类补丁模式：

### 1. 限制性补丁 (Limiting Patch)

一个笼统的论断被做出，随后补丁限定了它的适用范围。

**补丁标记词**：`注意：此论断针对的是…而非…`、`需要注意的是`、`此处的X指的是…而非…`

**虚构场景**：某技能文档讨论缓存策略，写道：

- 原始论断："缓存越大，性能越好。"
- 补丁："注意：此论断针对的是数据缓存，而非代码缓存。"
- **矛盾**：如果"越大越好"是关于缓存的普适规律，它应该对代码缓存同样成立。补丁的存在说明原始论断过于笼统--真正准确的表述应直接写明"数据缓存越大，读取性能越好"，而非用"缓存"一词一概而论后再打补丁收窄。

### 2. 术语重定义补丁 (Term Redefinition Patch)

一个术语按其常规含义使用后，补丁重新定义了它的含义。

**补丁标记词**：`此处"X"指的是…而非…`、`"X"在这里的含义是…`

**虚构场景**：某技能文档讨论任务调度，写道：

- 术语使用："本技能采用强制执行（Forced Execution）模式。"
- 补丁："> 此处'强制执行'指的是推荐执行，而非真正的强制。"
- **矛盾**："强制"的字面含义是不可违抗，"推荐"是可以忽略的。如果实际行为是推荐，就不该用"强制"这个词。补丁试图重新定义一个已有明确含义的术语，说明术语选择本身就是错的。

### 3. 机制降格补丁 (Mechanism Demotion Patch)

一个理论框架被当作实际机制呈现后，补丁将其降格为"心智模型"。

**补丁标记词**：`以下是一个…心智模型，而非…实际机制`、`此模型的价值在于…`

**虚构场景**：某技能文档讨论搜索排序，写道：

- 框架呈现："系统使用 TF-IDF 算法来理解文档的排序机制。"
- 补丁："> 以下是一个帮助理解排序的心智模型，而非系统实际的排序机制。"
- **矛盾**：文档先以陈述事实的口吻说"系统使用 TF-IDF"，后又说这只是"心智模型，非实际机制"。如果 TF-IDF 不是实际机制，就不应以事实口吻呈现，而应直接用实际机制来解释排序。

### 4. 否认冲突补丁 (Conflict Denial Patch)

两处论述看似矛盾，补丁明确声明它们"不冲突"。

**补丁标记词**：`X与Y并不冲突`、`两者是同一Z的正反两面`、`这并不矛盾`

**虚构场景**：某技能文档讨论日志策略，先写"日志级别越高越好，能捕获更多信息"，后写"日志级别应尽量低，减少性能开销"。随后补丁：

- 补丁："高日志级别与低性能开销并不冲突，两者是日志策略的正反两面。"
- **矛盾**：高日志级别确实会增加性能开销，两者存在真实的 trade-off。补丁用"正反两面"一笔带过，既没有解释为何不冲突，也没有说明在什么条件下两者可以共存。

### 5. 自相矛盾补丁 (Self-Contradiction Patch)

一个段落在论证某结论时，自身承认了与结论相反的事实。

**补丁标记词**：`虽然…但…`（让步后不修正结论）、`需要注意的是，现代…因此…`

**虚构场景**：某技能文档讨论错误处理方式，写道：

- 结论："同步错误处理不可靠，不推荐使用。"
- 段内让步："虽然同步处理能在一定程度上保证错误被捕获..."
- 补丁："需要注意的是，现代框架的异步错误处理已经成熟，因此同步处理的可靠性因框架而异。"
- **矛盾**：段内承认同步处理能捕获错误（有效），补丁又说可靠性"因框架而异"（有时可靠），却得出"不可靠、不推荐"的绝对结论。论证链自相矛盾。

---

## 修复原则

修复不是"用新补丁覆盖旧补丁"，而是**从根源消除矛盾**，使补丁句不再被需要。

| 补丁类型       | 根源修复方式                                                       |
| -------------- | ------------------------------------------------------------------ |
| 限制性补丁     | 修正原始论断，使其从一开始就准确，无需限定范围                     |
| 术语重定义补丁 | 更换术语，使用字面含义与上下文一致的词                             |
| 机制降格补丁   | 删除独立框架，将洞察直接整合进正确的机制论述中                     |
| 否认冲突补丁   | 将矛盾双方合并到同一位置，当场解释它们为何不矛盾，无需后续补丁否认 |
| 自相矛盾补丁   | 清理论证链，删除自相矛盾的让步句，保持论证一致性                   |

---

## 工作流

### 步骤 1：读取目标文件

读取用户指定的 SKILL.md 文件全文。

### 步骤 2：扫描补丁模式

对照上述 5 类检测模式，逐段扫描全文。对每个疑似补丁：

- 找到补丁句本身
- 找到补丁所消解的原始矛盾（矛盾双方）
- 判断补丁类型

### 步骤 3：展示矛盾

将检测到的所有矛盾以表格形式展示给用户：

| #   | 矛盾双方 | 补丁位置 | 补丁类型   | 补丁手法   |
| --- | -------- | -------- | ---------- | ---------- |
| 1   | A vs B   | 第X行    | 限制性补丁 | 拆分子类型 |
| ... | ...      | ...      | ...        | ...        |

### 步骤 4：确认

询问用户是否需要修复。若用户拒绝，结束。若用户确认，进入步骤 5。

### 步骤 5：备份

在目标文件同级目录下生成 `SKILL.backup.md`，复制原始文件内容。若已存在同名备份文件，覆盖之。

### 步骤 6：从根源修复

使用 SearchReplace 工具，对每处矛盾执行根源修复：

- 删除补丁句
- 修正原始论述，使矛盾从根源消除
- 修复后的文档中不应再出现任何补丁标记词

### 步骤 7：报告

输出修复摘要，列出每处矛盾的修复方式。

---

## 工作原则

- **只检测不打补丁**：检测矛盾后，修复方式是从根源消除，而非追加新补丁。
- **备份先行**：任何修改前必须先备份，确保可回退。
- **保持原意**：修复矛盾时不应改变作者的原始意图，只消除论述中的矛盾结构。
- **全局一致性**：修复一处矛盾后，检查全文是否有其他位置引用了被修改的术语或论断，同步更新。
