Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/sounio-lang/sounio/typesgit clone --depth 1 https://github.com/Sounio-lang/sounioWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00814 |
| Opus 5 | $0.00000 | $0.00407 |
| Sonnet 5 | $0.00000 | $0.00163 |
| Haiku 4.5 | $0.00000 | $0.00081 |
Grade A, and why
types scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Sounio Type System
Primitives
i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, bool, char
Fixed-Size Arrays
Arrays MUST have a compile-time size. No slices.
let arr: [i64; 4] = [1, 2, 3, 4]
var buf: [i64; 256] = [0; 256] // fill with zeros
let combined = a ++ b // concatenation
Vec (Growable)
let v: Vec<i32> = [1, 2, 3, 4]
For manual control, use stdlib IntVec / FloatVec with impl blocks.
Structs
struct Point { x: f64, y: f64 }
let p = Point { x: 1.0, y: 2.0 }
Enums
enum Color { Red, Green, Blue }
let c = Color::Red
match c {
Color::Red => 10
Color::Green => 20
Color::Blue => 30
_ => 0
}
Tuples
let pair = (42, true)
let (x, y) = (1, 2) // destructuring
Function Types
fn square(x: i64) -> i64 { x * x }
let f: fn(i64) -> i64 = square
let result = f(7) // 49
fn apply(f: fn(i64) -> i64, x: i64) -> i64 { f(x) }
NO closure literals. Only named function references.
Linear Types
Must be consumed exactly once:
linear struct Handle { fd: i32 }
fn consume(h: Handle) -> i32 { h.fd } // consumes h
Affine Types
Can be consumed at most once:
affine struct Token { id: i64 }
Units of Measure
Dimensional analysis at compile time:
unit kg
unit mg = 0.001 * kg
unit velocity = m / s
let dose: mg = 500.0
let mass: kg = 75.0
Standard 7-dimensional SI exponent vector (mass, length, time, temperature, amount, current, luminosity).
Refinement Types
Types with predicates:
type Probability = { p: f64 | p >= 0.0 && p <= 1.0 }
type SafeDose = { d: f64 | d > 0.0 && d <= 1000.0 }
Epistemic Types (Knowledge)
Sounio's unique feature — uncertainty propagation through computation:
use epistemic::{Knowledge}
let dose: Knowledge<mg> = measure(500.0, uncertainty: 2.5)
// Value + uncertainty tracked through all arithmetic
What Does NOT Exist
- No
Box<T>,Rc<T>,Arc<T>— use fixed arrays or linear types - No trait objects or dynamic dispatch — use function references
- No generics (yet) — use monomorphic types
- No
Result<T, E>— return(value, error_code)tuples - No
Option<T>— use stdlibIntOption/FloatOption
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 106 lines · 0 tokens per session scan A feaf21e35e45
types is a cursor rule published in the GitHub repository Sounio-lang/sounio (5 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 814 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.