一键导入
no-std-rules
Compatibility rules for keeping istok-core and istok-transport free of std — allowed crates, feature gates, and forbidden patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Compatibility rules for keeping istok-core and istok-transport free of std — allowed crates, feature gates, and forbidden patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How to write deterministic, harness-based H3 engine tests using MockHarness — no real sockets, no timers, script-driven and byte-exact.
How to scope, implement, and close milestones — vertical slices, DoD checklists, scaffold rules, and sequencing constraints.
Coding conventions for all Istok crates — error handling, panic-free library code, feature gates, and style rules.
| name | no_std Rules |
| description | Compatibility rules for keeping istok-core and istok-transport free of std — allowed crates, feature gates, and forbidden patterns. |
| applies_to | ["claude","codex"] |
| triggers | ["any change to istok-core","istok-transport","adding a dependency","new Cargo.toml"] |
istok-core and istok-transport must remain no_std-compatible so the engine
can eventually run on embedded or kernel targets. These rules prevent accidental
std contamination.
// Required at the top of lib.rs for no_std crates
#![no_std]
extern crate alloc; // only if heap allocation is needed
| Crate | core | alloc | std |
|---|---|---|---|
istok-core | yes | behind alloc feature | behind std feature only |
istok-transport | yes | behind alloc feature | behind std feature only |
istok-h3 | yes | yes | behind std feature |
istok-io-tokio | yes | yes | yes (std required) |
default-features = false:
some-crate = { version = "x.y", default-features = false }
# varint encoding without std dependency
leb128 = { version = "0.2", default-features = false }
core and alloc primitives over external crates when the implementation is small.std::collections::HashMap → use alloc::collections::BTreeMap or a feature-gated HashMapstd::io::Write / std::io::Read → define crate-local traits or use embedded-iostd::string::String → use alloc::string::String (behind alloc feature)std::vec::Vec → use alloc::vec::Vec (behind alloc feature)# Verify no_std compiles (no std, no alloc)
cargo build -p istok-core --no-default-features --locked
# Verify with alloc
cargo build -p istok-core --no-default-features --features alloc --locked
use std::… anywhere in istok-core without a #[cfg(feature = "std")] guard.std without checking default-features.