Build spatial neighbor graphs for spatial transcriptomics data using Squidpy. Compute k-nearest neighbors, Delaunay triangulation, and radius-based connectivity for downstream spatial analyses.
SkillScore91Maintained
Automatic
◆Research pack
Last verified 8/2/2026
What it changes
Passed 20 of 22 test cases with the skill, and 15 of 22 without it.
Without skill68%
With skill91%
Checks it passed that the model alone missed
Filters duplicate edges using condition if i < j
Flattens distance array using .toarray().flatten()
Calls sc.pp.neighbors with n_neighbors=15 and n_pcs=30
and 7 more in the full report
5 fixed15 passed either way2 still failing0 broke
Pass-rate lift
+23 pp
Tokens
+29%
Agent turns
0%
Response time
-47%
Model gemini-3.6-flashMeasured 8/2/2026v120 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 5
Prompt
For spot index `spot_idx = 0`, write Python code to extract its neighbor indices from `conn` (scipy sparse matrix) and retrieve their corresponding distance values from sparse matrix `dist` as a 1D numpy array.
What was checked, without and with the skill
Checked
Without skill
With skill
Extracts neighbor indices using conn[spot_idx].nonzero()[1]
Missed
Passed
Extracts distances using dist[spot_idx, neighbor_indices].toarray().flatten()
Missed
Passed
case-12 · gemini-3.6-flash · 8/2/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md178 linessingle file
Spatial Neighbor Graphs
Build spatial neighbor graphs for connectivity-based analyses.
Required Imports
import squidpy as sq
import scanpy as sc
import numpy as np