AI Assistant
The navi skill gives your AI coding agent focused knowledge of the Navi language — syntax, execution model, standard library, and common patterns — so it can write correct, idiomatic .nv indicator and strategy scripts without needing to learn from scratch each session.
What's included
The skill contains four reference files loaded on demand:
| File | Purpose |
|---|---|
syntax.md | Surface syntax — declarations, control flow, functions, struct/enum/newtype, imports |
execution-model.md | Bar-by-bar execution, type qualifiers (const/input/simple/series), var/varip, na, history references, avoiding repainting |
stdlib.md | Built-in functions — prelude, ta/math/str, Array/Map/Matrix, drawing, strategy |
patterns.md | Proven idioms — indicator/strategy/library skeletons, warmup guards, stateful accumulators, cross logic, pitfalls |
Installation
Install from the longbridge/navi repository with the Skills CLI:
npx skills add longbridge/naviTo inspect the repository's available skills before installing:
npx skills add longbridge/navi --listIf your installer asks which skill to add, choose navi. You can also install it explicitly:
npx skills add longbridge/navi --skill naviAlternatively, download the packaged skill and extract it into your agent's skills directory.
Install the standalone navi CLI as well so the AI agent can compile and run the scripts it writes.
macOS or Linux:
curl -fsSL https://navi-lang.org/install.sh | shWindows PowerShell:
irm https://navi-lang.org/install.ps1 | iexVerify the CLI is available:
navi --versionUpdate the installed skill when Navi documentation or APIs change:
npx skills update naviThe CLI contains no market data. The validation workflow below uses --data with caller-provided synthetic or real OHLCV data.
Usage
Once installed, compatible AI coding agents can use the skill automatically when working with .nv files or when you ask about Navi.
Write a complete Navi VWAP indicator with configurable upper and lower bands.
Save it as vwap_bands.nv and validate it with the navi CLI.For better results, include:
- The script kind: indicator, strategy, or library
- Inputs and expected plots, signals, or orders
- Symbol or timeframe assumptions
- Repainting and warmup requirements
- The target
.nvfilename
Recommended Workflow
Ask the agent for a complete
.nvfile, not an isolated fragment.Use
snake_casefor filenames, variables, parameters, and functions.Require the agent to validate the file with the standalone
naviCLI:bashnavi check path/to/script.nvHave the agent apply canonical formatting with
navi fmt path/to/script.nv, or verify it withnavi fmt --check.When several files changed, validate them together — both commands accept files, directories, and glob patterns:
bashnavi check "src/**/*.nv" navi fmt srcUse the validated script with the Longbridge CLI, App, or desktop client. The standalone
naviCLI is primarily a development and debugging tool.
Do not accept a claim that a script was validated unless the agent ran the CLI successfully. A code block alone is not validation.
Runtime behavior
The standalone navi CLI validates compilation and formatting; it does not execute scripts and bundles no market data, so it cannot confirm runtime behavior on its own. To check what a script actually produces, prefer these in order:
- An installed and authenticated Longbridge CLI:
longbridge quant runexecutes a script directly against Longbridge historical data. - A Longbridge MCP server in the AI environment: request historical candlesticks with its market-data tools.
- The Playground, which runs the script in the browser against sample candles.
Reason explicitly about warmup, rising, falling, flat, and signal-producing paths when reviewing a script the CLI can only compile.
Online preview
After validation, an AI agent can generate a Playground preview by encoding the complete UTF-8 script as unpadded Base64URL and placing it in the code query parameter:
https://navi-lang.org/playground?code=<base64url-source>Opening the link loads the script as an unsaved file and adds it to the chart. Base64URL uses - and _ instead of + and /, with trailing = removed. Keep the source file alongside the link because browsers and chat clients limit URL length.
Example Requests
Review momentum_strategy.nv for repainting and series-state errors.
Fix the file, preserve its behavior, and run navi check when finished.Create a Navi library that exports EMA and crossover helpers.
Use Navi naming conventions, save it as moving_average_helpers.nv,
and return the exact navi check result.The skill treats navi-lang.org and its standard-library reference as the source of truth for current APIs.

