/med-paper-assistant:pdf-asset-extractorfrom med-paper-assistant
Ingests PDFs to extract figures, tables, and sections, then builds a cross-document knowledge graph for queryable RAG. Useful for research paper analysis and literature review.
Ships in med-paper-assistant. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
將 PDF 文件分解為可查詢的資產(圖片、表格、章節),並建立跨文獻知識圖譜。
核心能力:
| 引擎 | 強項 | 弱項 | 觸發方式 |
|---|---|---|---|
| PyMuPDF (預設) | 快速、輕量 (~50MB) | 版面分析精度較低 | ingest_documents() |
| Marker (高精度) | 精確 bbox、section hierarchy | 重模型 (~1GB)、較慢 | ingest_documents(use_marker=True) 或 parse_pdf_structure() |
blocks.json — 結構化區塊(含 bbox、polygon、section_hierarchy)Base64 圖片非常大,一次只處理一張!
- 一張圖片 ≈ 200KB base64 ≈ ~270K tokens
- 對話 context 有限,多張圖片會快速耗盡
- 建議流程:先
inspect_document_manifest→ 選定目標圖 → 一次 fetch 一張
如果 AI 有視覺能力(Vision),可直接分析返回的圖片 如果是純文字 AI,應誠實告知無法分析圖片內容
系統以
fig_{page}_{index}命名,非解析圖說文字 需手動對照 manifest 頁碼與實際 Figure 編號
| Tool | 用途 | 參數 |
|---|---|---|
ingest_documents | 匯入 PDF(ETL 流程) | file_paths: list[str], async_mode: bool, use_marker: bool |
parse_pdf_structure | Marker 結構化解析(單檔) | file_path: str |
get_job_status | 查詢 ETL 進度 | job_id: str |
list_jobs | 列出所有工作 | active_only: bool |
cancel_job | 取消 ETL 工作 | job_id: str |
| Tool | 用途 | 參數 |
|---|---|---|
list_documents | 列出所有已處理文件 | 無 |
inspect_document_manifest | 查看文件結構(圖/表/章節清單) | doc_id: str |
fetch_document_asset | 取得特定資產 | doc_id, asset_type, asset_id |
| Tool | 用途 | 參數 |
|---|---|---|
list_section_tree | 顯示完整 section hierarchy 樹狀結構 | doc_id: str |
get_section_detail | 取得特定 section 的詳細資訊 | doc_id: str, section_path: str |
get_section_blocks | 提取特定 section 的所有 blocks | doc_id: str, section_path: str |
search_sections | 搜尋 section 名稱 | doc_id: str, query: str |
| Tool | 用途 | 參數 |
|---|---|---|
search_source_location | 在 blocks.json 中搜尋特定內容 | doc_id: str, query: str, block_types: list |
| Tool | 用途 | 參數 |
|---|---|---|
consult_knowledge_graph | 跨文獻 RAG 查詢 | query: str, mode: str |
export_knowledge_graph | 導出圖譜(JSON/Mermaid) | format: str, limit: int |
Resources 會自動更新,可直接瀏覽文件大綱:
| Resource URI | 說明 |
|---|---|
documents://list | 所有已處理文件列表 |
document://{doc_id}/outline | 📋 文件完整大綱(推薦起點) |
document://{doc_id}/manifest | 完整 manifest JSON |
document://{doc_id}/figures | 圖片清單(ID、頁碼、尺寸) |
document://{doc_id}/tables | 表格清單 |
document://{doc_id}/sections | 章節層級結構 |
knowledge-graph://summary | 知識圖譜統計概覽 |
# 瀏覽已處理的文件
→ documents://list
# 查看文件大綱(推薦起點)
→ document://abc123def/outline
# 列出所有圖片
→ document://abc123def/figures
# 知識圖譜概覽
→ knowledge-graph://summary
使用者:「幫我匯入這份 PDF」/ 「分析這份論文」
步驟:
1. 取得 PDF 絕對路徑
2. 呼叫 ingest_documents(預設 async_mode=True)
3. 使用 get_job_status 追蹤進度
4. 完成後提供 doc_id
範例呼叫:
# 異步匯入(推薦,大檔案用)
ingest_documents(file_paths=["/papers/study.pdf"])
# 返回 job_id,用 get_job_status 追蹤
# 同步匯入(小檔案)
ingest_documents(file_paths=["/papers/small.pdf"], async_mode=False)
使用者:「這份文件有什麼圖表?」
步驟:
1. 呼叫 list_documents 找到 doc_id
2. 呼叫 inspect_document_manifest
3. 列出所有 figures/tables/sections
範例呼叫:
list_documents()
inspect_document_manifest(doc_id="abc123def")
Manifest 內容:
tab_1, tab_2...(ID、頁碼)fig_2_1, fig_3_1...(ID、尺寸、頁碼)sec_intro, sec_methods...(標題、行號)fetch_document_asset(
doc_id="abc123def",
asset_type="figure",
asset_id="fig_3_1"
)
# 返回 ImageContent (base64) + metadata
fetch_document_asset(
doc_id="abc123def",
asset_type="table",
asset_id="tab_1"
)
# 返回 Markdown 格式表格
# 特定章節
fetch_document_asset(doc_id="abc123def", asset_type="section", asset_id="sec_methods")
# 全文 Markdown
fetch_document_asset(doc_id="abc123def", asset_type="full_text", asset_id="full")
使用者:「比較這兩篇文獻的發現」/ 「AlphaFold 是什麼?」
步驟:
1. 確認文件已 ingest 且已建立索引
2. 選擇查詢模式
3. 呼叫 consult_knowledge_graph
查詢模式:
| Mode | 用途 | 適合場景 |
|---|---|---|
local | 細節查詢 | 特定藥物劑量、具體數據 |
global | 全局模式 | 跨文獻趨勢、主題歸納 |
hybrid | 混合模式(推薦) | 一般問答 |
範例呼叫:
consult_knowledge_graph(
query="What is AlphaFold and how does it work?",
mode="hybrid"
)
使用者:「顯示知識圖譜」/ 「圖譜長什麼樣?」
步驟:
1. 選擇輸出格式
2. 呼叫 export_knowledge_graph
3. Mermaid 格式可直接渲染
輸出格式:
| Format | 用途 | 建議 limit |
|---|---|---|
summary | 統計 + 樣本節點 | 50(預設) |
mermaid | Mermaid 流程圖 | 20-30 |
json | 完整節點/邊 JSON | 100+ |
範例呼叫:
# 快速概覽
export_knowledge_graph(format="summary")
# Mermaid 視覺化(可渲染)
export_knowledge_graph(format="mermaid", limit=25)
# 完整 JSON 數據
export_knowledge_graph(format="json", limit=100)
Mermaid 輸出範例:
graph TD
N0["AlphaFold"]
N1["DeepMind"]
N2["Protein Structure"]
N0 -->|developed by| N1
N0 -->|predicts| N2
使用者:「幫我分析這份 PDF」
執行流程:
1. ingest_documents → 取得 job_id
2. get_job_status → 等待完成
3. inspect_document_manifest → 了解結構
4. fetch section (Introduction) → 快速瀏覽
5. 根據需要 fetch 特定圖表
6. consult_knowledge_graph → 整合分析
使用者:「給我 Figure 3」
執行流程:
1. list_documents → 找到 doc_id
2. inspect_document_manifest → 找 fig_X_X 對應
3. fetch_document_asset(asset_type="figure", asset_id="fig_3_1")
4. 返回圖片 + metadata
使用者:「比較 A 和 B 論文的結論」
執行流程:
1. 確認兩份文件都已 ingest
2. consult_knowledge_graph(mode="global")
3. export_knowledge_graph(format="mermaid") → 視覺化關係
使用者:「圖譜裡有什麼?」
執行流程:
1. export_knowledge_graph(format="summary") → 統計
2. export_knowledge_graph(format="mermaid", limit=20) → 視覺化
| 資產類型 | 大約 Token 數 | 建議 |
|---|---|---|
| Section (1頁) | ~500-1000 | ✅ 優先使用 |
| Table | ~200-500 | ✅ 低成本 |
| Figure (base64) | ~200K-500K | ⚠️ 一次一張 |
| Full text (10頁) | ~10K-20K | ⚠️ 視需要 |
| Knowledge Graph (summary) | ~500 | ✅ 快速概覽 |
| Knowledge Graph (mermaid) | ~1K-3K | ✅ 視覺化 |
操作後應回報:
## PDF 處理結果
### 📄 文件資訊
- **doc_id**: `abc123def`
- **標題**: Nobel Prize Chemistry 2024
- **頁數**: 15 頁
### 📊 可用資產
| 類型 | 數量 | 範例 ID |
| -------- | ---- | ---------------------- |
| Figures | 8 | fig_2_1, fig_5_1 |
| Tables | 3 | tab_1, tab_2 |
| Sections | 5 | sec_intro, sec_methods |
### 🔗 知識圖譜
- **節點**: 383
- **關係**: 99
- 可使用 `export_knowledge_graph` 視覺化
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pdf-extraction, knowledge-graph, rag, document-analysis, mcp-tools
npx claudepluginhub u9401066/med-paper-assistant --plugin med-paper-assistant25 skills in this plugin
/academic-debate學術辯論與觀點比較框架。
LOAD THIS SKILL WHEN: debate、辯論、pro/con、正反方、devil's advocate、挑戰假設、counter-argument、反駁、compare viewpoints、比較觀點、challenge、質疑
CAPABILITIES: 純指令技能,不需要專屬 MCP tool。利用 LLM 推理能力 + 現有 tools (read_draft, search_local_references) 完成分析。
/academic-writing-harnessCross-agent workflow for evidence-grounded manuscripts, proposals, reports, student papers, and preprints with auditable gates./auto-paper全自動論文撰寫 + 閉環自我改進系統。
LOAD THIS SKILL WHEN: 全自動寫論文、auto write、自動撰寫、幫我寫完整篇、autopilot、從頭到尾、一鍵寫論文
CAPABILITIES: 編排所有研究 Skills + 3 層 Audit Hooks + Meta-Learning 自我改進
/concept-development發展研究概念並驗證創新性。觸發:concept、發展概念、研究概念、novelty、創新點、補充概念、幫我補充、擴展概念、加強、驗證失敗、novelty不夠、怎麼改。/concept-validation概念驗證:確保 concept.md 達到可寫作標準。
LOAD THIS SKILL WHEN: 驗證、validate、可以開始寫了嗎、novelty 夠嗎、check concept
CAPABILITIES: validate_concept, validate_concept_quick, validate_for_section
/draft-writing論文草稿的撰寫、讀取、引用管理。
LOAD THIS SKILL WHEN: 寫草稿、draft、撰寫、Introduction、Methods、Results、Discussion、引用、citation、字數、patch、編輯草稿
CAPABILITIES: draft_action(action="write"|"section"|"read"|"list"|"insert_citation"|"sync_references"|"count_words"|"available_citations"|"patch")
Other plugins' skills for the same job