Skip to content

kgraph57/paper-writer-skill

paper-writer

Verified

Medical/scientific paper writing workflow skill. Manages the full pipeline from literature search to submission-ready manuscript. Creates and manages a project directory with IMRAD-format section files, literature matrix, reference management, and quality checklists. Supports both English and Japanese papers. Triggers: 'write paper', 'paper-write', 'start manuscript', '論文を書く', '論文執筆', '論文プロジェクト', 'manuscript', 'research paper', '原稿作成'.

FileKindSize
SKILL.mdskill md77.7 KB
examples/case-studies/discovery-to-draft.mdmarkdown5.3 KB
references/abstract-formats.mdmarkdown5.1 KB
references/adversarial-review.mdmarkdown21.6 KB
references/ai-disclosure.mdmarkdown6.4 KB
references/ai-for-science-model.mdmarkdown12.8 KB
references/citation-guide.mdmarkdown2.4 KB
references/citation-verification.mdmarkdown10.5 KB
references/clinical-trial-registration.mdmarkdown4.7 KB
references/coauthor-review.mdmarkdown14.2 KB
references/coi-detailed.mdmarkdown6.8 KB
references/desk-rejection-prevention.mdmarkdown6.1 KB
references/hook-compatibility.mdmarkdown6.1 KB
references/humanizer-academic.mdmarkdown12.0 KB
references/imrad-guide.mdmarkdown2.5 KB
references/journal-reformatting.mdmarkdown5.6 KB
references/journal-selection.mdmarkdown13.5 KB
references/keywords-guide.mdmarkdown4.6 KB
references/master-reference-list.mdmarkdown11.3 KB
references/multilingual-guide.mdmarkdown12.4 KB
references/novelty-check.mdmarkdown13.8 KB
references/open-access-guide.mdmarkdown4.6 KB
references/pubmed-query-builder.mdmarkdown16.7 KB
references/reporting-guidelines-full.mdmarkdown10.6 KB
references/reporting-guidelines.mdmarkdown3.2 KB
references/section-checklist.mdmarkdown4.5 KB
references/statistical-reporting-full.mdmarkdown8.6 KB
references/statistical-reporting.mdmarkdown22.5 KB
references/submission-portals.mdmarkdown4.1 KB
references/supplementary-materials.mdmarkdown3.9 KB
references/tables-figures-guide.mdmarkdown7.7 KB
references/word-count-limits.mdmarkdown4.6 KB
scripts/analysis-template.pyexecutablescript19.6 KB
scripts/compile-manuscript.shexecutablescript6.9 KB
scripts/forest-plot.pyexecutablescript16.9 KB
scripts/sr-dedup.pyexecutablescript12.5 KB
scripts/sr-pdf-link.pyexecutablescript6.8 KB
scripts/sr-prisma-count.pyexecutablescript8.7 KB
scripts/table1.pyexecutablescript9.7 KB
scripts/word-count.shexecutablescript12.8 KB
templates/abstract.mdmarkdown1.3 KB
templates/acknowledgments.mdmarkdown1.7 KB
templates/analysis-workflow.mdmarkdown5.1 KB
templates/case-abstract.mdmarkdown1.2 KB
templates/case-introduction.mdmarkdown1.7 KB
templates/case-report.mdmarkdown2.2 KB
templates/conclusion.mdmarkdown1.0 KB
templates/cover-letter.mdmarkdown1.3 KB
templates/data-management.mdmarkdown5.7 KB
templates/declarations.mdmarkdown6.1 KB
templates/discussion.mdmarkdown1.8 KB
templates/graphical-abstract.mdmarkdown2.7 KB
templates/highlights.mdmarkdown3.8 KB
templates/human-loop-ledger.mdmarkdown9.4 KB
templates/introduction.mdmarkdown1.8 KB
templates/limitations-guide.mdmarkdown6.2 KB
templates/literature-matrix.mdmarkdown1.2 KB
templates/methods.mdmarkdown1.9 KB
templates/preregistration.mdmarkdown19.5 KB
templates/project-init-case.mdmarkdown3.2 KB
templates/project-init.mdmarkdown3.6 KB
templates/proof-correction.mdmarkdown2.5 KB
templates/research-question.mdmarkdown18.6 KB
templates/response-to-reviewers.mdmarkdown12.5 KB
templates/results.mdmarkdown1.5 KB
templates/review-article.mdmarkdown11.6 KB
templates/revision-cover-letter.mdmarkdown10.3 KB
templates/sr-data-extraction.mdmarkdown9.2 KB
templates/sr-grade.mdmarkdown14.7 KB
templates/sr-outline.mdmarkdown13.5 KB
templates/sr-prisma-flow.mdmarkdown12.9 KB
templates/sr-prospero.mdmarkdown15.9 KB
templates/sr-rob.mdmarkdown18.3 KB
templates/sr-screening-pipeline.mdmarkdown12.1 KB
templates/study-design.mdmarkdown28.5 KB
templates/submission-ready.mdmarkdown2.5 KB
templates/title-page.mdmarkdown3.5 KB

scripts/sr-pdf-link.py

View on GitHub
#!/usr/bin/env python3
"""
SR PDF Linker — links full-text PDFs to screening records and renames them.

For full-text screening you need each PDF tied to its bibliographic record.
Filenames from publishers are useless ("nihms-1234.pdf", "1-s2.0-....pdf").
This script reads the DOI out of each PDF, joins it to the records CSV by DOI,
and (optionally) renames matched PDFs to a canonical, sortable name. It NEVER
deletes or overwrites originals — renames are copies into a `renamed/` subfolder.

It also reports the two gaps that feed the PRISMA diagram:
  - include-records with NO matching PDF  → "reports not retrieved"
  - PDFs that match NO record             → check manually (wrong file? not searched?)

Usage:
    python sr-pdf-link.py --pdfs full-texts/ --records 02_title_abstract_screen.csv
    python sr-pdf-link.py --pdfs full-texts/ --records 02_title_abstract_screen.csv \
        --include-only --rename

DOI extraction is robust (DOIs are unique + machine-readable); title guessing
from PDFs is not, so this script joins on DOI only. Records without a DOI must
be linked manually.
"""

import argparse
import csv
import os
import re
import shutil
import sys

csv.field_size_limit(10_000_000)

DOI_RE = re.compile(r"10\.\d{4,9}/[^\s\"'<>\])}]+", re.IGNORECASE)


def norm_doi(doi):
    if not doi:
        return ""
    d = doi.strip().lower().rstrip(".,;)")
    d = re.sub(r"^https?://(dx\.)?doi\.org/", "", d)
    d = re.sub(r"^doi:\s*", "", d)
    return d


def extract_text_first_pages(path, pages=2):
    """Try pypdf, then pdfplumber. Return concatenated text of first N pages."""
    try:
        from pypdf import PdfReader
        reader = PdfReader(path)
        txt = []
        for p in reader.pages[:pages]:
            txt.append(p.extract_text() or "")
        if any(t.strip() for t in txt):
            return "\n".join(txt)
    except Exception:
        pass
    try:
        import pdfplumber
        with pdfplumber.open(path) as pdf:
            return "\n".join((pg.extract_text() or "")
                             for pg in pdf.pages[:pages])
    except Exception as e:
        print(f"  ! Could not read {os.path.basename(path)}: {e}", file=sys.stderr)
        return ""


def doi_from_pdf(path):
    text = extract_text_first_pages(path)
    m = DOI_RE.search(text or "")
    return norm_doi(m.group(0)) if m else ""


def first_author_surname(authors):
    if not authors:
        return "NA"
    first = re.split(r"[;]", authors)[0].strip()
    if "," in first:
        surname = first.split(",")[0]
    else:
        parts = first.split()
        surname = parts[0] if parts else "NA"
    surname = re.sub(r"[^A-Za-z]", "", surname)
    return surname or "NA"


def slug(s):
    return re.sub(r"[^A-Za-z0-9]+", "-", (s or "")).strip("-")


def main():
    ap = argparse.ArgumentParser(description="Link full-text PDFs to records by DOI")
    ap.add_argument("--pdfs", required=True, help="Folder of PDFs")
    ap.add_argument("--records", required=True, help="Records CSV (01 or 02 stage)")
    ap.add_argument("--include-only", action="store_true",
                    help="Only expect PDFs for records with consensus_decision=include")
    ap.add_argument("--rename", action="store_true",
                    help="Copy matched PDFs to <pdfs>/renamed/ with canonical names")
    ap.add_argument("--output", help="Link map CSV (default: <pdfs>/pdf-link-map.csv)")
    args = ap.parse_args()

    if not os.path.isdir(args.pdfs):
        sys.exit(f"PDF folder not found: {args.pdfs}")
    if not os.path.isfile(args.records):
        sys.exit(f"Records CSV not found: {args.records}")

    with open(args.records, newline="", encoding="utf-8-sig", errors="replace") as f:
        records = list(csv.DictReader(f))

    def is_target(r):
        if r.get("dup_of"):
            return False
        if args.include_only:
            return (r.get("consensus_decision") or "").strip().lower().startswith("inc")
        return True

    targets = [r for r in records if is_target(r)]
    by_doi = {norm_doi(r.get("doi")): r for r in targets if norm_doi(r.get("doi"))}

    pdfs = [os.path.join(args.pdfs, n) for n in sorted(os.listdir(args.pdfs))
            if n.lower().endswith(".pdf") and os.path.isfile(os.path.join(args.pdfs, n))]

    rename_dir = os.path.join(args.pdfs, "renamed")
    if args.rename:
        os.makedirs(rename_dir, exist_ok=True)

    link_rows = []
    matched_record_ids = set()
    unmatched_pdfs = []

    for path in pdfs:
        base = os.path.basename(path)
        doi = doi_from_pdf(path)
        rec = by_doi.get(doi) if doi else None
        if rec:
            rid = rec.get("record_id", "")
            matched_record_ids.add(rid)
            new_name = ""
            if args.rename:
                tag = rec.get("pmid") or slug(doi) or rid
                new_name = f"{first_author_surname(rec.get('authors'))}_{rec.get('year','')}_{tag}.pdf"
                shutil.copy2(path, os.path.join(rename_dir, new_name))
            link_rows.append({"record_id": rid, "doi": doi, "title": rec.get("title", ""),
                              "pdf_file": base, "renamed_to": new_name, "status": "matched"})
            print(f"  matched  {base}  ->  {rid}" +
                  (f"  ({new_name})" if new_name else ""))
        else:
            unmatched_pdfs.append(base)
            link_rows.append({"record_id": "", "doi": doi, "title": "",
                              "pdf_file": base, "renamed_to": "",
                              "status": "no_doi" if not doi else "doi_not_in_records"})
            print(f"  UNMATCHED {base}  (doi={doi or 'none found'})")

    not_retrieved = [r for r in targets if r.get("record_id") not in matched_record_ids]

    out = args.output or os.path.join(args.pdfs, "pdf-link-map.csv")
    with open(out, "w", newline="", encoding="utf-8") as f:
        w = csv.DictWriter(f, fieldnames=["record_id", "doi", "title",
                                          "pdf_file", "renamed_to", "status"])
        w.writeheader()
        w.writerows(link_rows)
        for r in not_retrieved:
            w.writerow({"record_id": r.get("record_id", ""),
                        "doi": norm_doi(r.get("doi")), "title": r.get("title", ""),
                        "pdf_file": "", "renamed_to": "", "status": "not_retrieved"})

    print("\n=== PDF link summary ===")
    print(f"  PDFs in folder:            {len(pdfs)}")
    print(f"  Matched to records:        {len(matched_record_ids)}")
    print(f"  PDFs matching no record:   {len(unmatched_pdfs)}")
    print(f"  Records with no PDF:       {len(not_retrieved)}  "
          f"(\"reports not retrieved\" = {len(not_retrieved)})")
    print(f"\nWrote link map: {out}")
    if args.rename:
        print(f"Renamed copies in: {rename_dir}")
    if unmatched_pdfs:
        print("\nUnmatched PDFs need a manual DOI check:")
        for n in unmatched_pdfs:
            print(f"  - {n}")


if __name__ == "__main__":
    main()
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall