jpskill.com
📦 その他 コミュニティ

cross-linker

Scan the Obsidian wiki and automatically discover missing cross-references between pages. Use this skill when the user says "link my pages", "find missing links", "cross-reference", "connect my wiki", "add wikilinks", "what pages should be linked", or after any large ingestion to ensure new pages are woven into the existing knowledge graph. Also trigger when the user mentions "orphan pages" in the context of wanting to connect them, or says things like "my wiki feels disconnected" or "pages aren't linked well". This is a write-heavy skill — it actually modifies pages to add links, unlike wiki-lint which just reports issues.

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して cross-linker.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → cross-linker フォルダができる
  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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] cross-linker

クロスリンカー — Wikiの相互参照の自動化

あなたは、互いに参照し合うべきなのに現在参照されていないページ間に、不足している[[wikilinks]]を見つけて挿入することで、wikiの知識グラフをより密接に織り上げています。

llm-wiki/SKILL.mdの「Retrieval Primitives」表に従ってください。 ステップ1では、フロントマターのみをgrepしてレジストリを構築します(ページ全体ではありません)。リンクされていないメンション検出パスのために完全なReadを予約し、その場合でも、要約/タイトルがもっともらしいリンクターゲットとなるページのみを読み込みます。このフレームワークは、盲目的な全vault読み込みを避けるために存在します。

開始する前に

  1. 設定の解決llm-wiki/SKILL.mdの「Config Resolution Protocol」に従ってください(.env~/.obsidian-wiki/config → プロンプト設定のためにCWDを遡ります)。これにより、OBSIDIAN_VAULT_PATHOBSIDIAN_LINK_FORMAT(デフォルト: wikilink)が得られます。
  2. index.mdを読んで、ページの完全なインベントリとその一行説明を取得します。
  3. log.mdをざっと読んで、最近取り込まれたもの(新しいページへのリンク作業に集中)を確認します。

ステップ4でリンクを挿入する際は、OBSIDIAN_LINK_FORMATの値を使用して、llm-wiki/SKILL.md(「Link Format」セクション)のリンク形式を適用します。OBSIDIAN_LINK_FORMAT=markdownの場合、編集中のファイルからターゲットページへの相対.mdパスを計算します。

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

vault内のすべての.mdファイルをグロブします(_archives/.obsidian/を除く)。各ページについて、以下を抽出します。

  • ファイル名.mdなし) — これがwikilinkのターゲットです。
  • フロントマターからのタイトル
  • フロントマターからのエイリアス(もしあれば)
  • フロントマターからのタグ
  • フロントマターまたはディレクトリ推論からのカテゴリ
  • 一行要約 — 最初の文またはtitleフィールド

ルックアップテーブルを構築します。

page_name → { path, title, aliases, tags, summary }

これがあなたの「語彙」です。このテーブルのすべてのエントリは、有効なwikilinkターゲットです。

ステップ2: 欠落しているリンクのスキャン

vault内の各ページについて:

  1. コンテンツ全体を読み込みます

  2. 既存のwikilinkを抽出します — 既に存在するすべての[[...]]参照を見つけます。

  3. リンクされていないメンションを検索します — ページのテキストに、[[...]]で囲まれていない以下のいずれかが含まれているかを確認します。

    • ページのファイル名(例: 「MyProject」という単語は表示されるが、[[projects/my-project/my-project]]が欠落している)
    • フロントマターからのページタイトル
    • フロントマターからのエイリアス
    • レジストリからのエンティティ名、プロジェクト名、コンセプト名
  4. 意味的なつながりを確認します — 複数のタグを共有している、または同じプロジェクトディレクトリにあるが、互いにリンクしていないページ。

マッチングルール

  • 名前の大文字と小文字を区別しないマッチング(例: 「my-project」はページMyProjectにマッチします)
  • ダイアクリティカルマークを区別しないマッチング — 比較する前に、ページ名と本文の両方をUnicode NFKDで正規化します(アクセント付き文字を基本文字+結合記号に分解し、結合記号を削除します)。これにより、本文の「Muller」がページ[[entities/müller]]にマッチし、その逆も同様になります。
  • 自己参照をスキップします — ページは自分自身にリンクすべきではありません。
  • 一般的な単語をスキップします — 「the」、「and」、一般的な用語はリンクしません。特徴的な名前のみにマッチさせます。
  • 最も短い曖昧さのないwikilinkパスを優先します — 名前がvault全体で一意である場合は、[[full/path/to/page-name]]ではなく[[page-name]]を使用します。
  • コードブロック内やフロントマター内ではリンクしません
  • 二重リンクしません[[foo]]が既にページに表示されている場合、別のリンクを追加しません。

ステップ3: 提案のスコアリングとランク付け

すべての可能なリンクが追加する価値があるわけではありません。複合シグナルを使用して各候補をスコアリングし、信頼度ラベルを付けます。

スコアリング

シグナル ポイント
テキスト内の正確な名前の一致 +4 本文に「MyProject」が表示される → my-project.mdにリンク
共有タグ(2つ以上) +2 両方とも#ai #agentとタグ付けされているが、それらの間にリンクがない
同じプロジェクト、リンクなし +2 両方ともprojects/my-project/の下にあるが、互いに参照していない
言及されたエンティティ/コンセプト +2 ページが「知識グラフ」に言及している → [[concepts/knowledge-graphs]]にリンク
カテゴリ間の接続 +2 ソースがconcepts/にあり、ターゲットがentities/にある(またはskills/synthesis/) — 異なる知識レイヤーがこのリンクをよりアーキテクチャ的に価値あるものにします
周辺→ハブへの到達 +2 ソースページの合計リンク数が2以下(周辺)だが、ターゲットが8以上(ハブ) — 緩いページを重要なコンセプトに接続する
部分的な名前の一致 +1 「graph」が表示されるが、ページはknowledge-graphs — もっともらしいが曖昧

信頼度ラベル

各候補にスコアに基づいて信頼度ラベルを付けます。

スコア ラベル アクション
≥ 6 EXTRACTED リンクは事実上確実 — 正確な言及または非常に強い一致。インラインで適用します。
3–5 INFERRED リンクは合理的な推論 — 共有コンテキスト、カテゴリ間、周辺→ハブ。インラインまたは関連セクションとして適用します。
1–2 AMBIGUOUS 弱いまたは部分的な一致。ユーザーが特に緩いページの接続を要求しない限りスキップします。

EXTRACTEDおよびINFERRED候補のみを処理します。ユーザーがINFERREDリンクを信頼する前にレビューできるように、クロスリンクレポートに信頼度ラベルを含めます。

ステップ4: リンクの適用

リンクが欠落している各ページについて:

4a: インラインリンク(推奨)

本文中の用語の最初の自然な言及を見つけて、wikilinkで囲みます。

前:

This project uses knowledge graphs to connect entities.

後:

This project uses [[concepts/knowledge-graphs|knowledge graphs]] to connect entities.

wikilinkパスが表示テキストと異なる場合は、[[path|display text]]形式を使用します。

4b: 関連セクション(フォールバック)

用語が本文中に自然に言及されていないが、ページが意味的に関連している場合(共有タグ、同じプロジェクト)、ページの下部に## Relatedセクションを追加します。

## Related

- [[projects/my-project/my-project]] — Also uses AI agents for research automation
- [[concepts/knowledge-graphs]] — Core technique used in this project

## Relatedセクションが既に存在する場合

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

Cross-Linker — Automated Wiki Cross-Referencing

You are weaving the wiki's knowledge graph tighter by finding and inserting missing [[wikilinks]] between pages that should reference each other but currently don't.

Follow the Retrieval Primitives table in llm-wiki/SKILL.md. Build the registry in Step 1 by grepping frontmatter only (not full pages). Reserve full Read for the unlinked-mention detection pass, and even there, only read pages whose summaries/titles make them plausible link targets. Blind full-vault reads are what this framework exists to avoid.

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 (default: wikilink).
  2. Read index.md to get the full inventory of pages and their one-line descriptions
  3. Skim log.md to see what was recently ingested (focus linking effort on new pages)

When inserting links in Step 4, apply the link format from llm-wiki/SKILL.md (Link Format section) using the OBSIDIAN_LINK_FORMAT value. When OBSIDIAN_LINK_FORMAT=markdown, compute the relative .md path from the file being edited to the target page.

Step 1: Build the Page Registry

Glob all .md files in the vault (excluding _archives/, .obsidian/). For each page, extract:

  • Filename (without .md) — this is the wikilink target
  • Title from frontmatter
  • Aliases from frontmatter (if any)
  • Tags from frontmatter
  • Category from frontmatter or directory inference
  • One-line summary — first sentence or title field

Build a lookup table:

page_name → { path, title, aliases, tags, summary }

This is your "vocabulary" — every entry in this table is a valid wikilink target.

Step 2: Scan for Missing Links

For each page in the vault:

  1. Read the full content

  2. Extract existing wikilinks — find all [[...]] references already present

  3. Search for unlinked mentions — check if the page's text contains any of these, without being wrapped in [[...]]:

    • Page filenames (e.g., the word "MyProject" appears but [[projects/my-project/my-project]] is missing)
    • Page titles from frontmatter
    • Aliases from frontmatter
    • Entity names, project names, concept names from the registry
  4. Check for semantic connections — pages that share multiple tags or are in the same project directory but don't link to each other

Matching Rules

  • Case-insensitive matching for names (e.g., "my-project" matches page MyProject)
  • Diacritic-insensitive matching — normalize both the page name and the body text with Unicode NFKD (decompose accented characters to base + combining marks, strip combining marks) before comparing. This ensures body text "Muller" matches page [[entities/müller]] and vice versa.
  • Skip self-references — a page shouldn't link to itself
  • Skip common words — don't link "the", "and", generic terms. Only match on distinctive names
  • Prefer the shortest unambiguous wikilink path — use [[page-name]] not [[full/path/to/page-name]] when the name is unique across the vault
  • Don't link inside code blocks or frontmatter
  • Don't double-link — if [[foo]] already appears on the page, don't add another

Step 3: Score and Rank Suggestions

Not every possible link is worth adding. Score each candidate using a composite signal, then tag it with a confidence label.

Scoring

Signal Points Example
Exact name match in text +4 "MyProject" appears in body text → link to my-project.md
Shared tags (2+) +2 Both tagged #ai #agent but no link between them
Same project, no link +2 Both under projects/my-project/ but don't reference each other
Mentioned entity/concept +2 Page mentions "knowledge graphs" → link to [[concepts/knowledge-graphs]]
Cross-category connection +2 Source is in concepts/, target is in entities/ (or skills/synthesis/) — different knowledge layers make this link more architecturally valuable
Peripheral→hub reach +2 Source page has ≤ 2 total links (peripheral) but target has ≥ 8 (hub) — connecting a loose page to a load-bearing concept
Partial name match +1 "graph" appears but page is knowledge-graphs — plausible but ambiguous

Confidence labels

Tag each candidate with a confidence label based on its score:

Score Label Action
≥ 6 EXTRACTED Link is effectively certain — exact mention or very strong match. Apply inline.
3–5 INFERRED Link is a reasonable inference — shared context, cross-category, peripheral→hub. Apply inline or as Related section.
1–2 AMBIGUOUS Weak or partial match. Skip unless user specifically asks to connect loose pages.

Only act on EXTRACTED and INFERRED candidates. Include the confidence label in the Cross-Link Report so the user can review INFERRED links before trusting them.

Step 4: Apply Links

For each page with missing links:

4a: Inline linking (preferred)

Find the first natural mention of the term in the body text and wrap it in wikilinks:

Before:

This project uses knowledge graphs to connect entities.

After:

This project uses [[concepts/knowledge-graphs|knowledge graphs]] to connect entities.

Use the [[path|display text]] format when the wikilink path differs from the display text.

4b: Related section (fallback)

If the term isn't mentioned naturally in the body but the pages are semantically related (shared tags, same project), add a ## Related section at the bottom of the page:

## Related

- [[projects/my-project/my-project]] — Also uses AI agents for research automation
- [[concepts/knowledge-graphs]] — Core technique used in this project

If a ## Related section already exists, append to it. Don't duplicate existing entries.

4c: Infer and write relationship type

For every EXTRACTED or INFERRED link added (inline or related section), infer a semantic relationship type from the surrounding sentence context and write it to the page's relationships: frontmatter block. Skip AMBIGUOUS links.

Type inference rules — scan the sentence containing the mention (or, for related-section links, the page title and shared-tag context):

Sentence pattern Inferred type
"X extends / builds on / generalises Y" extends
"X implements / is an implementation of Y" implements
"X contradicts / opposes / refutes / is at odds with Y" contradicts
"X is derived from / based on / adapted from Y" derived_from
"X uses / relies on / depends on / requires Y" uses
"X replaces / supersedes / deprecates Y" replaces
Shared tags or cross-category inference with no directional cue related_to

If the surrounding context is ambiguous or the link came from shared-tag matching (no in-body mention), default to related_to.

Writing the block:

Read the page's YAML frontmatter. If a relationships: block already exists, append new entries without duplicating existing targets. If the block is absent, add it after aliases: (or after tags: when aliases: is missing).

relationships:
  - target: "[[concepts/knowledge-graphs]]"
    type: uses

Always use wikilink format ([[path/to/page]]) for target values in the relationships: YAML block — regardless of OBSIDIAN_LINK_FORMAT. The OBSIDIAN_LINK_FORMAT setting controls body content; frontmatter properties always use wikilink syntax so that wiki-export can reliably parse them.

Only add entries for links added in this cross-linker run — do not touch typed entries that were already present.

Step 5: Score Misc Page Affinity

After the main linking pass, update affinity scores for all pages in misc/ (pages with promotion_status: misc in their frontmatter, or located under the misc/ directory).

For each misc page:

  1. Collect outgoing links — all [[wikilinks]] in the page body
  2. Collect incoming links — grep the vault for [[misc/<slug>]] and [[<slug>]] references
  3. For each linked page (both directions), check if it belongs to a project:
    • Lives under projects/<project-name>/
    • Has a project: frontmatter field matching a project name
  4. Group by project name and sum: outgoing_links + incoming_links
  5. Update the affinity frontmatter block on the misc page:
affinity:
  obsidian-wiki: 3
  another-project: 1
  1. If any project's score ≥ 3: flag this page as a promotion candidate and record it for the report

Efficiency note: only read the full body of misc pages — other pages only need a frontmatter grep to determine their project membership.

Step 6: Report

Present a summary:

## Cross-Link Report

### Links Added: 23 across 12 pages

| Page | Links Added | Confidence | Placement | Relationship Types |
|---|---|---|---|---|
| `projects/my-project/my-project.md` | 3 | EXTRACTED | 2 inline, 1 related | uses ×2, related_to ×1 |
| `entities/jane-doe.md` | 5 | INFERRED | 3 inline, 2 related | extends ×1, uses ×3, related_to ×1 |
| ... | | | | |

### Orphan Pages Remaining: 2
- `references/foo.md` — no incoming or outgoing links found
- `concepts/bar.md` — could not find related pages

### Misc Promotion Candidates: N
Pages in misc/ that have ≥ 3 connections to a single project — ready to be promoted:

| Page | Top Project | Score |
|---|---|---|
| `misc/web-martinfowler-articles-microservices.md` | `obsidian-wiki` | 4 |

To promote: move the page to `projects/<project-name>/references/` and update all backlinks.

### Pages Skipped: 3
- `index.md`, `log.md` — special files
- `_archives/*` — archived content

Step 7: Update Log and Hot Cache

Append to log.md:

- [TIMESTAMP] CROSS_LINK pages_scanned=N links_added=M typed_relations_written=T pages_modified=P orphans_remaining=Q misc_affinity_updated=R promotion_candidates=S

hot.md — Read $OBSIDIAN_VAULT_PATH/hot.md (create from the template in wiki-ingest if missing). Update Recent Activity with a one-line summary of what was linked — e.g. "Cross-linked 23 mentions across 12 pages; 2 orphans remain." Keep the last 3 operations. Update updated timestamp.

Tips

  • Run after every ingest. New pages are almost always poorly connected. This is the fix.
  • Be conservative with inline links. Only link the first natural mention, not every occurrence.
  • Don't touch pages in _archives/. Those are frozen snapshots.
  • Respect existing structure. If a page carefully curates its links in a ## Key Concepts section, add to that section rather than creating a separate ## Related.
  • Entity pages are link magnets. An entity like jane-doe should be linked from almost every project page. Prioritize these.