Agent skill

Bib Filter

by flonat in flonat/flonat-research

Filter a LaTeX project's bibliography to the entries actually cited, with Overleaf-source resolution, temporary staging, validation, approval-gated canonical replacement, and compilation.

MITAuto-check passedDocuments & Office

Install Bib Filter

skills CLI
$ npx skills add flonat/flonat-research --skill bib-filter -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install flonat/flonat-research bib-filter --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/flonat/flonat-research.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/bib-filter .claude/skills/bib-filter && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bib-filter
GitHub stars
146
Token cost
~1.7k tokens
SKILL.md length
774 words
Files
1
Skills in repo
83
Repo updated
First seen
Licence
MIT

At a glance

Filter a LaTeX project's bibliography to the entries actually cited, with Overleaf-source resolution, temporary staging, validation, approval-gated canonical replacement, and compilation.

  • Works in 6 steps: Locate files → Extract all citation keys from .tex → Parse .bib and filter → …
  • Tasks that involve LaTeX
  • SKILL.md covers When to Use, Process, Edge Cases and Output Verification (Guard)
  • Calls uv and git

What it does

Bib Filter is an agent skill from flonat/flonat-research. Filter a LaTeX project's bibliography to the entries actually cited, with Overleaf-source resolution, temporary staging, validation, approval-gated canonical replacement, and compilation. Use before submission or after large revisions.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering LaTeX and Citation management. It works with LaTeX. The repository describes itself as: Shareable Claude Code + Codex infrastructure for PhD researchers — skills, agents, hooks, and rules for academic workflows. The licence is MIT.

When your agent uses it

  • Tasks that involve LaTeX
  • Tasks that involve Citation management

Example prompts

  • “/bib-filter”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Glob, Grep, Write, Edit, Bash(ls*), Bash(wc*), Bash(realpath*), Bash(readlink*), Bash(shasum*), Bash(uv*), Bash(latexmk*), Bash(mv*), Bash(rm*), Bash(mktemp*), Skill, AskUserQuestion

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Locate files
  2. Extract all citation keys from .tex
  3. Parse .bib and filter
  4. Stage a cited-only candidate
  5. Validate before replacement
  6. Approval-gated canonical replacement

What it can do on your machine

Read from SKILL.md and the folder at commit da27600. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • Write
    • Edit
    • Bash(ls*)
    • Bash(wc*)
    • Bash(realpath*)
    • Bash(readlink*)
    • Bash(shasum*)

    …and 7 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bib Filter loads about 1.7k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 774 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from flonat/flonat-research at commit da27600, republished under its MIT licence (© flonat). 774 words, ~1,709 tokens.

Download SKILL.mdSave it as .claude/skills/bib-filter/SKILL.md (or your agent's skills folder).
name
bib-filter
description
Filter a LaTeX project's bibliography to the entries actually cited, with Overleaf-source resolution, temporary staging, validation, approval-gated canonical replacement, and compilation. Use before submission or after large revisions.
allowed-tools
Read, Glob, Grep, Write, Edit, Bash(ls*), Bash(wc*), Bash(realpath*), Bash(readlink*), Bash(shasum*), Bash(uv*), Bash(latexmk*), Bash(mv*), Bash(rm*), Bash(mktemp*), Skill, AskUserQuestion
argument-hint
[path-to-tex-or-project-dir]

Bibliography Filter

Produce and validate a cited-only bibliography, then replace the manuscript's canonical .bib only after explicit approval. In an Overleaf-linked project, the resolved Overleaf bibliography is canonical; a wrapper-local copy is not a second authority.

When to Use

  • Before submission — strip unused references from the bibliography
  • When a shared .bib (e.g., Paperpile/Paperpile export) contains hundreds of entries but the paper cites a subset
  • To reduce .bib file size for Overleaf or arXiv upload
  • As a cleanup step after major revision (removed sections may leave orphan citations)

Process

Step 1: Locate files

If given a directory, resolve the actual manuscript source first:

  • For paper-<arm>/paper, run realpath/readlink and inspect the resolved Overleaf target before declaring a bibliography missing.
  • Read \bibliography{...} or \addbibresource{...} from the canonical driver and resolve the referenced .bib relative to that source tree.
  • Do not select a project-root export, backup, or stale wrapper copy merely because it has the same filename.

Then find the main .tex and .bib files:

  • .tex: Glob for *.tex in the directory (and paper/ subdirectory if it exists). The main file is the one containing \begin{document}.
  • .bib: Look for \bibliography{...} or \addbibresource{...} in the main .tex to find the bib filename. Fall back to globbing *.bib.

If given a specific .tex file, derive the .bib from it.

Step 2: Extract all citation keys from .tex

Scan all .tex files in the project (main + any \input{}/\include{} files) for citation commands:

\cite{key1,key2}
\citep{key1,key2}
\citet{key1}
\citealt{key1}
\citealp{key1}
\citeauthor{key1}
\citeyear{key1}
\citetext{key1}
\parencite{key1,key2}
\textcite{key1}
\autocite{key1}
\footcite{key1}
\fullcite{key1}
\nocite{key1}

Handle:

  • Multiple keys in one command: \cite{key1,key2,key3} → extract all three
  • Whitespace around commas: \cite{key1, key2} → trim
  • Optional arguments: \cite[p.~5]{key1} or \citep[see][]{key1} → extract key1
  • \nocite{*} → special case: means "include everything", so filtered.bib = full .bib (warn and stop)

Collect into a deduplicated set of cited keys.

Step 3: Parse .bib and filter

Read the .bib file. For each entry (@article{key,, @book{key,, @inproceedings{key,, etc.):

  • If the entry's key is in the cited set → include in output
  • If not → exclude
  • Preserve @string{}, @preamble{}, and @comment{} blocks (they may be needed by included entries)
Step 4: Stage a cited-only candidate

Write a temporary candidate beside the canonical bibliography, using a collision-safe name such as .references.filtered.<timestamp>.bib. Do not create a durable second bibliography authority.

Report:

Original: N entries
Cited: M keys found in .tex
Filtered: M entries written to <temporary candidate>
Removed: N-M unused entries

If any cited keys are not found in the .bib, list them as warnings and recommend the configured bibliography validator or manual reconciliation.

Step 5: Validate before replacement

Before asking to replace anything:

  1. verify every cited key is present, including crossref parents;
  2. run the configured bibliography validator against the candidate;
  3. compile the manuscript in a temporary build/output directory using the candidate;
  4. compare bibliography entry count and rendered reference count with the expected cited set;
  5. report the exact canonical target, its current hash, the candidate hash, kept keys, dropped keys, and validation result.

If any cited key is missing or validation/compilation fails, leave the canonical bibliography unchanged and stop.

Show full SKILL.md (316 more words)Show less
Step 6: Approval-gated canonical replacement

Ask: “Replace <canonical-bib-path> with the validated cited-only candidate?” Only an explicit approval authorizes replacement.

After approval:

  1. recheck the canonical file hash to detect concurrent Overleaf changes;
  2. atomically replace the canonical .bib at the resolved Overleaf path;
  3. compile again from the canonical source and confirm no missing citations or bibliography errors;
  4. remove the temporary candidate after successful verification;
  5. report the final canonical path and hash.

Do not retain both references.bib and filtered.bib in the Overleaf tree.

Dropped but strategically important comparator records belong in the literature authority, Paperpile, or a registered literature review packet—not in the live manuscript bibliography merely for safekeeping.

Edge Cases

  • Multiple .bib files: preserve the driver's declared multi-file structure unless the user separately approves consolidation; stage one filtered candidate per canonical source
  • \nocite{*}: Warn that all entries are cited and stop — filtering would be a no-op
  • Cross-references: Some .bib entries use crossref = {parent-key}. If a cited entry cross-references another, include the parent even if it's not directly cited
  • Empty result: If no citations found in .tex, warn and do not write an empty file
  • Concurrent Overleaf change: if the canonical hash changes between staging and replacement, discard the replacement attempt, re-resolve, and repeat validation

Output Verification (Guard)

This skill writes files. Before any auto-commit, emit an outputs manifest and run the shared verifier. See skills/_shared/verify-outputs.md for the full protocol.

Required tail steps (before git commit):

  1. Write manifest to <project>/.claude/state/outputs-manifest-<UTC-timestamp>.json listing every file this skill claims to have written in this invocation (paths relative to the project root).

  2. Run:

    bash
    uv run python "<skills-root>/_shared/verify_outputs.py" \
        --manifest "$MANIFEST" \
        --project-root "$PROJECT_ROOT"
  3. If the verifier exits non-zero, do not commit — surface the missing-files list to the user and stop. The verifier has already logged an error entry to ~/.local/state/ai-workflows/skill-outcomes.jsonl, which feeds the shared skill-health dashboard.

Why: closes the "hallucinated outputs" failure class (commit b2cff75, 2026-04-18).

© flonat, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/bib-filter of flonat/flonat-research.

Open the folder on GitHubat commit da27600

Compare with similar skills

Bib Filter next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bib Filter compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bib Filter this skillflonat/flonat-research146—~1.7kAutomated safety check: PassMIT
Literature Surveyai4s-research/ai4s-skills2372 repos~2kAutomated safety check: PassMIT
Typst Paperbahayonghang/academic-writing-skills498—~3.6kAutomated safety check: PassNone
Light TypesettingLight0305/Light-skills640—~3.3kAutomated safety check: PassMIT
Latex Setupfcakyon/phd-skills415—~1.1kAutomated safety check: NotesMIT
Latex Rhythm Refinerappautomaton/latex-arxiv-SKILL458—~890Automated safety check: PassMIT

Similar skills

  • Literature Survey

    ai4s-research/ai4s-skills

    A skill your agent uses when the user wants a comprehensive literature survey on a specific research topic.

    237 GitHub starsUsed in 2 repos~2k tokens
    Documents & OfficeAuto-check passed
  • Typst Paper

    bahayonghang/academic-writing-skills

    Typst paper assistant for existing .typ manuscripts in English or Chinese.

    498 GitHub stars~3.6k tokensUpdated 11 days ago
    Documents & OfficeAuto-check passed
  • Light Typesetting

    Light0305/Light-skills

    Build and preflight submission-ready LaTeX/PDF artifacts for Light stage 11.

    640 GitHub stars~3.3k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Latex Setup

    fcakyon/phd-skills

    A skill your agent uses when the user wants to set up or troubleshoot a LaTeX environment, choose between biber and bibtex, install packages for a specific venue template, or configure compilation.

    415 GitHub stars~1.1k tokensUpdated 23 days ago
    Documents & OfficeAuto-check: notes
  • Latex Rhythm Refiner

    appautomaton/latex-arxiv-SKILL

    Post-process LaTeX project prose to improve readability through varied sentence and paragraph lengths.

    458 GitHub stars~890 tokensUpdated 25 days ago
    Documents & OfficeAuto-check passed
  • Evidence Ledger

    wanshuiyin/Anti-Autoresearch

    Build the deterministic evidence ledger (artifactmanifest.json + claims.json) that every other Anti-Autoresearch auditor reads.

    161 GitHub stars~11k tokensUpdated 2 days ago
    Documents & OfficeAuto-check: notes

More from flonat/flonat-research

All 83 skills in this repo
  • Latex Posters

    flonat/flonat-research

    Create a large-format academic poster in LaTeX using beamerposter, tikzposter, or baposter.

    146 GitHub stars~1.5k tokensUpdated 10 days ago
    Auto-check: notes
  • Skill Creator

    flonat/flonat-research

    Create, revise, and evaluate reusable AI workflow skills, including trigger-quality tests.

    146 GitHub stars~4.4k tokensUpdated 10 days ago
    Auto-check passed
  • DOCX

    flonat/flonat-research

    Create, read, edit, or convert Microsoft Word documents while preserving professional document structure.

    146 GitHub stars~1.2k tokensUpdated 10 days ago
    Auto-check passed
  • PDF

    flonat/flonat-research

    Read, create, combine, split, rotate, OCR, watermark, secure, or extract content from PDF files.

    146 GitHub stars~488 tokensUpdated 10 days ago
    Auto-check passed
  • Init Project Orchestration

    flonat/flonat-research

    Create or migrate project-level agents, repeatable project workflows, and planning state from one client-neutral contract, then render repository-scoped adapters for both Claude Code and Codex.

    146 GitHub stars~1.6k tokensUpdated 10 days ago
    Auto-check passed
  • Pre Commit Audit

    flonat/flonat-research

    Deliver a fast pre-commit safety scan: file size, anonymity (author / affiliation strings in tex/bib), hardcoded secrets, and invisible-Unicode carriers.

    146 GitHub stars~2.8k tokensUpdated 10 days ago
    Auto-check: notes

Works with

Questions about Bib Filter

What does Bib Filter do?

Filter a LaTeX project's bibliography to the entries actually cited, with Overleaf-source resolution, temporary staging, validation, approval-gated canonical replacement, and compilation. Bib Filter is an agent skill from flonat/flonat-research. Filter a LaTeX project's bibliography to the entries actually cited, with Overleaf-source resolution, temporary staging, validation, approval-gated canonical replacement, and compilation.

When should I use Bib Filter?

Bib Filter fits situations like: tasks that involve LaTeX; tasks that involve Citation management.

How do I install Bib Filter in Claude Code?

Run `npx skills add flonat/flonat-research --skill bib-filter -a claude-code`. Or copy the skill folder (skills/bib-filter in flonat/flonat-research) into .claude/skills/bib-filter in your project. Claude Code loads it when a task matches its description.

How do I install Bib Filter in Codex?

Run `npx skills add flonat/flonat-research --skill bib-filter -a codex`. Or copy the skill folder (skills/bib-filter in flonat/flonat-research) into .agents/skills/bib-filter in your project. Codex loads it when a task matches its description.

Can I use Bib Filter in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add flonat/flonat-research --skill bib-filter -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bib-filter, .gemini/skills/bib-filter, .github/skills/bib-filter and .opencode/skills/bib-filter in your project.

What does Bib Filter need to run?

Going by SKILL.md and its folder, Bib Filter needs the command-line tools its instructions call (uv and git). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Glob, Grep, Write, Edit, Bash(ls*), Bash(wc*), Bash(realpath*), Bash(readlink*), Bash(shasum*), Bash(uv*), Bash(latexmk*), Bash(mv*), Bash(rm*), Bash(mktemp*), Skill, AskUserQuestion.

Does Bib Filter access the network?

SKILL.md contains no URLs. Its commands use uv and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Bib Filter safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bib Filter use?

Bib Filter is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bib Filter use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bib Filter?

Skills that share tags, products or a category with Bib Filter: Literature Survey (ai4s-research/ai4s-skills, 237 stars), Typst Paper (bahayonghang/academic-writing-skills, 498 stars), Light Typesetting (Light0305/Light-skills, 640 stars) and Latex Setup (fcakyon/phd-skills, 415 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bib Filter?

flonat (a GitHub user) maintains it in flonat/flonat-research, which has 146 GitHub stars. The repository holds 83 skills in this directory. The repository was last updated on September 29, 2026.

Source: flonat/flonat-research on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.