将语音转写项目输出的复杂文件结构整理合并为适合 Obsidian 归档的 Markdown 文档
npx skills add https://github.com/cafe3310/public-agent-skills --skill long-audio-to-obsidian
此技能将散乱的语音转写项目文件整理成结构清晰的 Markdown 文档,便于在 Obsidian 等知识库中归档。
它采用 "Agent 规划 + 脚本执行" 的模式:
当用户要求将一个包含多个原始音频、数十个转写分段、以及各种说明文档的目录“整理归档”时使用。
首先,使用 list_directory (必要时配合 glob) 扫描目标项目目录。
你需要回答以下问题:
1-原始文件 或类似目录)5-最终输出,文件名包含行号如 _1-200)5-最终输出 中非分段的 Markdown 文件)基于你的分析,构建一个 JSON 配置文件。不要直接输出给用户,而是准备写入临时文件。
JSON 结构定义:
{
"output_dir": "目标项目路径/obsidian_archive",
"tasks": [
{
"filename": "1-原始录音汇总.md",
"title": "原始录音汇总",
"sections": [
{
"title": "文件1.txt",
"path": "绝对路径或相对路径/文件1.txt",
"syntax": "text"
}
]
},
{
"filename": "2-最终输出脚本汇总.md",
"title": "最终输出脚本汇总",
"sections": [
{
"title": "Part 1 (1-200)",
"path": "路径/output_1-200.txt",
"syntax": "text"
},
{
"title": "Part 2 (201-400)",
"path": "路径/output_201-400.txt",
"syntax": "text"
}
// Agent 必须确保这里的顺序是正确的!
]
}
// ... 继续为“整理要求汇总”和“知识整理汇总”创建任务
]
}
write_file 将 JSON 配置保存为临时文件,例如 merge_plan.json。 python3 .gemini/skills/long-audio-to-obsidian/scripts/doc_merger.py merge_plan.json
*(注意:请根据实际安装位置调整脚本路径)*
merge_plan.json。脚本生成的只是标准文件名的中间产物。为了方便 Obsidian 使用,你需要进行最后一步的人工智能优化:
2024-01-01 会议转写 - 项目 A)。run_shell_command 的 mv 命令,将 obsidian_archive 中的标准文件重命名为带前缀的格式。1-原始录音汇总.md -> {标题} 1 原始录音汇总.md2-最终输出脚本汇总.md -> {标题} 2 最终输出脚本汇总.md{标题}.md 的新文件。[[文件名]])。索引页内容示例:
相关文档:
[[2024-01-01 会议转写 - 项目 A 1 原始录音汇总]]
[[2024-01-01 会议转写 - 项目 A 2 最终输出脚本汇总]]
...
请按照以下四个维度组织输出文件(对应 JSON 中的 4 个 task):
0-工作日志.md)3-校对和术语表.md)4-分段主题.md)2-要求和信息/*)问题和回答-xxx.md)。path 推荐使用绝对路径,或者相对于执行 doc_merger.py 时的相对路径。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/long-audio-to-obsidian 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.