moonshine Agent Skills & AI Rules

GitHub

Very low latency speech to text, intent recognition, and text to speech, for building voice agents and interfaces

10,640 stars C C 1 file ยท ~1,020 tokens #intent-recognition#stt#tts#voice#voice-recognition
RAW Rules
2 Discovered Rules โ€ข ~2,383 Estimated Tokens
Quick:
Loading skill content...

AI Agent Protocol & Instructions

AGENTS.md root-instruction ~679 tokens
Raw
# Contributor notes for agents

This file is for people (and coding agents) working **in this repository**. App developers integrating the published library should use [`.agents/skills/moonshine-voice/SKILL.md`](.agents/skills/moonshine-voice/SKILL.md) instead โ€” do not mix those audiences.

## Branching

`main` only ever contains released code. Development happens on a `dev-v<version>` candidate branch. Pull requests target that candidate, not `main`. See [docs/release-process.md](docs/release-process.md). Do not start or publish a release unless the user explicitly asked.

## Building and tests

Large model and TTS binaries are not in git. Before `scripts/test-core.sh` or offline TTS work:

```bash
scripts/fetch-voice-assets.sh all
```

A few compile-time embeds and ONNX Runtime prebuilts still use Git LFS. If a compile fails with something like `'version' does not name a type` on an `*_embedded.cpp` file, run `git lfs pull`.

Useful scripts (prefer these over ad-hoc cmake/pytest invocations):

- `scripts/test-core.sh` โ€” C++ core build and tests
- `scripts/test-python.sh` โ€” Python bindings
- `scripts/test-wasm.sh` โ€” WebAssembly bindings
- `scripts/test-docs.sh` โ€” documentation snippet tests
- `scripts/format-core.sh` โ€” Google-style clang-format for first-party `core/`
- `scripts/check-banned-constructs.sh` โ€” C++ construct gates

C++ policy lives in [core/STYLE_GUIDE.md](core/STYLE_GUIDE.md): C++20, RAII, no new owning `new`/`delete` or `reinterpret_cast` outside the baseline allow-list, no unsafe C string functions. Do not format or lint `core/third-party/` or `core/cpp-annote/`.

## Public API

Language bindings follow construct โ†’ chainable setters โ†’ `load()`. Constructors are cheap and cannot fail. Do not put downloads or model opens in a constructor. The high-level types are `MicTranscriber`, `AgentFlow`, and `TextToSpeech`; `Transcriber` is the low-level PCM path and `EmbeddingModel` is the low-level text-embedding path. `DialogFlow` and the Intent API are gone.

Only OnnxRuntime flatbuffer models (`.ort`) are accepted. Do not add `.onnx` loading paths.

User-facing changes go in [CHANGELOGS.md](CHANGELOGS.md): Keep a Changelog, high-level bullets, no more than about 200 characters each.

## Layout

- `core/` โ€” C++ engine and C API (`moonshine-c-api.h`)
- `language-bindings/` โ€” Python, WASM, Swift, Android
- `docs/` โ€” mkdocs source, published at https://moonshine-voice.readthedocs.io
- `examples/` โ€” per-platform sample apps (the fine-tune notebook is `examples/python/finetune/`; the trainer is `moonshine_voice.lora` / `moonshine-voice finetune`)
- `micro/` โ€” tiny on-device models, separate from the main library