用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/publieople/hermes-config-kit --skill rust-windows-native-dev命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | rust-windows-native-dev |
| description | Windows Rust: windows crate COM, winreg, cross-compile. |
Windows system programming in Rust. Hard-won knowledge from BootKeeper (windows crate 0.62.2).
Structure crates so pure logic compiles on Linux and Windows API code is cfg-gated:
# Cargo.toml — platform deps MUST be target-gated or Linux build dies
[dependencies] # cross-platform: serde, chrono, thiserror, uuid
[target.'cfg(windows)'.dependencies]
winreg = "0.56"
windows = { version = "0.62", features = [...] }
// lib.rs — Windows-only modules behind cfg
pub mod windows; // mod.rs gates submodules #[cfg(windows)]
cargo test): runs pure-logic tests (rule engines, storage, models) — fast feedback without Windows.cargo build --target x86_64-pc-windows-msvc, needs rustup target add x86_64-pc-windows-msvc): validates API usage/features compile. Lib crates compile; bin crates fail at link — no MSVC link.exe on Linux. So a CLI/Tauri bin can't be cross-verified locally; let CI do it.windows-latest runner in GitHub Actions): the ONLY place Windows-only code actually runs. Cross-compiling proves it compiles; CI proves it runs. A null-pointer deref in WinVerifyTrust passed cross-compile and crashed on the real runner (STATUS_STACK_BUFFER_OVERRUN). Always add a test-windows job with integration tests hitting real registry/Task Scheduler.Full API notes in references/windows-crate-com.md. Summary:
Win32_System_TaskScheduler + Win32_System_Com + Win32_System_Variant + Win32_System_Ole; WINTRUST_DATA → Win32_Security_Cryptography (not just WinTrust!). Missing feature = "cannot find" errors.Connect(&VARIANT, ...) not Connect(NULL); collections use Count() + get_Item(&VARIANT) — not iterators; out-params like IExecAction::Path(&mut BSTR); IActionCollection::Count(&mut i32) returns Result<()>.let-else + unsafe needs parens: let Ok(x) = (unsafe { f() }) else { ... };data.Anonymous.pFile = &mut file_info;), never deref-and-assign (*data.Anonymous.pFile = ... → null deref). Union field is Anonymous, not u.CLSID_CTaskScheduler, not TaskSchedulerClass.0x800B0100 (TRUST_E_NOSIGNATURE) exceeds i32 → compare as 0x800B0100u32 as i32.winreg 0.56 — alive, 196M downloads. Registry Run keys.windows 0.62 — official, 283M downloads.taskschd crate — DEAD (2023, 3.9k downloads). Do not use; use windows crate TaskScheduler COM.schtasks CLI wrapping — fragile, localized output. Avoid.#![cfg(windows)] in tests/, run on CI windows-latest; assert "no panic" + non-empty names for registry/tasks/folders.cargo clippy --workspace --all-targets -- -D warnings on both platforms in CI.