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/patternsgit 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.01226 |
| Opus 5 | $0.00000 | $0.00613 |
| Sonnet 5 | $0.00000 | $0.00245 |
| Haiku 4.5 | $0.00000 | $0.00123 |
Grade A, and why
patterns 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 — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Sounio Patterns — Verified Copy-Paste Examples
All patterns are sourced from tests/run-pass/ and verified with souc check.
Hello World
fn main() with IO {
println("Hello, World!")
}
Array Processing (map/fold)
fn square(x: i64) -> i64 { x * x }
fn map4(arr: [i64; 4], f: fn(i64) -> i64) -> [i64; 4] with Mut, Panic {
var out: [i64; 4] = [0; 4]
var i: i64 = 0
while i < 4 {
out[i as usize] = f(arr[i as usize])
i = i + 1
}
out
}
fn fold4(arr: [i64; 4], init: i64, f: fn(i64, i64) -> i64) -> i64 with Panic {
var acc = init
for i in 0..4 {
acc = f(acc, arr[i as usize])
}
acc
}
Error Handling (Tuples)
fn safe_divide(a: f64, b: f64) -> (f64, i32) with Div, Panic {
if b == 0.0 { (0.0, 1) } // error code 1
else { (a / b, 0) } // success
}
fn main() with IO, Div, Panic {
let (result, err) = safe_divide(10.0, 3.0)
if err == 0 { println("OK") }
else { println("Division by zero") }
}
Struct with Methods
struct Counter { value: i64 }
impl Counter {
fn new() -> Counter { Counter { value: 0 } }
fn get(self: &Counter) -> i64 { self.value }
fn increment(self: &!Counter) with Mut { self.value = self.value + 1 }
}
fn main() with IO, Mut {
var c = Counter::new()
c.increment()
c.increment()
assert(c.get() == 2)
}
Array Mutation via &! Reference
// Use explicit deref for bare arrays
fn fill(arr: &![i64; 4], val: i64) with Mut, Panic {
(*arr)[0] = val
(*arr)[1] = val
(*arr)[2] = val
(*arr)[3] = val
}
// Or wrap in struct (more reliable)
struct Buffer { data: [i64; 256] }
fn fill_buffer(buf: &!Buffer, val: i64) with Mut, Panic {
for i in 0..256 {
buf.data[i as usize] = val
}
}
Higher-Order Functions
fn double(x: i64) -> i64 { x + x }
fn negate(x: i64) -> i64 { 0 - x }
fn select_op(which: i64) -> fn(i64) -> i64 {
if which == 0 { double }
else { negate }
}
fn main() with IO, Panic {
let op = select_op(0)
let result = op(21)
assert(result == 42)
}
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 · 169 lines · 0 tokens per session scan A 290893fabbf5
patterns 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 1,226 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.