qol-architecture

Encapsulate OS differences behind a trait abstraction for cross-platform Rust plugins.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/qol-tools/qol-skills --skill qol-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: qol-architecture
Source: https://github.com/qol-tools/qol-skills/tree/main/plugins/qol-dev-conventions/skills/qol-architecture
Command: npx skills add https://github.com/qol-tools/qol-skills --skill qol-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Encapsulates OS differences behind a trait abstraction to enable cross-platform Rust plugins. A clean separation of platform-specific code from business logic reduces cfg-sprawl and compile-time fragility.

Core Features & Use Cases

  • Trait-based platform abstraction with per-OS implementations to isolate cross-cutting concerns.
  • Centralized wiring that removes #[cfg(target_os)] gates from core logic.
  • Runtime-safe stubs for unsupported OSes to preserve cross-compilation and CI validation.
  • Use Case: refactor a Rust plugin to support Linux, macOS, and Windows without compile_error! gates.

Quick Start

Refactor a Rust plugin to move platform-specific code behind a trait with per-OS impls and remove inline cfg(target_os) usage.

Frequently Asked Questions about qol-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove cfg target_os gates from Rust core logic?

To remove cfg target_os gates from Rust logic, encapsulate OS differences behind a trait abstraction with per-OS implementations. This centralizes platform wiring, keeping core logic OS-agnostic and eliminating inline conditional compilation sprawl.

What is the best way to support Linux, macOS, and Windows in a Rust plugin?

The best way to support Linux, macOS, and Windows in a Rust plugin is using trait-based platform abstraction. This isolates platform-specific code into separate implementations while maintaining a shared interface for cross-compilation and CI validation.

How do I handle unsupported OSes during Rust cross-compilation without compile_error?

Handle unsupported OSes during Rust cross-compilation by implementing runtime-safe stubs behind your trait abstraction. This preserves CI validation across all targets without requiring compile_error gates or blocking the build process.

Does refactoring Rust plugins for cross-platform support reduce compile-time fragility?

Refactoring Rust plugins for cross-platform support reduces compile-time fragility by moving platform-specific code behind a clean trait boundary. This separation prevents cfg-sprawl and isolates cross-cutting OS concerns from business logic.

Can I use trait abstractions to keep Rust business logic OS-agnostic?

Yes, you can use trait abstractions to keep Rust business logic OS-agnostic. By defining a shared interface with platform-specific implementations, core code interacts only with the trait, completely hiding OS differences.

Why does cross-platform Rust development cause cfg-sprawl and how to fix it?

Cross-platform Rust development causes cfg-sprawl when platform conditionals scatter throughout core logic. Fix it by refactoring to move OS-specific code behind a centralized trait abstraction with dedicated per-OS implementations.