ns-language

Resolve NeuroScript syntax and shape errors in .ns files.

Updated Nov 25, 2025
One-click install
npx skills add https://github.com/severeon/neuroscript-rs --skill ns-language
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ns-language
Source: https://github.com/severeon/neuroscript-rs/tree/main/.claude/skills/ns-language
Command: npx skills add https://github.com/severeon/neuroscript-rs --skill ns-language

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides an authoritative NeuroScript language reference and troubleshooting guide to resolve questions about neuron definitions, ports, shapes, connections, match expressions, context bindings, conditionals, and impl references so authors can write correct .ns files and avoid shape or instantiation errors.

Core Features & Use Cases

  • Syntax reference: Clear rules for neuron declarations, parameters, port specifications, use statements, impl notation, and comments.
  • Shape and dimension system: Explanations of literal, named, wildcard, variadic, and expression dimensions, plus shape unification and broadcasting rules.
  • Graph & control flow guidance: Best practices for pipelines, implicit and explicit forks, match expressions, guards, and if/elif/else routing.
  • Context and recursion semantics: Detailed behavior for @lazy, @static, and @global bindings, recursion constraints, and validation rules.
  • Validation scenarios: How to detect and fix non-exhaustive matches, unreachable arms, dimension mismatches, recursive instantiation errors, and impl/import formatting mistakes.

Quick Start

Ask the skill to inspect a neuron definition that is failing validation and explain the minimal changes required to fix ports, shapes, match arms, or context bindings.

Frequently Asked Questions about ns-language

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

FAQPage Schema
How do I fix shape unification errors in NeuroScript neuron definitions?

To fix shape unification errors in NeuroScript neuron definitions, you must ensure that literal, named, wildcard, and variadic dimensions align correctly across ports and match patterns according to the language's broadcasting rules. This skill resolves those mismatches by inspecting the .ns file and explaining the minimal changes required for port declarations and shape consistency.

How does match expression exhaustiveness work in .ns files?

Match expression exhaustiveness in .ns files requires that all possible shape patterns are covered by the match arms without unreachable routes. This skill validates your match expressions by detecting non-exhaustive matches and unreachable arms, then explains how to correct the guards and conditionals to ensure complete routing.

What are the semantics of @lazy, @static, and @global context bindings in NeuroScript?

The semantics of @lazy, @static, and @global context bindings in NeuroScript dictate how variables are instantiated and scoped during neuron execution and recursion. This skill provides detailed behavior explanations and validation rules to prevent recursive instantiation errors and improper context binding.

How do I validate impl references and import formatting in a .ns file?

To validate impl references and import formatting in a .ns file, you must check that the impl notation and use statements follow the correct syntax rules for neuron definitions. This skill inspects the formatting mistakes and explains the minimal changes required to resolve impl and import errors.

Why is my variadic pattern causing a dimension mismatch in my neuron definition?

A variadic pattern causes a dimension mismatch in a neuron definition when its shape does not correctly unify with the connected ports or literal dimensions during broadcasting. This skill identifies the specific dimension mismatches in your .ns file and explains how to adjust the variadic patterns for proper shape unification.