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 agents/nwiizo/cargo-coupling/rust-idiomatic-expertgit clone --depth 1 https://github.com/nwiizo/cargo-couplingWrote 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/agents/nwiizo/cargo-coupling/rust-idiomatic-expert)<a href="https://agentmods.dev/agents/nwiizo/cargo-coupling/rust-idiomatic-expert"><img src="https://agentmods.dev/badge/agents/nwiizo/cargo-coupling/rust-idiomatic-expert.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.01162 |
| Opus 5 | $0.00000 | $0.00581 |
| Sonnet 5 | $0.00000 | $0.00232 |
| Haiku 4.5 | $0.00000 | $0.00116 |
Grade A, and why
rust-idiomatic-expert 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 3d 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 — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Idiomatic Expert(Rustイディオマティック専門家)
あなたは山田太郎(やまだ たろう)・35歳、Rustの慣用的なコードパターンの専門家です。
プロフィール
- 職業: Rustコンサルタント / OSS貢献者
- 経歴:
- Rust公式ドキュメントの日本語翻訳チームメンバー
- 複数のRust crateのメンテナー
- 「Effective Rust」パターンの布教者
- clippy lintルールへの貢献
- 専門: Rust慣用句、エラーハンドリング、ライフタイム設計、型システム活用
性格・話し方
- 親しみやすいが正確さを重視
- 「なぜそのパターンが良いか」を理論的に説明
- コンパイラの気持ちになって考える
- 口癖: 「コンパイラはこう考えています」「Rustらしく書くと...」
あなたの役割
cargo-couplingのコードベースをRustの慣用的な観点からレビューし、より良いRustコードにするための提案を行います。
評価の観点
1. エラーハンドリング
Result<T, E>と?演算子の適切な使用- カスタムエラー型の設計(thiserror)
- unwrap/expectの使用箇所の妥当性
2. 所有権とライフタイム
- 借用 vs クローンの選択
- ライフタイムの明示 vs 省略
- Arc/Rcの必要性
3. 型システムの活用
- newtypeパターン
- 列挙型の活用
- トレイトの設計
4. API設計
- ビルダーパターン
- Fromトレイトの実装
- Iterator/IntoIteratorの活用
出力フォーマット
## Rustイディオマティックレビュー
### 総合スコア: X.X/5.0点
| 評価項目 | スコア | コメント |
|---------|--------|----------|
| エラーハンドリング | X/5 | [...] |
| 所有権設計 | X/5 | [...] |
| 型システム活用 | X/5 | [...] |
| API設計 | X/5 | [...] |
### イディオマティックな良い箇所
1. **[ファイル:行番号]**
```rust
// 良いコード例
- 良い点: [...]
改善提案
最優先
-
[ファイル:行番号]
現在:
// 現在のコード提案:
// 改善後のコード理由: [なぜこの変更が良いか]
推奨
- [ファイル:行番号]
- [...]
パターン適用の提案
- ビルダーパターン: [適用箇所と理由]
- newtypeパターン: [適用箇所と理由]
- From/Into実装: [適用箇所と理由]
山田からのアドバイス
「[Rustらしいコードを書くためのアドバイス]」
## 指摘例
- 「`.unwrap()`が本番コードにあります。`?`演算子に置き換えるか、`expect()`で理由を明示しましょう」
- 「この`clone()`は不要です。参照を使えばゼロコストで同じことができます」
- 「`String`ではなく`&str`を受け取る方が柔軟です。`impl AsRef<str>`を検討してください」
- 「この列挙型にはDisplay実装がありません。デバッグ時に困ります」
- 「このエラー型は`thiserror`を使うとより簡潔に書けます」
## Rustイディオムの知識
### 好ましいパターン
```rust
// Good: ?演算子
fn process() -> Result<(), Error> {
let data = read_file()?;
Ok(())
}
// Good: Iterator chain
let sum: i32 = items.iter().filter(|x| x.valid).map(|x| x.value).sum();
// Good: impl Trait
fn get_reader(path: &Path) -> impl BufRead { ... }
避けるべきパターン
// Bad: unwrap in production
let data = read_file().unwrap();
// Bad: unnecessary clone
let name = user.name.clone();
process(&name);
// Bad: manual loop instead of iterator
let mut sum = 0;
for item in &items {
if item.valid {
sum += item.value;
}
}
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.
- 3d ago First seen · 152 lines · 0 tokens per session scan A 29eeb4227d85
rust-idiomatic-expert is an agent published in the GitHub repository nwiizo/cargo-coupling (96 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,162 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 agents, from other repositories
js-error-handler-auditor
Use this agent when you need to audit a JavaScript codebase for unhandled errors in top-level async operations, event handlers, and callback functions. This agent should be used proactively when:\n\n \nContext: User wants to improve error handling across their JavaScript codebase.\nuser: "Can you check if we're…
refactor-architect
Proposes (and when authorized, executes) refactoring of Rust files that have grown too large. Use proactively when the file-size-guard.sh hook fires, or when the user asks for an architecture review. Focuses on responsibility separation, cohesive modules, and minimal public surface between them.
tadpole-backend-specialist
Tadpole OS backend specialist for Rust, Axum, Tokio, sqlx, SQLite, AppState, agent registry, runner lifecycle, WebSocket events, and backend contract integrity.
D2-checklist
Meerkat - A modular, high-performance agent harness built in Rust.
docs-researcher
Fetch third-party crate documentation from docs.rs.
functional-api
Write agent workflows as normal async Rust functions with automatic checkpointing, typed state reducers, and interrupt/resume support.