Claude-skill-registry bip
Unified guidance for using the bipartite reference library CLI. Use when searching for papers, managing the library, or exploring literature via S2/ASTA.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/bip" ~/.claude/skills/majiayu000-claude-skill-registry-bip && rm -rf "$T"
skills/data/bip/SKILL.mdBip Reference Library
A CLI tool for managing academic references with local storage and external paper search.
Repository: Configured via
nexus_path in ~/.config/bip/config.json
⚠️ CRITICAL: Local-First Search Policy
ALWAYS search locally before using external APIs. NEVER call ASTA without explicit user permission.
The nexus library has ~6000 papers. Most relevant papers are already there.
Required Search Order
-
Local search FIRST (always do this):
bip search "author keyword" -
If
fails (e.g., schema error), rebuild the database:bip searchbip rebuild --forceThen retry the search.
-
Only if not found locally AND user confirms, use ASTA:
"I couldn't find that paper in the local library. Would you like me to search Semantic Scholar (ASTA)?"
DO NOT call
bip asta, mcp__asta__*, or any external API without asking first.
Argument Handling
When invoked with arguments like
/bip find <query> or /bip <query>:
- Always search local library first with
bip search "<query>" - If local search fails with an error, rebuild the database and retry
- Only after exhausting local options, ask user if they want to search externally
- For title searches, use the full title; for topic searches, use key terms
Proactive Concept Discovery
When discussing papers, always look for opportunities to create concept nodes:
- Papers that introduce new methods, models, or techniques (e.g., "categorical Jacobian")
- Papers that apply existing concepts in novel ways
- Connections between papers through shared concepts
Suggest creating concepts when you notice:
- A named method or algorithm being introduced
- A technique being reused across multiple papers
- A bridge between the user's work and external literature
Quick Reference
| Task | Command |
|---|---|
| Search local library | |
| Search by author | (exact last name, AND logic) |
| Search by title | or |
| Search by year | or |
| Search by venue | (partial match) |
| Lookup by DOI | |
| Combined search | |
| Semantic search | |
| Get paper details | |
| Add paper to collection | |
| Find literature gaps | |
| Fast paper search (external) | |
| Find text snippets | |
| Create concept | |
| Link paper to concept | |
| Papers for concept | |
| Concepts for paper | |
| Import projects from config | |
| Import with concept edges | |
Search Strategy
Field-Specific Search Flags
Use
--author and --year flags for precise filtering:
# Search by author (exact last name matching to avoid false positives) bip search --author "Yu" --author "Bloom" # Last names only bip search -a "Tim Yu" -a "Bloom" # First + last name bip search -a "Yu, Timothy" # Last, First format # Filter by year bip search --year 2024 # exact year bip search --year 2020:2024 # range (inclusive) bip search --year 2022: # 2022 and later bip search --year :2020 # 2020 and earlier # Combine keyword + filters bip search "deep mutational scanning" --author "Bloom" --year 2023:
Multiple authors use AND logic - all must appear in the paper.
Author matching rules:
- Single word (e.g.,
) → exact last name match (won't match "Yujia")-a "Yu" - Two+ words (e.g.,
) → exact last name + first name prefix-a "Tim Yu" - Comma format (e.g.,
) → same as above-a "Yu, Tim"
Query Formulation Tips
Keep queries short and specific - Long conceptual queries perform poorly:
- Bad:
"correlation between BME criterion and Felsenstein likelihood around correct tree" - Good:
or"BME Felsenstein likelihood phylogeny""Bruno WEIGHBOR likelihood"
Use --author flag instead of embedding names in query - Precise last name matching:
- Good:
(exact last name match)bip search -a "Yu" -a "Bloom" --year 2022: - Good:
(first prefix + exact last name)bip search -a "Tim Yu" -a "Bloom" - Bad:
(keyword search is substring-based)bip search "Tim Yu Bloom"
Use specific method/algorithm names:
,"WEIGHBOR"
,"FASTME"
rather than general descriptions"neighbor joining"
Systematic Search Workflow
For finding a specific paper or result:
-
Local library first (fastest, already curated):
# Use flags for author/year filtering (most reliable) bip search -a "AuthorName" --year 2020: bip search "topic" -a "Author" # Or plain keyword search bip search "author topic" bip semantic "conceptual description" # for topic-heavy queries -
External keyword search with author names:
bip asta search "AuthorName keyword1 keyword2" --limit 20 --human -
Broaden if needed - remove author, try synonyms:
bip asta search "minimum evolution likelihood" --human bip asta search "distance method maximum likelihood phylogeny" --human -
Citation tracing - if you find a related paper, check what cites it:
bip asta citations DOI:10.xxxx/yyyy --limit 50 --human -
MCP tools directly - for more control over fields and filters:
mcp__asta__search_papers_by_relevance with specific date ranges mcp__asta__get_citations with publication_date_range filter
Snippet Search Caveats
The
bip asta snippet command can be slow and unreliable (timeouts are common). Alternatives:
- Use keyword search first to find candidate papers
- Use MCP
directly with smaller limitsmcp__asta__snippet_search - If snippet times out, fall back to
bip asta search
S2 vs ASTA: When to Use Which
Both access Semantic Scholar's paper database but through different APIs:
| Use Case | Command | Why |
|---|---|---|
| Add paper to collection | | Only S2 can modify local library |
| Find literature gaps | | Analyzes your collection |
| Explore without adding | | Faster, read-only |
| Find text snippets in papers | | Unique to ASTA |
| Fast paper search | | 10x faster rate limit |
| Get citations/references | Either works | ASTA is faster |
Rule of thumb: Use
bip asta for exploration, bip s2 when you want to modify your library.
See api-guide.md for detailed comparison.
Common Workflows
Find a Paper
-
Search local library first:
bip search "Schmidler phylogenetics" # or for topic-heavy queries: bip semantic "importance sampling MCMC" -
Get PDF path for a result:
bip get <id> # pdf_path field + "/Users/matsen/Google Drive/My Drive/Paperpile" -
If not in library, search externally:
bip asta search "phylogenetic inference"
Update Library from Paperpile
- Export from Paperpile (JSON format) to ~/Downloads
- Find the export file:
ls -t ~/Downloads/Paperpile*.json | head -1 - Import:
bip import --format paperpile "<path>" - Optionally delete the export file after confirming success
Explore Literature
-
Search by topic:
bip asta search "variational inference phylogenetics" --limit 20 -
Find specific text passages:
bip asta snippet "Bayesian phylogenetic inference" -
Trace citations:
bip asta citations DOI:10.1093/sysbio/syy032 bip asta references DOI:10.1093/sysbio/syy032 -
Add interesting papers to your collection:
bip s2 add DOI:10.1093/sysbio/syy032
See workflows.md for detailed workflow instructions.
Output Format
All commands output JSON by default. Add
--human for readable format:
bip asta search "phylogenetics" --human bip s2 lookup DOI:10.1234/example --human
Paper ID Formats
Both S2 and ASTA accept these identifier formats:
DOI:10.1093/sysbio/syy032ARXIV:2106.15928PMID:19872477CorpusId:215416146- Raw Semantic Scholar ID (40-char hex)
Concept Nodes (Knowledge Graph)
Build a knowledge graph by creating concepts and linking papers to them.
Create Concepts
# Add a concept with name, aliases, and description bip concept add somatic-hypermutation \ --name "Somatic Hypermutation" \ --aliases "SHM,shm" \ --description "Process by which B cells diversify antibody genes" # List all concepts bip concept list --human # Get a specific concept bip concept get somatic-hypermutation --human
Link Papers to Concepts
# Use flags: -s (source paper), -t (target concept with concept: prefix), -r (relationship type), -m (summary) bip edge add -s Halpern1998-yc -t concept:mutation-selection-model -r introduces \ -m "Foundational paper defining the mutation-selection model" bip edge add -s Yaari2013-dg -t concept:somatic-hypermutation -r models \ -m "Introduces S5F model for SHM targeting"
Note: Use
concept: prefix for concept targets, project: for project targets.
Standard Relationship Types
| Type | When to Use |
|---|---|
| Paper first presents or defines this concept |
| Paper uses concept as a tool or method |
| Paper creates computational/mathematical model |
| Paper uses concept for evaluation/benchmarking |
| Paper identifies limitations or problems |
| Paper builds upon or extends the concept |
Query the Knowledge Graph
# Find all papers linked to a concept bip concept papers somatic-hypermutation --human # Filter by relationship type bip concept papers somatic-hypermutation --type introduces # Find what concepts a paper relates to bip paper concepts Halpern1998-yc --human
Manage Concepts
# Update a concept bip concept update somatic-hypermutation --description "Updated description" # Delete a concept (warns if papers linked) bip concept delete unused-concept # Force delete (removes linked edges too) bip concept delete old-concept --force # Merge duplicate concepts bip concept merge shm somatic-hypermutation --human
Troubleshooting
Snippet Search Timeouts
bip asta snippet frequently times out with "context deadline exceeded". Workarounds:
- Reduce limit:
instead of default--limit 5 - Use MCP directly:
with small limitmcp__asta__snippet_search - Fall back to keyword search:
is more reliablebip asta search - Retry once - sometimes it's transient
No Results Found
If searches return nothing relevant:
- Check spelling of author names and technical terms
- Simplify query - fewer terms, more common synonyms
- Try both local and external:
bip search "topic" # local bip semantic "topic" # local semantic bip asta search "topic" # external - Check date filters - paper may be too old/new for range
Paper Not Found by ID
If
bip get <id> or bip asta paper <id> fails:
- Verify ID format:
(include prefix)DOI:10.xxxx/yyyy - Try alternate IDs: Same paper may have DOI, PMID, arXiv ID
- Search by title instead:
bip asta search "exact paper title"
SQL Schema Errors
If you see errors like
no such column: pmid or similar schema mismatches:
bip rebuild --force
The SQLite database is ephemeral and rebuilt from the JSONL source of truth. Schema changes require deleting and rebuilding.
Slow Performance
commands are rate-limited to 1 req/secbip s2- Use
for bulk exploration (10 req/sec)bip asta - Run searches in parallel when independent