SuperAPI AI Directory

long-audio-to-obsidian

General & other

View repository

Updated 10-15 17:31

About this skill

Long Audio to Obsidian Archiver

This skill organizes scattered speech transcription project files into clearly structured Markdown documents for archiving in knowledge bases such as Obsidian.

It adopts the "Agent planning + script execution" model:

  1. Agent (you): responsible for understanding the directory structure, identifying file types, logically sorting segmented files (for example, by line numbers 1-200, 201-400), and generating a merge plan.
  2. Script: responsible for mechanically reading files and generating Markdown according to your plan.

Use Cases

Use this when the user asks to "organize and archive" a directory containing multiple raw audio files, dozens of transcription segments, and various explanatory documents.

Workflow

1. Survey & Analyze

First, use list_directory (together with globif necessary) to scan the target project directory. You need to answer the following questions:

  • Which are theraw recording texts? (usually in 1-原始文件 or a similar directory)
  • Which are thefinal output segmented scripts? (usually in 5-最终输出, with file names containing line numbers such as _1-200)
    • Key task: you need to sort them correctly according to the numbers in the file names.
  • Which areproject metadata? (logs, glossaries, background requirements, etc.)
  • Which arederived knowledge/Q&A?(5-最终输出 non-segmented Markdown files)

2. Generate Configuration

Based on your analysis, build a JSON configuration file. Do not output it directly to the user; instead, prepare to write it to a temporary file.

JSON structure definition:

{
  "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 必须确保这里的顺序是正确的!
      ]
    }
    // ... 继续为“整理要求汇总”和“知识整理汇总”创建任务
  ]
}

3. Execute

  1. Use write_file to save the JSON configuration as a temporary file, for example merge_plan.json。

  2. Call the script to execute the merge:

    python3 .gemini/skills/long-audio-to-obsidian/scripts/doc_merger.py merge_plan.json
    

    (Note: please adjust the script path according to the actual installation location)

  3. Check the script output to confirm successful generation.

  4. Delete the temporary file merge_plan.json。

4. Rename & Index

The script only generates intermediate products with standard file names. To make them convenient for Obsidian, you need to perform one final step of artificial intelligence optimization:

  1. Determine the project title: based on the original directory name or core file name, extract a clear project title (for example 2024-01-01 会议转写 - 项目 A)。
  2. Rename files: use run_shell_command 's mv command to rename the standard files in obsidian_archive to a prefixed format.
    • 1-原始录音汇总.md -> {标题} 1 原始录音汇总.md
    • 2-最终输出脚本汇总.md -> {标题} 2 最终输出脚本汇总.md
    • ...and so on.
  3. Generate an index page:
    • Create a new file named {标题}.md .
    • The content should include Obsidian WikiLinks ([[文件名]])。
    • If there are related external product documents (not merged in), links can also be added here.

Example index page content:

相关文档:

[[2024-01-01 会议转写 - 项目 A 1 原始录音汇总]]

[[2024-01-01 会议转写 - 项目 A 2 最终输出脚本汇总]]

...

Archiving Standards

Please organize the output files according to the following four dimensions (corresponding to the 4 tasks in the JSON):

  1. Raw Recording Summary: Contains all raw recording texts.
  2. Final Output Script Summary: Contains all proofread and merged segmented texts.Order is critical。
  3. Organization Requirements and Log Summary:
    • Work Log (0-工作日志.md)
    • Proofreading Glossary (3-校对和术语表.md)
    • Segment Topics (4-分段主题.md)
    • All Background Requirement Files (2-要求和信息/*)
  4. Knowledge Organization Summary:
    • Contains all derived generated knowledge files (such as 问题和回答-xxx.md)。

Notes

  • Path Handling: The path in JSON is recommended to use absolute paths, or relative paths relative to when doc_merger.py is executed.
  • Fault Tolerance: If an expected directory does not exist (for example, there is no "Knowledge Organization" file), then do not include the corresponding task in the JSON, or create an empty task.
  • Sorting: The script will not sort automatically.MustAll logical sorting of files must be completed by the Agent when generating the JSON.