From dcda9265659f3513f52bdf1b3645a29c61616e49 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sun, 15 Feb 2026 17:49:57 +0000 Subject: [PATCH 1/7] Initial plan From 2b8748819189b8d375f53d2d82fe2d4d226206d0 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sun, 15 Feb 2026 17:52:32 +0000 Subject: [PATCH 2/7] Create Agent Skill for wenxian under skill/ directory Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com> --- skill/SKILL.md | 155 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 skill/SKILL.md diff --git a/skill/SKILL.md b/skill/SKILL.md new file mode 100644 index 0000000..c572041 --- /dev/null +++ b/skill/SKILL.md @@ -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 +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 +``` + +## 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 +``` + +### Using PMID (PubMed ID) + +```bash +uvx wenxian from PMID:12345678 +``` + +### 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 + ``` + +## 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) +- **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 +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 From f62dc0b6c89572b2b5a6a35aa7951f3224baacaf Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:04:41 +0000 Subject: [PATCH 3/7] Update SKILL.md: change license to LGPL-3.0, simplify examples, and conditional uv install Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com> --- skill/SKILL.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/skill/SKILL.md b/skill/SKILL.md index c572041..5b8fca7 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -1,7 +1,7 @@ --- 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 +license: LGPL-3.0 compatibility: Requires Python 3.10+, uv package manager recommended metadata: author: njzjz @@ -25,7 +25,9 @@ Wenxian is a tool that generates BibTeX entries from various academic paper iden ## Installation and Prerequisites -Wenxian requires Python 3.10+. It's recommended to use `uv` package manager: +Wenxian requires Python 3.10+. It's recommended to use `uv` package manager. + +If `uv` is not already installed, install it with: ```bash pip install uv @@ -45,16 +47,10 @@ uvx wenxian from 10.1063/5.0155600 uvx wenxian from 1512.03385 ``` -or with the arXiv prefix: - -```bash -uvx wenxian from arXiv:1512.03385 -``` - ### Using PMID (PubMed ID) ```bash -uvx wenxian from PMID:12345678 +uvx wenxian from 12345678 ``` ### Using paper title @@ -117,8 +113,8 @@ The command will print a BibTeX entry to standard output. For example: ## 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) +- **arXiv ID**: arXiv preprint identifier (e.g., 1512.03385) +- **PMID**: PubMed identifier (e.g., 12345678) - **Paper title**: Full or partial paper title as a string (e.g., "Attention is all you need") ## Integration examples @@ -142,7 +138,7 @@ 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 +uvx wenxian from "1512.03385" >> references.bib uvx wenxian from "Attention is all you need" >> references.bib ``` From c0481b70d8bfc454e21f9ba63c80b3b0f668bfb6 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:41:21 +0000 Subject: [PATCH 4/7] Document -t text option for plain text citations in README and SKILL Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com> --- README.md | 20 +++++++++++++++++++ skill/SKILL.md | 52 +++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f270a5e..33257bc 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,26 @@ uvx wenxian from "Attention is all you need" It is expected to see a ${\mathrm{B{\scriptstyle{IB}} T_{\displaystyle E} X}}$ entry printed into the standard output. +#### Output formats + +By default, `wenxian` outputs BibTeX format. You can use the `-t` or `--type` option to generate different output formats: + +- **BibTeX format** (default): + ```sh + uvx wenxian from 1512.03385 + ``` + +- **Plain text format**: + ```sh + uvx wenxian from 1512.03385 -t text + ``` + Example output: `Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun, Deep Residual Learning for Image Recognition, arXiv, 2015, 1512.03385.` + +- **Markdown format**: + ```sh + uvx wenxian from 1512.03385 -t markdown + ``` + ### Use wenxian in a GitHub Actions workflow You can use `wenxian` in a GitHub Actions workflow, as a bridge between the input identifiers and the output ${\mathrm{B{\scriptstyle{IB}} T_{\displaystyle E} X}}$ entries: diff --git a/skill/SKILL.md b/skill/SKILL.md index 5b8fca7..4980e57 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -1,6 +1,6 @@ --- 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. +description: Generate citations from academic paper identifiers (DOI, PMID, arXiv ID, or paper titles) in various formats including BibTeX, plain text, and Markdown. Use this skill when users need to create citations, bibliography entries, or convert paper identifiers to different citation formats. license: LGPL-3.0 compatibility: Requires Python 3.10+, uv package manager recommended metadata: @@ -9,19 +9,20 @@ metadata: repository: https://github.com/njzjz/wenxian --- -# Wenxian - BibTeX Entry Generator +# Wenxian - Citation Generator ## When to use this skill Use this skill when: -- Users need to generate BibTeX entries for academic papers +- Users need to generate citations or bibliography 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 are working on LaTeX documents and need BibTeX entries +- Users need plain text or Markdown formatted citations - 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. +Wenxian is a tool that generates citations from various academic paper identifiers in multiple formats (BibTeX, plain text, Markdown). The name "wenxian" (文献) means "literature" or "references" in Chinese. ## Installation and Prerequisites @@ -63,9 +64,35 @@ uvx wenxian from "Attention is all you need" Note: Enclose paper titles in quotes if they contain spaces. +### Output formats + +By default, wenxian generates BibTeX format. You can specify different output formats using the `-t` or `--type` option: + +#### BibTeX format (default) + +```bash +uvx wenxian from 1512.03385 +``` + +#### Plain text format + +Generate a plain text citation instead of BibTeX: + +```bash +uvx wenxian from 1512.03385 -t text +``` + +Example output: `Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun, Deep Residual Learning for Image Recognition, arXiv, 2015, 1512.03385.` + +#### Markdown format + +```bash +uvx wenxian from 1512.03385 -t markdown +``` + ## Expected output -The command will print a BibTeX entry to standard output. For example: +By default, the command will print a BibTeX entry to standard output. For example: ```bibtex @article{vaswani2017attention, @@ -117,6 +144,12 @@ The command will print a BibTeX entry to standard output. For example: - **PMID**: PubMed identifier (e.g., 12345678) - **Paper title**: Full or partial paper title as a string (e.g., "Attention is all you need") +## Supported output formats + +- **BibTeX** (default): For LaTeX documents and reference managers +- **Plain text**: Human-readable citation format +- **Markdown**: For Markdown documents and wikis + ## Integration examples ### In a workflow @@ -146,6 +179,7 @@ uvx wenxian from "Attention is all you need" >> references.bib 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 +3. **Choose appropriate format**: Use `-t text` for plain citations, `-t markdown` for Markdown documents, or default BibTeX for LaTeX +4. **Verify output**: Check the generated citation for completeness +5. **Use uv**: The `uvx` command ensures you're always using the latest version without manual installation +6. **Handle errors gracefully**: If wenxian fails, ask the user to verify the identifier or try an alternative identifier type From 8aa8807169e24ef1a23c353be2b75370856bf763 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:50:25 +0000 Subject: [PATCH 5/7] Add alternative uv installation method using curl for systems without pip Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com> --- skill/SKILL.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/skill/SKILL.md b/skill/SKILL.md index 4980e57..bdc6662 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -34,6 +34,12 @@ If `uv` is not already installed, install it with: pip install uv ``` +Or, if pip is not available: + +```bash +curl -LsSf https://astral.sh/uv/install.sh | sh +``` + ## How to generate BibTeX entries ### Using DOI (Digital Object Identifier) From ddc6041eb8be3422d4e45136d3c792fec46ac5d8 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 16 Feb 2026 03:40:54 +0800 Subject: [PATCH 6/7] update README Updated output formats section to clarify default format and options. --- README.md | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 33257bc..3d147ee 100644 --- a/README.md +++ b/README.md @@ -38,25 +38,18 @@ uvx wenxian from "Attention is all you need" It is expected to see a ${\mathrm{B{\scriptstyle{IB}} T_{\displaystyle E} X}}$ entry printed into the standard output. -#### Output formats +By default, `wenxian` outputs ${\mathrm{B{\scriptstyle{IB}} T_{\displaystyle E} X}}$ format. You can use the `-t text` or `--type text` option to generate plain text format. -By default, `wenxian` outputs BibTeX format. You can use the `-t` or `--type` option to generate different output formats: +### The Agent Skill (used in OpenClaw or IDEs) -- **BibTeX format** (default): - ```sh - uvx wenxian from 1512.03385 - ``` +`wenxian` provides an [Agent Skill](https://agentskills.io/) in the [`skill`](./skill/) directory, which has been supported by +[OpenClaw](https://docs.openclaw.ai/tools/skills), +[Claude](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview), +[Codex](https://developers.openai.com/codex/skills/), +and [VS Code](https://code.visualstudio.com/docs/copilot/customization/agent-skills). -- **Plain text format**: - ```sh - uvx wenxian from 1512.03385 -t text - ``` - Example output: `Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun, Deep Residual Learning for Image Recognition, arXiv, 2015, 1512.03385.` - -- **Markdown format**: - ```sh - uvx wenxian from 1512.03385 -t markdown - ``` +For example, you can ask your OpenClaw bot to `install the skill https://github.com/njzjz/wenxian/tree/master/skill`. +After that is done, you can ask the bot to generate the references by sending the bot paper titles or DOIs. ### Use wenxian in a GitHub Actions workflow From f3a0863a5f6085e0535b83c77c299e1c6958ed42 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 15 Feb 2026 19:41:03 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- skill/SKILL.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/skill/SKILL.md b/skill/SKILL.md index bdc6662..5b12b1e 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -14,6 +14,7 @@ metadata: ## When to use this skill Use this skill when: + - Users need to generate citations or bibliography entries for academic papers - Users have DOI, PMID, arXiv ID, or paper titles and need citations - Users are working on LaTeX documents and need BibTeX entries @@ -113,11 +114,13 @@ By default, the command will print a BibTeX entry to standard output. For exampl ## 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" @@ -163,6 +166,7 @@ By default, the command will print a BibTeX entry to standard output. For exampl 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 ```