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/briangmilnes/apas-verus/collection-iteratorsgit clone --depth 1 https://github.com/briangmilnes/APAS-VERUSWrote 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/briangmilnes/apas-verus/collection-iterators)<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/collection-iterators"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/collection-iterators.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 | $0.00000 | $0.01801 |
| Opus 5 | $0.00000 | $0.00901 |
| Sonnet 5 | $0.00000 | $0.00360 |
| Haiku 4.5 | $0.00000 | $0.00180 |
Grade A, and why
collection-iterators 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.
How it starts
The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Collection Iterator Standard
Every APAS-VERUS collection module must implement the iterator standard defined in docs/APAS-VERUSIterators.rs. The canonical reference implementation is src/Chap18/ArraySeqStEph.rs.
Exemplar
📋 /home/milnes/projects/APAS-VERUS/src/Chap18/ArraySeqStEph.rs
Required Components (all inside verus!)
All 10 source components go in section // 10. iterators of the file.
| # | Component | Purpose |
|---|---|---|
| 1 | Custom iterator struct wrapping inner Rust iterator | CollectionIter<'a, T> { inner: std::slice::Iter<'a, T> } |
| 2 | View for iterator: type V = (int, Seq<T>), closed spec fn delegating to self.inner@ |
Position + full sequence |
| 3 | iter_invariant open spec fn: 0 <= [email protected] <= [email protected]() |
Bounds the position index |
| 4 | Iterator::next with ensures (None/Some arms, old(self)@ pattern) |
Core verified iteration contract |
| 5 | Ghost iterator struct: { pub pos: int, pub elements: Seq<T>, pub phantom: PhantomData<&'a T> } |
Spec-level loop state |
| 6 | ForLoopGhostIteratorNew impl on exec iterator |
Creates ghost from exec |
| 7 | ForLoopGhostIterator impl on ghost iterator (6 spec fns) |
Full ghost loop protocol |
| 8 | View for ghost iterator: elements.take(pos) = items-seen-so-far |
For assertions after loop |
| 9 | iter(&self) method with ensures [email protected] == 0, [email protected] == self.seq@, iter_invariant(&it) |
Entry point |
| 10 | IntoIterator for &Self with same ensures as iter() |
Enables for x in &collection |
Optional but recommended:
IntoIterator for Self(consuming pattern, yieldsTnot&T)
Iterator::next ensures pattern
fn next(&mut self) -> (next: Option<&'a T>)
ensures ({
let (old_index, old_seq) = old(self)@;
match next {
None => {
&&& self@ == old(self)@
&&& old_index >= old_seq.len()
},
Some(element) => {
let (new_index, new_seq) = self@;
&&& 0 <= old_index < old_seq.len()
&&& new_seq == old_seq
&&& new_index == old_index + 1
&&& element == old_seq[old_index]
},
}
})
{
self.inner.next()
}
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.
- 5d ago First seen · 185 lines · 0 tokens per session scan A 2e4240f7235a
collection-iterators is a cursor rule published in the GitHub repository briangmilnes/APAS-VERUS (10 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,801 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.
Other cursor rules, from other repositories
core
Core STT/TTS abstraction layer documentation.
rust-module-refactor
Use when splitting Rust modules, moving tests, tightening visibility, or preserving facades during refactors.
rust-architect
PoolAI — Rust Architect workflow: runtime stack, MSYS2, target/ disk, pre-push checks, docs sync.
rust-development-standards
Rust development standards: idioms, style, anti-patterns (Rust 2021 edition, 2024 where applicable).
cube-engine
Use when changing Rust puzzle state, moves, notation, scrambles, or validation.
ivolgaql-project
Общие принципы ИволгаQL (MVP, Rust, русский UX, TCP).