Focus pdf-to-bibtex skill on paper metadata and fix jabkit convert stdout output - #16292
Conversation
…dout output
The pdf-to-bibtex skill mixed two different tasks: getting a BibTeX entry
describing a PDF paper (pdfMerged and friends) and extracting the entries a
paper cites (pdfBibiliography). The latter is not a registered import format
("Unknown import format: pdfBibiliography"), so its table row is removed and
the skill is scoped to the paper's own metadata.
The separate doi-to-bibtex workflow step is dropped: pdfMerged already looks
up DOI/arXiv/ISBN identifiers found in the PDF and merges the fetched
metadata into the entry.
While verifying the documented commands, jabkit convert without --output
turned out to print the BibDatabase object reference instead of BibTeX;
it now uses ExportService.printDatabaseContextToStdOut like the other
subcommands.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NEJvTaG41iVdG5o1hEyBfS
PR Summary by QodoScope pdf-to-bibtex skill to paper metadata; fix jabkit convert stdout export
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Splits the reference-list use case out of the pdf-to-bibtex skill (see PR #16292, which scopes that skill to the paper's own metadata): the new skill documents jabkit pdf extract-references, and the jabkit skill's command table and examples now list the subcommand. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NEJvTaG41iVdG5o1hEyBfS
Code Review by Qodo
1.
|
Adds a regression test asserting exit code 2 and the "Unknown export format" message when jabkit convert without --output is given an unknown --output-format, and extends the CHANGELOG entry to cover the --output-format handling on stdout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NEJvTaG41iVdG5o1hEyBfS
Related issues and pull requests
Related to the skills introduced in #16162. The counterpart skill for extracting a paper's reference list will be part of #16186, which ships the required
jabkit pdf extract-referencescommand.PR Description
🤖 The
pdf-to-bibtexskill mixed two different user goals: producing a BibTeX entry describing a PDF paper (pdfMergedand friends) and extracting the entries a paper cites (pdfBibiliography). The latter is not a registered import format —jabkit convert --input-format pdfBibiliographyfails with "Unknown import format" — so the skill now scopes itself to the paper's own metadata and no longer documents that format id. The separatedoi-to-bibtexworkflow step is dropped as well, becausepdfMergedalready resolves DOI/arXiv/ISBN identifiers found in the PDF and merges the fetched metadata into the entry (verified: a test PDF gained publisher, pages, series, and month from the Crossref lookup).While verifying the documented commands,
jabkit convertwithout--outputturned out to printorg.jabref.model.database.BibDatabase@17932d9binstead of BibTeX (regression from #15913). It now prints the library viaExportService.printDatabaseContextToStdOut, the same path all other subcommands use, with a JUnit test guarding it.Analogies
Like honey, this change is the product of many small verifications distilled into something that keeps: every documented flag was run against the real binary. Like chocolate, it is better with less filler — the skill lost a redundant lookup step and a format that never worked. And like the moon, the skill now shows only one face: the side that describes the paper itself, while the reference-list side orbits in #16186.
jabref-contrib-policy:4.2:reviewed:ok
Steps to test
./gradlew :jabkit:installDistjabkit/build/install/jabkit/bin/jabkit -p convert --input <some>.bib --input-format bibtex(no--output). Before this PR it printedorg.jabref.model.database.BibDatabase@...; now it prints the BibTeX entries.jabkit -p convert --input <paper>.pdf --input-format pdfMergedon a paper with a DOI and observe fields (publisher, pages, month, ...) merged in from the DOI lookup — matching the updated skill text.jabkit convert --input <paper>.pdf --input-format pdfBibiliographyand observe "Unknown import format" — the reason the format id was removed from the skill.AI usage
Claude Code (model claude-fable-5)
AI CHECKLIST.md walkthrough
1. Code self-review
Nullability and control flow
== null/!= nullchecks — the only null check (outputFile == null) is pre-existing picocli option handling, unchanged in kind.Objects.requireNonNull(...)— nullability expressed via JSpecify annotations.@NullMarked— no new classes.Optionalconsumed withifPresent/ifPresentOrElse/map/orElseThrow— no Optional in the diff.StringUtil.isBlank(...)used instead ofs == null || s.isBlank()— no string blank checks in the diff.Exceptions
catch (Exception e)— no catch blocks added.throw new RuntimeException(...)/IllegalStateException(...).Style and idioms
BibEntryobjects built with withers — no BibEntry construction in main code.List.of().Pattern.compile(...)constant — no regexes.org.jabref.logic.util.BackgroundTask— no background work.///) uses Markdown syntax — no Javadoc changed.User-facing text
!; labels do not end with:— no labels.Security
text/htmlresponses — no HTML output.Tests
ConvertTest.noOutputPrintsBibtexToStdoutcovers the stdout fix.@DisplayName, do not catch exceptions, use@TempDir.2. Verification commands
./gradlew :jabkit:test(module of the change) — passes;:jablib:checknot run, no jablib change../gradlew :jabkit:checkstyleMain :jabkit:checkstyleTest— passes (no jmh sources in jabkit)../gradlew :jabkit:modernizer— passes../gradlew rewriteRunrun before committing; a subsequent run reports no changes../gradlew javadoc— no Javadoc changed; module javadoc unaffected by the 4-line diff.npx markdownlint-cli2on changed Markdown —CHANGELOG.mdclean; remainingMD060table-style hits inskills/**are pre-existing onmainand outside the CI lint scope (docs/**/*.md*.md).rewriteRun.3. Documentation
CHANGELOG.mdentry added for the user-visiblejabkit convertfix, linking this PR.docs/requirements/— bug fix and doc scoping, no new feature.docs/— no architecture change.4. Pull request
.github/PULL_REQUEST_TEMPLATE.md, every section filled.gh pr create --body-file.Checklist
:jabkit:installDist; before/after stdout output and the pdfMerged DOI enrichment verified by hand)CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)jabkit convertstdout behavior🤖 Generated with Claude Code