从知识库目录中检索、筛选和提取特定关键词相关知识
npx skills add https://github.com/cafe3310/public-agent-skills --skill obsidian-knowledge-filter
此技能旨在从由大量 Markdown 文件组成的知识库(例如 Obsidian Vault)中,通过一个精确且分阶段的工作流,进行知识的检索、筛选和提取。它采用带编号前缀的 YAML 和 Markdown 文件来管理每一步的中间数据,并在每个关键步骤暂停以供用户审阅,确保最终产出的内容高度相关且无重复。
核心理念: 此技能的目标是在用户的指导下,通过一系列独立的脚本和分析步骤,精确地从知识库中提炼与特定主题相关的信息,并通过结构化的方式呈现,最终形成综合分析报告。
当用户请求您通过查找、关联和综合分散在个人知识库中的信息来解决复杂问题时,请使用此技能。此工作流特别适用于需要高精度、希望减少冗余信息并全程参与筛选过程的场景。
该过程分为四个主要阶段,每个阶段都以用户审阅为节点。
001_analyze_files.py此脚本递归地在指定目录中搜索所有 .md 文件,并执行以下操作:
tmp-, _attachments, 或 .trash 的文件/目录。tmp-YYYY-MM-DD-HH-MM-SS-analysis/ 临时目录中,生成 001_analysis.yaml。001_analysis.yaml 格式详解:
这是一个 YAML 文件,包含一个文件信息对象的列表。每个对象都具有以下结构:
- file_path: '文件夹/2025-12-29-示例文件.md' # 相对于当前工作目录的路径
keyword_counts:
- word: '关键词1'
count: 5
- word: '关键词2'
count: 2
line_ranges:
- [10, 30] # 第一个内容提取区间
- [45, 65] # 第二个内容提取区间
Agent 暂停并请求用户审阅 001_analysis.yaml,用户可手动编辑此文件以增删文件或修改行号区间。
002_extract_content.py用户确认后,此脚本会读取 001_analysis.yaml,并根据其中的 file_path 和 line_ranges 提取相应的内容。
**)。![[...]])。002_content.yaml,其结构与 001_analysis.yaml 类似,但每个对象都增加了一个 content 字段。002_content.yaml 格式详解:
- file_path: '文件夹/2025-12-29-示例文件.md'
keyword_counts:
# ... (同上)
line_ranges:
# ... (同上)
content: "这是从文件中提取并清理后的文本内容...\n..."
Agent 再次暂停,请求用户审阅 002_content.yaml,确保提取和清理后的内容符合预期。
用户确认后,Agent 开始对 002_content.yaml 进行智能分析。为提升效率并保证分析的连贯性,Agent 采用分块「读取-分析-写出」循环模式:
002_content.yaml 文件;例如,第一次会读取 1-1000 行。003_content_analysis.md 文件中,清晰地标注每个洞察来源于哪个文件。这种方法避免了逐条分析的低效与碎片化,确保了分析过程的流畅性和上下文关联性。
003_content_analysis.md,其中包含了对所有文件片段的综合洞察。Agent 完成所有内容块的分析后,暂停并请求用户审阅最终生成的 003_content_analysis.md,确认洞察的准确性和深度。
在用户完成最终审阅后,Agent 将以 003_content_analysis.md 为素材,撰写一份逻辑连贯、结构清晰的最终报告。
004_report.mdAgent 向用户提交最终的 04_report.md 报告。
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.
Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill.
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
Take cafe3310/obsidian-knowledge-filter from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.