人工智能AI 应用AI 技能RAGMCP 服务网页爬虫【免费下载链接】Skill_SeekersConvert documentation websites, GitHub repositories, and PDFs into Claude AI skills with automatic conflict detection项目地址https://gitcode.com/gh_mirrors/sk/Skill_Seekers点击查看免费下载导读本文以 Skill Seeker 仓库中 Phase 2 黄金测试产物tests/golden/phase2/pptx_kw/references/section_s1-s1.md为样本逐段拆解 PowerPoint.pptx演示文稿被转换为 Claude Skill 后其章节参考文件section reference file的生成格式与底层机制。读完本文你将掌握该参考文件每个区块Source 标注、Slide 范围、标题层级、正文、Speaker Notes、代码示例、表格、图片统计分别来自哪些源码逻辑以及 Skill Seeker 如何借助布局类型、等宽字体、标题模式等启发式规则完成演示文稿的结构化提取。一、样本文件在仓库中的定位section_s1-s1.md并不是一份独立的技术教程而是 Skill Seeker黄金测试golden test基准树的一部分。它位于 PPTX 抓取器的 Phase 2 测试产物目录下tests/golden/phase2/pptx_kw/ ├── references/ │ ├── index.md # 目录与统计 │ ├── section_s1-s1.md # Setup 章节参考文件本文主体 │ ├── section_s2-s2.md # Api 章节参考文件 │ └── section_s3-s3.md # Other 章节参考文件 └── SKILL.md # 生成的 Skill 主入口这一整棵 golden 树对应测试 tests/test_phase2_golden_pptx.py 中的test_pptx_keyword_categorization_matches_goldenpptx_kw 即 keyword categorization 路径的产物其用途是证明 PPTX 抓取器在迁移到DocumentSkillBuilder基类后输出与重构前逐字节一致。测试通过 tests/phase2_golden_utils.py 中的build_snapshot与assert_matches_golden比较实际构建产物与 golden 树任何字节差异都会导致断言失败。因此本文解读的格式不是随意写就的 Markdown而是Skill Seeker 的 PPTX → Skill 输出契约SKILL.md、index.md 与每个 section 参考文件的结构全部由 src/skill_seekers/cli/pptx_scraper.py 中PptxToSkillConverter._write_reference_section等构建逻辑严格生成。二、参考文件整体骨架H1 标题与 Source 标注section_s1-s1.md的开头结构如下# Setup --- ** Source: Section 1** (Slides 1-3) ## Getting Started Guide2.1 Source 行与 Slide 范围** Source: Section 1** (Slides 1-3)由_write_reference_section生成见 pptx_scraper.pyf.write(f---\n\n** Source: Section {sec_num}**) if slide_range: f.write(f (Slides {slide_range})) f.write(\n\n)其中slide_range是_build_section_from_slides依据该章节首尾幻灯片的编号拼出的字符串slide_range: ( f{slide_list[0][slide_number]}-{slide_list[-1][slide_number]} if slide_list else )从样本可见 Setup 章节覆盖Slides 1-3对应测试数据SECTIONS[0][slide_range] 1-3而第三章节 Othersection_s3-s3.md因没有slide_range生成的是不带括号的** Source: Section 3**——这正是测试注释中 No slide_range exercises the bare Source: Section N line 所验证的分支。2.2 标题层级H1 章节 H3 幻灯片小标题章节主标题## Getting Started Guide由heading原为 h1加一级得到##对应md_level # * (int(heading_level[1]) 1)。章节内的#### Slide 2: Verify Setup、#### Slide 3: First Demo是单个幻灯片的标题被提升为 h3 子标题渲染为####后的产物。测试数据中每个小标题的文本格式为Slide {num}: {title}由_build_section_from_slides生成if slide_title and slide_title ! heading: sub_headings.append({ level: h3, text: fSlide {slide_num}: {slide_title}, })值得注意Setup 章节测试数据原本同时含 h2Installation Steps与 h3而 keyword 分类路径使用的SECTIONS_H3_ONLY变体将所有小标题降为 h3。样本最终呈现 Slide 2/Slide 3 两个 h3 主题正好触发_format_key_concepts中Slide Topics 分支当不存在 h2 时用 h3 标题填充该区块见 SKILL.md 的 Slide Topics 列表。三、正文与 Speaker Notes 的合并策略Welcome to the project. This section explains setup. ### Speaker Notes [Slide 1] Remember to demo the install.3.1 正文来源正文文本来自幻灯片中各文本框架除标题占位符外的内容由_extract_slide收集body_parts后以\n\n.join(...)合并。样本中的 Welcome to the project... 即该章节幻灯片的正文文本。3.2 Speaker Notes 的提取与前置演讲者备注由_extract_speaker_notes读取幻灯片的notes_slide文本框架获得。_build_section_from_slides会把每张幻灯片的备注以[Slide N]前缀拼接if notes: notes_parts.append(f[Slide {slide_num}] {notes})最后统一追加到正文之后、并冠以### Speaker Notes小节标题combined_text \n\n.join(text_parts) if notes_parts: combined_text \n\n### Speaker Notes\n\n \n\n.join(notes_parts)样本中的[Slide 1] Remember to demo the install.正是这一逻辑的直接产物——备注与正文合并在section[text]中_write_reference_section写入时再执行strip()这正是测试注释 Trailing whitespace exercises the strip-before-write path 覆盖的场景第二章节All endpoints are documented here.\n的尾随换行会被去除。四、代码示例等宽字体启发式 质量评分### Code Examples python print(hello)pip install thing### 4.1 代码块检测机制 PPTX 抓取器不是靠识别 围栏来发现代码而是使用**字体启发式** 1. _process_text_frame 逐段落遍历文本框架调用 _detect_code_blocks 判断是否为代码 2. _detect_code_blocks 统计段落 run 中使用等宽字体如 Courier、Consolas、Menlo、JetBrains Mono 等完整清单见 MONOSPACE_FONTS 集合的字符占比占比 ≥ 0.6 直接判定为代码占比 ≥ 0.3 时再结合 _text_looks_like_code 的代码语法模式def 、import 、赋值语句、括号运算符等做二次确认 3. 连续代码段落会被 _finalize_code_block 合并为一个代码块并调用 scraper_utils.score_code_quality 给出 0~10 的质量分。 ### 4.2 语言识别 代码块在提取阶段 language 为空由 _detect_languages 在章节聚合后调用 LanguageDetector(min_confidence0.15) 自动判定置信度 ≥ 0.3 才写入语言标签。因此样本中 print(hello) 被标为 python、pip install thing 被标为 bash并汇总为 languages_detected: {python: 2, bash: 1}见 SKILL.md 的 Language Breakdown。 ### 4.3 质量排序 写入 SKILL.md 的 Code Examples 区块时所有代码块按 quality_score 降序排列并截取 Top 15、每种语言最多 5 条超过 500 字符的代码会被截断为 前500字符 \n...。这正是为何 Api 章节的 60 行长函数测试中 LONG_CODE质量分 9.5在 SKILL.md 中以省略号结尾而 print(hello)8.5 分与 pip install thing6.0 分按分数依次展示。 ## 五、表格首行即表头 markdown ### Tables | Option | Default | | --- | --- | | debug | false | | port | 8080 |表格由_extract_tables从 python-pptx 的Table对象提取遍历每行每单元格合并单元格内多段落文本默认把第一行当作表头headers rows_data[0] data_rows rows_data[1:] return {headers: headers, rows: data_rows}_write_reference_section随后调用_write_markdown_table渲染为 Markdown 表格。样本中的debug/false、port/8080正是 Setup 章节表格的还原。需注意分支差异第二章节的表格section_s2-s2.md 中的| a | b | / | c | d |对应测试里headers: []的无表头路径渲染时首行退化为普通行这由测试注释 Table without headers exercises the headerless rendering path 明确标注。六、图片统计只计数不导出二进制### Images *2 image(s) in this section*PPTX 抓取器不提取图片二进制数据避免 JSON 体积膨胀而是记录图片的数量、名称、宽高与 alt 文本。_write_reference_section仅在image_count 0时输出统计行img_count section.get(image_count, 0) if img_count 0: f.write(f### Images\n\n*{img_count} image(s) in this section*\n\n)Setup 章节统计到 2 张图片与 golden 树的total_images: 2以及 SKILL.md 的 Images/Diagrams: 2 一致_extract_images_info还会尝试从形状 XML 的cNvPr元素读取descr作为 alt 文本访问性描述这部分不写入参考文件仅保留在提取 JSON 中。七、章节如何被切分布局类型与标题模式样本section_s1-s1.md之所以存在是因为_group_slides_into_sections把 8 张幻灯片切成了 3 个章节。切分依据布局类型_extract_slide检查slide.slide_layout.name是否命中TITLE_ONLY_LAYOUTSsection header、section、title slide、title only命中则is_section_slide True断点聚合_group_slides_into_sections收集所有is_section_slide且有标题的幻灯片作为章节断点断点之前的幻灯片归入前置章节标题缺省为 Introduction没有断点时整份演示文稿合并为单一章节每个断点幻灯片之后到下一个断点前的幻灯片归入同一章节章节标题取断点幻灯片标题最终生成section_s{n}-s{n}.md这样的命名_reference_filename依据章节序号与总数决定样本s1-s1即第 1 个章节、共 3 个章节。八、与 index.md 和 SKILL.md 的关系references/index.md 汇总了 3 个章节的导航链接与统计Total slides: 8 / Sections: 3 / Code blocks: 3 / Images: 2 / Tables: 2由_write_index_statistics生成其中Tables 行是 PPTX 覆盖版新增的字段SKILL.md 是 Skill 主入口包含 YAML frontmatter、Presentation Information、When to Use、Section Overview、Key Concepts、Quick Reference、按语言分组排序的 Code Examples、Table Summary、Presentation Statistics 与 Navigation指向各 reference 文件。整个产物树构成一个自包含的 skillAI Agent 读 SKILL.md 获得概览再按需跳转到各 section 参考文件获取细节。九、如何在命令行复现该产物section_s1-s1.md对应的构建命令PPTX 专用参数定义见 src/skill_seekers/cli/arguments/pptx.pyskill-seekers pptx --pptx ./deck.pptx --name golden_pptx_kw --output ./skill要点说明--pptx接受单个.pptx文件或包含多个.pptx的目录目录按文件名排序后合并处理多文件时每张幻灯片记录source_file--from-json可从已提取的 JSON 直接构建跳过提取阶段PPTX 命令的--enhance-level默认被覆盖为0禁用 AI 增强如需增强需显式指定若python-pptx未安装会提示pip install skill-seekers[pptx]或pip install python-pptx运行测试验证格式UPDATE_GOLDENS1 pytest tests/test_phase2_golden_pptx.py可重新捕获 golden 树会覆盖提交的基准正常模式则做逐字节对比。十、小结这份参考文档告诉了我们什么section_s1-s1.md虽然只是一份黄金测试基准文件但它完整暴露了 Skill Seeker PPTX 转换器的输出契约参考文件区块生成逻辑数据来源# Setup##主标题_write_reference_section标题层级映射章节标题/布局 Source: Section N (Slides x-y)_write_reference_sectionslide_range幻灯片编号聚合#### Slide N: Title_build_section_from_slides子标题生成单张幻灯片标题正文 ### Speaker Notes_build_section_from_slides文本合并文本框与 notes_slide### Code Examples_detect_code_blocks/LanguageDetector等宽字体启发式### Tables_extract_tablespython-pptx Table 对象### Images统计行_write_reference_section计数分支图片形状计数理解这些机制无论是想定制自己的 PPTX → Markdown 提取管线还是排查 Skill Seeker 生成产物的格式问题都能直接从上述源码与测试路径中找到精确答案。进一步阅读仓库内的 tests/test_phase2_golden_pptx.py 定义了全部输入数据结构SECTIONS、SECTIONS_H3_ONLYtests/phase2_golden_utils.py 说明了 golden 对比协议完整的 PPTX 提取逻辑集中在 src/skill_seekers/cli/pptx_scraper.py。赞分享人工智能AI 应用AI 技能RAGMCP 服务网页爬虫【免费下载链接】Skill_SeekersConvert documentation websites, GitHub repositories, and PDFs into Claude AI skills with automatic conflict detection项目地址https://gitcode.com/gh_mirrors/sk/Skill_Seekers点击查看免费下载相关推荐Skill_Seekers HTML 文档转 Claude Skill从 section_s1-s1.md 看关键词分类与参考文件生成流程Skill_Seekers HTML 文档转 Claude Skill从 section_s1 s1.md 看关键词分类与参考文件生成流程 Skill_See人工智能AI 应用AI 技能RAGMCP 服务网页爬虫Skill Seekers Man 手册转 Skill 全流程解析以 curl 参考文档为例Skill Seekers Man 手册转 Skill 全流程解析以 curl 参考文档为例 本篇技术指南围绕 Skill Seekers 仓库中 tests人工智能AI 应用AI 技能RAGMCP 服务网页爬虫Skill_Seekers Jupyter Notebook 转 Skill 的参考文件格式解析以 Data Loading 代码单元格为例Skill_Seekers Jupyter Notebook 转 Skill 的参考文件格式解析以 Data Loading 代码单元格为例 本文以 Skil人工智能AI 应用AI 技能RAGMCP 服务网页爬虫创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考