Skip to main content

systems-programming

Systems programming patterns for C++, Rust, and low-level development. Covers memory management, concurrency, FFI, and performance optimization.

来源信息

仓库
skeletorflet/opencode-kit
最近来源活动
2026年3月31日 18:16
检测到的 SKILL.md 语言
英语
星标
9
Forks
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
systems-programming
description
Systems programming patterns for C++, Rust, and low-level development. Covers memory management, concurrency, FFI, and performance optimization.
license
MIT
compatibility
opencode
metadata
{"audience":"developers","category":"backend"}
# Systems Programming ## What I Do - Design memory-safe systems code patterns - Implement low-level concurrency primitives - Write FFI bindings between languages - Optimize for cache locality and CPU performance - Apply zero-cost abstraction patterns ## When to Use Me - Writing performance-critical code - Implementing custom data structures - Creating FFI bindings - Optimizing hot paths - Working with unsafe code ## Key Principles 1. **RAII**: Resource Acquisition Is Initialization for all resources 2. **Zero-Cost Abstractions**: Abstractions should compile to optimal code 3. **Cache Locality**: Design data structures for CPU cache efficiency 4. **Lock-Free When Possible**: Prefer atomics and lock-free structures 5. **Measure First**: Profile before optimizing ## Common Patterns ### RAII Pattern (C++) ```cpp class FileHandle { public: explicit FileHandle(const std::string& path) : file_(std::fopen(path.c_str(), "r")) { if (!file_) throw std::runtime_error("Failed to open file"); } ~FileHandle() { if (file_) std::fclose(file_); } FileHandle(const FileHandle&) = delete; FileHandle& operator=(const FileHandle&) = delete; private: std::FILE* file_; }; ``` ## Validation ```bash # C++ clang-tidy src/*.cpp -- -std=c++23 valgrind --leak-check=full ./build/app # Rust cargo clippy -- -D warnings cargo test ```
在 GitHub 查看