jpskill.com
🛠️ 開発・MCP コミュニティ

wiki-dedup

Scan the Obsidian wiki for page-level identity collisions — different pages covering the same concept under different names (e.g. "RSC" vs "React Server Components") — and merge them. Use this skill when the user says "dedup my wiki", "find duplicate pages", "merge duplicates", "identity resolution", "consolidate my wiki", "I have duplicate pages", or "my wiki has two pages for the same thing". Distinct from wiki-lint (which checks structure) and cross-linker (which adds links) — this skill makes destructive page-level merges and requires careful confirmation.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o wiki-dedup.zip https://jpskill.com/download/22840.zip && unzip -o wiki-dedup.zip && rm wiki-dedup.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22840.zip -OutFile "$d\wiki-dedup.zip"; Expand-Archive "$d\wiki-dedup.zip" -DestinationPath $d -Force; ri "$d\wiki-dedup.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して wiki-dedup.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → wiki-dedup フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] wiki-dedup

Wiki Dedup — アイデンティティ解決とページレベルの重複排除

あなたは、異なる名前で同じ概念を扱っているWikiページを見つけてマージします。これは書き込みが多く、破壊的な可能性のあるスキルです。ページのマージは自動的に元に戻すことはできません。慎重に作業し、マージモードで実行する前に確認してください。

llm-wiki/SKILL.md の「Retrieval Primitives」表に従ってください。 候補検出パスでは、フロントマターとタイトルのみを使用します(安価です)。確認済みの候補ペアに対してのみ、ページ本文全体を開いてください。

開始する前に

  1. 設定の解決llm-wiki/SKILL.md の「Config Resolution Protocol」に従ってください(.env~/.obsidian-wiki/config → プロンプト設定のためにCWDを遡ります)。これにより、OBSIDIAN_VAULT_PATHOBSIDIAN_LINK_FORMAT が得られます。
  2. index.md を読んで、1行の説明とタグが付いた全ページインベントリを取得してください。
  3. log.md を簡単に読んでください。もし重複排除が実行されたばかりであれば、すでにマージされたものをメモしてください。

モード

モード フラグ 動作
監査 (デフォルト) 候補のみを報告 — 書き込みなし
マージ --merge 確認済みの各ペアを表示し、マージ前に確認を求めます
自動マージ --auto 高信頼度ペア(score ≥ 0.90)を非対話的にすべてマージします

ユーザーが指定しない場合、監査モードで実行し、結果を提示してから続行するかどうかを尋ねます。

ステップ1:ページレジストリの構築

Vault内のすべての.mdファイルをグローブします(_archives/_raw/.obsidian/index.mdlog.mdhot.md_insights.md、およびフロントマターにredirects_to:を含むファイルは除外します。これらはすでにマージされたリダイレクトスタブです)。

残りの各ページから、フロントマターから以下を抽出します。

  • node_id — Vaultルートからの相対パス(.mdなし)
  • title — フロントマターのtitleフィールド
  • aliases — フロントマターのaliasesリスト(存在しない場合もあります)
  • tags — フロントマターのtagsリスト
  • category — ディレクトリプレフィックス

ルックアップテーブルを構築します:node_id → {title, aliases, tags, category, summary}

ステップ2:候補ペアの検出

レジストリ内のすべてのページペアについて、以下のシグナルを使用して類似度スコアを計算します。

2a. タイトル類似度シグナル

シグナル 評価方法 最大寄与度
トークン重複 小文字化されたタイトル単語トークン(スペース、ハイフン、アンダースコア、句読点で分割)のJaccard類似度 0.65
編集距離 小文字化されたタイトルの正規化された編集距離:1 - (edits / max(len_a, len_b)) 0.40
部分文字列の包含 一方のタイトルがもう一方の部分文字列である(例:「RSC」 ⊂ 「React Server Components」) 0.50
エイリアスの相互一致 ページAのタイトルがページBのaliasesに現れる、またはその逆 0.65

複合タイトルスコア = min(max(token_overlap, edit_distance, substring), 0.65) + alias_cross_bonus

正確な計算は必要ありません。類似度の程度について自信を持って判断してください。

タイトル抽出の注意点: 一部のページではYAMLブロックスカラー(title: >- または title: |)を使用しています。title:の値が>->|、または|-の場合、実際のタイトルは次のインデントされた行にあります。そこから読み取ってください。リテラル文字列>-をタイトルとして比較しないでください。

2b. 意味的シグナル(安価なパス)

シグナル ポイント
同じcategoryディレクトリ +0.10
タグ重複 ≥ 3つの共有タグ +0.15
タグ重複 ≥ 2つの共有タグ +0.05
同じ最初のタグ(主要タグ) +0.05

2c. しきい値

複合スコアが0.75以上のペアを候補としてフラグ付けします。0.90以上のスコアのペアは高信頼度です。

スコア範囲 → 信頼度ラベル:

スコア ラベル
≥ 0.90 高 — ほぼ確実に同じ概念
0.75–0.89 中 — 同じである可能性が高い、要確認
0.60–0.74 低 — 略語または専門化の可能性あり。ユーザーが要求しない限りスキップ

高および中の候補のみをステップ3に進めます。

2d. 迅速な終了ルール

Vaultのページ数が10未満の場合、ペアのループをスキップし、「Vaultが小さすぎて意味のある重複がない」と報告します。Vaultのページ数が500を超える場合、候補を50ペアのバッチで処理します。バッチ間で一時停止し、進捗状況を報告します。

ステップ3:意味的判断

各候補ペアについて(スコアの降順でソート):

  1. 両方のページを完全に読み込みます(候補プールが小さいため、全ページ読み込みが正当化されます)。
  2. 質問:これらのページは同じ概念を扱っていますか、それとも別個のものですか?

3つの判断のいずれかを割り当てます。

判断 意味
merge 同じ概念 — 異なる名前、略語、エイリアス、または偶発的な重複。マージしても安全です。
keep-separate 関連しているが別個 — 例:「Server Actions」と「Server Components」は関連するReact機能であり、重複ではありません。
needs-review 曖昧 — かなりの重複があるが、意味のある違いもある。ユーザーが決定するためにフラグを立てます。

各判断に短い理由(1文)を付けます。これはレポートとログに表示されます。

ステップ4:監査レポート

マージ/自動マージモードでも、常にこのレポートを作成します(ユーザーが何が起こるかを確認できるようにするため):

## Wiki Dedup レポート

### 高信頼度候補 (スコア ≥ 0.90): Nペア

| スコア | ページA | ページB | 判断 | 理由 |
|---|---|---|---|---|
| 0.95 | `concepts/rsc.md` | `concepts/react-server-components.md` | merge | 「RSC」は略語であり、両方のページは同一の資料を扱っています |
| 0.91 | `entities/vaswani-2017.md` | `references/attention-is-all-you-need.md` | keep-separate | 一方は人物のスタブ、もう一方は論文の参照です |

### 中信頼度候補 (スコア 0.75–0.89): Nペア

| スコア | ページA | ページB | 判断 | 理由 |
|---|---|---|---|---|
| 0.82 | `concepts/fine-tuning.md` | `concepts/finetuning.md` | merge | 同じ概念、ハイフン表記のバリアント |

### 人間によるレビューが必要: Nペア

| スコア | ページA | ページB | 理由 |
|---|---|---|---|
| 0.78 | `concepts/agents.md` | `concepts/autonomous-agents.md` | かなりの重複があるが、「agents」は意図的に広範である可能性があります |

### 要約
- スキャンされたページ数: N
- 見つかった候補ペア数: M
- 推奨されるマージ数: X
- 分離を維持: Y
- レビューが必要: Z

監査モードでは、ここで停止し、「--mergeを実行してインタラクティブに」と尋ねます。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Wiki Dedup — Identity Resolution and Page-Level Deduplication

You are finding and merging wiki pages that cover the same concept under different names. This is a write-heavy, potentially destructive skill — page merges cannot be automatically undone. Work carefully and confirm before acting in merge mode.

Follow the Retrieval Primitives table in llm-wiki/SKILL.md. The candidate-detection pass uses only frontmatter and titles (cheap). Only open full page bodies for confirmed candidate pairs.

Before You Start

  1. Resolve config — follow the Config Resolution Protocol in llm-wiki/SKILL.md (walk up CWD for .env~/.obsidian-wiki/config → prompt setup). This gives OBSIDIAN_VAULT_PATH and OBSIDIAN_LINK_FORMAT.
  2. Read index.md to get the full page inventory with one-line descriptions and tags.
  3. Read log.md briefly — if a dedup run just happened, note what was already merged.

Modes

Mode Flag Behavior
Audit (default) Report candidates only — no writes
Merge --merge Show each confirmed pair, ask for confirmation before merging
Auto-merge --auto Merge all high-confidence pairs (score ≥ 0.90) non-interactively

If the user doesn't specify, run in Audit mode and present findings before asking whether to proceed.

Step 1: Build the Page Registry

Glob all .md files in the vault (excluding _archives/, _raw/, .obsidian/, index.md, log.md, hot.md, _insights.md, and any file that contains redirects_to: in its frontmatter — those are already merged redirect stubs).

For each remaining page, extract from frontmatter:

  • node_id — relative path from vault root, without .md
  • title — frontmatter title field
  • aliases — frontmatter aliases list (may be absent)
  • tags — frontmatter tags list
  • category — directory prefix

Build a lookup table: node_id → {title, aliases, tags, category, summary}.

Step 2: Detect Candidate Pairs

For every pair of pages in the registry, compute a similarity score using these signals:

2a. Title similarity signals

Signal How to assess Max contribution
Token overlap Jaccard similarity of lowercased title word-tokens (split on spaces, hyphens, underscores, punctuation) 0.65
Edit distance Normalized edit distance on lowercased titles: 1 - (edits / max(len_a, len_b)) 0.40
Substring containment One title is a substring of the other (e.g. "RSC" ⊂ "React Server Components") 0.50
Alias cross-match Page A's title appears in page B's aliases, or vice versa 0.65

Composite title score = min(max(token_overlap, edit_distance, substring), 0.65) + alias_cross_bonus.

You don't need exact arithmetic — make a confident judgement about degree of similarity.

Title extraction note: Some pages use YAML block scalars (title: >- or title: |). When the title: value is >-, >, |, or |-, the actual title is on the next indented line — read it from there. Never compare the literal string >- as a title.

2b. Semantic signals (cheap pass)

Signal Points
Same category directory +0.10
Tag overlap ≥ 3 shared tags +0.15
Tag overlap ≥ 2 shared tags +0.05
Same first tag (dominant tag) +0.05

2c. Threshold

Flag pairs with composite score ≥ 0.75 as candidates. Pairs scoring 0.90+ are high-confidence.

Score ranges → confidence labels:

Score Label
≥ 0.90 HIGH — almost certainly the same concept
0.75–0.89 MEDIUM — likely the same, verify
0.60–0.74 LOW — possible abbreviation or specialisation; skip unless user asks

Only carry HIGH and MEDIUM candidates into Step 3.

2d. Quick exit rule

If the vault has fewer than 10 pages, skip the pair loop and report "vault too small to have meaningful duplicates". If the vault has more than 500 pages, process candidates in batches of 50 pairs — pause and report progress between batches.

Step 3: Semantic Verdict

For each candidate pair (sorted by score descending):

  1. Read both pages in full (full page read — justified because candidate pool is small).
  2. Ask: are these pages covering the same concept, or are they distinct?

Assign one of three verdicts:

Verdict Meaning
merge Same concept — different name, abbreviation, alias, or accidental duplicate. Safe to merge.
keep-separate Related but distinct — e.g. "Server Actions" vs "Server Components" are related React features, not duplicates.
needs-review Ambiguous — substantial overlap but also meaningful differences. Flag for the user to decide.

Attach a short reason to each verdict (one sentence). This appears in the report and the log.

Step 4: Audit Report

Always produce this report, even in merge/auto-merge mode (so the user sees what will happen):

## Wiki Dedup Report

### High-Confidence Candidates (score ≥ 0.90): N pairs

| Score | Page A | Page B | Verdict | Reason |
|---|---|---|---|---|
| 0.95 | `concepts/rsc.md` | `concepts/react-server-components.md` | merge | "RSC" is the abbreviation; both pages cover identical material |
| 0.91 | `entities/vaswani-2017.md` | `references/attention-is-all-you-need.md` | keep-separate | One is a person stub, one is a paper reference |

### Medium-Confidence Candidates (score 0.75–0.89): N pairs

| Score | Page A | Page B | Verdict | Reason |
|---|---|---|---|---|
| 0.82 | `concepts/fine-tuning.md` | `concepts/finetuning.md` | merge | Same concept, hyphenation variant |

### Needs Human Review: N pairs

| Score | Page A | Page B | Reason |
|---|---|---|---|
| 0.78 | `concepts/agents.md` | `concepts/autonomous-agents.md` | Substantial overlap but "agents" may intentionally be broader |

### Summary
- Pages scanned: N
- Candidate pairs found: M
- Recommended merges: X
- Keep separate: Y
- Needs review: Z

In Audit mode, stop here and ask: "Run --merge to interactively merge the recommended pairs, or --auto to merge all high-confidence ones automatically?"

Step 5: Merge

For each merge verdict pair (in merge or auto-merge mode):

In merge mode: show the pair and verdict, then ask: "Merge [Page A] into [Page B]? (yes/skip/review)". Skip on anything other than yes.

In auto-merge mode: only process HIGH-confidence (score ≥ 0.90) merges without prompting.

5a: Pick the canonical page

Apply these tiebreakers in order until one wins:

  1. More incoming wikilinks — grep the vault for [[node_id]] references; higher count wins
  2. Richer content — longer page body (more lines) wins
  3. More sources — larger sources: list wins
  4. Title length — longer, more descriptive title wins (e.g. "React Server Components" beats "RSC")
  5. Alphabetical — earlier title wins

The canonical page is the survivor. The other page becomes the secondary (to be merged in, then replaced with a redirect stub).

5b: Merge content into the canonical page

Read both pages. Update the canonical page:

  • aliases: — add secondary page's title and all its aliases (no duplicates)
  • tags: — merge both tag lists (deduplicate, cap at 5 domain tags + system tags)
  • sources: — merge both source lists (deduplicate)
  • relationships: — merge both relationship lists (deduplicate by target, prefer typed entries over untyped)
  • base_confidence — recompute using the union of sources and the formula from llm-wiki/SKILL.md
  • updated — set to now
  • summary: — rewrite to cover the merged scope if the secondary page added new ground
  • Body content — merge unique sections and bullets from the secondary page. Do not blindly append — integrate the content. Avoid duplicating claims already present in the canonical page. Use ^[inferred] markers where synthesis is needed.
  • provenance: — recompute after merging

5c: Write a redirect stub at the secondary page path

---
title: <secondary page title>
redirects_to: "[[<canonical node_id>]]"
aliases: [<secondary aliases>]
category: <secondary category>
tags: []
created: <secondary original created>
updated: <ISO timestamp now>
---

This page has been merged into [[<canonical page title>]].

The redirects_to: field tells any skill reading this page to follow the redirect rather than treat it as content.

5d: Rewrite wikilinks vault-wide

Grep the entire vault for any link pointing at the secondary slug:

  • [[secondary-slug]][[canonical-slug]]
  • [[secondary-slug|display text]][[canonical-slug|display text]]
  • If OBSIDIAN_LINK_FORMAT=markdown: [text](../path/to/secondary.md)[text](../path/to/canonical.md)

Safety rules:

  • Never rewrite inside code blocks (``fences orinline code`)
  • Never rewrite inside the redirect stub itself (that's the one place the old slug should remain legible)
  • Never use rm or destructive shell ops — only Edit/Write tools
  • Rewrite one file at a time, verifying each before moving on
  • If a file has zero occurrences, skip it

5e: Update tracking files

index.md — Remove the secondary page's entry. Update the canonical page's entry with the merged summary.

.manifest.json — For the secondary page's source entries: add "merged_into": "<canonical node_id>" to each. For the canonical page: merge in the secondary's pages_created and pages_updated lists.

hot.md — Update Recent Activity: "Merged N duplicate pairs; canonical pages updated."

5f: Final check

After all merges, grep the vault for any remaining [[secondary-slug]] references (in non-stub files). If any survive, report them — the rewrite step may have missed a non-standard link format.

Step 6: Log

Append to log.md:

- [TIMESTAMP] DEDUP mode=audit|merge|auto-merge pages_scanned=N pairs_found=M merged=X kept_separate=Y needs_review=Z wikilinks_rewritten=W

Redirect Stub Handling

Other skills should handle redirect stubs as follows:

  • wiki-export — skip pages with redirects_to: in frontmatter; they are not content nodes
  • wiki-query — if a search hits a redirect stub, follow redirects_to: and read the canonical page instead
  • wiki-lint — validate that every redirects_to: wikilink resolves to an existing, non-stub page (a redirect chain — stub pointing to stub — is an error)
  • cross-linker — treat redirect stubs as non-targets; never add a new [[wikilink]] pointing at a stub page

Tips

  • Audit first, always. Even in auto-merge mode, the audit report is shown. Read it before trusting the results.
  • Check needs-review last. These are the hard cases — don't batch them with obvious merges.
  • Abbreviations are the most common case. "GPT" / "GPT-4" / "GPT4", "RSC" / "React Server Components", "LLM" / "Large Language Models" — these score high on substring containment and are almost always safe to merge.
  • Different versions are not duplicates. "GPT-3" and "GPT-4" are related but distinct. "fine-tuning" and "fine-tuning-llms" may be distinct (technique vs. specific application).
  • Run cross-linker after dedup. The redirect stubs leave the graph in a slightly inconsistent state. Cross-linker will tighten it up.