PyTorch Geometric (PyG) Graph Neural Network Assistant
Gives Claude accurate, version-current PyTorch Geometric patterns for node/link/graph tasks, heterogeneous graphs, and large-scale sampling.
Dev & CodingAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
Loads practical PyG 2.7 expertise into Claude:
- Correct
Data/HeteroDataconstruction and the critical[2, num_edges]COOedge_indexconvention - A decision table for picking conv layers (GCNConv, GATv2Conv, SAGEConv, GINConv, TransformerConv, RGCNConv, HGTConv)
- Ready-made training patterns for node classification, graph classification (DataLoader +
global_mean_pool), and link prediction (RandomLinkSplit, negative sampling) - Scaling recipes:
NeighborLoader,ClusterLoader, GraphSAINT, DDP notes - Three approaches to heterogeneous GNNs:
to_hetero(),HeteroConv, native operators - Custom layers via
MessagePassingwith the_i/_jauto-indexing rules - Explainability through
torch_geometric.explain - Eight common pitfalls with fixes
Who it's for
- ML engineers and researchers building GNNs for recommendations, knowledge graphs, molecules, or fraud detection
- Teams moving beyond NetworkX analytics into trainable graph models
- Anyone burned by PyG API churn who wants version-accurate snippets
Examples
- "Train a 2-layer GCN on Cora" → full Planetoid loading, masked loss, and evaluation loop.
- "Turn my user/movie CSVs into HeteroData and do link prediction" → index mapping,
T.ToUndirected(), andLinkNeighborLoaderscaffolding. - "My graph won't fit on the GPU" →
NeighborLoaderconfig withnum_neighborsmatched to model depth and correct seed-node slicing.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/torch-geometric folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/torch-geometric/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/sas && mkdir -p ~/.claude/skills && cp -r /tmp/sas/skills/torch-geometric ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy this skill:
cp -r scientific-agent-skills/skills/torch-geometric ~/.claude/skills/(keep the nestedreferences/folder — the guide links to it). - Set up Python:
pip install torchthenpip install torch_geometric(Python 3.10+ and PyTorch 2.6+ required). - Restart Claude Code and ask something like "build a PyG graph classification model" to trigger the skill.
View source on GitHub ↗License: MIT