agentleFS
talayashtalayash/agentrium/.claude/skills/rust-patterns/SKILL.md

rust-patterns

Skill48 starsChanged 18 days agoMITView on GitHub

Rust/Tauri patterns and best practices for Agentrium backend

22 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use nuxt4-patterns, pytorch-patterns and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 6 projects that use this

  • Yog-SothoSkill

    pytorch-patterns

    PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading. Always activate when the user is writing PyTorch models or training scripts, reviewing deep learning code, debugging training loops or data pipelines, optimizing GPU memory or training speed, setting up reproducible experiments, implementing transfer learning or fine-tuning, or asks anything about nn.Module, DataLoader, autograd, AMP, or torch.compile.

    Also in 7 projects that use this

  • loulanyueSkill

    santa-method

    Multi-agent adversarial verification with convergence loop. Two independent review agents must both pass before output ships.

    Also in 4 projects that use this

  • RojiosSkill

    defi-amm-security

    Security checklist for Solidity AMM contracts, liquidity pools, and swap flows. Covers reentrancy, CEI ordering, donation or inflation attacks, oracle manipulation, slippage, admin controls, and integer math.

    Also in 3 projects that use this

  • RojiosSkill

    llm-trading-agent-security

    Security patterns for autonomous trading agents with wallet or transaction authority. Covers prompt injection, spend limits, pre-send simulation, circuit breakers, MEV protection, and key handling.

    Also in 3 projects that use this

  • Exploration-labsSkill

    token-budget-advisor

    Proactive token budget assessment and task chunking strategy. Use this skill when queries involve multiple large file uploads, requests for comprehensive multi-document analysis, complex multi-step workflows with heavy research (10+ tool calls), phrases like "complete analysis", "full audit", "thorough review", "deep dive", or tasks combining extensive research with large output artifacts. This skill helps assess token consumption risk early and recommend chunking strategies before beginning work.

    Also in 3 projects that use this

  • +3 more from loulanyue

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never .unwrap() in production - use ?

    line 10
  2. Very specific:

    Use anyhow for internal errors, convert to String at IPC boundary

    line 11
  3. Very specific:

    Never hold a Mutex lock across .await points

    line 15
  4. Very specific:

    All commands are async with #[tauri::command]

    line 19
  5. Very specific:

    Use CREATE_NO_WINDOW flag on process spawns

    line 25
  6. Distinctive:

    Test path handling with backslashes

    line 26
  7. Distinctive:

    Always clean up resources even on error paths

    line 31

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rust Patterns for Agentrium

Error Handling

  • Commands return Result<T, String> - use .map_err(|e| e.to_string())
  • Never .unwrap() in production - use ? operator
  • Use anyhow for internal errors, convert to String at IPC boundary

Thread Safety

  • AppState uses Arc<Mutex<T>> - lock, use, drop quickly
  • Never hold a Mutex lock across .await points
  • PTY reader threads use mpsc::channel to communicate with Tokio tasks

Tauri Commands

  • All commands are async with #[tauri::command]
  • Access state via tauri::State<'_, AppState>
  • Register every command in main.rs invoke_handler

Windows Specifics

  • Wrap shell commands with cmd /C
  • Use CREATE_NO_WINDOW flag on process spawns
  • Test path handling with backslashes

PTY Lifecycle

  • Spawn → reader thread → mpsc channel → Tokio task → emit events
  • On close: signal reader thread, join, close channel, emit terminal-finished
  • Always clean up resources even on error paths

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.