← ClaudeAtlas

qol-arch-cross-platformlisted

Use when adding or refactoring symbols (functions, types, constants, use statements) that *might* be consumed by only one platform's backend, even when the symbol itself looks platform-neutral. Prevents the most common qol-tools cross-platform regression: code that compiles green on Linux but emits dead_code / unused_imports / unused_mut errors on macOS or Windows under `-D warnings`. Triggers on edits to shared modules that border `platform/` directories, on `#[allow(dead_code)]` / `#[allow(unused_mut)]` reaches, on `#[cfg(target_os)]` attributes attached to `use` statements, and any time you find yourself "quieting a lint" on one OS. For the strategy-pattern code layout that this skill builds on, see `qol-arch-code`. For CI-side enforcement that catches the failures across all three OSes, see `qol-arch-cicd`.
qol-tools/qol-skills · ★ 0 · Code & Development · score 62
Install: claude install-skill qol-tools/qol-skills
# qol-arch-cross-platform: Cross-Platform Symbol Hygiene > Cross-platform warnings are errors: code that compiles green on Linux breaks macOS/Windows under `-D warnings` because `dead_code`, `unused_imports`, and `unused_mut` differ per backend. CI runs `RUSTFLAGS=-D warnings` on every target; this gate is not optional. Full symbol-hygiene patterns and triggers follow. ## Why this skill exists The `qol-arch-code` skill compartmentalizes platform-specific *bodies* into `platform/{linux,macos,windows}.rs`. That solves the easy half of the problem. The *hard* half is symbols that look cross-platform but in practice are consumed by only one OS's backend. Those symbols compile clean on the host you're on (because the consumer compiles too), and explode under `-D warnings` on the OS where the consumer is cfg'd out: - **`dead_code`** — `pub fn`, `pub const`, `pub struct` in a shared module whose only callers live behind `#[cfg(target_os = "linux")]`. - **`unused_imports`** — `use` statements that pull in symbols only referenced from a cfg-gated function body. - **`unused_mut`** — function parameters or local bindings that are only mutated in one platform's branch. The qol-tools commit history is full of these. The `d797294` refactor moved sixteen `dead_code` errors out of macOS-side `qol-tray` builds by relocating a `BindingMatcher` table from the shared `capture/mod.rs` into the linux-only `capture/platform/linux/matcher.rs`. The `33df35d` follow-up flipped a constants module