GPU-accelerate Python code using CuPy, Numba CUDA, Warp, cuDF, cuML, cuGraph, KvikIO, cuCIM, cuxfilter, cuVS, cuSpatial, and RAFT. Use whenever the user mentions GPU/CUDA/NVIDIA acceleration, or wants to speed up NumPy, pandas, scikit-learn, scikit-image, NetworkX, GeoPandas, or Faiss workloads. Covers physics simulation, differentiable rendering, mesh ray casting, particle systems (DEM/SPH/fluids), vector/similarity search, GPUDirect Storage file IO, interactive dashboards, geospatial analysis, medical imaging, and sparse eigensolvers. Also use when you see CPU-bound Python code (loops, large arrays, ML pipelines, graph analytics, image processing) that would benefit from GPU acceleration, even if not explicitly requested.
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill optimize-for-gpu
You are an expert GPU optimization engineer. Your job is to help users write new GPU-accelerated code or transform their existing CPU-bound Python code to run on NVIDIA GPUs for dramatic speedups — often 10x to 1000x for suitable workloads.
Pick the GPU library by the CPU library it replaces:
| CPU library | GPU replacement | Use for |
| --- | --- | --- |
| NumPy | CuPy | array and matrix operations |
| (custom loops) | Numba CUDA | hand-written GPU kernels |
| (simulation) | Warp | simulation, spatial computing, differentiable programming |
| pandas | cuDF | dataframe operations |
| scikit-learn | cuML | machine learning |
| NetworkX | cuGraph | graph analytics |
| (file IO) | KvikIO | high-performance GPU file IO |
| (dashboards) | cuxfilter | GPU-accelerated interactive dashboards |
| scikit-image | cuCIM | image processing |
| Faiss / Annoy | cuVS | vector search |
| GeoPandas | cuSpatial | geospatial analytics |
| (low-level) | RAFT (pylibraft) | GPU primitives and multi-GPU |
Full per-library guidance, including when each is the *wrong* choice and how to combine
them, is in references/decision_framework.md.
Install commands and CUDA version selection are in
references/installation.md. Before/after conversions for
every library are in
references/code_transformation_patterns.md.
When helping a user optimize code, follow this process:
Before optimizing, understand where time is actually spent:
import time
# or use cProfile, line_profiler, or py-spy for detailed profiling
Don't guess — measure. The bottleneck might not be where the user thinks.
Not all code benefits from GPU acceleration. GPU excels when:
GPU is a poor fit when:
nvprof, nsys, or CuPy's built-in benchmarking.These apply across all libraries:
.get() or cp.asnumpy() forces a sync.float32 instead of float64 when precision allows — GPU float32 throughput is 2x-32x higher.Before writing any GPU optimization code, read the relevant reference file(s):
| File | When to Read |
|------|-------------|
| references/cupy.md | User has NumPy/SciPy code, or needs array operations on GPU |
| references/numba.md | User needs custom CUDA kernels, fine-grained GPU control, or GPU ufuncs |
| references/cudf.md | User has pandas code, or needs dataframe operations on GPU |
| references/cuml.md | User has scikit-learn code, or needs ML training/inference/preprocessing on GPU |
| references/cugraph.md | User has NetworkX code, or needs graph analytics on GPU |
| references/warp.md | User needs GPU simulation, spatial computing, mesh/volume queries, differentiable programming, or robotics |
| references/kvikio.md | User needs high-performance file IO to/from GPU, GPUDirect Storage, reading S3/HTTP to GPU, or Zarr on GPU |
| references/cuxfilter.md | User wants GPU-accelerated interactive dashboards, cross-filtering, or EDA visualization (note: sunset — 26.06 is the final release) |
| references/cucim.md | User has scikit-image code, or needs image processing, digital pathology, or WSI reading on GPU |
| references/cuvs.md | User needs vector search, nearest neighbors, similarity search, or RAG retrieval on GPU |
| references/cuspatial.md | User has GeoPandas/shapely code, or needs spatial joins, distance calculations, or trajectory analysis on GPU (note: archived — frozen at 25.04) |
| references/raft.md | User needs sparse eigensolvers, device memory management, or multi-GPU primitives |
Read the specific reference before writing code — they contain detailed API patterns, optimization techniques, and pitfalls specific to each library.
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.
MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.
UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.
Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.
Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.
Take k-dense-ai/optimize-for-gpu from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.