Bib coverage

From flonat/flonat-research · View interactive version

Bib coverage is an AI agent skill from the GitHub repository flonat/flonat-research. Compare a project .bib against a Paperpile project/topic folder to find uncited papers or unfiled entries. Use when the user asks to compare a project .bib against a Paperpile project/topic folder to find uncited papers or unfiled entries.

How to use this skill

Skill file

Bibliography Coverage

LIBRARY-FIRST RULE: ALWAYS check Paperpile (paperpile search-library) when assessing coverage.

Compare a project's .bib file against a Paperpile project/topic folder to identify gaps between the project bibliography and the reference library.

When to Use

When NOT to Use

Inputs

  1. Project .bib file — detected automatically (same logic as bib-validate: look for references.bib, then any .bib in the project)
  2. Paperpile folder — resolved from:

Workflow

1. Load Project Bibliography

Parse the .bib file to extract all entry keys and titles.

2. Load Paperpile Folder

  1. Call paperpile get-folders to find the relevant full topic path
  2. Call paperpile get-items-by-folder "<full path>" to get items in that folder
  3. Extract item keys (citekey) and titles

Paperpile's labelsNamed and foldersNamed are distinct. Project/topic

collections use folders. If a leaf occurs under multiple parents, stop and

request or derive the full path; never silently choose one.

Graceful degradation: If the paperpile CLI is unavailable, skip with a warning — report .bib-only stats.

Live mode (main session; paperpile-mode.sh status): the folder listing above comes from the local export, which lags up to a day, so a paper filed or saved since then looks like "Cited but Not in Folder". For each item that would land in that bucket, confirm with the connector before reporting it as needing filing: look the items up with get_references_from_library by citekeys/dois (up to 100 per call), and for folder membership list the folder directly with get_references_from_library and folder_id (page with the returned cursor; find the ID with get_collections_from_library, and use IDs, never names, because several folders share a name). Label connector-confirmed items pending export. The folder listing route follows the tool schema and has not been exercised here; if it misbehaves, fall back to the export result with a caveat. A failed live call falls back to the export result with a one-line caveat. See CODE9.

3. Compare

Produce three lists:

| Category | Description | Action |

|----------|-------------|--------|

| Cited + In Folder | Items in both .bib and the Paperpile folder | No action — healthy |

| Cited but Not in Folder | Items in .bib but not in the Paperpile folder | Needs filing in Paperpile |

| In Folder but Not Cited | Items in the Paperpile folder but not cited in any .tex | Potential references — review for inclusion |

4. Coverage Stats

## Coverage Report

**Paperpile folder:** [full path] ([N] items)
**Project .bib:** [M] entries

| Metric | Count | % |
|--------|-------|---|
| Cited + In Folder | X | X/N |
| Cited but Not Filed | Y | — |
| In Folder, Not Cited | Z | Z/N |
| Coverage (cited/folder) | — | X/N% |

5. Recommendations

Based on the results:

Report Format

## bib-coverage: [Project Name]

**Topic:** [slug] | **Collection:** [name] ([N] items) | **Bib:** [filename] ([M] entries)

### Coverage: X/N (XX%)

### Cited but Not in Collection (need filing)
| # | Key | Title | Year |
|---|-----|-------|------|

### In Collection but Not Cited (potential references)
| # | Key | Title | Year |
|---|-----|-------|------|

Phase 6 (Optional): Gap Discovery via Recommendations

When coverage is low (<50%) or the user says "find what I'm missing", use the S2 Recommendations API to discover papers that should be in the collection but aren't.

  1. Select seed papers — pick the 3-5 most-cited papers from the .bib file
  2. Get recommendations — run scholarly scholarly-similar-works <paper_id> --json for each seed paper to get ML-based similar paper suggestions
  3. Filter against existing — remove papers already in the .bib or Paperpile folder
  4. Rank by relevance — sort by citation count and recency
  5. Present candidates — show a table of recommended additions with titles, years, citation counts

Dispatch rule. If ≥5 seed papers are selected, dispatch a single Explore sub-agent that runs scholarly scholarly-similar-works for each seed and writes merged candidates to /tmp/bib-coverage-similar.json. Main context reads only the merged result. For 3–4 seeds, inline calls are fine. See CODE2.

This turns a passive coverage check into an active discovery tool — finding papers the researcher should know about based on what they already cite.

Cross-References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.