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 skills add aphrody-code/bxc --skill bxc-rust-ffigit clone --depth 1 https://github.com/aphrody-code/bxcWrote 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/skills/aphrody-code/bxc/bxc-rust-ffi)<a href="https://agentmods.dev/skills/aphrody-code/bxc/bxc-rust-ffi"><img src="https://agentmods.dev/badge/skills/aphrody-code/bxc/bxc-rust-ffi/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/aphrody-code/bxc/bxc-rust-ffi"><img src="https://agentmods.dev/badge/skills/aphrody-code/bxc/bxc-rust-ffi.svg" alt="Reviewed on agentmods" width="80" 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.00108 | $0.00879 |
| Opus 5.5 | $0.00043 | $0.00352 |
| Sonnet 5.5 | $0.00022 | $0.00176 |
| Haiku 4.5 | $0.00011 | $0.00088 |
Grade A, and why
bxc-rust-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 1mo 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 — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
bxc Rust FFI (cdylib for Bun)
The hot path of bxc lives in Rust, exposed to Bun via cdylib + N-API style FFI (or raw extern "C" with bun:ffi or manual).
Crate Layout (in rust-bridge/)
- bxc-rust-bridge (the cdylib crate exporting bxc_* symbols)
- crates/x-client (native X GraphQL/REST + rusqlite store + ranking helpers)
- crates/x-algorithm (pure Rust port of xai-org/x-algorithm For You ranking, used via FFI or re-exported)
Critical Rules
- Single rusqlite: libsqlite3-sys "links" = "sqlite3". Only one version of rusqlite (0.37) can be linked in the cdylib. All crates in the workspace must use
{ workspace = true }for rusqlite. - Workspace Cargo.toml: Define [workspace.dependencies] rusqlite = { version = "0.37", features = ["bundled"] } etc. Use in member crates.
- no_mangle + extern "C": For symbols called from Bun (or via the bridge lib).
- Async in FFI: Use tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(...) inside the extern "C" fn. Never leak runtimes.
- Error handling: Return *mut c_char (JSON or null). Caller frees with CString.
- Build:
cargo build -p bxc-rust-bridge --release(or viabun run build:linux). Output in rust-bridge/target/release/libbxc_rust_bridge.{so,dylib,dll}
Cross-Platform Notes
- Linux: .so (default target)
- macOS: .dylib (x86_64-apple-darwin + aarch64-apple-darwin for universal if needed)
- Windows: .dll (x86_64-pc-windows-msvc). Also produce .exe for standalone tools.
- In Bun code: use
dlopenwith platform-specific name orprocess.platform+process.archto pick the right file. ProvideBXC_RUST_BRIDGE_LIBoverride.
Common FFI Pattern (from bxc)
#[no_mangle]
pub extern "C" fn bxc_x_algorithm_rank(
candidates_json: *const c_char,
context_json: *const c_char,
top_k: i32,
) -> *mut c_char {
// parse with serde, call pure algo, return CString::new(json).unwrap().into_raw()
}
Bun side lazily dlopen the lib on first use; falls back to pure JS for some paths (title, stripTags, markdown) if cdylib missing.
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.
- 1mo ago Changed · +1 lines 1bb287bd6b61
- 1mo ago First seen · 55 lines · 108 tokens per session scan A 32ed57145be5
bxc-rust-ffi is a skill published in the GitHub repository aphrody-code/bxc (3 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 108 tokens to every session and 879 once invoked, about $0.0004 per session on Opus 5.5. 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 skills, from other repositories
rust-crate-ci
Load before editing any Rust crate in this repo (currently runners/swarm-sandbox-runner). Covers the mandatory local validation gate, common rustfmt/clippy pitfalls, and Windows-specific Rust correctness patterns that CI enforces but are hard to catch locally without a Windows toolchain.
rust-learner
Learn Rust language features and crate updates. Use when user asks about Rust version changelog, what's new in Rust, crate updates, Cargo.toml dependencies, tokio/serde/axum features, or any Rust ecosystem questions.
Agent Browser Automation
Fast Rust-based headless browser automation CLI with Node.js fallback for AI agents, featuring navigation, clicking, typing, snapshots, and structured commands optimized for agent workflows.
rewrite-in-rust
Assess, plan, execute, and verify migrations of existing software to Rust. Use for requests to rewrite, port, migrate, or oxidize a codebase, library, module, application, or subsystem in Rust, including RIIR requests. Adapts to the source language and repository; supports incremental replacement, a separate complete…
using-claude-cli
How to drive claude (Claude Code) as a non-interactive CLI tool — headless runs, MCP servers, permissions, output formats, and piping. Use when scripting Claude, spawning a sub-agent from another process, or wiring Claude into CI/automation.
rust-migration
C/C++ to idiomatic Rust conversion patterns and pipeline. Covers pointer translation, memory management, error handling, string conversion, struct patterns, and quality gates. Use when: convert C to Rust, migrate to Rust, C to Rust patterns, Rust migration, rewrite in Rust.