Kg Note Method Obsidian
Obsidian笔记库按KG笔记法整理——四种笔记类型、链接权限、关系中转、命名规范、新旧分离。自动纠错+建关系+去重+补缺+无关内容分离+分层加载 Skill: Kg Note Method Obsidian Owner: realpda Summary: Obsidian笔记库按KG笔记法整理——四种笔记类型、链接权限、关系中转、命名规范、新旧分离。自动纠错+建关系+去重+补缺+无关内容分离+分层加载 Tags: kg-notes:1.5.0, knowledge-graph:1.5.0, latest:3.23.0, note-organization:1.5.0, obsidian:1.5.0 Version history: v3.23.0 | 2026-05-09T11:42:50.060Z | user 回退v3.22.0: 撤销'分支模式'和'直接跳到执行阶段'改动, 回到v3.21.0状态 v3.22.0 | 2026-05-09T11:39:38.178Z | user 手动命令区分支模式(直接执行/分析); 步0有同名可续接清单→直接跳到执行阶段(不重复
Rank
62
Safety
84
Downloads
1.5k
Updated
Oct 10, 2026
Version
3.23.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.5K downloadsadoption · observed Oct 10, 2026
- Latest release
- 3.23.0release · observed May 9, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s17aspeya65fa14fe9v237r5qd863x8n:kg-note-method-obsidian- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-realpda-kg-note-method-obsidian/snapshot"
Documentation
CLAWHUB
122,768 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: kg-note-method-obsidian
description: Obsidian笔记库按KG笔记法整理——四种笔记类型、链接权限、关系中转、命名规范、新旧分离。自动纠错+建关系+去重+补缺+无关内容分离+分层加载
version: 3.23.0
author: Hermes Agent
license: MIT
metadata:
hermes:
tags: [obsidian, kg-notes, knowledge-graph, token-saving]
---
# KG笔记法 — Obsidian 笔记整理
<!-- 速查: 内容检查+拆分→分类匹配→名称匹配→图片保护→直链检查→查相关笔记→查重→更改清单→补完计划→收尾 -->
> ⚠️ **不主动改写笔记**:所有命令(除 `kg 完善`),尽量保留原文原貌。
## ⚡ 手动调用命令
> 所有命令第一步:`skill_view(name='kg-note-method-obsidian')` 加载本 skill。不可跳过。
### `kg start`
加载本 skill。
### `kg "笔记名.md"/"关键词"`
`kg start` → 建执行清单+检查清单到 `_working/`(清单强制)→ 查找笔记逐条跑 ①-⑥ → ⑦ → 按清单执行 → ⑧,无笔记则新建再跑
### `kg 完善 "笔记名.md"`
`kg start` → 建执行清单+检查清单到 `_working/`(清单强制)→ 逐条跑 ①-⑥ → ⑦ → ⑨ → 按清单执行 → ⑧
### `kg 检查 "笔记名.md"` / `kg 检查 "关键词"`
与其他命令相同的清单(清单名=笔记名),区别仅在于:分析完成后**询问是否执行**,等用户确认后才动手。
### `kg 查看 "笔记名.md"`
加载 L0(frontmatter)。相关则加载 L1(对应段落)。仍不足加载 L2(全文)。
> 用户消息以 `kg` 开头 → 必须先加载本 skill。路径含 vault → 自动触发,用上述命令更可靠。
| `_working/` | 当前任务清单目录 |
**📦 内置脚本和参考(skill_view + file_path 加载):**
1. `checklist-generator.py` — 自动生成执行清单+检查清单。用法:`python <script> <任务名> <步1> [步2...]`
2. `yaml-validator.py` — 编辑后验证 YAML 结构。用法:`python <script> <文件.md>`
3. `enrichment.py` — 补完计划:将搜索结果格式化为 KG 标准段落追加到笔记。用法:`echo "内容" | python <script> <文件.md> --stdout` 或 `--text "..."`
**清单目录:** vault 根目录下的 `_working/`
### 两个清单文件
| 文件 | 用途 | 更新时机 |
|:----|:-----|:--------|
| `{任务名}_执行清单.md` | 预判所有步骤的详细操作 | 任务开始前一次性生成 |
| `{任务名}_检查清单.md` | 追踪每步完成/失败状态 | 每步完成后立即更新 |
### 执行清单格式
**执行时照做,不重复分析。**
```markdown
# {任务名} — 执行清单
## 步骤
### 1. 重命名「美食-青岛.md」→「青岛美食.md」(②名称检查:主体名禁` - `)
- 操作类型:mv
### 2. 修改「笔记A.md」tag
- 操作类型:patch
- tags: [旧tag] → tags: [某物]
### 3. 新建「笔记A - 关系 - 笔记B.md」
- 操作类型:新建文件
- 内容:[[笔记A]]关系描述[[笔记B]]。
### 4. 检查两端残留链接 + 查重
- 操作类型:检查验证
### N. 删除本任务的2个清单文件
- 操作类型:删除文件
```
### 检查清单格式
**极度精简一行状态码。执行清单已含完整描述,这里只记进度。每步一个位:`0`=未做,`1`=完成。** 文件内容仅一行:
```
0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
```
步数 = 冒号分隔的位数。更新时 `patch` 单字符 `0`→`1`(只改对应位,不改全文)。失败步记步号到末尾:` | 失败:3,7`。**完整标识**:检查清单全 `1` + 执行清单最后一步≥"删除本任务2个清单文件"。
格式示例(17步,第1、3步已完成,第7步失败):
```
1:0:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0 | 失败:7
```
### 执行流程
**步0 和步5 不可跳过。跳过步0 → 同名任务已有清单却被覆盖。跳过步5 → 用户不知道还有其他任务。**
```
0. 任务开始前(不可跳过):
search_files target=content, pattern='检查清单', path=_working/
├─ 有同名任务的清单 → read_file 检查清单+执行清单 → 检查是否可续接
│ (有未完成位 且 最后一步不是"删除本任务")→ 从未完成步开始
│ 否则(全1或最后一步是删除)→ 删除清单文件,重新建
├─ 有其他任务的清单(不同名)→ 当前任务执行完后步5再提示
└─ 无清单 → **清理同名残留:先 `search_files` 搜 `_working/` 下所有包含该笔记名的清单文件并删除**(防止之前建错的 `笔记名+命令名` 形式残留)。
然后生成执行清单+检查清单。**清单名=笔记名(用户给的参数),不加任何命令前缀/后缀。**
**参数映射:** `kg 检查 苏州` → checklist-generator.py 第一个参数传 `苏州`,不传 `苏州检查`
`kg "青岛美食.md"` → 传 `青岛美食`
`kg 完善 资本收益.md` → 传 `资本收益`
优先用脚本(需设环境变量):
`OBSIDIAN_VAULT="<vault绝对路径>" python scripts/checklist-generator.py <任务名> <步1> [步2...]`
或用完整路径:`python <script_full_path> <任务名> <步1> [步2...]`(此时仅打印到终端,需手动保存)
⚠️ 脚本在终端输出清单不等于文件已保存到 scripts/README.md
Scripts for kg-note-method-obsidian. ## checklist-generator.py 生成执行清单 + 检查清单文件。 ``` python scripts/checklist-generator.py <任务名> <步1> [步2...] ``` 自动追加"删除本任务2个清单文件"为最后一步,检查清单 bitmask 同步。 ## yaml-validator.py YAML frontmatter 校验。支持: - 概念/某物/skill/关系 类型检查 - frontmatter 开闭确认 - 禁止字段检查(type/[[links]/related_fragments) - agent memory 碎片专用检查(summary必需) - Git Bash 路径兼容 ``` python scripts/yaml-validator.py <文件.md> ``` ## enrichment.py 补完计划 — 将搜索结果格式化为 KG 标准段落,追加到笔记。 ``` echo "内容" | python scripts/enrichment.py <笔记.md> --stdout python scripts/enrichment.py <笔记.md> --text "补充内容" ``` 根据笔记类型自动匹配格式(概念→来源, 某物→补充信息, 关系→单句)。
_meta.json
{
"ownerId": "kn7fqb3c2xfkrkayjpw1sceew1863n0d",
"slug": "kg-note-method-obsidian",
"version": "3.23.0",
"publishedAt": 1778326970060
}references/yaml-parsing-pitfalls.md
# YAML Frontmatter Parsing Pitfalls
## The `body_start` Offset Bug (discovered 2026-05-09)
**Symptom:** YAML validator reports `STRAY_FM_CLOSE: body contains '---'` on a clean file, or body content is shifted/includes the closing `---` delimiter.
**Root cause:** Using `.lstrip('\n')` on `raw[3:]` changes the offset, then `close_idx = rest.find('\n---')` returns an index relative to the stripped string, but `body_start = close_idx + 5` tries to use it on the original `raw` string. The lstrip shifts everything.
**Bad pattern (DO NOT USE):**
```python
rest = raw[3:].lstrip('\n') # offset shifted by stripping
end_idx = rest.find('\n---') # index relative to stripped string
yaml_block = rest[:end_idx].strip() # OK for parsing YAML
body_start = end_idx + 5 # WRONG: end_idx is in stripped space, not raw
body_raw = raw[body_start:] # WRONG: starts too early or in wrong place
```
**Correct pattern:**
```python
close_idx = raw.find('\n---', 3) # always search in raw, skip first 3 chars (---)
if close_idx == -1:
return errors
yaml_block = raw[3:close_idx].strip() # YAML content
body_raw = raw[close_idx + 5:] # +5 skips \n---\n, correct because close_idx is in raw
```
**Key insight:** Always search for the closing `---` delimiter in the original `raw` string, not in a `lstrip()`-ed copy. The `\n---` sequence is deterministic (it's `\n` + `---` + `\n`), so `close_idx + 5` is correct when operating on the original string.
## Common `tag:` vs `tags:` Typo
Several notes in the vault use `tag:` (singular, missing 's') instead of `tags:`. The yaml-validator now detects this with `TAG_VS_TAGS` error.
**Detection logic:**
```python
if 'tag' in fields and 'tags' not in fields:
errors.append("TAG_VS_TAGS: frontmatter has 'tag:' — did you mean 'tags:'?")
```
## Agent Memory Frontmatter Rules
Agent memory fragments (`agent memory/` directory) have special rules:
- No `type:` field (use `tags:` instead)
- No `[[links]]` in frontmatter
- No `related_fragments` field (use `project:` grouping)
- Must have `summary:` field with `importance:` rating
These are enforced by `yaml-validator.py` and should not be overridden.skill-card.md
## Description: Organizes Obsidian vault notes with the KG note method by classifying note types, normalizing naming and links, deduplicating relationships, and preparing checklist-driven corrections and enrichments. This skill is ready for commercial/non-commercial use. ## Publisher: [realpda](https://clawhub.ai/user/realpda) ### License/Terms of Use: MIT-0 ## Use Case: Obsidian users and agents use this skill to inspect, reorganize, and enrich Markdown vault notes into KG-style concept, object, skill, and relation notes. It is intended for checklist-driven note maintenance, relationship cleanup, YAML validation, and controlled vault edits. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The skill can directly modify, rename, delete, and enrich Obsidian vault notes. Mitigation: Use the explicit kg 检查 preview flow before applying changes, keep vault backups, and review generated execution checklists before file edits. Risk: File operations could affect notes outside the intended workspace if the working path is too broad. Mitigation: Restrict the working path to the intended Obsidian vault and verify checklist files are created under that vault's _working directory. Risk: Enrichment can append externally sourced or unreviewed content to notes. Mitigation: Preview enrichment output with --stdout and review external search results before appending them to vault files. ## Reference(s): - [YAML Frontmatter Parsing Pitfalls](references/yaml-parsing-pitfalls.md) - [ClawHub skill page](https://clawhub.ai/realpda/skills/kg-note-method-obsidian) - [Publisher profile](https://clawhub.ai/user/realpda) ## Skill Output: **Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] **Output Format:** [Markdown notes and checklists with inline shell commands and Python helper script guidance] **Output Parameters:** [1D] **Other Properties Related to Output:** [May create, modify, rename, delete, validate, or enrich Obsidian Markdown files in the selected vault.] ## Skill Version(s): 3.23.0 (source: evidence.release and artifact frontmatter) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/realpda/skills/kg-note-method-obsidian",
"sourceUrl": "https://clawhub.ai/realpda/skills/kg-note-method-obsidian",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T10:19:38.179Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-realpda-kg-note-method-obsidian/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-realpda-kg-note-method-obsidian/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T10:19:38.179Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.5K downloads",
"href": "https://clawhub.ai/realpda/kg-note-method-obsidian",
"sourceUrl": "https://clawhub.ai/realpda/kg-note-method-obsidian",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T10:19:38.179Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "3.23.0",
"href": "https://clawhub.ai/realpda/kg-note-method-obsidian",
"sourceUrl": "https://clawhub.ai/realpda/kg-note-method-obsidian",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-09T11:42:50.060Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-realpda-kg-note-method-obsidian/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-realpda-kg-note-method-obsidian/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 3.23.0",
"description": "回退v3.22.0: 撤销'分支模式'和'直接跳到执行阶段'改动, 回到v3.21.0状态",
"href": "https://clawhub.ai/realpda/kg-note-method-obsidian",
"sourceUrl": "https://clawhub.ai/realpda/kg-note-method-obsidian",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-09T11:42:50.060Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
