AgentSkillsCN

obsidian

当需要批量处理 Obsidian 的 Markdown 仓库时,可优先选用此技能。系统会处理维基链接提取、标签规范化、前言 CRUD 操作,以及仓库分析。适用于仓库范围内的转换、链接审计、标签标准化、元数据管理,以及迁移工作流。系统与 obsidian-markdown 集成,以实现语法校验;同时与 obsidian-data-importer 集成,以支持结构化导入。

SKILL.md
--- frontmatter
name: obsidian
description: This skill should be used when working with Obsidian files including .md notes with wikilinks/callouts/properties, .base database views with filters/formulas, or .canvas visual diagrams. Routes to specialized sub-skills based on file type and task context. Features self-iterative learning that improves with use.
user-invocable: true
context: fork
agent: obsidian-file-agent
model: sonnet
hooks:
  SessionStart:
    - type: command
      command: bash ${CLAUDE_PLUGIN_ROOT}/scripts/hooks/session-start.sh
      timeout: 10
  PostToolUse:
    - matcher: Write|Edit
      type: command
      command: bash ${CLAUDE_PLUGIN_ROOT}/scripts/hooks/post-tool-use.sh
      timeout: 5
  SessionEnd:
    - type: command
      command: bash ${CLAUDE_PLUGIN_ROOT}/scripts/hooks/session-end.sh
      timeout: 10
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - Bash

Obsidian Skill

Version: 2.2.0 | SDK: Claude Code Skills 2.1+

Directory Index


Comprehensive skill for creating and editing Obsidian vault files. Routes to specialized sub-skills based on file type. Self-iterative: learns your patterns and preferences over time through hot-reloadable memory.

File Type Detection

ExtensionFile TypeSub-skill
.mdMarkdown notesobsidian-markdown
.baseDatabase viewsobsidian-bases
.canvasVisual diagramsobsidian-canvas

Sub-skill Routing

When to use each sub-skill:

Obsidian Markdown - Use when:

  • Creating or editing .md files in Obsidian vaults
  • Working with wikilinks ([[Note]]), embeds (![[Note]])
  • Adding callouts, frontmatter properties, or tags
  • Using Obsidian-specific syntax (block references, comments)

Obsidian Bases - Use when:

  • Creating or editing .base files
  • Building database-like views of notes
  • Working with filters, formulas, or summaries
  • Creating table, cards, list, or map views

JSON Canvas - Use when:

  • Creating or editing .canvas files
  • Building visual mind maps or flowcharts
  • Working with nodes, edges, and groups
  • Creating project boards or research canvases

Quick Syntax Reference

Markdown (.md)

markdown
[[Note Name]]              # Wikilink
![[Note Name]]             # Embed
> [!note] Title            # Callout
#tag                       # Tag

Bases (.base)

yaml
filters:
  and:
    - file.hasTag("project")
views:
  - type: table
    order: [file.name, status]

Canvas (.canvas)

json
{
  "nodes": [
    {"id": "1", "type": "text", "x": 0, "y": 0, "width": 300, "height": 150, "text": "# Node"}
  ],
  "edges": []
}

Progressive Loading

For detailed documentation, load the appropriate sub-skill:

  • Detailed syntaxreferences/*.md in each sub-skill
  • Working examplesexamples/* in each sub-skill
  • Starter templatestemplates/* in each sub-skill

Self-Iterative Memory

This skill learns and improves over time:

How It Works

  1. SessionStart - Loads your usage history and preferences
  2. Pattern Tracking - Records which Obsidian features you use most
  3. SessionEnd - Derives preferences from usage patterns
  4. Hot-Reload - Changes to skill files are immediately available

Memory Storage

  • Location: .claude/obsidian-memory.json in project directory
  • Tracks: pattern usage, vault context, learned preferences

Memory Commands

bash
# View usage statistics
python scripts/hooks/memory-manager.py stats

# Add a learning note
python scripts/hooks/memory-manager.py learn "Discovered useful pattern"

# Reset memory
python scripts/hooks/memory-manager.py reset

What's Tracked

CategoryPatterns
Markdownwikilinks, callouts, embeds, properties, tags
Basesfilters, formulas, views, summaries
CanvastextNodes, fileNodes, linkNodes, groupNodes, edges

Validation

Run validation scripts to check file syntax:

bash
./scripts/validate-all.sh

Hooks Architecture

HookTriggerPurpose
SessionStartSession beginsLoad memory, detect vault
PostToolUseWrite/Edit completesTrack pattern usage
SessionEndSession endsSave learnings, derive preferences

Specialized Agents

This skill uses context: fork with specialized agents for optimal Obsidian file handling.

Default Agent

  • obsidian-file-agent - Master agent handling all three file types with domain-specific expertise

Domain-Specific Agents

Located in agents/ directory:

AgentModelSpecialization
obsidian-markdownHaikuFast markdown note operations
obsidian-basesSonnetComplex formula calculations
obsidian-canvasHaikuJSON canvas generation
obsidian-file-agentSonnetMaster agent (default)

Agent Installation

For the specialized agents to work, install them to your global agents directory:

bash
# Install all obsidian agents
./scripts/install-agents.sh

# Or manually symlink
ln -s "$(pwd)/agents/"*.md ~/.claude/agents/

Agent Selection

  • The skill uses agent: obsidian-file-agent by default
  • Specialized agents can be invoked directly if installed:
    • Use obsidian-markdown for fast note operations
    • Use obsidian-bases for complex formula work
    • Use obsidian-canvas for visual diagram creation

References