paper-archive
Paper Archive
Use this skill to archive academic papers from ~/Downloads into a structured iCloud directory with auto-generated Obsidian reading notes.
Load References When Needed
- Read
references/categories.mdbefore classifying a paper. - Read
references/obsidian-note-template.mdbefore creating the Obsidian note.
Configuration
| Variable | Default | Description |
|---|---|---|
PAPER_ARCHIVE_DIR |
~/Library/Mobile Documents/com~apple~CloudDocs/Documents/books/技术类/papers |
PDF archive root |
OBSIDIAN_VAULT |
(defined in .profile.darwin) |
Obsidian Vault root |
Workflow
Execute these 6 steps in order. Use AskUserQuestion for user decisions — never skip confirmations.
Step 1: Scan Downloads
ls ~/Downloads/*.pdf
List all PDF files in ~/Downloads. Show the list to the user.
Step 2: User Selects PDF
Use AskUserQuestion to let the user pick which PDF(s) to archive. Process one PDF at a time through steps 3–6, then loop back for the next.
Step 3: Read PDF & Extract Metadata
Use the Read tool to read the first 5–10 pages of the selected PDF. Extract:
- title: full paper title
- authors: list of authors
- year: publication year
- venue: conference/journal name (e.g., NeurIPS 2024, Nature)
- abstract: full abstract text
- keywords: topic keywords
If metadata is ambiguous, infer from content. If the PDF is unreadable or not a paper, inform the user and skip.
Step 4: AI Classify + User Confirm
- Read
references/categories.mdto load the classification scheme. - Based on extracted metadata, assign the best-fit category.
- Generate the target filename using the naming convention:
- Format:
{FirstAuthorLastName}{Year}_{Title_Words}.pdf - Title words: capitalize each word, join with
_, drop articles/prepositions, max ~6 words - Examples:
Vaswani2017_Attention_Is_All_You_Need.pdf,Brown2020_Language_Models_Few_Shot_Learners.pdf
- Format:
- Present to the user for confirmation:
- Title, authors, year, venue
- Proposed category
- Proposed filename
- Target path:
$PAPER_ARCHIVE_DIR/{category}/{filename}
- Let the user modify category or filename before proceeding.
Step 5: Move + Rename
mkdir -p "$PAPER_ARCHIVE_DIR/{category}"
mv ~/Downloads/{original}.pdf "$PAPER_ARCHIVE_DIR/{category}/{new_filename}.pdf"
Verify the move succeeded. If $PAPER_ARCHIVE_DIR is not set, fall back to the default path.
Step 6: Create Obsidian Note
- Read
references/obsidian-note-template.mdto load the template. - Fill in all frontmatter fields and the Abstract section from extracted metadata.
- Leave other sections (Key Contributions, Methodology, etc.) empty for the user to fill during reading.
- Write the note to:
$OBSIDIAN_VAULT/Reading/papers/{Title}.md- Create the
papers/directory if it doesn't exist:mkdir -p "$OBSIDIAN_VAULT/Reading/papers" - Title in the filename should match the paper title (spaces allowed, Obsidian handles them).
- Create the
- Confirm creation to the user.
After step 6, if there are more PDFs selected in step 2, loop back to step 3 for the next PDF.
Execution Rules
- 所有用户可见的输出使用中文,包括确认提示、状态信息、错误消息等。
- Always confirm category and filename with the user before moving files.
- Never overwrite an existing file — if the target path exists, ask the user.
- Use
$PAPER_ARCHIVE_DIRif set; otherwise use the default iCloud path. - Use
$OBSIDIAN_VAULTfor the vault path — it must be set. - Quote all file paths (iCloud paths contain spaces and CJK characters).
- The
pdf_pathin the Obsidian note should be the final archived path.