Rust Skills:让 AI 写 Rust 更精准的秘密武器
Rust Skills:让 AI 写 Rust 更精准的秘密武器
What Problem Does Meta-Cognition Solve?
Rust-Skills Capabilities Summary
Rust Compiler Error Code Index
Technical Subcategory Index (YYY)
Meta-Question Categories Index
Sub-Agent Context Negotiation Protocol
Negotiation Response Templates
Meta-Cognition Reasoning Framework
Error Protocol (3-Strike Rule)
Externalized Cognition Principles
Rust Skills - Agent Instructions
Rust Skills Trigger Test Checklist
Browser Automation with agent-browser
Add SAFETY Comment Before Any Unsafe Block
Do Not Abuse Unsafe to Escape Compiler Safety Checks
Avoid Union Except for C Interop
Do Not Share Raw Pointers Across Threads
Implement Drop for Rust Types Wrapping Memory-Managing C Pointers
Use References Instead of Raw Pointers When Calling Safe C Functions
Document Invariant Assumptions for C-Provided Parameters
Types Used in FFI Should Have Stable Layout
Use PhantomData
Use assert! Instead of debug_assert! in Unsafe Functions
Do Not Expose Uninitialized Memory in Public APIs
Avoid Double-Free from Panic Safety Issues
Read Documentation Carefully When Using std::ffi Types
Be Aware of Memory Safety Issues from Panics
Prefer pointer::cast Over as for Pointer Casting
Do Not Let String/Vec Auto-Drop Other Process's Memory
Validate Non-Robust External Values
Separate Data and Code When Passing Rust Closures to C
Avoid Passing Strings Directly to C from Public Rust API
Consider Safety When Manually Implementing Auto Traits
Avoid Passing Trait Objects to C Interfaces
Do Not Create Aliases for Types/Methods Named "Unsafe"
Unsafe Checker - Section Definitions
Do Not Implement Drop for Types Passed to External Code
Prefer Reentrant Versions of C-API or Syscalls
Do Not Manually Convert Immutable Pointer to Mutable
Exported Rust Functions Must Be Designed for Thread-Safety
Mutable Return from Immutable Parameter is Wrong
Be Careful with UB When Referencing #[repr(packed)] Struct Fields
Handle Panics When Crossing FFI Boundaries
Do Not Blindly Use Unsafe for Performance
Use Third-Party Crates for Bitfields
Use Portable Type Aliases from std or libc
Ensure I/O Safety When Using Raw Handles
Do Not Modify Memory Variables of Other Processes or Dynamic Libraries
Provide Unsafe Counterparts for Performance Alongside Safe Methods
Choose Appropriate Data Layout for Struct/Tuple/Enum
Use Dedicated Opaque Type Pointers Instead of c_void for C Opaque Types
Do Not Dereference Pointers Cast to Misaligned Types
Ensure C-ABI Compatibility for Strings Between Rust and C
Use MaybeUninit
Do Not Use Union Variants Across Different Lifetimes
Add Safety Section in Docs for Public Unsafe Functions