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 2mo 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.
- 2mo ago Changed · +1 lines 1bb287bd6b61
- 3mo 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 2mo 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.
bxc-rust-ffi compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| bxc-rust-ffiaphrody-code/bxc | Skill | 3 | 2mo ago | Apache-2.0 | A | 108 | Claude Code |
| rust-crate-ciZaxbyHub/opencode-swarm | Skill | 551 | yesterday | MIT | A | 60 | Claude Code |
| rust-learneractionbook/actionbook | Skill | 1.6k | 1mo ago | Apache-2.0 | A | 51 | Claude Code |
| rewrite-in-rustFirstp1ck/pi-coding-agent-forge | Skill | 96 | today | MIT | A | 152 | Claude Code, Codex |
| Agent Browser AutomationPramodDutta/qaskills | Skill | 253 | 1mo ago | MIT | A | 37 | Claude Code, Codex |
| using-claude-clideveloperz-ai/ui-debugger-mcp | Skill | 2 | 3d ago | MIT | A | 61 | Claude Code, Codex |
| rust-migrationJuanMarchetto/agent-skills | Skill | 5 | 8mo ago | MIT | A | 60 | Claude Code |