brainx-general-guard

Routes BrainX modeling tasks to scale-appropriate package skills and enforces BrainX-native implementation.

1|Updated Jul 23, 2026
One-click install
npx skills add https://github.com/chaobrain/BrainX-skill --skill brainx-general-guard-chaobrain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: brainx-general-guard
Source: https://github.com/chaobrain/BrainX-skill/tree/main/brainx-display-cases/creative-experiment-verification/06-seizure-recruitment/run2/.agents/skills/brainx-general-guard
Command: npx skills add https://github.com/chaobrain/BrainX-skill --skill brainx-general-guard-chaobrain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? BrainX spans multiple packages (BrainPy-State, BrainCell, BrainMass, BrainState, BrainUnit, BrainTools), and choosing the wrong scale or writing generic NumPy/JAX code leads to incorrect or non-idiomatic neuroscience simulations. This guard identifies the modeling scales a task represents and routes work to the owning package skills before any code is written. ## Core Features & Use Cases - Scale-based skill routing: Maps tasks involving point neurons, ion channels, cellular morphology, or aggregate population dynamics to the correct BrainX package skills, including multiscale combinations. - BrainX-native code enforcement: Directs implementation toward high-level APIs such as brainmass.Simulator, brainunit.math, and brainstate.transform instead of manual array machinery or raw JAX transforms on State-aware code. - Scientific validation rules: Enforces frozen parameters, independent controls, causal-branch verification, and honest claim derivation for simulation experiments. - Use Case: When asked to build a spiking network coupled to whole-brain dynamics, the guard opens both BrainPy-State and BrainMass skills, then guides a single canonical implementation using each package's orchestrator. ## Quick Start Ask the agent to build or debug a BrainX model and let this guard run first to select the right package skills and APIs.

Frequently Asked Questions about brainx-general-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right BrainX package for a neuroscience model?

Match the modeling scale your task explicitly represents: BrainPy-State for point neurons and spiking networks, BrainCell for ions, channels, and morphology, and BrainMass for aggregate populations or whole-brain dynamics. Multiscale tasks open two or all three owning skills.

How do I build a multiscale BrainX simulation combining spiking networks and brain regions?

Treat the task as multiscale and open both BrainPy-State and BrainMass skills before coding. Keep each mechanism at its own scale and connect them through the packages' canonical APIs rather than mixing population-rate State into a point-neuron model.

Can I use raw jax.jit or jax.vmap on BrainX State-aware code?

No. Raw JAX transforms are only valid for pure array or PyTree functions that do not close over BrainState State. For stateful operations, use brainstate.transform.jit, grad, vmap, for_loop, or scan as directed by the owning package.

Should I inspect installed BrainX packages to learn their APIs?

No. Installed packages are treated only as execution dependencies; check importability and route missing packages to BrainX-install. Modeling knowledge comes from the owning skills, their references, and official API documentation.

When is a Python loop acceptable in a BrainX simulation?

A small host loop is valid only across causally sequential trials where each iteration calls one compiled rollout and selected State must reset at the boundary. Never use Python loops for timesteps or recurrent updates inside one logical rollout; use brainstate.transform.for_loop or scan.