anbeime/skill / antinet-agentteams/skills/doc-parse
doc-parse
Unverified将 PDF/PPT/Excel/Word 等多格式文档解析为结构化 Markdown,并输出元数据与解析置信度,作为 RAG 与四色卡片的数据底座。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.1 KB |
| scripts/run_doc_parse.py | script | 2.2 KB |
scripts/run_doc_parse.py
View on GitHub#!/usr/bin/env python3
"""doc-parse Skill 执行脚本(密卷房 / mijuanfang)。
对应 AgentTeams 子任务: doc-parse
真实调用: core.runtime.AgentSession.run_stage("doc-parse")
-> archive.mijuanfang.MiJuanFangAgent.parse()
三级 fallback(mineru -> pymupdf -> pdfplumber);离线时降级为预存全文读取,
并如实标注 fallback_used 与 confidence。证明解析 Worker 真实可执行。
"""
from __future__ import annotations
import os
import sys
import json
import argparse
HERE = os.path.dirname(os.path.abspath(__file__))
SKILLS_ROOT = os.path.dirname(os.path.dirname(HERE))
PKG = os.path.dirname(SKILLS_ROOT)
sys.path.insert(0, os.path.join(PKG, "core"))
from runtime import AgentSession # noqa: E402
def _safe(o):
if hasattr(o, "to_dict"):
return o.to_dict()
if isinstance(o, (list, tuple)):
return [_safe(x) for x in o]
if isinstance(o, dict):
return {k: _safe(v) for k, v in o.items()}
if isinstance(o, (str, int, float, bool)) or o is None:
return o
return str(o)
def main() -> None:
ap = argparse.ArgumentParser(description="doc-parse skill runner")
ap.add_argument("--topic", default=None)
args = ap.parse_args()
sess = AgentSession(PKG)
if args.topic:
sess.cfg["project"]["topic_example"] = args.topic
texts = sess.run_stage("doc-parse") # 解析结果(list[dict] 或 list[object])
parsed_count = getattr(sess.mijuanfang, "last_parsed_count", None)
payload = {
"skill": "doc-parse",
"stage": "doc-parse",
"worker": "mijuanfang(密卷房)",
"parsed_count": parsed_count,
"doc_count": len(texts) if isinstance(texts, (list, tuple)) else None,
"result": _safe(texts),
}
out_dir = os.path.join(PKG, "examples", "snse_survey", "skill_outputs")
os.makedirs(out_dir, exist_ok=True)
out_path = os.path.join(out_dir, "doc_parse.json")
with open(out_path, "w", encoding="utf-8") as f:
json.dump(payload, f, ensure_ascii=False, indent=2)
print(f"[doc-parse] parsed={parsed_count} docs={payload['doc_count']}")
print(f"[doc-parse] -> {out_path}")
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate 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. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', 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 or .dotx 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. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse 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. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx 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 or .potx 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 (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |