[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72T4R3J06WK40AV63BMW2HD":3,"skill-same:01M72T4R3J06WK40AV63BMW2HD":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M72T4R3J06WK40AV63BMW2HD","industrial-rust-techniques",null,"Industrial-grade Rust engineering manual and best practices. Covers high-throughput compilation optimization (sccache, linkers, profile tuning, split-debuginfo), memory stability against OOM\u002FRAM-exhaustion, robust async architectures (Tokio, Axum, Tower), zero-copy serialization, high-performance crates ecosystem, and production testing workflows.","iberi22\u002Fskills","iberi22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10615454?v=4","01M72SQ2NXAA3GW0FSH053A5ES","Brahyan Belalcazar","01M72SQ2PYCH0SSA1K61NGEHDV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Findustrial-rust-techniques\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: industrial-rust-techniques\ndescription: >-\n  Industrial-grade Rust engineering manual and best practices. Covers high-throughput compilation optimization (sccache, linkers, profile tuning, split-debuginfo), memory stability against OOM\u002FRAM-exhaustion, robust async architectures (Tokio, Axum, Tower), zero-copy serialization, high-performance crates ecosystem, and production testing workflows.\n---\n\n# Industrial Rust Techniques & Systems Engineering\n\nComprehensive guide, patterns, and operational protocols for building, compiling, optimizing, and maintaining production-grade Rust systems within large monorepos and resource-constrained environments.\n\n---\n\n## 1. Compilation Performance & Resource Optimization\n\n### 1.1 Multi-Tier Build Profile Strategy\nAvoid full debug symbol generation during local development. In large workspaces with crates like `polars`, `candle`, `tokenizers`, or `axum`, GNU `ld` can easily consume 2-4 GB of RAM per compilation thread if symbols are monolithic.\n\nConfigure global or project profiles (`~\u002F.cargo\u002Fconfig.toml` or `.\u002FCargo.toml`):\n\n```toml\n[profile.dev]\nopt-level = 0\ndebug = 1                # Line tables only (sufficient for backtraces and IDE debugging)\nsplit-debuginfo = \"unpacked\" # Keeps debuginfo in separate object files, sparing RAM during linking\n\n[profile.dev.package.\"*\"]\nopt-level = 2            # Compiles 3rd-party dependencies with optimization once, keeping tests fast\n\n[profile.test]\nopt-level = 0\ndebug = 1\nsplit-debuginfo = \"unpacked\"\n\n[profile.test.package.\"*\"]\nopt-level = 2\n\n[profile.release]\nopt-level = 3\nlto = \"thin\"             # ThinLTO provides ~95% of full LTO performance at 20% of the link time and RAM\ncodegen-units = 16       # Parallel codegen units\npanic = \"abort\"          # Eliminates unwind landing pads, reducing binary size by 15-30%\nstrip = \"symbols\"        # Strips debug symbols automatically in release\n```\n\n### 1.2 Shared Cache (`sccache`)\nNever compile identical 3rd-party dependencies across multiple workspaces or projects from scratch.\n\n* **Configuration** (`~\u002F.cargo\u002Fconfig.toml`):\n  ```toml\n  [build]\n  rustc-wrapper = \"sccache\"\n  ```\n* **Status Inspection**:\n  ```bash\n  sccache --show-stats\n  ```\n* **Caché Storage**: Stored locally on fast NVMe storage (`~\u002F.cache\u002Fsccache`), automatically LRU-evicted.\n\n### 1.3 Storage & RAM-Disk Rules\n* **Never point Cargo target directories into `tmpfs` \u002F RAM-disks** if the workspace compiles large integration tests or deep ML\u002Fdata pipelines. Símbolos acumulados pueden superar 30 GB y disparar el kernel OOM killer o bloquear sockets de I\u002FO.\n* **Keep targets on local NVMe disk**: Linux Page Cache will automatically use idle RAM as high-speed read\u002Fwrite buffers without locking memory from OS services or user terminals.\n\n---\n\n## 2. Modern Rust Crates Ecosystem (Production Standard)\n\n| Domain | Recommended Crate(s) | Role & Industrial Rationale |\n| :--- | :--- | :--- |\n| **Async Runtime** | `tokio = { version = \"1.43\", features = [\"full\"] }` | Standard battle-tested multi-threaded runtime. |\n| **HTTP \u002F Web** | `axum = \"0.8\"`, `tower = \"0.5\"`, `tower-http = \"0.6\"` | Ergonomic routing, composable middleware with zero-cost abstractions. |\n| **Error Handling** | `thiserror = \"2.0\"` (libs), `anyhow = \"1.0\"` (apps\u002Fbins) | Idiomatic domain errors vs flexible application context. |\n| **Serialization** | `serde = { version = \"1.0\", features = [\"derive\"] }`, `simd-json = \"0.14\"` | Fast JSON parsing utilizing CPU SIMD vectorization. |\n| **Observability** | `tracing = \"0.1\"`, `tracing-subscriber = { version = \"0.3\", features = [\"env-filter\", \"json\"] }` | Structured, contextual async event logging. |\n| **Concurrency \u002F Primitives** | `parking_lot = \"0.12\"`, `crossbeam = \"0.8\"`, `dashmap = \"6.1\"` | Faster, smaller mutexes and lock-free concurrent maps. |\n| **Memory \u002F Arena** | `bytes = \"1.10\"`, `bumpalo = \"3.16\"`, `smallvec = \"1.13\"` | Zero-copy byte slices and high-speed arena allocation. |\n| **Databases** | `sqlx = { version = \"0.8\", features = [\"runtime-tokio\", \"postgres\", \"sqlite\"] }` | Async, compile-time verified SQL queries. |\n| **Validation** | `validator = { version = \"0.19\", features = [\"derive\"] }` | Declarative payload validation. |\n\n---\n\n## 3. High-Throughput Code Patterns\n\n### 3.1 Zero-Copy String & Buffer Handling\nAvoid cloning strings and byte vectors across async boundaries and request processing.\n\n```rust\nuse bytes::Bytes;\nuse std::borrow::Cow;\n\n\u002F\u002F Prefer Borrowed\u002FCow or Bytes for payload forwarding\npub struct FramePayload\u003C'a> {\n    pub topic: Cow\u003C'a, str>,\n    pub data: Bytes, \u002F\u002F Reference-counted slice, clone is O(1) pointer bump\n}\n```\n\n### 3.2 Structured Error Hierarchy\nSeparate library domain errors from application edge errors:\n\n```rust\nuse thiserror::Error;\n\n#[derive(Error, Debug)]\npub enum EngineError {\n    #[error(\"Database query failed: {0}\")]\n    Database(#[from] sqlx::Error),\n    #[error(\"Unauthorized access to resource: {0}\")]\n    Unauthorized(String),\n    #[error(\"Validation failed: {0}\")]\n    Validation(String),\n}\n```\n\n### 3.3 Cancellation-Safe Async Loops\nAlways ensure background tasks and stream processors are cancellation-safe when selecting over channels:\n\n```rust\nuse tokio::sync::mpsc;\n\npub async fn run_event_loop(mut rx: mpsc::Receiver\u003CEvent>) {\n    loop {\n        tokio::select! {\n            biased; \u002F\u002F Evaluates branches in order for predictable prioritization\n\n            Some(event) = rx.recv() => {\n                process_event(event).await;\n            }\n            _ = tokio::signal::ctrl_c() => {\n                tracing::info!(\"Graceful shutdown triggered\");\n                break;\n            }\n        }\n    }\n}\n```\n\n---\n\n## 4. Development Workflow & Fast Feedback Loops\n\n1. **Syntax & Type Check First (`cargo check`)**:\n   Never run full `cargo build` for simple syntax or type validation. `cargo check` skips codegen and linking completely, running in \u003C 20% of the build time.\n2. **Clippy in Industrial Mode**:\n   ```bash\n   cargo clippy --workspace --all-targets -- -D warnings\n   ```\n3. **Bandwidth Preservation (Data Saver)**:\n   In metered connections, enforce offline operation in `~\u002F.cargo\u002Fconfig.toml`:\n   ```toml\n   [net]\n   offline = true\n   git-fetch-with-cli = true\n   ```\n4. **Target Directory Cleanup Protocol**:\n   Clean individual crate targets periodically instead of nuking global caches:\n   ```bash\n   cargo clean -p \u003Ccrate_name>\n   ```\n","# Industrial Rust Techniques & Systems Engineering\n\nComprehensive guide, patterns, and operational protocols for building, compiling, optimizing, and maintaining production-grade Rust systems within large monorepos and resource-constrained environments.\n\n---\n\n## 1. Compilation Performance & Resource Optimization\n\n### 1.1 Multi-Tier Build Profile Strategy\nAvoid full debug symbol generation during local development. In large workspaces with crates like `polars`, `candle`, `tokenizers`, or `axum`, GNU `ld` can easily consume 2-4 GB of RAM per compilation thread if symbols are monolithic.\n\nConfigure global or project profiles (`~\u002F.cargo\u002Fconfig.toml` or `.\u002FCargo.toml`):\n\n```toml\n[profile.dev]\nopt-level = 0\ndebug = 1                # Line tables only (sufficient for backtraces and IDE debugging)\nsplit-debuginfo = \"unpacked\" # Keeps debuginfo in separate object files, sparing RAM during linking\n\n[profile.dev.package.\"*\"]\nopt-level = 2            # Compiles 3rd-party dependencies with optimization once, keeping tests fast\n\n[profile.test]\nopt-level = 0\ndebug = 1\nsplit-debuginfo = \"unpacked\"\n\n[profile.test.package.\"*\"]\nopt-level = 2\n\n[profile.release]\nopt-level = 3\nlto = \"thin\"             # ThinLTO provides ~95% of full LTO performance at 20% of the link time and RAM\ncodegen-units = 16       # Parallel codegen units\npanic = \"abort\"          # Eliminates unwind landing pads, reducing binary size by 15-30%\nstrip = \"symbols\"        # Strips debug symbols automatically in release\n```\n\n### 1.2 Shared Cache (`sccache`)\nNever compile identical 3rd-party dependencies across multiple workspaces or projects from scratch.\n\n* **Configuration** (`~\u002F.cargo\u002Fconfig.toml`):\n  ```toml\n  [build]\n  rustc-wrapper = \"sccache\"\n  ```\n* **Status Inspection**:\n  ```bash\n  sccache --show-stats\n  ```\n* **Caché Storage**: Stored locally on fast NVMe storage (`~\u002F.cache\u002Fsccache`), automatically LRU-evicted.\n\n### 1.3 Storage & RAM-Disk Rules\n* **Never point Cargo target directories into `tmpfs` \u002F RAM-disks** if the workspace compiles large integration tests or deep ML\u002Fdata pipelines. Símbolos acumulados pueden superar 30 GB y disparar el kernel OOM killer o bloquear sockets de I\u002FO.\n* **Keep targets on local NVMe disk**: Linux Page Cache will automatically use idle RAM as high-speed read\u002Fwrite buffers without locking memory from OS services or user terminals.\n\n---\n\n## 2. Modern Rust Crates Ecosystem (Production Standard)\n\n| Domain | Recommended Crate(s) | Role & Industrial Rationale |\n| :--- | :--- | :--- |\n| **Async Runtime** | `tokio = { version = \"1.43\", features = [\"full\"] }` | Standard battle-tested multi-threaded runtime. |\n| **HTTP \u002F Web** | `axum = \"0.8\"`, `tower = \"0.5\"`, `tower-http = \"0.6\"` | Ergonomic routing, composable middleware with zero-cost abstractions. |\n| **Error Handling** | `thiserror = \"2.0\"` (libs), `anyhow = \"1.0\"` (apps\u002Fbins) | Idiomatic domain errors vs flexible application context. |\n| **Serialization** | `serde = { version = \"1.0\", features = [\"derive\"] }`, `simd-json = \"0.14\"` | Fast JSON parsing utilizing CPU SIMD vectorization. |\n| **Observability** | `tracing = \"0.1\"`, `tracing-subscriber = { version = \"0.3\", features = [\"env-filter\", \"json\"] }` | Structured, contextual async event logging. |\n| **Concurrency \u002F Primitives** | `parking_lot = \"0.12\"`, `crossbeam = \"0.8\"`, `dashmap = \"6.1\"` | Faster, smaller mutexes and lock-free concurrent maps. |\n| **Memory \u002F Arena** | `bytes = \"1.10\"`, `bumpalo = \"3.16\"`, `smallvec = \"1.13\"` | Zero-copy byte slices and high-speed arena allocation. |\n| **Databases** | `sqlx = { version = \"0.8\", features = [\"runtime-tokio\", \"postgres\", \"sqlite\"] }` | Async, compile-time verified SQL queries. |\n| **Validation** | `validator = { version = \"0.19\", features = [\"derive\"] }` | Declarative payload validation. |\n\n---\n\n## 3. High-Throughput Code Patterns\n\n### 3.1 Zero-Copy String & Buffer Handling\nAvoid cloning strings and byte vectors across async boundaries and request processing.\n\n```rust\nuse bytes::Bytes;\nuse std::borrow::Cow;\n\n\u002F\u002F Prefer Borrowed\u002FCow or Bytes for payload forwarding\npub struct FramePayload\u003C'a> {\n    pub topic: Cow\u003C'a, str>,\n    pub data: Bytes, \u002F\u002F Reference-counted slice, clone is O(1) pointer bump\n}\n```\n\n### 3.2 Structured Error Hierarchy\nSeparate library domain errors from application edge errors:\n\n```rust\nuse thiserror::Error;\n\n#[derive(Error, Debug)]\npub enum EngineError {\n    #[error(\"Database query failed: {0}\")]\n    Database(#[from] sqlx::Error),\n    #[error(\"Unauthorized access to resource: {0}\")]\n    Unauthorized(String),\n    #[error(\"Validation failed: {0}\")]\n    Validation(String),\n}\n```\n\n### 3.3 Cancellation-Safe Async Loops\nAlways ensure background tasks and stream processors are cancellation-safe when selecting over channels:\n\n```rust\nuse tokio::sync::mpsc;\n\npub async fn run_event_loop(mut rx: mpsc::Receiver\u003CEvent>) {\n    loop {\n        tokio::select! {\n            biased; \u002F\u002F Evaluates branches in order for predictable prioritization\n\n            Some(event) = rx.recv() => {\n                process_event(event).await;\n            }\n            _ = tokio::signal::ctrl_c() => {\n                tracing::info!(\"Graceful shutdown triggered\");\n                break;\n            }\n        }\n    }\n}\n```\n\n---\n\n## 4. Development Workflow & Fast Feedback Loops\n\n1. **Syntax & Type Check First (`cargo check`)**:\n   Never run full `cargo build` for simple syntax or type validation. `cargo check` skips codegen and linking completely, running in \u003C 20% of the build time.\n2. **Clippy in Industrial Mode**:\n   ```bash\n   cargo clippy --workspace --all-targets -- -D warnings\n   ```\n3. **Bandwidth Preservation (Data Saver)**:\n   In metered connections, enforce offline operation in `~\u002F.cargo\u002Fconfig.toml`:\n   ```toml\n   [net]\n   offline = true\n   git-fetch-with-cli = true\n   ```\n4. **Target Directory Cleanup Protocol**:\n   Clean individual crate targets periodically instead of nuking global caches:\n   ```bash\n   cargo clean -p \u003Ccrate_name>\n   ```\n",{"name":5,"description":7},"main","688810f2886d212632acf81e532b24e483dd8b98","skills\u002Fgeneral\u002Findustrial-rust-techniques","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills","https:\u002F\u002Fgithub.com\u002Fiberi22","Senior WEB Full-Stack","2026-10-12 02:46:21",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add iberi22\u002Fskills --skill industrial-rust-techniques",{"tool":37,"command":38},"bunx","bunx skills add iberi22\u002Fskills --skill industrial-rust-techniques",{"tool":40,"command":41},"pnpm","pnpm dlx skills add iberi22\u002Fskills --skill industrial-rust-techniques","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Findustrial-rust-techniques\u002FSKILL.md",true,[],[46,52,59,65,71,77],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M72TWQEQD46ZC9TRBAABF78P","web-design-guidelines","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M72TWMQFTYD08DGXVAXRPPEB","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall. Recovers the page via archives and provenance-checked fallbacks.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M72TVQMS3HCTX18C8T97WTQQ","studio-coach","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fstudio-coach\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M72TVNA2PR9RZW0ZAXYP1G6J","src-generator","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsrc-generator\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M72TVEJHHB6SAT3R3TY9MJKS","sqlite-pro","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsqlite-pro\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M72TVC2EVBHQHCX96VTTYKB8","rigor-evaluator","Use when you need a quick heuristic rigor score (10 criteria, 0-2 each) for the features in a .gitcore\u002Ffeatures.json file, to decide which features are ready to ship.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Frigor-evaluator\u002FSKILL.md",[],[]]