一键导入
wiki-ingest-ocr
Ingest new academic papers or PDFs into the raw/ folder of your active topic wiki using the local OCR model configured in config.yaml.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Ingest new academic papers or PDFs into the raw/ folder of your active topic wiki using the local OCR model configured in config.yaml.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Compile raw sources into detailed, Obsidian-compatible, interlinked Markdown pages under wiki/ references/ and concepts/.
Deduplicates concepts, splits overly broad concepts, and synthesizes multi-source concept definitions by dynamically searching and analyzing all papers that reference them.
Ingest new academic papers, notes, or web articles into the raw/ folder of your active topic wiki.
Initialize a new topic workspace folder with standard raw/, wiki/, inbox/, and output/ directories.
Statically check and repair double-bracket linkages and frontmatter within your compiled wiki directory.
Automatically builds semantic links between concept markdown files by calculating vector similarity using a local Ollama embedding model.
基于 SOC 职业分类
| name | wiki_ingest_ocr |
| description | Ingest new academic papers or PDFs into the raw/ folder of your active topic wiki using the local OCR model configured in config.yaml. |
| commands | {"ingest_ocr":"Ingest new PDFs (from inbox/ or a specific path) using local GLM-OCR into the raw/ directory."} |
Resolving script paths (read first): Commands below invoke scripts as
<BIN>/X.py(and a few as<SKILLS>/...). Resolve these to absolute paths once before running anything:
<SKILL_DIR>= the directory thisSKILL.mdlives in.<SKILLS>= theskills/folder containing this skill =<SKILL_DIR>/..<BIN>= thebin/folder beside it =<SKILL_DIR>/../../binDo not hardcode a fixed prefix like
.agents/binor../bin: shell relative paths resolve against the current working directory (usually the topic root), not this skill's location. Once resolved,<BIN>is typically.agents/binwhen invoked from the hub root, or.claude/binfrom inside a topic directory.
This skill handles converting external PDF documents (especially academic papers or scanned articles inside inbox/ or custom local paths) into high-fidelity clean Markdown using the local OCR model configured in config.yaml (default: glm-ocr at 130 DPI).
Figures are handled automatically. Both the PDF path (
pdf2md-agent) and the TeX path (tex2md.py) extract figures into animages/folder beside the output Markdown and embed them inline (). Figure files are prefixed with the document slug, so multiple papers can share oneraw/<type>/images/folder without collisions. Vector figures and.epssources are rasterised to PNG. You do not need to handle figures manually.
When the user asks to ingest PDFs using local OCR (or runs the command without a path):
Resolve Ingestion Targets:
inbox/ directory for any .pdf, .md, or .tex files.inbox/ contains multiple target files, you MUST loop through all of them and process them one by one in a batch.inbox/ is empty of target files, only then prompt the user to specify a file path.Identify Source Type: For each PDF file, academic papers go to raw/papers/, other articles to raw/articles/.
File Type Handling & Conversion:
.pdf files (Execute Local GLM-OCR Conversion):
pdf2md-agent script on the PDF:
python <BIN>/pdf2md-agent/agent.py "<PDF_PATH>" -o "<TOPIC_DIR>/raw/<type>" -t "<DOC_TITLE>"
YYYY-MM-DD-slug.md directly into your output directory. You do NOT need to rename the file or append YAML manually..md files or general inbox files, call the ingest helper script:
python <BIN>/ingest_helper.py --source-file \"<MD_FILE>\" --type \"<TYPE>\" --topic-dir \"<TOPIC_DIR>\" [--date \"<DATE>\"]
This script handles parsing/injecting standard YAML frontmatter, slugifying, and moving/copying the file..tex files (and arXiv .tar.gz source bundles): You MUST use the Pandoc conversion script instead of OCR. Run:
python <BIN>/tex2md.py "<TEX_OR_TARGZ_PATH>" -o "<TOPIC_DIR>\raw\<type>"
Note: This script automatically generates YAML frontmatter, writes the file, and extracts/converts referenced figures into images/ (rasterising .pdf/.eps figures to PNG). Check the printed Figures: N embedded, M unresolved line; if any are unresolved, the source bundle may be missing those figure files.Post-Processing Pipeline: Extract the exact path of the generated Markdown file from the conversion script's output. Then, trigger the pipeline to handle moving and formatting (skipping global lint for now):
python <BIN>/ingest_pipeline.py "<ORIGINAL_FILE_PATH>" --topic-dir "<TOPIC_DIR>" --md-file "<GENERATED_MD_FILE>" --skip-lint --log-msg "Ingested <DOC_TITLE> via OCR"
Manual Math Error Correction (Agentic Fallback):
ingest_pipeline.py outputs any warnings like [WARNING] Math syntax errors in <FILE>:, you MUST immediately stop and fix them.Double subscript or Unexpected end of stream.python <BIN>/pdf_math_crop.py "<PDF_PATH>" --text "<search_text_near_error>" --out "<TOPIC_DIR>\scratch\crop.png"crop.png, then manually edit the Markdown file to correct the semantic math errors based on the ground truth in the original paper, and re-run python <BIN>/validate_math_latex.py <FILE> to confirm all errors are gone.Global Lint & Index (End of Batch):
inbox/ have been processed through steps 1-5, you MUST run the global lint and index operation ONCE outside the loop:python <BIN>/ingest_pipeline.py "none" --topic-dir "<TOPIC_DIR>" --lint-only