一键导入
rust
Rust systems programmer — write, compile, test, and debug Rust projects. Gives the entity the ability to create performant, safe systems software using Cargo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Rust systems programmer — write, compile, test, and debug Rust projects. Gives the entity the ability to create performant, safe systems software using Cargo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | rust |
| description | Rust systems programmer — write, compile, test, and debug Rust projects. Gives the entity the ability to create performant, safe systems software using Cargo. |
You can write Rust code, compile it, run it, and read compiler errors — all within the workspace. You have access to cargo and rustc via the cmd_run tool.
cargo init or cargo new.rs files with ws_writecargo build, cargo check, cargo clippycargo runcargo testcargo fmtcargo add, remove with cargo remove[TOOL:ws_mkdir path="my-project/src"]
[TOOL:ws_write path="my-project/src/main.rs" content="fn main() {\n println!(\"Hello, world!\");\n}"]
[TOOL:ws_read path="my-project/src/main.rs"]
[TOOL:ws_list path="my-project/src"]
[TOOL:cmd_run cmd="cargo init my-project"]
[TOOL:cmd_run cmd="cargo build"]
[TOOL:cmd_run cmd="cargo run"]
[TOOL:cmd_run cmd="cargo test"]
[TOOL:cmd_run cmd="cargo check"]
[TOOL:cmd_run cmd="cargo clippy"]
[TOOL:cmd_run cmd="cargo fmt"]
[TOOL:cmd_run cmd="cargo add serde"]
[TOOL:cmd_run cmd="cargo add serde --features derive"]
[TOOL:cmd_run cmd="cargo remove some-crate"]
Never write partial .rs files. Write the full source code every time with ws_write.
Before modifying any existing file:
[TOOL:ws_read path="src/main.rs"]
Then write the complete modified version back.
Do NOT call rustc directly unless the user specifically asks. Always prefer cargo build, cargo run, cargo test. Cargo handles dependencies, build profiles, and linking.
Rust's compiler gives excellent error messages. When a build fails:
Each cmd_run runs one command. Do NOT chain commands with && or ;.
Step 1: [TOOL:cmd_run cmd="cargo new my-project"]
Step 2: [TOOL:ws_list path="my-project/src"]
Step 3: [TOOL:ws_write path="my-project/src/main.rs" content="...your code..."]
Step 4: [TOOL:cmd_run cmd="cargo build"]
Step 5: [TOOL:cmd_run cmd="cargo run"]
Step 1: [TOOL:cmd_run cmd="cargo new my-lib --lib"]
Step 2: [TOOL:ws_write path="my-lib/src/lib.rs" content="...your code..."]
Step 3: [TOOL:cmd_run cmd="cargo test"]
Step 1: [TOOL:cmd_run cmd="cargo add serde --features derive"]
Step 2: [TOOL:cmd_run cmd="cargo add tokio --features full"]
Step 3: [TOOL:ws_read path="Cargo.toml"]
use std::io;
fn main() {
println!("Enter your name:");
let mut name = String::new();
io::stdin().read_line(&mut name).expect("Failed to read line");
let name = name.trim();
println!("Hello, {name}!");
}
#[derive(Debug, Clone)]
struct Point {
x: f64,
y: f64,
}
impl Point {
fn new(x: f64, y: f64) -> Self {
Self { x, y }
}
fn distance(&self, other: &Point) -> f64 {
((self.x - other.x).powi(2) + (self.y - other.y).powi(2)).sqrt()
}
}
use std::fs;
use std::io;
fn read_config(path: &str) -> Result<String, io::Error> {
fs::read_to_string(path)
}
fn main() {
match read_config("config.toml") {
Ok(content) => println!("Config: {content}"),
Err(e) => eprintln!("Error reading config: {e}"),
}
}
use std::fs;
use std::io;
fn process_file(path: &str) -> Result<usize, io::Error> {
let content = fs::read_to_string(path)?;
Ok(content.lines().count())
}
trait Summary {
fn summarize(&self) -> String;
}
struct Article {
title: String,
content: String,
}
impl Summary for Article {
fn summarize(&self) -> String {
format!("{}: {}...", self.title, &self.content[..50.min(self.content.len())])
}
}
let numbers = vec![1, 2, 3, 4, 5];
let doubled: Vec<i32> = numbers.iter().map(|n| n * 2).collect();
let sum: i32 = numbers.iter().sum();
let evens: Vec<&i32> = numbers.iter().filter(|n| *n % 2 == 0).collect();
#[derive(Debug)]
enum Command {
Quit,
Echo(String),
Move { x: i32, y: i32 },
Count(i32),
}
fn execute(cmd: Command) {
match cmd {
Command::Quit => println!("Quitting"),
Command::Echo(msg) => println!("{msg}"),
Command::Move { x, y } => println!("Moving to ({x}, {y})"),
Command::Count(n) => println!("Count: {n}"),
}
}
[package]
name = "my-project"
version = "0.1.0"
edition = "2021"
[dependencies]
[package]
name = "my-project"
version = "0.1.0"
edition = "2021"
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
clap = { version = "4", features = ["derive"] }
anyhow = "1"
[package]
name = "my-lib"
version = "0.1.0"
edition = "2021"
[dependencies]
thiserror = "1"
[dev-dependencies]
assert_matches = "1"
| Need | Crate | Feature |
|---|---|---|
| JSON serialization | serde + serde_json | derive |
| CLI argument parsing | clap | derive |
| Async runtime | tokio | full |
| HTTP client | reqwest | json |
| HTTP server | axum or actix-web | — |
| Error handling | anyhow (apps) or thiserror (libs) | — |
| Logging | tracing + tracing-subscriber | — |
| Regex | regex | — |
| Random numbers | rand | — |
| Date/time | chrono | — |
| File paths | camino | — |
| Environment vars | dotenvy | — |
When a build fails:
E0308 (mismatched types)[TOOL:ws_read path="src/main.rs"]
[TOOL:ws_write path="src/main.rs" content="...fixed code..."]
[TOOL:cmd_run cmd="cargo build"]
| Error | Meaning | Fix |
|---|---|---|
E0382 — use of moved value | Ownership transferred | Clone, borrow with &, or restructure |
E0308 — mismatched types | Wrong type | Check function signature, add conversion |
E0502 — cannot borrow as mutable | Aliasing violation | Restructure borrows, use .clone() |
E0433 — unresolved import | Missing use or dependency | Add use statement or cargo add |
E0599 — no method found | Missing trait import or impl | Add use TraitName; or implement the trait |
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_add() {
assert_eq!(add(2, 3), 5);
}
#[test]
fn test_add_negative() {
assert_eq!(add(-1, 1), 0);
}
}
[TOOL:cmd_run cmd="cargo test"]
[TOOL:cmd_run cmd="cargo test test_add"]
my-cli/
Cargo.toml (clap dependency)
src/
main.rs (argument parsing + dispatch)
commands/
mod.rs
run.rs
build.rs
my-lib/
Cargo.toml
src/
lib.rs (public API + module declarations)
core.rs (internal logic)
utils.rs (helpers)
my-api/
Cargo.toml (axum, tokio, serde, serde_json)
src/
main.rs (server setup + routing)
routes/
mod.rs
health.rs
users.rs
models/
mod.rs
user.rs
rustc directly — use cargo build instead.rs filews_read firstcargo clippy and fix themunwrap() in library code — use Result and ? insteadcmd_run call per commandBuild, install, and manage complete NekoCore OS apps — HTML payload, installer contract, window registration, start menu category. Produces installer-managed, reversible app packages.
Create and register new MA task blueprints, task types, and classification rules
Extract characters from a book and create them as NekoCore OS entities with POV-isolated memories. Supports main-only, all, or specific character selection.
Production code author — write, edit, debug, and scaffold real code projects. Gives the entity the ability to create working software saved as actual code files.
Create structured courses, curricula, lesson plans, and exam prep materials from topics or books
Build, run, and manage D&D campaigns with session prep, world lore, and narrative arcs