lib-rs-structure

lib-rs-structure is a cursor rule for Cursor from briangmilnes/APAS-VERUS. It costs 811 tokens per session, scanned A, original, MIT.

A set of project rules for organizing Rust's lib.rs file and controlling its compiler settings. Verus is a tool used to formally check whether Rust code meets stated properties.

In plain words
What is it for?
Use it when adding Rust modules, changing toolchain settings, or preparing chapters of a Verus-checked project.
Why use it?
It keeps module declarations and compiler features consistent, and prevents verification-related code from being hidden with conditional compilation.

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/briangmilnes/apas-verus/lib-rs-structure
Clone the repo
git clone --depth 1 https://github.com/briangmilnes/APAS-VERUS

Made for: Cursor.

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

agentmods badge for lib-rs-structure

README.md
[![agentmods](https://agentmods.dev/badge/rules/briangmilnes/apas-verus/lib-rs-structure.svg)](https://agentmods.dev/rules/briangmilnes/apas-verus/lib-rs-structure)
Your own site
<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/lib-rs-structure"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/lib-rs-structure.svg" alt="Measured on agentmods" height="20"></a>
Per session 811 This file is loaded in full into every session.
When invoked 811 The same file — it is already loaded in full.
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.00811 $0.00811
Opus 5 $0.00405 $0.00405
Sonnet 5 $0.00162 $0.00162
Haiku 4.5 $0.00081 $0.00081

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

Security

Grade A, and why

lib-rs-structure 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 5d 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/apas-verus/lib-rs-structure.mdc · 91 lines

How it starts

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

lib.rs Structure

Rust Toolchain

The project pins Rust 1.93.0 via rust-toolchain.toml. No nightly features are used by project code.

The one exception: #![cfg_attr(verus_keep_ghost, feature(allocator_api))] is required because Verus's nightly Rust exposes Arc<T, A> and our assume_specification for Arc::clone in vstdplus/smart_ptrs.rs must match that exact signature. If vstd adds an Arc::clone spec upstream, remove this line and delete our local spec.

Do not add any other #![feature(...)] or #![cfg_attr(..., feature(...))] to lib.rs.

No verus_keep_ghost

There must be no use of verus_keep_ghost in lib.rs for module gating, split pub mod blocks, or #[cfg(not(verus_keep_ghost))] duplicate code. The sole permitted use is the allocator_api feature gate documented in the Rust Toolchain section above. See no-cfg-not-verus-keep-ghost.mdc for the full antipattern list.

Every chapter gets one unconditional pub mod ChapNN block containing all its files. If a chapter doesn't verify under Verus, that is the project state (PBOGH), not something to hide behind conditional compilation.

Commenting out files that don't compile under Verus

Files that use external crates Verus can't link (rand, bitvec, ordered_float, etc.) or have other Verus-incompatible constructs should be commented out in lib.rs with a reason, not hidden behind verus_keep_ghost gates:

pub mod Chap39 {
    // pub mod BSTTreapStEph;  // uses rand (Verus can't link)
    // pub mod BSTTreapMtEph;  // uses rand (Verus can't link)
}

This keeps the files visible and grep-able. When #[verifier::expect_failure] becomes available in Verus, these can be uncommented and marked as expected failures, making it easy to check whether a Verus update fixes them.

Allowed cfg gates

Only these cfg attributes are permitted in lib.rs:

Gate Purpose
#[cfg(not(feature = "experiments_only"))] Skip chapters when verifying only experiments
#[cfg(not(any(feature = "experiments_only", feature = "dev_only")))] Skip chapters in dev-only mode
#[cfg(feature = "all_chapters")] Optional slow/WIP files within a chapter

Read the full file on GitHub · 91 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. 5d ago First seen · 91 lines · 811 tokens per session scan A ba4bc076043a

Subscribe to this mod's changes

lib-rs-structure is a cursor rule published in the GitHub repository briangmilnes/APAS-VERUS (10 stars, last pushed 1mo ago), licensed MIT. It adds 811 tokens to every session, about $0.0041 per session on Opus 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.