返回 Skill 列表
extension
分类: 开发与工程无需 API Key

academic-bibtex-manager

当用户请求将学术论文添加到BibTeX参考文献文件中,同时保持格式一致性和从适当的存储库中获取时。此技能处理以下几点:1)读取现有的BibTeX文件以理解格式约定;2)跨多个来源(如会议论文的OpenReview、预印本的arXiv)搜索学术论文;3)从会议页面或arXiv条目中提取正确的BibTeX元数据;4)根据出版场所确定合适的引用格式(@article与@inproceedings);5)在保留现有文件结构和格式的同时追加新条目。触发条件包括请求‘添加到ref.bib’、‘更新参考文献’、‘引用论文’,或者在处理学术参考文件时。

person作者: jakexiaohubgithub

Instructions

Primary Objective

Add requested academic paper entries to a specified BibTeX (.bib) file. Ensure entries are correctly formatted, sourced from authoritative repositories (OpenReview for conferences, arXiv for preprints), and consistent with the existing file's style.

Core Workflow

1. Parse User Request & Identify Target File

  • Extract the list of paper titles/identifiers from the user's request.
  • Identify the target .bib file path (commonly ref.bib or specified by the user).
  • First Action: Always read the existing file (filesystem-read_file) to understand its structure, formatting conventions (indentation, line breaks, entry ordering), and to avoid duplicate entries.

2. Research & Source BibTeX Data

For each requested paper:

  • Search Strategy: Use local-web_search with queries combining the paper title and key terms like "openreview" or "arxiv".
  • Source Determination:
    • Conference Papers: If the paper appears in search results from openreview.net, it is likely a peer-reviewed conference paper (e.g., ICLR, NeurIPS). Fetch the HTML page (fetch-fetch_html) to extract the official BibTeX entry from the page's metadata or BibTeX modal.
    • Preprints/Technical Reports: If the primary source is arxiv.org, it is an arXiv preprint. Fetch the page (fetch-fetch_markdown or fetch-fetch_html) to obtain authors, title, year, and arXiv ID.
  • Format Selection: Use @inproceedings{...} for confirmed conference papers. Use @article{...} for arXiv preprints, reports, or journal articles. Match the citation key style (e.g., authorYYYYkeyword) observed in the existing file.

3. Construct & Validate New Entries

  • Conference Entries: Use the exact BibTeX provided by OpenReview. Verify it includes booktitle, year, and url fields.
  • arXiv Entries: Construct an @article entry with fields: title, author, journal={arXiv preprint arXiv:XXXX.XXXXX}, year. Ensure author lists are formatted consistently (e.g., "Last, First and Last, First").
  • Check for Duplicates: Before writing, scan the newly read file content to ensure the paper (by title or likely citation key) isn't already present.

4. Write to File

  • Use filesystem-edit_file to append the new BibTeX entries to the end of the existing file.
  • Formatting: Insert a blank line before the new block of entries. Maintain the existing file's indentation style (spaces vs. tabs). Ensure each entry ends with a newline.
  • Order: Add entries in the order they were requested.

5. Final Verification & Summary

  • Read the tail of the updated file (filesystem-read_file with tail parameter) to confirm successful addition.
  • Provide the user with a concise summary listing each added paper, its citation key, source (arXiv/Conference), and the format used (@article/@inproceedings).

Key Decision Rules

  • arXiv vs. Conference: A paper listed on OpenReview with a conference title (e.g., "ICLR 2024") is a conference paper. A paper only found on arXiv or described as a "technical report" is an @article.
  • BibTeX Source Priority: 1) Official BibTeX from OpenReview page, 2) Constructed entry from arXiv metadata, 3) Fallback to manual construction from search results if needed.
  • File Safety: Never overwrite the entire file. Always use edit_file to append at a specific, safe location (e.g., before the end of the file).

Common Triggers & User Phrases

  • "Please help me add the following article to the ref.bib file..."
  • "Update the bibliography with these papers..."
  • "Cite these papers in the .bib file..."
  • "Add these references, keep the format consistent."

Error Handling

  • Missing Paper: If a paper cannot be found via search, inform the user and ask for clarification (e.g., a DOI, arXiv ID, or full author list).
  • File Not Found: If the target .bib file does not exist, ask the user for confirmation before creating a new one.
  • Parsing Error: If fetched HTML lacks clear BibTeX, proceed to construct a minimal, correct entry from available metadata and note the limitation to the user.