Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
---
name: wenxian
description: Generate BibTeX entries from academic paper identifiers including DOI, PMID, arXiv ID, or paper titles. Use this skill when users need to create citations, bibliography entries, or convert paper identifiers to BibTeX format for LaTeX documents.
license: LGPL-2.1
Comment thread
njzjz marked this conversation as resolved.
Outdated
compatibility: Requires Python 3.10+, uv package manager recommended
metadata:
author: njzjz
version: "1.0"
repository: https://github.com/njzjz/wenxian
---

# Wenxian - BibTeX Entry Generator

## When to use this skill

Use this skill when:
- Users need to generate BibTeX entries for academic papers
- Users have DOI, PMID, arXiv ID, or paper titles and need citations
- Users are working on LaTeX documents and need bibliography entries
- Users mention citations, references, BibTeX, or academic papers

## Overview

Wenxian is a tool that generates BibTeX entries from various academic paper identifiers. The name "wenxian" (文献) means "literature" or "references" in Chinese.

## Installation and Prerequisites

Wenxian requires Python 3.10+. It's recommended to use `uv` package manager:

```bash
pip install uv
Comment thread
njzjz marked this conversation as resolved.
```
Comment thread
njzjz marked this conversation as resolved.

## How to generate BibTeX entries

### Using DOI (Digital Object Identifier)

```bash
uvx wenxian from 10.1063/5.0155600
```

### Using arXiv ID

```bash
uvx wenxian from 1512.03385
```

or with the arXiv prefix:

```bash
uvx wenxian from arXiv:1512.03385
Comment thread
njzjz marked this conversation as resolved.
Outdated
```

### Using PMID (PubMed ID)

```bash
uvx wenxian from PMID:12345678
Comment thread
njzjz marked this conversation as resolved.
Outdated
```

### Using paper title

When the identifier is a text string, wenxian searches by paper title:

```bash
uvx wenxian from "Attention is all you need"
```

Note: Enclose paper titles in quotes if they contain spaces.

## Expected output

The command will print a BibTeX entry to standard output. For example:

```bibtex
@article{vaswani2017attention,
title={Attention is all you need},
author={Vaswani, Ashish and Shazeer, Noam and ...},
journal={Advances in neural information processing systems},
volume={30},
year={2017}
}
```

## Common use cases

1. **Single citation**: Generate a BibTeX entry for one paper
```bash
uvx wenxian from "10.1038/nature12373"
```

2. **Multiple citations**: Generate entries for multiple papers by running the command multiple times
```bash
uvx wenxian from "10.1038/nature12373"
uvx wenxian from "10.1126/science.1158899"
```

3. **Save to file**: Redirect output to a .bib file
```bash
uvx wenxian from "10.1038/nature12373" >> references.bib

Copilot AI Feb 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent quoting of DOI identifier. Line 131 uses quotes around the DOI "10.1038/nature12373", but the "Using DOI" example at line 49 shows DOI identifiers without quotes. For consistency with line 49 and the guidance at line 72 (quotes are for titles with spaces), consider removing quotes from this DOI identifier.

Suggested change
uvx wenxian from "10.1038/nature12373" >> references.bib
uvx wenxian from 10.1038/nature12373 >> references.bib

Copilot uses AI. Check for mistakes.
Comment on lines +119 to +131

Copilot AI Feb 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent quoting of DOI identifiers. Lines 119, 125, 126, 131, and 183 use quotes around DOI identifiers (e.g., "10.1038/nature12373"), but lines 49 and 171 show DOI identifiers without quotes. According to line 72, quotes are only required for paper titles with spaces. For consistency with the "Using DOI" example at line 49 and the guidance at line 72, consider removing quotes from DOI identifiers in these examples, or add a note explaining when quotes are needed.

Suggested change
uvx wenxian from "10.1038/nature12373"
```
2. **Multiple citations**: Generate entries for multiple papers by running the command multiple times
```bash
uvx wenxian from "10.1038/nature12373"
uvx wenxian from "10.1126/science.1158899"
```
3. **Save to file**: Redirect output to a .bib file
```bash
uvx wenxian from "10.1038/nature12373" >> references.bib
uvx wenxian from 10.1038/nature12373
  1. Multiple citations: Generate entries for multiple papers by running the command multiple times

    uvx wenxian from 10.1038/nature12373
    uvx wenxian from 10.1126/science.1158899
  2. Save to file: Redirect output to a .bib file

    uvx wenxian from 10.1038/nature12373 >> references.bib

Copilot uses AI. Check for mistakes.
```

## Edge cases and troubleshooting

1. **Invalid identifier**: If the identifier is not recognized, wenxian will return an error. Verify the identifier format.

2. **Network issues**: Wenxian queries external APIs. Network connectivity is required.

3. **Paper title not found**: If searching by title doesn't return results, try:
- Using a more complete or exact title
- Using the DOI or arXiv ID instead
- Checking for typos in the title

4. **Multiple results for title search**: Wenxian will return the best match. If unsure, use a specific identifier like DOI.

5. **Special characters in titles**: Always use quotes around paper titles, especially if they contain spaces or special characters.

## Supported identifier types

- **DOI**: Digital Object Identifier (e.g., 10.1063/5.0155600)
- **arXiv ID**: arXiv preprint identifier (e.g., 1512.03385 or arXiv:1512.03385)
- **PMID**: PubMed identifier (e.g., PMID:12345678)
Comment thread
njzjz marked this conversation as resolved.
Outdated
- **Paper title**: Full or partial paper title as a string (e.g., "Attention is all you need")

## Integration examples

### In a workflow

When a user asks to "add a citation for DOI 10.1234/example", you should:

1. Run wenxian to generate the BibTeX entry:
```bash
uvx wenxian from 10.1234/example
```

2. Display or save the output to their bibliography file

3. Confirm the citation has been added

### Batch processing

For multiple citations, run wenxian for each identifier and append results:

```bash
uvx wenxian from "10.1038/nature12373" >> references.bib
uvx wenxian from "arXiv:1512.03385" >> references.bib
Comment thread
njzjz marked this conversation as resolved.
Outdated
uvx wenxian from "Attention is all you need" >> references.bib
```

## Best practices

1. **Prefer specific identifiers**: DOI and arXiv IDs are more reliable than title searches
2. **Quote titles**: Always enclose paper titles in quotes
3. **Verify output**: Check the generated BibTeX entry for completeness
4. **Use uv**: The `uvx` command ensures you're always using the latest version without manual installation
5. **Handle errors gracefully**: If wenxian fails, ask the user to verify the identifier or try an alternative identifier type