Skip to content

joshua-zyy/academic-paper-writer / skills/academic-citation

academic-citation

Verified

Search, verify, and map citations for CS/AI/ML papers. Produces VERIFIED/UNVERIFIED reference lists with Citation-to-Claim maps and Exemplar Sets. Use when: finding references for a paper section, verifying citation accuracy, building exemplar sets for introduction/related work learning, checking if existing citations are real and accurate, supplementing local literature library. Triggers on: 找引用, 文献检索, citation pass, find references, reference check, 补文献, citation verification, Exemplar Set, search papers, verify citation, 核验文献, 查引用, literature search, reference verification, citation verification with reading, 引用确认, 全文阅读验证.

scripts/convert-pdfs-to-md.py

View on GitHub
#!/usr/bin/env python3
"""PDF literature library to Markdown converter.

This skill entrypoint defaults to the MinerU precise parsing API. It delegates
to the bundled implementation in this skill package so the historical command
name remains stable for users of the open-source skill.

Usage:
  python .agents/skills/academic-paper-writer/skills/academic-citation/scripts/convert-pdfs-to-md.py researchPaper/refs researchPaper/refs_md --type ref
  python .agents/skills/academic-paper-writer/skills/academic-citation/scripts/convert-pdfs-to-md.py researchPaper/refs/paper.pdf researchPaper/refs_md --type ref

Environment:
  MINERU_API_TOKEN must be set. Do not hard-code the token in this file.
"""

from __future__ import annotations

import runpy
import sys
from pathlib import Path


def normalize_exit_code(code: object) -> int:
    if code is None:
        return 0
    if isinstance(code, int):
        return code
    print(code)
    return 1


def run_script(script_path: Path, argv: list[str]) -> int:
    old_argv = sys.argv
    sys.argv = [str(script_path), *argv]
    try:
        try:
            runpy.run_path(str(script_path), run_name="__main__")
        except SystemExit as exc:
            return normalize_exit_code(exc.code)
        return 0
    finally:
        sys.argv = old_argv


def find_project_root(start: Path) -> Path:
    for candidate in [start, *start.parents]:
        if (candidate / "scripts" / "convert_pdfs_to_md_mineru_api.py").is_file():
            return candidate
    raise FileNotFoundError(
        "未找到项目级 MinerU 转换脚本 scripts/convert_pdfs_to_md_mineru_api.py。"
    )


def main(argv: list[str] | None = None) -> int:
    argv = sys.argv[1:] if argv is None else argv
    script_path = Path(__file__).resolve()
    bundled_script = script_path.with_name("convert_pdfs_to_md_mineru_api.py")
    if bundled_script.is_file():
        return run_script(bundled_script, argv)

    try:
        project_root = find_project_root(script_path.parent)
    except FileNotFoundError as exc:
        print(f"错误: {exc}")
        return 2

    mineru_script = project_root / "scripts" / "convert_pdfs_to_md_mineru_api.py"
    return run_script(mineru_script, argv)


if __name__ == "__main__":
    raise SystemExit(main())
add-product-e2e-evalpaperclipai/paperclipAdd or extend a Paperclip full-stack runner E2E workflow, fixture, matcher, or report evidence path for local or Daytona execution.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
add-runner-evalpaperclipai/paperclipAdd or extend a Paperclip Runner protocol evaluation definition, roster, assertion, or report fixture with provenance and narrow validation.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
diagnose-why-work-stoppedpaperclipai/paperclipCompatibility entry point for failed, stalled, looping, or over-recovered Paperclip work. Use fix-failed-paperclip-run for the full diagnosis, regression, repair, real verification, and green-PR workflow; honor an explicitly requested diagnosis-only scope.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
fix-failed-paperclip-runpaperclipai/paperclipDiagnose and fix failed, stuck, slow, or incorrectly blocked Paperclip tasks and runs. Use with a task/run URL or failure report to trace the root cause, prove a regression red then green, check second-order effects, verify the real workflow, and deliver a PR with passing checks.Stars: 115kUpdated Claude CodeCodexVerifiedInstall