obsidian-links について
obsidian-linksは、ObsidianのWikiリンクを整形、検証、修正するスキルです。Vault文書の管理に向けて、リンク作成前に対象ファイルと見出しの正確な表記を確認します。
主な機能
- 01完全なファイル名とフォルダパスで整形
- 02正確な見出しへのリンク作成
- 03YAMLプロパティ内のリンクを引用符で囲む
- 04リンク先の確認とリンク切れの修正
活用シーン
- 01Vaultの命名規則に沿ったノート間リンク
- 02確認済みの見出しへのリンク追加
- 03文書内のリンク切れの確認
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ jykim/ claude-obsidian-skills --skill obsidian-linksインストール後、Claude Code で/obsidian-linksを入力して読み込まれたか確認します。
詳細
Obsidian Wiki リンク
ボルトの規則に従って、Wiki リンクを整形、検証、修正します。
このスキルを使用するタイミング
次の操作が必要な場合に有効化します。
- ボルト内の他のファイルへの Wiki リンクを作成する
- 特定の見出しへのセクションリンクを追加する
- YAML フロントマターのプロパティ内のリンクを整形する
- リンクが既存のファイル/セクションを指していることを確認する
- リンク切れを見つけて修正する
- ドキュメント内のリンクの整合性を検証する
リンクの基本的な整形ルール
1. 完全なファイル名の形式
必ず日付プレフィックス付きの完全なファイル名を使用します。
✅ CORRECT: [[2025-10-31 Project Notes]]
❌ INCORRECT: [[Project Notes]] (missing date)
❌ INCORRECT: [[2025-10-31]] (missing title)
2. フォルダーパスの規則
明確にするためにフォルダープレフィックスを含めます。
✅ CORRECT: [[Journal/2025-10-31]]
✅ CORRECT: [[Articles/2025-10-31 Perennial Seller]]
✅ CORRECT: [[Roundup/2025-10-31]]
ルール:明確さとナビゲーションのため、フォルダープレフィックスを一貫して使用します。
3. セクションリンク
見出しのテキストを一字一句正確に使用します。
Source file header:
## PKM System Maintenance
✅ CORRECT:
[[Journal/2025-10-31#PKM System Maintenance]]
❌ INCORRECT:
[[Journal/2025-10-31#PKM System]] (truncated)
[[Journal/2025-10-31#pkm-system-maintenance]] (slug format)
重要:文字、句読点、スペースを、記載どおりに正確に一致させます。
4. 索引ではなくソースにリンクする
必ずトピックの集約ページではなく、元のコンテンツにリンクします。
✅ CORRECT: [[Articles/2025-08-15 Skill Development]]
❌ INCORRECT: [[Topics/Career#Skill Development]]
Reason: Maintains source attribution and traceability
5. プロパティのリンク形式
YAML のリスト内でリンクを使用する場合は、引用符で囲みます。
sources:
- "[[Journal/2025-10-31]]"
- "[[Articles/2025-10-31 Title]]"
links:
- "[[Roundup/2025-10-31]]"
attendees:
- "[[People/John]]"
リンク検証の原則
1. リンクする前に検索する
リンクを作成する前に、必ずリンク先が存在することを確認します。
Process:
1. Search for target file using Glob or Grep
2. Verify file exists
3. If section link, read file and verify header exists
4. Create link with exact filename and header text
❌ NEVER:
- Guess at filenames
- Assume files exist
- Fabricate section headers
2. セクション見出しを確認する
セクションリンクを作成する場合は、ソースを読み、正確に一致させます。
Steps:
1. Read target file
2. Search for exact header text
3. Copy character-for-character (including special characters)
4. Create section link
If unsure about exact header:
✅ Link to file only: [[Journal/2025-10-31]]
❌ Don't guess: [[Journal/2025-10-31#Guessed Header]]
3. ファイルの存在確認
適切なツールを使用してファイルを確認します。
For specific file:
- Use Glob with full path pattern: "Journal/2025-10-31.md"
- Or Read the file directly
For finding files by keyword:
- Use Glob with pattern: "Articles/**/*keyword*.md"
- Check Topics directory before linking to topics
4. リンク切れはすぐに修正する
リンク切れを見つけたら、修正します。
Process:
1. Identify broken link
2. Search for correct target file
3. Update link with correct path/filename (use Edit tool)
4. Verify section header if applicable
5. Report fix to user
作業全体の流れ
新しいリンクの作成(整形+検証)
Step 1: Determine Target
- Identify file to link to
- Note folder location
- Note complete filename
Step 2: Verify File Exists
- Use Glob: "**/{filename}.md"
- Or Read file directly
- If not found, search by keyword
Step 3: Verify Section (if needed)
- Read target file
- Search for exact header text
- Copy character-for-character
- If unsure, link to file only
Step 4: Format Link
- Use complete filename: [[YYYY-MM-DD Title]]
- Add folder prefix
- Add section if verified: [[File#Exact Header]]
- Wrap in quotes if in YAML property
Step 5: Create Link
- Link points to existing file
- Section header matches exactly (if used)
- Follows folder prefix conventions
リンク切れの特定と修正
Step 1: Detection
- Read document content
- Extract all wiki links
- For each link, verify file exists
- For section links, verify header exists
Step 2: Search for Correct Target
- Use context to determine intent
- Search vault with Glob/Grep
- Verify file exists
Step 3: Fix Link
- Use Edit tool to update broken link
- Replace with correct path/filename
- Verify section header if applicable
Step 4: Report
- Show old link (broken)
- Show new link (fixed)
- Explain reason for fix
特殊なケース
ジャーナル/日次ファイル
Path: Journal/YYYY-MM-DD.md
Format: [[Journal/YYYY-MM-DD]]
Section links:
- Headers may vary by language
- ALWAYS verify exact text before linking
- If unsure, link to file only
Validation:
1. Check file: Journal/YYYY-MM-DD.md
2. Read file content
3. Search for exact header
4. Use exact match or file-only link
トピックリンク
CRITICAL: Search Topics directory BEFORE linking
Validation:
1. Use Glob: "Topics/**/*{keyword}*.md"
2. Find matching topic page
3. Use complete category path
Examples:
- [[Topics/Technology/PKM]]
- [[Topics/Career/Skills]]
❌ NEVER link to non-existent topic pages
人名
Simple name: [[John]]
With context: [[People/John]] (if folder exists)
Validation: Verify person file exists before linking
品質チェックリスト
リンク操作を完了する前に確認します。
整形:
- すべてのリンクで完全なファイル名を使用している
- フォルダープレフィックスが規則に従っている
- セクション見出しが一字一句正確に一致している
- YAML プロパティ内のリンクが引用符で囲まれている
- すべてのリンクがトピック索引ではなくソースを指している
検証:
- すべてのリンク先ファイルの存在を確認している
- セクション見出しを確認している(推測していない)
- トピックリンクが既存のトピックページを指している
- リンク切れを特定して修正している
コメント
Markdown 対応