rust-systems-sh-tmkozg
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "rust-systems-sh-tmkozg" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5dfb340e823cbd2d6ed7f4389604bb8cd6ddf39cf34f9992185df5613f2c048d. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/rust-systems-sh-tmkozg before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
A Rustsystems-specific skill to help AI agents efficiently complete tasks related to Rustsystems.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- fn modify_in_place(data: &mut Vec<u8>) { data.retain(|b| *b != 0); data.sort_unstable(); }
- Testing
- Not tested
Browse files
Frontmatter
name: Rustsystems
slug: rust-systems
version: 1.0.0
displayName: Rustsystems
description: >
Rustsystems专用技能,帮助AI Agent高效完成相关任务。
Rustsystems专用技能,帮助AI Agent高效完成相关任务。
summary: "Rustsystems专用技能,帮助AI Agent高效完成相关任务。"
license: MIT
category: 开发者工具
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"Rust Systems
Ownership and Borrowing
fn process_data(data: &[u8]) -> Vec<u8> {
data.iter().map(|b| b.wrapping_add(1)).collect()
}
fn modify_in_place(data: &mut Vec<u8>) {
data.retain(|b| *b != 0);
data.sort_unstable();
}
fn take_ownership(data: Vec<u8>) -> Vec<u8> {
let mut result = data;
result.push(0xFF);
result
}
fn main() {
let data = vec![1, 2, 3, 0, 4];
let processed = process_data(&data); // borrow: data still usable
let mut owned = take_ownership(data); // move: data no longer usable
modify_in_place(&mut owned); // mutable borrow
}
Prefer borrowing (&T, &mut T) over ownership transfer. Use Clone only when necessary.
Error Handling
use thiserror::Error;
#[derive(Error, Debug)]
pub enum AppError {
#[error("database error: {0}")]
Database(#[from] sqlx::Error),
#[error("not found: {resource} with id {id}")]
NotFound { resource: &'static str, id: String },
#[error("validation failed: {0}")]
Validation(String),
}
type Result<T> = std::result::Result<T, AppError>;
async fn get_user(pool: &PgPool, id: &str) -> Result<User> {
sqlx::query_as::<_, User>("SELECT * FROM users WHERE id = $1")
.bind(id)
.fetch_optional(pool)
.await?
.ok_or_else(|| AppError::NotFound {
resource: "User",
id: id.to_string(),
})
}
Use thiserror for library errors, anyhow for application-level errors. Avoid .unwrap() in production code.
Traits and Generics
trait Repository {
type Item;
type Error;
async fn find_by_id(&self, id: &str) -> std::result::Result<Option<Self::Item>, Self::Error>;
async fn save(&self, item: &Self::Item) -> std::result::Result<(), Self::Error>;
}
struct PgUserRepo {
pool: PgPool,
}
impl Repository for PgUserRepo {
type Item = User;
type Error = AppError;
async fn find_by_id(&self, id: &str) -> Result<Option<User>> {
let user = sqlx::query_as::<_, User>("SELECT * FROM users WHERE id = $1")
.bind(id)
.fetch_optional(&self.pool)
.await?;
Ok(user)
}
async fn save(&self, user: &User) -> Result<()> {
sqlx::query("INSERT INTO users (id, name, email) VALUES ($1, $2, $3)")
.bind(&user.id)
.bind(&user.name)
.bind(&user.email)
.execute(&self.pool)
.await?;
Ok(())
}
}
Async Patterns
use tokio::sync::Semaphore;
use futures::stream::{self, StreamExt};
async fn fetch_all(urls: Vec<String>, max_concurrent: usize) -> Vec<Result<String>> {
let semaphore = Arc::new(Semaphore::new(max_concurrent));
stream::iter(urls)
.map(|url| {
let sem = semaphore.clone();
async move {
let _permit = sem.acquire().await.unwrap();
reqwest::get(&url).await?.text().await.map_err(Into::into)
}
})
.buffer_unordered(max_concurrent)
.collect()
.await
}
async fn graceful_shutdown(handle: tokio::runtime::Handle) {
let ctrl_c = tokio::signal::ctrl_c();
ctrl_c.await.expect("Failed to listen for Ctrl+C");
handle.shutdown_timeout(std::time::Duration::from_secs(30));
}
Builder Pattern
pub struct ServerConfig {
host: String,
port: u16,
workers: usize,
tls: bool,
}
pub struct ServerConfigBuilder {
host: String,
port: u16,
workers: usize,
tls: bool,
}
impl ServerConfigBuilder {
pub fn new() -> Self {
Self { host: "0.0.0.0".into(), port: 8080, workers: 4, tls: false }
}
pub fn host(mut self, host: impl Into<String>) -> Self { self.host = host.into(); self }
pub fn port(mut self, port: u16) -> Self { self.port = port; self }
pub fn workers(mut self, n: usize) -> Self { self.workers = n; self }
pub fn tls(mut self, enabled: bool) -> Self { self.tls = enabled; self }
pub fn build(self) -> ServerConfig {
ServerConfig { host: self.host, port: self.port, workers: self.workers, tls: self.tls }
}
}
Anti-Patterns
- Using
.unwrap()or.expect()in library code - Cloning data unnecessarily instead of borrowing
- Holding a
MutexGuardacross.awaitpoints (causes deadlocks) - Using
Arc<Mutex<Vec<T>>>when a channel would be more appropriate - Writing
unsafewithout documenting invariants - Not using
#[must_use]on Result-returning functions
Checklist
- [ ] Error types defined with
thiserrorand?operator used for propagation - [ ] No
.unwrap()in production paths - [ ] Ownership model minimizes cloning
- [ ] Async code uses bounded concurrency (semaphores or
buffer_unordered) - [ ] Traits used for abstraction and testability
- [ ]
unsafeblocks have documented safety invariants - [ ] Builder pattern used for complex configuration structs
- [ ] Clippy lints enabled and warnings addressed
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Rust 系统编程核心概念指南,包括所有权、错误处理、异步模式等
- 面向开发者群体,具有明确的实用价值和广泛的应用场景
Areas to improve
-
触发描述不清晰 Reported severity: Major
description 内容重复且模糊,未明确说明具体触发场景或用户意图
Recommendation: 建议明确描述 Skill 的具体用途,例如:'当用户需要 Rust 系统编程指导、代码审查或最佳实践建议时触发'
Areas to improve
-
缺少 When to Use 章节 Reported severity: Minor
文档结构完整但缺少明确的用户使用场景说明
Recommendation: 建议添加 'When to Use' 章节,说明用户在什么情况下应该使用此 Skill
Highlights
- 文档结构清晰,包含多个技术章节和丰富的代码示例
- frontmatter 完整,版本信息和元数据规范
Highlights
- 代码示例语法正确,涵盖 Rust 系统编程的主要模式和最佳实践
- 内容可靠,提供了实用的检查清单和常见反模式警告
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.