Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计未展示

moai-lang-rustmoai lang Rust 搜索

Agent Skill

moai-lang-rust 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

318

周安装

13

GitHub Stars

公开资料未说明

下载量

102
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:moai-lang-rust(moai lang Rust 搜索)
来源仓库:https://github.com/modu-ai/cc-plugins
仓库路径:skills/moai-lang-rust
安装命令:
npx skills add modu-ai/cc-plugins --skill "moai-lang-rust"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add modu-ai/cc-plugins --skill "moai-lang-rust"

简介

moai-lang-rust 用于查找、检索和筛选 Rust 相关技术信息,支持多宿主环境使用。

  • 适用于根据关键词或任务场景快速定位 Rust 语言文档、库用法或最佳实践。
  • 通过 npx skills add modu-ai/cc-plugins --skill "moai-lang-rust" 安装并参考原始 README 验证功能。
  • 使用前需确认权限边界、仓库维护状态及是否触发联网或文件操作行为。
  • 属于研究检索类技能,专为 Codex、Claude、Cursor、Gemini CLI 中的 Rust 开发需求设计。

SKILL.md

Quick Reference (30 seconds)

Rust 1.92+ Development Specialist with deep patterns for high-performance, memory-safe applications.

Auto-Triggers: .rs, Cargo.toml, async/await, Tokio, Axum, SQLx, serde, lifetimes, traits

Core Use Cases:

  • High-performance REST APIs and microservices
  • Memory-safe concurrent systems
  • CLI tools and system utilities
  • WebAssembly applications
  • Low-latency networking services

Quick Patterns:

Axum REST API: Create Router with route macro chaining path and handler. Add with_state for shared state. Bind TcpListener with tokio::net and serve with axum::serve.

Async Handler with SQLx: Define async handler function taking State extractor for AppState and Path extractor for id. Use sqlx::query_as! macro with SQL string and bind parameters. Call fetch_optional on pool, await, and use ok_or for error conversion. Return Json wrapped result.


Implementation Guide (5 minutes)

Rust 1.92 Features

Modern Rust Features:

  • Rust 2024 Edition available (released with Rust 1.85)
  • Async traits in stable (no more async-trait crate needed)
  • Const generics for compile-time array sizing
  • let-else for pattern matching with early return
  • Improved borrow checker with polonius

Async Traits (Stable): Define trait with async fn signatures. Implement trait for concrete types with async fn implementations. Call sqlx macros directly in trait methods.

Let-Else Pattern: Use let Some(value) = option else with return for early exit. Chain multiple let-else statements for sequential validation. Return error types in else blocks.

Web Framework: Axum 0.8

Installation: In Cargo.toml dependencies section, add axum version 0.8, tokio version 1.48 with full features, and tower-http version 0.6 with cors and trace features.

Complete API Setup: Import extractors from axum::extract and routing macros. Define Clone-derive AppState struct holding PgPool. In tokio::main async main, create pool with PgPoolOptions setting max_connections and connecting with DATABASE_URL from env. Build Router with route chains for paths and handlers, add CorsLayer, and call with_state. Bind TcpListener and call axum::serve.

Handler Patterns: Define async handlers taking State, Path, and Query extractors with appropriate types. Use sqlx::query_as! for type-safe queries with positional binds. Return Result with Json success and AppError failure.

Async Runtime: Tokio 1.48

Task Spawning and Channels: Create mpsc channel with capacity. Spawn worker tasks with tokio::spawn that receive from channel in loop. For timeouts, use tokio::select! macro with operation branch and sleep branch, returning error on timeout.

Database: SQLx 0.8

Type-Safe Queries: Derive sqlx::FromRow on structs for automatic mapping. Use query_as! macro for compile-time checked queries. Call fetch_one or fetch_optional on pool. For transactions, call pool.begin, execute queries on transaction reference, and call tx.commit.

Serialization: Serde 1.0

Derive Serialize and Deserialize on structs. Use serde attribute with rename_all for case conversion. Use rename attribute for field-specific naming. Use skip_serializing_if with Option::is_none. Use default attribute for default values.

Error Handling

thiserror: Derive Error on enum with error attribute for display messages. Use from attribute for automatic conversion from source errors. Implement IntoResponse by matching on variants and returning status code with Json body containing error message.

CLI Development: clap

Derive Parser on main Cli struct with command attributes for name, version, about. Use arg attribute for global flags. Derive Subcommand on enum for commands. Match on command in main to dispatch logic.

Testing Patterns

Create test module with cfg(test) attribute. Define tokio::test async functions. Call setup helpers, invoke functions under test, and use assert! macros for verification.


Advanced Patterns

For comprehensive coverage including:

  • Advanced ownership patterns, lifetimes, and smart pointers
  • Trait design and generic programming
  • Performance optimization strategies and profiling
  • Engineering best practices and coding guidelines
  • Async patterns and concurrency

See: reference/engineering.md for ownership and traits, reference/performance.md for optimization, reference/guidelines.md for coding standards

Performance Optimization

Release Build: In Cargo.toml profile.release section, enable lto, set codegen-units to 1, set panic to abort, and enable strip.

Deployment

Minimal Container: Use multi-stage Dockerfile. First stage uses rust alpine image, copies Cargo files, creates dummy main for dependency caching, builds release, copies source, touches main.rs for rebuild, builds final release. Second stage uses alpine, copies binary from builder, exposes port, and sets CMD.

Concurrency

Rate-Limited Operations: Create Arc-wrapped Semaphore with max permits. Map over items spawning tasks that acquire permit, process, and return result. Use futures::future::join_all to collect results.


Context7 Integration

Library Documentation Access:

  • /rust-lang/rust - Rust language and stdlib
  • /tokio-rs/tokio - Tokio async runtime
  • /tokio-rs/axum - Axum web framework
  • /launchbadge/sqlx - SQLx async SQL
  • /serde-rs/serde - Serialization framework
  • /dtolnay/thiserror - Error derive
  • /clap-rs/clap - CLI parser

Works Well With

  • moai-lang-go - Go systems programming patterns
  • moai-domain-backend - REST API architecture and microservices patterns
  • moai-foundation-quality - Security hardening for Rust applications
  • moai-workflow-testing - Test-driven development workflows

Troubleshooting

Common Issues:

  • Cargo errors: Run cargo clean followed by cargo build
  • Version check: Run rustc --version and cargo --version
  • Dependency issues: Run cargo update and cargo tree
  • Compile-time SQL check: Run cargo sqlx prepare

Performance Characteristics:

  • Startup Time: 50-100ms
  • Memory Usage: 5-20MB base
  • Throughput: 100k-200k req/s
  • Latency: p99 less than 5ms
  • Container Size: 5-15MB (alpine)

Additional Resources

See reference/engineering.md for advanced ownership patterns and trait design.

See reference/performance.md for optimization strategies and profiling techniques.

See reference/guidelines.md for Rust coding standards and best practices.


Last Updated: 2026-01-11 Version: 1.2.0

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.67%
按下载量换算27

windsurf

22.41%
按下载量换算23

trae

17.77%
按下载量换算18

OpenCode

10.73%
按下载量换算11

Codex

7.47%
按下载量换算8

Antigravity

3.16%
按下载量换算3

安全审计

暂无安全审计结果可展示。

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add modu-ai/cc-plugins --skill "moai-lang-rust" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills