跳到正文
cccskills
免费在 GitHub 公开

format-references-zotero

Turn PMID markers in a Markdown manuscript into a Word document with editable Zotero citation fields and a bibliography. The workflow retrieves PubMed metadata and can search for and install citation styles for Zotero.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Zotero reference formatting workflow. Converts [PMID: xxxx] markers in Markdown manuscripts to Word (.docx) with native Zotero field codes (ADDIN ZOTERO_ITEM / ADDIN ZOTERO_BIBL). Users click "Refresh" once in Word to complete formatting. Includes search_styles.py for searchin...

集成工具Word

实测评分 未实测

查看安装方法

适用场景

  • Convert a Markdown paper with PMID markers into a Zotero-ready Word document
  • Find and install a journal or citation style for Zotero
  • Change the citation style and refresh the document in Word

包含的文件(6)

  • SKILL.md7.4 KB
  • eval_report_format-references-zotero_result.json10.3 KB
  • POLISH_CHANGELOG.md701 B
  • scripts/check_env.py10.5 KB
  • scripts/process_references.py23.1 KB
  • scripts/search_styles.py7.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Source: https://github.com/aipoch/medical-research-skills

Medical Literature Reference Formatter — Zotero Edition

Converts [PMID: xxxx] markers directly to native Word Zotero field codes, maintaining full editability: users can switch citation styles in Zotero at any time and Refresh once in Word to update the entire document.

Workflow

Step 0 — Check Environment (first run or on error)

python "<skill_dir>/scripts/check_env.py"

Checks: Python, python-docx, Pandoc, PubMed API, Zotero installation and running status.

If it reports .ris not associated with Zotero, ask the user if they want to fix it. If they agree, run:

python "<skill_dir>/scripts/check_env.py" --fix-ris

Step 1 — Confirm Target File

Ask when user has not provided a full path. Desktop path: C:\Users\<username>\Desktop\<filename>.md

Step 2 — Confirm Citation Style

Default is nature. If the user specifies another style (e.g., Vancouver, Elsevier, APA), first confirm it is installed:

python "<skill_dir>/scripts/search_styles.py" <keyword>          # search available styles
python "<skill_dir>/scripts/search_styles.py" --install <style-id>  # download and install

Styles are automatically installed to Zotero's local styles directory (located via prefs.js, cross-platform).

Step 3 — Run Processing Script

python "<skill_dir>/scripts/process_references.py" "<absolute_path>" [--style <style-id>]

Default style is nature; you can specify any installed style ID:

python "<skill_dir>/scripts/process_references.py" "paper.md" --style elsevier-harvard
python "<skill_dir>/scripts/process_references.py" "paper.md" --style vancouver

Script completes: PMID extraction → PubMed metadata → generate .docx with Zotero fields (including ZOTERO_PREF) → generate .ris → auto-open.

Step 3.5 — Change Style / Force Refresh Cache

python "<skill_dir>/scripts/process_references.py" "paper.md" --style vancouver
python "<skill_dir>/scripts/process_references.py" "paper.md" --force-refresh   # clear cache, re-fetch from PubMed

Cache file <stem>_pubmed_cache.json is auto-generated in the same directory as the .md file, avoiding redundant PubMed fetches. After adding new PMIDs, just run normally — existing references use cache, only new ones are fetched.

Step 4 — Integrity Check

After fetching from PubMed, the script automatically checks: if any PMID fetch failed, it lists the specific IDs and suggests retrying with --force-refresh.

Step 5 — Common Issues

Pandoc not installed: https://pandoc.org/installing.html

python-docx not installed: pip install python-docx

PubMed inaccessible: Network issue, retry later.

Zotero not running: Open Zotero desktop app — Word Refresh requires it to format citations.

Style not installed: Run search_styles.py --install <style-id> to auto-download and install.

Step 6 — Inform User

Document generated, .ris imported into Zotero library. Click "Refresh" in the Zotero tab in Word to complete formatting. To change styles later, run change_style.py with the new style, then Refresh once to update the entire document.

Output Files

FileDescription
<stem>-zotero.docxWord document with Zotero field codes
<stem>.risReference data for Zotero library import (shared with EndNote edition)
<stem>_pubmed_cache.jsonPubMed metadata cache to avoid redundant fetches

Citation Style Management (search_styles.py)

This skill includes search_styles.py for searching and installing CSL citation styles — no need to leave the command line or manually download .csl files.

Search Available Styles

python "<skill_dir>/scripts/search_styles.py" <keyword>

Keywords can be journal names or style names, for example:

python "<skill_dir>/scripts/search_styles.py" science       # search Science-related styles
python "<skill_dir>/scripts/search_styles.py" nature        # search Nature-related styles
python "<skill_dir>/scripts/search_styles.py" vancouver     # search Vancouver numbered styles
python "<skill_dir>/scripts/search_styles.py" elsevier      # search Elsevier journal styles
python "<skill_dir>/scripts/search_styles.py" chinese       # search Chinese journal styles

Install Style to Zotero

Find the desired style ID from search results, then install:

python "<skill_dir>/scripts/search_styles.py" --install <style-id>

Examples:

python "<skill_dir>/scripts/search_styles.py" --install science         # Science journal
python "<skill_dir>/scripts/search_styles.py" --install vancouver-nlm   # Vancouver numbered
python "<skill_dir>/scripts/search_styles.py" --install nature          # Nature
python "<skill_dir>/scripts/search_styles.py" --install elsevier-harvard # Elsevier Harvard

Styles are automatically downloaded to Zotero's local styles directory (~Zotero/styles/). After restarting Zotero, they become available in Word.

Generate Word Document with Installed Style

After installing a style, specify the installed style ID via --style in Step 3's process_references.py:

python "<skill_dir>/scripts/process_references.py" "paper.md" --style science
python "<skill_dir>/scripts/process_references.py" "paper.md" --style vancouver-nlm

Supported Style Sources

The script searches from the Zotero official style repository (https://www.zotero.org/styles), covering 9000+ journal and institution CSL styles, including but not limited to:

  • Science / Nature / Cell / PNAS / JAMA / NEJM / Lancet / BMJ
  • APA / MLA / Chicago / Vancouver / Harvard
  • University thesis formats
  • Chinese journals (Chinese Science Bulletin, Science China, etc.)
  • Publisher-specific formats (Elsevier, Springer, Taylor & Francis, etc.)

Field Code Mechanism

The script replaces each [PMID: xxxx] with an ADDIN ZOTERO_ITEM CSL_CITATION field containing complete CSL JSON metadata, and inserts an ADDIN ZOTERO_BIBL field at the end. Zotero's Word plugin recognizes these fields and formats all citations and bibliography according to the current style on Refresh.

Process:

  1. Pandoc compiles Markdown to intermediate .docx (with ZRCITE{pmid} markers)
  2. python-docx opens .docx, replaces markers with Word field codes (w:fldChar / w:instrText)
  3. Injects ZOTERO_PREF field to ensure style persistence after Refresh

Requirements

  • Python 3.7+
  • python-docx — pip install python-docx
  • Pandoc — https://pandoc.org/installing.html
  • Zotero desktop + Word plugin (Zotero must be running during Refresh)
  • Network — access to PubMed API

Input Validation

This skill accepts requests that match the documented purpose of format-references-zotero and include enough context to complete the workflow safely.

Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:

format-references-zotero only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Condense an academic paper into a structured abstract of up to 250 words, organized by background, objective, methods, results, and conclusion. It aims to retain key quantitative findings and supports papers from several research fields; figures and charts are not interpreted.

中文简介正在准备中。当前显示英语简介。

  • Creating a concise abstract from a research paper
  • Summarizing empirical studies while retaining key statistics
  • Preparing structured summaries across multiple papers
aipoch/medical-research-skills19802026年9月17日 更新

Trim English academic abstracts to a target word count while preserving key findings, statistics, and the background-to-conclusion structure. Choose conservative, balanced, or aggressive compression, check word counts, and review the edited text for readability and accuracy.

中文简介正在准备中。当前显示英语简介。

  • Cutting an abstract to meet a journal word limit
  • Preparing a conference abstract with a strict word count
  • Checking an abstract's word count before submission
aipoch/medical-research-skills19802026年9月17日 更新

Refines long medical drafts, reports, or literature notes into formal, single-paragraph Chinese and English abstracts in an SCI journal style. It can place both abstracts in a Markdown report while keeping claims grounded in the source text.

中文简介正在准备中。当前显示英语简介。

  • Condensing a medical study report into bilingual abstracts
  • Preparing unstructured abstracts from literature notes
  • Creating a Markdown report with Chinese and English abstracts
aipoch/medical-research-skills19802026年9月17日 更新

Creates three to five concise English Highlights for journal submission from manuscript text or supported files. It adapts bullets to the article type, keeps each within 85 characters, and grounds every claim in the supplied source without inventing results.

中文简介正在准备中。当前显示英语简介。

  • Draft journal Highlights from an abstract or manuscript
  • Summarize a meta-analysis or review for submission
  • Extract key findings from a supported PDF or DOCX
aipoch/medical-research-skills19802026年9月17日 更新

Design comparative drug safety studies using FAERS, the FDA’s adverse event reporting database, within one defined safety area. The plan compares drugs or classes, lays out workload options and analysis steps, and distinguishes detected signals from conclusions the data cannot support.

中文简介正在准备中。当前显示英语简介。

  • Comparing drug classes within one adverse event area
  • Planning a FAERS study with active comparators
  • Adding declared subgroup or onset characterization
aipoch/medical-research-skills19802026年9月17日 更新

Predicts absorption, distribution, metabolism, and excretion properties for small molecules from their structures. Use the results to compare compounds, screen libraries, and review drug-likeness scores in structured outputs. Predictions support prioritization and need experimental validation.

中文简介正在准备中。当前显示英语简介。

  • Compare predicted ADME profiles for small-molecule candidates
  • Screen a compound library for drug-likeness
  • Rank candidates against target property ranges
aipoch/medical-research-skills19802026年9月17日 更新

查看 aipoch 的全部技能

报告此技能的问题