Install
openclaw skills install @67available/pdf-renameRename academic PDF papers to a standardized format "[Year] [Venue] Title.pdf" using a three-stage pipeline (Extract → Verify → Rename). Use when the user asks to organize, batch-rename, or metadata-enrich PDF files in a folder. Activates on keywords like "rename PDFs", "organize papers", "batch rename PDFs", "rename papers by metadata", "pdf重命名", "文献整理".
openclaw skills install @67available/pdf-renameRename academic PDFs to: [Year] [Venue] Title.pdf
Three-stage pipeline:
Extract → Verify → Rename
Anti-error principle: Never re-parse PDF content during Rename. The Manifest is the single source of truth.
# Stage 1: Extract raw text → manifest.json
python scripts/extract.py "<folder_path>"
# Stage 2: LLM parses raw_text → inject verified data → manifest_verified.json
# (Agent reads manifest.json raw_text field and writes to scripts/VERIFIED_DATA_*.py)
python scripts/apply_verified.py "<folder_path>"
# Stage 3: Preview / Execute
python scripts/execute.py "<folder_path>" --preview
python scripts/execute.py "<folder_path>" --execute
What it does:
manifest.json → raw_text fieldyear_hint from filename prefixManifest schema — see references/manifest_spec.md
The agent reads manifest.json, parses each raw_text field, and writes verified metadata.
Steps:
manifest.jsonraw_text to extract: title, authors, venue, year, abstractscripts/VERIFIED_DATA_*.py with verified entriesVERIFIED_DATA format:
VERIFIED_DATA = {
"OriginalFilename.pdf": {
"title": "Correct Paper Title",
"year": "2024",
"venue": "NeurIPS",
"confirmed": True # must be True to be renamed
},
}
Rules:
confirmed: True → status becomes ready → will be renamedconfirmed: False or omitted → skippedVERIFIED_DATA_*.py files are auto-merged⚠️ Key gotchas during parsing:
"Direct score maximization outperformsplanning loss") — use context to infer correct split"Math. Program. (2012) 133..." is NOT the title — read furtherconfirmed: False and skipThen run:
python scripts/apply_verified.py "<folder_path>"
status == 'ready' files are renamed(1), (2) suffixes<folder>/_backup_YYYYMMDD_HHMMSS/python scripts/execute.py "<folder_path>" --preview # dry run
python scripts/execute.py "<folder_path>" --execute # rename
| Script | Purpose |
|---|---|
scripts/extract.py | Stage 1: extract raw PDF text → manifest.json |
scripts/apply_verified.py | Stage 2: inject verified metadata → manifest_verified.json |
scripts/execute.py | Stage 3: rename files (preview or execute) |
scripts/llm_parse.py | (Optional) programmatic LLM parsing via gateway API |
| Symptom | Cause | Fix |
|---|---|---|
raw_text empty | PDF is a scan | Skip (confirmed: False) or manually determine metadata |
| Title extracted without spaces | pypdf concatenates lines | LLM infers from context; use filename as hint |
| Wrong year (arXiv ≠ conference) | Used filename year | Use venue year from raw_text, not filename |
| DOI/journal ref at top of page | Metadata precedes title | Read past it — title is usually after |
| Middle-dot author lines misidentified | · separator in names | LLM handles via semantic understanding |
| Non-paper files renamed | No filter applied | Set confirmed: False for non-papers |
| Windows filename encoding garbled | Chinese/non-ASCII chars in PowerShell | Use Python scripts, not manual file ops |
| Ligature artifacts | PDF encoding (e.g., fi → fi) | clean_title_text() in extract.py handles these |
references/manifest_spec.md — Full manifest JSON schemareferences/venue_abbrev.md — Standard venue abbreviation map