$npx -y skills add bahayonghang/academic-writing-skills --skill bib-search-citationSearch and cite from local BibTeX/BibLaTeX .bib libraries, including Zotero exports. Use to find, filter, preview, export, or generate LaTeX/Typst citation snippets by topic, author, year, venue, DOI, arXiv ID, keywords, abstract, fields, recency, or claim support. Do not use for
| 1 | # Bib Search Citation |
| 2 | |
| 3 | ## Capability Summary |
| 4 | |
| 5 | Research-oriented retrieval over a local `.bib` file (BibTeX/BibLaTeX, including |
| 6 | Zotero exports with fields like `shorttitle`, `annotation`, `keywords`, |
| 7 | `abstract`, `file`, DOI, URL, eprint). Searches by topic and field filters, |
| 8 | returns stable JSON, renders compact previews, emits LaTeX/Typst citation |
| 9 | snippets, and returns raw BibTeX only when exact export or manual verification |
| 10 | requires it. |
| 11 | |
| 12 | ## Triggering |
| 13 | |
| 14 | Requests such as: "Search my `.bib` file for recent Mamba forecasting papers", |
| 15 | "Find entries by Cheng after 2024 that have code and return cite snippets", |
| 16 | "Show the raw BibTeX for the best match", "Filter Zotero-exported entries whose |
| 17 | annotation mentions CodeAvailable", "Preview the JSON output from a saved |
| 18 | search". For a natural-language request, infer a conservative search spec and |
| 19 | state the assumptions. If the user gives a compact filter expression, preserve |
| 20 | it closely instead of translating it into vague prose. |
| 21 | |
| 22 | ## Do Not Use |
| 23 | |
| 24 | - validating citations already used inside a `.tex`/`.typ` project (use the |
| 25 | writing skill's bibliography module) |
| 26 | - compiling, formatting, or diagnosing manuscript source trees |
| 27 | - rewriting related-work prose |
| 28 | - online discovery with no local `.bib` file (use a research workflow and |
| 29 | verify external metadata first) |
| 30 | - inventing bibliographic metadata missing from the `.bib` file |
| 31 | |
| 32 | ## Module Router |
| 33 | |
| 34 | | Module | Best for | Command | |
| 35 | | ----------- | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 36 | | `query` | one-shot compact search with inline filters | `uv run python -B $SKILL_DIR/scripts/search_bib.py --bib references.bib --query 'mamba forecasting author:Cheng year>=2024 has:code cite:both limit:5'` | |
| 37 | | `spec-json` | structured search spec generated from a complex request | `uv run python -B $SKILL_DIR/scripts/search_bib.py --bib references.bib --spec-json '{"query":"mamba forecasting","filters":{"year_min":2024},"citation_mode":"both"}'` | |
| 38 | | `spec-file` | repeatable saved search workflow | `uv run python -B $SKILL_DIR/scripts/search_bib.py --bib references.bib --spec-file search.json` | |
| 39 | | `preview` | compact human-readable summary after JSON search output exists | `uv run python -B $SKILL_DIR/scripts/preview_bib_search.py --input results.json` | |
| 40 | |
| 41 | `search_bib.py` is the source of truth for parsing, filtering, scoring, sorting, |
| 42 | raw BibTeX preservation, and citations; `preview_bib_search.py` renders only. |
| 43 | |
| 44 | ## Required Inputs |
| 45 | |
| 46 | - path to one local `.bib` file |
| 47 | - one of compact `--query`, inline `--spec-json`, or saved `--spec-file` |
| 48 | - optional sort, limit, citation-mode, raw BibTeX, or returned-field preferences |
| 49 | |
| 50 | Common spec fields: `query`; `filters.year_min/year_max/years_in/exclude_years`, |
| 51 | `filters.author_contains/author_excludes`, `filters.type_in/exclude_type_in`, |
| 52 | `filters.has/exclude_has`, `filters.field_contains/field_excludes`; |
| 53 | `sort` (`relevance`, `year_desc`, `year_asc`, `title`); `limit` (default 5); |
| 54 | `return_fields`; `include_raw_bib` (`true` only for original entries or exact |
| 55 | export); `citation_mode` (`latex`, `typst`, `both`, `none`). Defaults and |
| 56 | compact operator syntax: `references/search-planning.md`. |
| 57 | |
| 58 | ## Output Contract |
| 59 | |
| 60 | Presentation order: |
| 61 | |
| 62 | 1. State how many matches were found and which filters were applied. |
| 63 | 2. List top matches with requested research fields. |
| 64 | 3. Include LaTeX and/or Typst snippets when requested or useful. |
| 65 | 4. Include raw BibTeX onl |