Builds and trains Graph Neural Networks with PyTorch Geometric (PyG) for node/graph classification, link prediction, molecular property prediction, and heterogeneous graphs.
Ships in alterlab-data-science. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
PyTorch Geometric is a library built on PyTorch for developing and training Graph Neural Networks (GNNs). Apply this skill for deep learning on graphs and irregular structures, including mini-batch processing, multi-GPU training, and geometric deep learning applications.
This skill should be used when working with:
| Scenario | Use Instead |
|---|---|
| Classical graph algorithms, centrality, shortest paths, or network visualization without learning | alterlab-networkx |
| Social-network-analysis designs (centrality, community detection, ERGMs) for substantive social-science claims | alterlab-sna |
| End-to-end molecular property prediction with MoleculeNet featurizers and pretrained chemistry models | alterlab-deepchem |
| Projects built on TorchDrug's datasets and tasks (GearNet, retrosynthesis, molecule generation) | alterlab-torchdrug |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-networkx) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
uv run --python ">=3.12" --with torch --with torch_geometric python train_gnn.py # no install step (PyG 2.8 needs Python >= 3.10)
# torch + PyG already importable (`python -c "import torch_geometric"`)? run with plain `python`.
# CPU-only machine: add --index https://download.pytorch.org/whl/cpu so uv fetches CPU torch, not multi-GB CUDA wheels
# Optional compiled ops (neighbor sampling, knn/radius graphs, fps): pick TORCH/CUDA to match your torch
uv run --python ">=3.12" --with torch --with torch_geometric --with pyg-lib --find-links https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html python train_gnn.py
PyG 2.8 folded torch-cluster and torch-spline-conv into pyg-lib (>= 0.7), so those two
packages are no longer needed. NeighborLoader raises ImportError unless pyg-lib (or
torch-sparse) is installed; for current PyTorch (2.13/2.14) data.pyg.org publishes only
pyg-lib wheels, not torch-scatter/torch-sparse.
Graphs are torch_geometric.data.Data objects: x (node features [N, F]), edge_index
(connectivity in COO [2, E]), optional edge_attr, y, pos, and any custom attribute
(train_mask, etc.). DataLoader batches multiple graphs into one block-diagonal graph
(no padding); a batch vector maps nodes back to their source graph.
Full install/sparse-deps, basic graph creation, benchmark loading, edge-index format, and
mini-batching details: references/getting_started.md.
InMemoryDataset, or from CSV
(references/datasets_and_loading.md; full catalog in references/datasets_reference.md).MessagePassing for custom layers (references/building_gnns.md; full layer list in
references/layers_reference.md).DataLoader + global pooling), or large-scale via NeighborLoader neighbor sampling
(references/training_workflows.md).HeteroData/to_hetero for heterogeneous graphs, transforms,
GNNExplainer explainability, hierarchical pooling, GPU, save/load
(references/advanced_features.md; transforms catalog in references/transforms_reference.md).GNNs follow neighborhood aggregation: transform node features → propagate messages along edges →
aggregate from neighbors → update representations. PyG ships 40+ conv layers. When choosing one,
check its capabilities: SparseTensor support, edge_weight, edge_attr, bipartite, and lazy
(-1 channel) initialization. Code for GCN/GAT/GraphSAGE and custom MessagePassing layers
(including the _i/_j target/source naming convention) is in references/building_gnns.md.
This skill includes detailed reference documentation:
references/getting_started.md: Install, basic graph creation, Data structure, edge-index format, mini-batchingreferences/building_gnns.md: Message passing, GCN/GAT/GraphSAGE code, custom MessagePassing layers, layer capabilitiesreferences/datasets_and_loading.md: Built-in datasets, custom InMemoryDataset, loading graphs from CSVreferences/training_workflows.md: Node classification, graph classification, large-scale neighbor samplingreferences/advanced_features.md: Heterogeneous graphs, transforms, explainability, pooling, GPU, save/loadreferences/layers_reference.md: Complete listing of all 40+ GNN layers with descriptions and capabilitiesreferences/datasets_reference.md: Comprehensive dataset catalog organized by categoryreferences/transforms_reference.md: All available transforms and their use casesUtility scripts are provided in scripts/:
scripts/visualize_graph.py: Visualize graph structure using networkx and matplotlibscripts/create_gnn_template.py: Generate boilerplate code for common GNN architecturesscripts/benchmark_model.py: Benchmark model performance on standard datasetsExecute scripts directly or read them for implementation patterns.
Part of the AlterLab Academic Skills suite.
evals/evals.json (opens in a new tab)references/advanced_features.md (opens in a new tab)references/building_gnns.md (opens in a new tab)references/datasets_and_loading.md (opens in a new tab)references/datasets_reference.md (opens in a new tab)references/getting_started.md (opens in a new tab)references/layers_reference.md (opens in a new tab)references/training_workflows.md (opens in a new tab)references/transforms_reference.md (opens in a new tab)scripts/benchmark_model.py (opens in a new tab)scripts/create_gnn_template.py (opens in a new tab)scripts/visualize_graph.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/alterlab-daskScales pandas/NumPy workflows beyond memory with Dask distributed computing — parallel DataFrames, arrays, delayed task graphs, and cluster execution. Use when existing pandas/NumPy code must run on larger-than-RAM data or across clusters, for parallel file processing, distributed ML, or integration with existing pandas code. For out-of-core analytics on a single machine prefer vaex; for in-memory speed prefer polars. Part of the AlterLab Academic Skills suite./alterlab-edaExploratory data analysis (EDA) on a scientific data file — auto-detects the format, runs structure/quality/statistics checks, and writes a markdown EDA report with downstream recommendations. Use when asked to "explore", "analyze", "summarize", "profile", or "QC" a data file, or to understand its structure/content/quality before deciding what analysis to run. Covers tabular (.csv .tsv .xlsx .parquet), arrays (.npy .npz .hdf5 .h5 .mat .fits), sequence/genomics (.fasta .fastq .sam .bam .vcf .bed .gff .gtf .h5ad), microscopy (.tif .nd2 .czi .lif .ims .dcm .nii), spectroscopy/MS (.mzML .mzXML .mgf .fid .jdx), chemistry (.pdb .cif .mol .sdf .xyz .gro), and proteomics/metabolomics (.pepXML .mzid .mzTab). For zero-shot forecasting of a series use alterlab-timesfm; to create/configure a chunked cloud array store use alterlab-zarr. Part of the AlterLab Academic Skills suite./alterlab-networkxCreates, analyzes, and visualizes complex networks and graphs in Python with NetworkX. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing topologies — applicable to social, biological, transportation, citation, and any pairwise-relationship networks. This is classical graph analytics, not deep learning — for training graph neural networks (GCN/message passing, node/edge/graph classification on Cora-style data) use alterlab-torch-geometric instead. Part of the AlterLab Academic Skills suite./alterlab-polarsFast in-memory DataFrame analytics with Polars — lazy evaluation, parallel execution, and an Apache Arrow backend for datasets that fit in RAM. Use when pandas is too slow but data still fits in memory, for 1-100GB datasets, ETL pipelines, or a faster pandas replacement. For larger-than-RAM data prefer dask or vaex. Part of the AlterLab Academic Skills suite./alterlab-pufferlibScales reinforcement learning with PufferLib — high-throughput parallel training (PuffeRL), vectorized environments, and native multi-agent systems achieving 2-10x speedups over standard implementations. Use when scaling RL to millions of steps per second, running vectorized or multi-agent setups, building custom PufferEnv tasks, or integrating game environments (Atari, Procgen, NetHack, PettingZoo). For standard single-agent algorithm implementations (PPO/SAC/DQN) or quick prototyping prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-pymcBayesian modeling and probabilistic programming with PyMC 6 and ArviZ 1.x — hierarchical models, MCMC (NUTS via PyMC, nutpie, NumPyro, or BlackJAX), variational inference, PSIS-LOO model comparison, and prior/posterior predictive checks. Use when fitting Bayesian or hierarchical models, estimating posteriors and credible intervals, diagnosing divergences, R-hat, or ESS, running probabilistic inference, or comparing models with LOO (WAIC was removed from ArviZ 1.x). Part of the AlterLab Academic Skills suite./alterlab-data-science:alterlab-torch-geometricfrom alterlab-data-science
npx claudepluginhub alterlab-ieu/alterlab-academic-skills --plugin alterlab-data-science2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job