neurokit2
NeuroKit2 is a Python toolkit for processing and analyzing physiological biosignals including ECG, EEG, EDA, respiration, EMG, and eye movement data. Use this skill when extracting cardiac metrics like heart rate variability, detecting brain activity patterns, measuring autonomic nervous system responses, or integrating multiple physiological signals for psychophysiology research and clinical applications.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/neurokit2 && cp -r /tmp/neurokit2/skills/neurokit2 ~/.claude/skills/neurokit2SKILL.md
# NeuroKit2
## Scope and evidence cutoff
Use this skill for method-aware, reproducible biosignal research with NeuroKit2. The
snapshot was checked on **2026-07-23** against:
- stable PyPI **0.2.13**, released 2026-03-02;
- Python metadata (`>=3.10`; classifiers 3.10–3.14) and wheel dependencies;
- GitHub release notes/tags, `NEWS.rst`, source at tag `v0.2.13`;
- official API pages/examples (the live site identified itself as
`0.2.13.dev214`); and
- pinned 0.2.13 runtime signatures and synthetic output schemas.
The live documentation can be ahead of the stable wheel. Prefer the pinned runtime
for reproducible work and name both versions if consulting development docs.
## Boundary
NeuroKit2 is a research and educational toolbox. Do **not** present its output as:
- a diagnosis, treatment recommendation, patient-monitoring decision, or alarm;
- validation, certification, or regulatory evidence for a medical device; or
- proof that a physiological construct is measured validly in a new sensor,
protocol, environment, population, or disease group.
Validate acquisition hardware, electrode/optode placement, units, sampling and clock
accuracy, preprocessing, detector/decomposition method, population, task, and
outcomes for the intended study. Preserve raw data and an auditable exclusion log.
Use deidentified local files only; do not place PHI in prompts, logs, examples, or
bundled fixtures.
## Reproducible installation
```bash
uv pip install "neurokit2==0.2.13"
```
For optional features, create a uv project, add only the packages actually required at
reviewed exact versions, and commit/review the resulting `uv.lock` before
`uv sync --locked`. NeuroKit2 exposes an upstream `full` extra, but this skill
intentionally does not install that floating transitive set in an automated workflow.
Optional capabilities can require MNE, cvxopt, Plotly, PyEMD, pyRQA, Pillow, OpenCV,
or file readers. Record the resolved environment with the analysis. Provision any MNE
data/template download as an explicit, checksummed study input. Do not install a moving
development branch for a reproducible study.
## Required data contract
Before processing, record:
1. signal identity and sensor/channel configuration;
2. native sampling rate in Hz and physical unit (or explicitly `arbitrary_unit`);
3. clock, timestamp origin, drift correction, and synchronization evidence;
4. polarity/orientation and acquisition-side filters/gain;
5. missing samples, discontinuities, saturation, flatlines, motion, and annotations;
6. whether event onsets are zero-based sample indices or seconds;
7. planned preprocessing order, methods, parameters, exclusions, and outputs; and
8. participant-level grouping needed to prevent leakage in later statistics.
Never infer units from a column name. Do not silently treat samples as milliseconds,
volts, microsiemens, or arbitrary units.
## Core workflow
### 1. Inspect before transforming
```bash
python skills/neurokit2/scripts/inspect_signal.py \
--input recording.csv --root . --deidentified \
--columns ECG,RSP,EDA --time-column time_s \
--units ECG=mV,RSP=a.u.,EDA=uS
```
The inspector is bounded and emits no row values or paths. Resolve non-monotonic time,
duplicate samples, gaps, non-finite values, flat runs, and sampling-rate disagreement
before filtering.
### 2. Preserve preprocessing order
Use this default reasoning order, adapting it to the acquisition and cited method:
1. preserve immutable raw signal and annotations;
2. verify time base, units, polarity, clipping, gaps, and artifacts;
3. segment at long gaps; only interpolate short gaps under a declared policy;
4. apply modality-specific cleaning at the native sampling rate;
5. detect peaks/onsets or decompose components;
6. inspect quality outputs and raw overlays;
7. correct peaks only with logged categories and sensitivity checks;
8. derive rates/features;
9. align continuous modalities on a declared common time grid; and
10. map event indices to that grid, epoch, baseline, and analyze.
Do not resample binary markers or peak-index arrays as ordinary continuous signals.
Map their timestamps to the target grid. Filtering and interpolation can create edge
artifacts and false precision; retain masks for padded, missing, and rejected regions.
### 3. Treat schemas as runtime observations
Return columns depend on NeuroKit2 version, function, method, signal availability, and
analysis mode. Never claim that one column list is universal.
```python
signals, info = nk.ecg_process(ecg, sampling_rate=250)
observed_schema = {
"columns": list(signals.columns),
"info_keys": sorted(info),
}
```
Persist the observed schema with package version, method parameters, sampling rate, and
quality/exclusion summary. Reference files list verified default schemas for 0.2.13,
not guarantees for every method.
## Current patterns
### ECG, corrected peaks, and duration-aware HRV
In stable 0.2.13, `ecg_process()` performs cleaning, R-peak detection with
`correct_artifacts=True`, rate, default `averageQRS` quality, DWT delineation, and phase.
```python
signals, info = nk.ecg_process(ecg, sampling_rate=250, method="neurokit")
time_hrv = nk.hrv_time(info, sampling_rate=250)
```
Inspect `ECG_R_Peaks_Uncorrected` and `ECG_fixpeaks_*`; a corrected series is not
automatically a valid NN series. For frequency/nonlinear HRV, enforce metric-specific
duration and beat-count requirements. Five minutes is the conventional short-term
reference; ULF is a long-recording measure, and VLF interpretation from short records
is unsafe. Do not interpret LF/HF as a direct sympathovagal balance. PPG pulse-rate
variability is not interchangeable with ECG HRV.
Use the bounded pipeline:
```bash
python skills/neurokit2/scripts/ecg_hrv_pipeline.py \
--synthetic --sampling-rate 250 --duration 300 \
--domains time,frequency,nonlinear
```
### EDA with explicit decomposition
The stable default `eda_process(method="neurokit")` uses high-pass tonic/phasicHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include "method validation", "analytical method validation", "AMV", "validation protocol", "acceptance criteria", "linearity", "reportable range", "accuracy and precision", "repeatability", "intermediate precision", "recovery", "LOD", "LOQ", "detection limit", "quantitation limit", "specificity", "robustness", "method transfer", "method comparison", "Deming", "Passing-Bablok", "Bland-Altman", "equivalence testing", "OOS investigation", "ICH Q2", "Q2(R2)", "Q14", "USP 1225", "ICH M10", "incurred sample reanalysis", "ISR", "CLSI EP", and any request to show that an assay works.
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g. "get my model's eval score up", "improve this agent/harness", "tune this pipeline", "beat the baseline on this benchmark", "run a search over approaches and keep the best", "do an MLE-bench / Kaggle-style optimization", or any long-horizon "make this artifact better and don't just memorize the dev set" task. Trigger it even when the user doesn't say "Arbor" or "hypothesis tree" but describes repeated experiment-and-evaluate loops, branching exploration of competing ideas, or worries about a dev/test gap. Runs Claude itself as the coordinator with subagent executors in isolated git worktrees; for the standalone `arbor` CLI tool see references/arbor-upstream.md.
Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.
Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.
Observe the user's screen via screenpipe, detect repeated research workflows, match them against existing scientific-agent-skills, and draft new skills (or composition recipes that chain existing ones) for the patterns not yet covered. Use when the user asks to analyze their recent work and propose skills based on what they actually do. Requires the screenpipe daemon (https://github.com/screenpipe/screenpipe) running locally on port 3030 — the skill has no other data source and will refuse to run if screenpipe is unreachable. All detection runs locally; only redacted cluster summaries reach the LLM.