omh-rust
Skill này làm gì
Skill hướng dẫn các thay đổi code Rust, đặc biệt cẩn thận với quyền sở hữu, xử lý lỗi và code unsafe. Dành cho lập trình viên viết hoặc sửa chương trình Rust.
Khi nào nên dùng
- ✓Khi bạn gặp lỗi của borrow checker hoặc lỗi vòng đời và cần một cách sửa rõ ràng.
- ✓Khi bạn đang viết lại code bằng Rust và muốn có kế hoạch cho quyền sở hữu và lỗi.
- ✓Khi code Rust của bạn dùng code unsafe hoặc hàm ngoài và cần được rà soát cẩn thận.
Liên kết skill
https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-rust/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Viết lại bộ phân tích này bằng Rust và sửa lỗi của borrow checker mà không làm hỏng các vòng đời.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent lên kế hoạch cho quyền sở hữu và xử lý lỗi, chuẩn bị thay đổi, và liệt kê các kiểm tra cần chạy. Code unsafe hoặc code ngoài sẽ được rà soát nghiêm ngặt hơn trước khi được coi là an toàn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Rust
This is an OMH rust workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
Why This Exists
rust closes OMH's zero-coverage Rust domain and makes the escalation from ordinary Rust work to undefined-behavior discipline a deterministic routing rule rather than something a model is trusted to notice.
Do Not Use When
- The request is a server, API, or schema design that happens to mention a Rust stack; use
omh-backendfor the contract and name Rust as the stack. - The request is debugging a stripped or source-less native binary; use
omh-native-debugging. - The request is a general code review of finished Rust; use
omh-code-review. - The request is a Rust vocabulary or concept question with no change to prepare; answer it directly.
Examples
Good example:
- Prompt: Rewrite this parser in Rust and fix the borrow checker errors.
- Expected behavior: Prepare rust_change_contract/v1 with the escalation verdict, ownership_shape/v1 for the parser's borrows, error_and_api_contract/v1, and rust_gate_list/v1.
- Why: The request is a Rust change whose difficulty is ownership shape, which is exactly what the contract has to settle before code.
Bad example:
- Prompt: It compiles and the unsafe block looks fine, so call the FFI wrapper safe.
- Expected behavior: Escalate on the
unsafe/FFI trigger, mark Miri and sanitizer evidence as not_observed, and name them as blocking items. - Why: Compilation proves nothing about the invariant an
unsafeblock asserts, and the escalation is not optional.
Completion Checklist
- The escalation verdict is stated with the trigger that decided it.
- The ownership shape names owners, borrows across boundaries, and every deliberate clone.
- The error type, its conversion boundary, and every surviving
unwrap/expect/panic!are named. - The gate list names the exact commands the executor must run and pass, covering every target, the feature extremes, doc tests, and the declared MSRV.
- An escalated change carries the Miri, sanitizer, and concurrency-testing requirements as blocking items.
- Compiler, clippy, test, Miri, sanitizer, and loom results stay observed-only.
Recovery Notes
- If the crate cannot be inspected, escalate by default and say the verdict is conservative rather than measured.
- If the toolchain cannot run Miri or a sanitizer for the escalated change, keep the change blocked and name the smallest substitute proof instead of downgrading the verdict.
When to Use
Use when Hermes should prepare a Rust change: ownership and lifetime shape, error and API types, cargo/clippy gates, and the mandatory UB escalation when the change touches unsafe, raw pointers, FFI, MaybeUninit, or lock-free primitives.
Strong routing signals: `rust`, `rust code`, `rust skill`, `rustlang`, `borrow checker`, `lifetime error`, `ownership error`, `trait bound`, `cargo build`, `cargo clippy`, `clippy lint`, `unsafe rust`, `unsafe block`, `raw pointer`, `maybeuninit`, `rust ffi`, `extern c`, `undefined behavior`, `miri`, `loom`, `ボローチェッカー`, `所有権エラー`, `ライフタイムエラー`, `トレイト境界`, `러스트`, `러스트 코드`, `빌림 검사기`, `소유권 에러`, `라이프타임 에러`, `언세이프`, `미정의 동작`, `借用检查器`, `所有权错误`, `生命周期错误`, `特征约束`, `bantu atasi error borrow checker`, `perbaiki masalah ownership Rust`, `jelaskan error lifetime Rust`, `tolong beresin error cargo clippy`, `tinjau blok unsafe Rust ini`, `giúp xử lý lỗi borrow checker`, `sửa vấn đề ownership trong Rust`, `giải thích lỗi lifetime trong Rust`, `hãy sửa lỗi cargo clippy`, `rà soát khối unsafe Rust này`
Catalog Metadata
Category: planning
Phase: rust-development
Quality tier: rust-safety-gated
Reasoning demand: standard
Quality bar:
- Run the escalation check before anything else and state the verdict; a change whose
unsafe/FFI status is unknown is escalated by default. - Load
references/rust-discipline.mdfor the ownership, error, API, binary-interface, and dependency rules, and name the gate commands from it rather than assumingcargo buildis the whole bar. - When the escalation triggers, load
references/ub-escalation.mdand carry its Miri, sanitizer, and loom-style concurrency requirements into the handoff as blocking items. - Name the ownership decision behind every clone,
Arc, interior-mutability wrapper, and lifetime annotation the change introduces. - Name the error type and its conversion boundary; a surviving
unwrapneeds a written reason, not silence. - Keep compilation, c
Câu hỏi thường gặp
Skill có chạy trình biên dịch Rust cho tôi không?
Skill chuẩn bị thay đổi và các kiểm tra cần chạy. Bạn hoặc các công cụ của bạn sẽ chạy build và kiểm thử.
Biên dịch được có nghĩa là code unsafe của tôi an toàn không?
Không. Code unsafe cần các kiểm tra riêng, và skill nói rõ điều này.
Skill có thể rà soát code Rust đã hoàn thành không?
Một skill rà soát code sẽ phù hợp hơn để xem xét code đã hoàn thiện.
Chi tiết
Mô tả gốc của tác giả
[omh] Rust ownership, lifetime, or unsafe trouble: prepare Rust changes with ownership, error, and API discipline, and escalate any unsafe, FFI, or lock-free change to the UB checklist. Use when the user says: rust, rust code, rust skill, rustlang, borrow checker, lifetime error, ownership error, trait bound.
repo: rlaope/oh-my-hermes
Độ phổ biến
- Sao GitHub
- 5.1k
- Vị trí xếp hạng
- #15159
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
omh-accessibility-audit
5.1kGiúp agent của bạn kiểm tra màn hình hoặc luồng có khoảng trống về khả năng truy cập không, như dùng bàn phím, nhãn trình đọc màn hình, tương phản và vùng chạm.
omh-adversarial-consensus
5.1kGiúp agent của bạn tấn công một đề xuất kỹ thuật từ nhiều góc độ độc lập trước khi bạn cam kết, rồi tổng hợp những gì còn đứng vững.
omh-agent-debug
5.1kGiúp agent của bạn tìm hiểu vì sao một agent AI khác bị kẹt, lặp vòng hoặc trôi khỏi nhiệm vụ, và gợi ý cách phục hồi nhỏ nhất an toàn.
omh-agent-instructions
5.1kGiúp agent của bạn viết hoặc cập nhật tệp hướng dẫn, như AGENTS.md hoặc CLAUDE.md, để nói cho các công cụ AI cách làm việc trong một dự án.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.