PrimeKG — Claude Code skill: query the drug and disease graph
Wraps the PrimeKG precision-medicine CSV in pandas helpers, so the agent can look up typed nodes, neighbours, disease summaries and short paths without leaving the repo.
npx skills add K-Dense-AI/scientific-agent-skills --skill primekg -a claude-codeWhat primekg does
The skill points an agent at PrimeKG, a graph of genes, drugs, diseases and phenotypes assembled from public resources. Three pandas helpers do the work: search_nodes, get_neighbors, get_disease_context. Each node is identified by id, type and source, so the agent resolves candidates first and only then walks edges.
Nothing is queried remotely. You download kg.csv from Dataverse and point PRIMEKG_DATA at it; the fallback path is data/PrimeKG/kg.csv. Python 3.11+ and pandas are required. The module reads the whole file for every query, so keep several GB of RAM free. That is the weak spot: on a small machine you will want an indexed local store built from the pinned file instead of repeated full scans.
Relation labels have to match what is stored. disease_protein, contraindication and disease_phenotype_positive all exist; a generic drug_disease or gwas does not, and the phenotype node type is spelled effect/phenotype. The helper returns no publications, clinical text, confidence scores or approval status. A path is a hypothesis, not evidence, which matters the moment you try to cite it.
What it helps with
- resolve a disease name to one typed node before traversal
- pull a gene's neighbours with the relation label intact
- keep indications apart from contraindications and off-label records
- summarise genes, drugs and phenotypes for a single disease
- check the pinned CSV checksum before running an analysis
Example prompts for the agent
- Find the PrimeKG disease node matching "Alzheimer" and show me its id, type and source before anything else.
- List the neighbours of the selected node under relation `indication`, with the original rows from `edge_rows`.
- Give me the disease context: associated genes, drugs and phenotypes, and split drug records into indication, contraindication and off-label.
How to install primekg
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill primekg -a claude-code2Manually: put the files in place
~/.claude/skills/primekg/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/primekg/
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill primekg -a codex2Manually: put the files in place
.agents/skills/primekg/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill primekg -a cursor2Manually: put the files in place
.cursor/skills/primekg/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install K-Dense-AI/scientific-agent-skills primekg2Manually: put the files in place
.github/skills/primekg/SKILL.md1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill primekg -a gemini-cli2Platform CLI
gemini skills install https://github.com/K-Dense-AI/scientific-agent-skills --path skills/primekgManually: put the files in place
.devin/skills/primekg/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill primekg -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set120
The whole set →Similar
Questions about primekg
How do I install PrimeKG in Claude Code?
Run npx skills add K-Dense-AI/scientific-agent-skills --skill primekg -a claude-code. The skill file lands at ~/.claude/skills/primekg/SKILL.md.
What does PrimeKG do?
It answers questions against a local copy of the PrimeKG CSV: typed node lookup, direct associations, disease context, and paths of one or two hops with relation names and provenance kept.
Does it work without downloading the CSV?
No. The skill makes no remote graph queries, so you need kg.csv on disk plus Python 3.11+ and pandas. Expect to give up several GB of RAM while it parses.