effects

A rule set for Sounio, a programming language, that requires functions to declare the side effects they perform. Side effects include actions such as file access, mutation, division, allocation, asynchronous work, and GPU execution.

In plain words
What is it for?
Use it when writing or checking Sounio functions. It helps enforce declarations such as IO, Mut, Div, Panic, Alloc, Async, GPU, and Prob, while keeping pure functions free of an effects clause.
Why use it?
It makes potentially unsafe or externally visible behavior explicit in function definitions. Effects also propagate to callers, so code must acknowledge the effects of functions it uses.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/sounio-lang/sounio/effects
Clone the repo
git clone --depth 1 https://github.com/Sounio-lang/sounio

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 689 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00689
Opus 5 $0.00000 $0.00345
Sonnet 5 $0.00000 $0.00138
Haiku 4.5 $0.00000 $0.00069

Measured 3d ago against content hash 77c5a8a532dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

effects 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 3d 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.

.cursor/rules/effects.mdc · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sounio Effects System

Every function that performs a side effect MUST declare it with with. Missing effects = compile error.

Effect Reference

Effect When Required Example
IO println(), print(), file I/O, env access fn greet() with IO { println("hi") }
Mut Mutating via &!, var reassignment in &! context fn set(x: &!i32) with Mut { *x = 5 }
Div Division / or modulo % fn half(x: f64) -> f64 with Div, Panic { x / 2.0 }
Panic Array access arr[i], assert(), as casts fn get(a: [i64; 4], i: i64) -> i64 with Panic { a[i as usize] }
Alloc Heap allocation (Vec, Box) Rare in most code
Async Async operations async fn fetch() with Async { }
GPU GPU kernel execution kernel fn k() with GPU { }
Prob Probabilistic sampling fn sample() with Prob { }

Rules

  1. Pure functions have NO with clause: fn add(a: i64, b: i64) -> i64 { a + b }
  2. Div always pairs with Panic: Division can panic on zero, so both are needed
  3. Effects propagate upward: A caller must declare all effects of its callees
  4. Multiple effects: fn process() with IO, Mut, Panic, Div { }

Common Patterns

// Pure — no effects
fn square(x: i64) -> i64 { x * x }

// IO only
fn hello() with IO { println("Hello") }

// Mutation
fn increment(c: &!i64) with Mut { *c = *c + 1 }

// Division (always with Panic)
fn average(a: f64, b: f64) -> f64 with Div, Panic { (a + b) / 2.0 }

// Array processing (Panic for bounds checks)
fn sum(arr: [i64; 4]) -> i64 with Panic {
    var total: i64 = 0
    for i in 0..4 { total = total + arr[i as usize] }
    total
}

// Main — usually needs everything
fn main() with IO, Mut, Panic, Div {
    // ...
}

Common Mistakes

  • Forgetting Panic when accessing arrays: arr[i as usize] needs Panic
  • Forgetting Mut when using &! references
  • Forgetting IO when calling println() or print()
  • Forgetting Div when using / or %
  • Not propagating effects from callees to callers

Read the full file on GitHub · 66 lines

Changes

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.

  1. 3d ago First seen · 66 lines · 0 tokens per session scan A 77c5a8a532dd

Subscribe to this mod's changes

effects is a cursor rule published in the GitHub repository Sounio-lang/sounio (5 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 689 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.