10-rust-workflow

10-rust-workflow is a cursor rule for Cursor from ryoha000/launcherg. It costs 0 tokens per session (1,064 once invoked), scanned A, original, Unlicense.

A Rust workflow rule for a project containing a Tauri desktop application and a Chrome Native Messaging host. It defines code organization, data naming, command usage, and test practices.

In plain words
What is it for?
Use it when implementing handlers, moving data between Rust and TypeScript, generating shared types, or checking the Tauri and native-host code. Rust is a programming language, while Tauri is a framework for desktop applications.
Why use it?
It prevents the Rust, TypeScript, and browser-facing parts from drifting apart or putting business logic in the wrong layer.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when implementing handlers, moving data between Rust and TypeScript, generating shared types, or checking the Tauri and native-host code. Rust is a programming language, while Tauri is a framework for desktop applications.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ryoha000/launcherg/10-rust-workflow
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.

Clone the repo
git clone --depth 1 https://github.com/ryoha000/launcherg

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 10-rust-workflow

README.md
[![agentmods](https://agentmods.dev/badge/rules/ryoha000/launcherg/10-rust-workflow/github.svg)](https://agentmods.dev/rules/ryoha000/launcherg/10-rust-workflow)
Your own site
<a href="https://agentmods.dev/rules/ryoha000/launcherg/10-rust-workflow"><img src="https://agentmods.dev/badge/rules/ryoha000/launcherg/10-rust-workflow/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.

agentmods 80×15 button for 10-rust-workflow

Your own site · 80×15
<a href="https://agentmods.dev/rules/ryoha000/launcherg/10-rust-workflow"><img src="https://agentmods.dev/badge/rules/ryoha000/launcherg/10-rust-workflow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,064 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01064
Opus 5 $0.00000 $0.00532
Sonnet 5 $0.00000 $0.00213
Haiku 4.5 $0.00000 $0.00106

Measured today against content hash 72c288de3233, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-13, from the pricing page.

Security

Grade A, and why

10-rust-workflow 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 today.

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/10-rust-workflow.mdc · 39 lines

What it actually says

Rust ワークフロー(Tauri / Native Messaging Host)

  • ビルドとテスト:
    • Tauri (Rust): task check:tauri:rust
    • Native Messaging Host: task check:native-messaging-host
  • モジュール分割: ドメイン/ユースケース/インフラのレイヤ責務を維持(ドメインにトレイト、ユースケースにモック)。
  • インターフェースモデル配置:
    • Tauri: src-tauri/src/interface/models。ドメインstructから From を実装し、#[serde(rename_all = "camelCase")] を付与。
    • Native Messaging Host: src-tauri/native-messaging-host/src/models。Chrome Native Messaging向けの入出力structを配置。こちらは snake_case で取り扱う。編集した際は task gen:native-messaging を実行してTS型を更新する。
  • シリアライズ規約:
    • Tauri(コマンド/イベント経由): TypeScript 側は camelCase で送受信。Rust のインターフェースstruct#[serde(rename_all = "camelCase")] を付与。Tauri が camelCasesnake_case のパラメータ解決を自動で行う前提。
    • Native Messaging Host: TypeScript/Rust ともに snake_case を使用。
  • コマンド実行ポリシー: すべて task 経由で実行(cargo の直接実行は禁止)。

Native Messaging Host ハンドラ実装ポリシー

  • main.rs の責務最小化: src-tauri/native-messaging-host/src/main.rs は入出力のフレーミング/JSONパース/メッセージ種別のディスパッチのみを行い、ビジネスロジックを持たない。
  • ユースケース経由の実行: すべてのハンドラ(例: handle_get_dmm_pack_ids)は usecase 層(src-tauri/usecase/**)に定義した公開メソッドを呼び出して結果を返す。main.rs からインフラのリポジトリへ直接アクセスしない。
  • モデル境界の明確化: Native Messaging のリクエスト/レスポンス構造体は native-messaging-host/src/models に置き、main.rs ではそれらとユースケースの引数/戻り値を相互変換するだけに留める。
  • エラーハンドリング: ユースケースは anyhow::Result を返し、main.rs 側で共通方針に従ってユーザー向けエラー文字列へ整形して返す。
  • 変更手順: 新規メッセージ追加時は「(1) ユースケースに公開メソッド追加 → (2) main.rs ハンドラで呼び出し → (3) 必要に応じて models を拡張 → (4) task check:native-messaging-host を通す」の順で実施する。

テスト戦略

  • repository に新規メソッドを追加した場合は、そのメソッドについてテストを実装する
  • テスト対象の関数ごとにテスト関数を定義する
  • 分けたテストの関数の中で Case を定義してテーブルテストを実装する
  • AAAを明確にする
  • domain に定義されたポートについてモックしてテストを行う場合は、原則そのポートについて#[mockall::automock]を付与し、そのモック実装を用いてテストを行う
    • ただし repository については src-tauri/usecase/src/repositorymock.rs で実装されているモックを用いてテストを行う
  • テスト名は snake_case と日本語を組み合わせた形で記述する
  • テスト対象の関数ごとにテスト関数を定義し、その中で Case を定義してテーブルテストを実装する

参照

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. today First seen · 39 lines · 0 tokens per session scan A 72c288de3233

Subscribe to this mod's changes

10-rust-workflow is a cursor rule published in the GitHub repository ryoha000/launcherg (37 stars, last pushed 5mo ago), licensed Unlicense. It costs nothing until one of its globs matches a file; then it loads 1,064 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-12.