关于 obsidian-markdown-structure
obsidian-markdown-structure 是用于验证 Obsidian 知识库 Markdown 结构的 Skill,检查 frontmatter 位置、标题层级、内容顺序和引用格式。
主要功能
- 01验证 YAML frontmatter 位置
- 02检查标题层级
- 03采用摘要优先的组织方式
- 04检查引用块署名
- 05遵循内容类型模板
适用场景
- 01创建结构规范的 Markdown 文档
- 02查找标题层级或 frontmatter 问题
- 03检查知识库内容格式是否一致
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ jykim/ claude-obsidian-skills --skill obsidian-markdown-structure安装后在 Claude Code 中输入/obsidian-markdown-structure确认已加载。
详细介绍
Markdown 结构验证
确保所有知识库内容的 Markdown 结构保持一致。
何时使用此技能
在需要执行以下操作时启用:
- 创建新的 Markdown 文档
- 验证文档结构
- 修复结构问题
- 确保格式一致
核心结构规则
1. Frontmatter 位置
顶部放置单个 YAML 块,后面空一行:
✅ CORRECT:
---
title: Document Title
created: 2025-10-31
tags:
- tag1
---
## First Section Header
Content starts here...
❌ INCORRECT:
---
title: Document Title
---
## First Section (no blank line)
❌ INCORRECT:
## Title
---
frontmatter: here
---
(frontmatter not at top)
重要规则:
- 只能有一个 YAML 块
- 必须位于文件开头
- 结束的
---后空一行 - 第一个标题前不能有内容
注意:此技能验证 frontmatter 的位置(在文档中的放置位置)。 对于 frontmatter 的内容(属性、值、格式),请使用
obsidian-yaml-frontmatter技能。
2. 标题层级
从 H2 开始,不重复使用 H1:
✅ CORRECT:
---
title: Document Title
---
## Introduction
Content...
### Subsection
Content...
❌ INCORRECT:
# Document Title (duplicates frontmatter title)
## Section
层级规则:
- 主章节使用 H2(
##) - 子章节使用 H3(
###) - 谨慎使用 H4(
####) - 不要跳过层级(H2 → H4)
3. 内容组织
摘要优先的结构:
✅ CORRECT:
---
frontmatter
---
## Summary
Overview of key points...
## Main Content
Detailed content...
## Related Topics
Links and connections...
❌ INCORRECT:
---
frontmatter
---
This is content without a heading.
## First Section
4. 引用块格式
带署名的引用块:
✅ CORRECT:
> "Quote text here" - Speaker/Context
> "Knowledge is power, but enthusiasm pulls the switch."
> - Ivern Ball
❌ INCORRECT:
"Quote text" (not in blockquote)
> Quote without attribution
结构验证工作流
步骤 1:检查 Frontmatter
Verify:
- [ ] Single YAML block at top
- [ ] Blank line after closing ---
- [ ] All required properties present
- [ ] Consistent property names
步骤 2:检查标题层级
Verify:
- [ ] No H1 after frontmatter (except special cases)
- [ ] Main sections use H2
- [ ] Subsections use H3
- [ ] No skipped levels
- [ ] Logical organization
步骤 3:检查内容组织
Verify:
- [ ] No content before first heading
- [ ] Summary/overview section first
- [ ] Sections follow logical order
- [ ] Proper quote formatting
步骤 4:按内容类型检查
Check content follows appropriate template structure:
- [ ] Journal: H1 title, standard sections
- [ ] Roundup: Opening quote(s), structured headers
- [ ] Events: Executive Summary, Key Takeaways, Next Actions
- [ ] Clippings: Summary first, then detailed sections
质量检查清单
完成结构验证前:
- 顶部只有一个 YAML frontmatter
- frontmatter 后空一行
- 第一个标题前没有内容
- 标题层级正确(H2 → H3 → H4)
- 引用块格式正确
- 包含摘要/概览章节
- 章节顺序合理
- 遵循对应内容类型的模板结构
评论
支持 Markdown