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/quinnjr/skia-rs/ffigit clone --depth 1 https://github.com/quinnjr/skia-rsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/quinnjr/skia-rs/ffi)<a href="https://agentmods.dev/rules/quinnjr/skia-rs/ffi"><img src="https://agentmods.dev/badge/rules/quinnjr/skia-rs/ffi.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00525 |
| Opus 5 | $0.00000 | $0.00262 |
| Sonnet 5 | $0.00000 | $0.00105 |
| Haiku 4.5 | $0.00000 | $0.00052 |
Grade A, and why
ffi 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 4d 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.
What it actually says
FFI Guidelines
C API Design
- All FFI functions in
skia-rs-ffi - Use opaque pointers for complex types
- Follow Skia's C API naming:
sk_{type}_{method} - Always check for null pointers
// skia-rs-ffi/src/lib.rs
/// Create a new paint object.
///
/// # Safety
/// Returns a valid pointer that must be freed with `sk_paint_delete`.
#[no_mangle]
pub unsafe extern "C" fn sk_paint_new() -> *mut Paint {
Box::into_raw(Box::new(Paint::new()))
}
/// Delete a paint object.
///
/// # Safety
/// `paint` must be a valid pointer returned by `sk_paint_new`.
#[no_mangle]
pub unsafe extern "C" fn sk_paint_delete(paint: *mut Paint) {
if !paint.is_null() {
drop(Box::from_raw(paint));
}
}
/// Set the paint color.
///
/// # Safety
/// `paint` must be a valid pointer.
#[no_mangle]
pub unsafe extern "C" fn sk_paint_set_color(paint: *mut Paint, color: u32) {
if let Some(p) = paint.as_mut() {
p.set_color32(Color(color));
}
}
Type Mappings
| Skia C++ | Rust | C FFI |
|---|---|---|
SkScalar |
Scalar (f32) |
float |
SkPoint |
Point |
sk_point_t |
SkRect |
Rect |
sk_rect_t |
SkColor |
Color |
uint32_t |
SkMatrix |
Matrix |
sk_matrix_t |
SkPath* |
*mut Path |
sk_path_t* |
SkPaint* |
*mut Paint |
sk_paint_t* |
SkCanvas* |
*mut Canvas |
sk_canvas_t* |
Safety Requirements
- All FFI functions must be marked
unsafe - Document safety requirements in doc comments
- Check for null pointers before dereferencing
- Use
#[repr(C)]for all FFI-visible structs
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.
- 4d ago First seen · 70 lines · 0 tokens per session scan A a1ad0ac4e653
ffi is a cursor rule published in the GitHub repository quinnjr/skia-rs (33 stars, last pushed 16d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 525 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-09-01.
Other cursor rules, from other repositories
core
Core STT/TTS abstraction layer documentation.
rust-architect
PoolAI — Rust Architect workflow: runtime stack, MSYS2, target/ disk, pre-push checks, docs sync.
table-of-contents-standard
Standard section ordering and TOC format for Verus source files.
arc-deref-pattern
When implementing parallel (Mt) algorithms in Verus, do NOT assume.
spec-fn-naming
Spec function naming conventions.
assume-false-diverge
The pattern assume(false); diverge() in a JoinHandle::join() error arm is a valid and unavoidable Verus idiom, not a proof hole to fix.