Storage Abstraction Layer
SKILL.md
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)
| Feature | Obsidian | Notion | Local |
|---|---|---|---|
| Create | mcp_obsidian_create_note |
mcp_notion_API-post-page |
write_to_file |
| Search | mcp_obsidian_search_vault |
mcp_notion_API-post-search |
N/A |
| Read | mcp_obsidian_read_note |
mcp_notion_API-get-block-children |
read_file |
| Path format | Relative to vault | Database/Page ID | File system path |
| Wikilinks | Supported | Converted to mentions | Supported |
μ°Έκ³ : Antigravityλ MCP λꡬ μ΄λ¦μ μ±κΈ μΈλμ€μ½μ΄(
_)λ₯Ό μ¬μ©ν©λλ€.
MCP λꡬ μ¬μ© κ°μ΄λ (Obsidian)
| μμ | λꡬλͺ | μ€λͺ |
|---|---|---|
| λ ΈνΈ μμ± | mcp_obsidian_create_note |
μ λ ΈνΈ μμ± |
| λ ΈνΈ κ²μ | mcp_obsidian_search_vault |
Vault λ΄ ν€μλ κ²μ |
| λ ΈνΈ μ½κΈ° | 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
Weekly Installs
0
Repository
treylom/knowledβ¦-managerGitHub Stars
42
First Seen
Jan 1, 1970
Security Audits