Back to list
treylom

storage-abstraction-layer

by treylom

Knowledge Manager Agent for Claude Code - Extract and organize content from web, PDF, social media to Obsidian/Notion

10🍴 5📅 Jan 22, 2026

SKILL.md


name: Storage Abstraction Layer description: Unified storage interface for Obsidian, Notion, and local file systems

Storage Abstraction Layer

Unified interface for saving notes across different storage backends


Storage Selection

function get_storage_backend() {
  config = Read("km-config.json")
  return config?.storage?.primary || "local"
}

🛑 MCP 도구 우선 사용 규칙 (CRITICAL)

┌─────────────────────────────────────────────────────┐
│ 🛑 CRITICAL: MCP 도구 사용 강제                      │
│                                                      │
│ MCP 도구가 사용 가능한 환경에서는 반드시 MCP 사용!    │
│                                                      │
│ ❌ 잘못된 예:                                        │
│    - write_to_file("vault/note.md", content)         │
│                                                      │
│ ✅ 올바른 예:                                        │
│    - mcp_obsidian_create_note(path, content)         │
└─────────────────────────────────────────────────────┘

Backend Mapping (Antigravity/Gemini CLI)

FeatureObsidianNotionLocal
Createmcp_obsidian_create_notemcp_notion_API-post-pagewrite_to_file
Searchmcp_obsidian_search_vaultmcp_notion_API-post-searchN/A
Readmcp_obsidian_read_notemcp_notion_API-get-block-childrenread_file
Path formatRelative to vaultDatabase/Page IDFile system path
WikilinksSupportedConverted to mentionsSupported

참고: Antigravity는 MCP 도구 이름에 싱글 언더스코어(_)를 사용합니다.

MCP 도구 사용 가이드 (Obsidian)

작업도구명설명
노트 생성mcp_obsidian_create_note새 노트 생성
노트 검색mcp_obsidian_search_vaultVault 내 키워드 검색
노트 읽기mcp_obsidian_read_note노트 내용 읽기
노트 목록mcp_obsidian_list_notes폴더 내 노트 목록

Unified Save Function

// Antigravity/Gemini CLI용 (싱글 언더스코어 사용)
function save_note(relativePath, content) {
  backend = get_storage_backend()
  config = Read("km-config.json")

  switch (backend) {
    case "obsidian":
      // ⚠️ 반드시 MCP 도구 사용!
      return mcp_obsidian_create_note({
        path: relativePath,
        content: content
      })

    case "notion":
      return mcp_notion_API_post_page({
        parent: { page_id: config.storage.notion.parentPageId },
        properties: { title: [{ text: { content: getTitle(relativePath) } }] }
      })

    case "local":
    default:
      fullPath = `${config.storage.local.outputPath}/${relativePath}`
      return write_to_file(fullPath, content)
  }
}

Path Normalization

function normalize_path(path) {
  // Windows backslash → forward slash
  path = path.replace(/\\/g, '/')

  // Remove leading slash for relative paths
  path = path.replace(/^\//, '')

  return path
}

Verification (CRITICAL)

After every save operation:

□ Did the tool actually execute? (no JSON-only output!)
□ Did we receive a success response?
□ Verify with Glob that file exists

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon