ia-c-systems

Solid

C patterns for systems code, libraries, and native extensions: module layout, function decomposition, status-enum errors, memory safety, and undefined behavior. Use when writing, reviewing, refactoring, or debugging C, working with malloc lifetimes, buffer overflows, sanitizers, or Valgrind, or building native extensions. For C++, see ia-cpp-systems.

Code & Development 33 stars 3 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
51
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# C Systems & Native Code Covers C11 and later for libraries, systems code, and native extensions. For C++ (RAII, templates, move semantics), see the `ia-cpp-systems` skill. ## Repo conventions outrank this skill Read the repo's `AGENTS.md`/`CLAUDE.md`, its public headers, and two adjacent `.c` files before writing anything. Where they conflict with the rules below, they win, and the diff carries no note about it. This gate is load-bearing. Established C codebases sanction idioms these rules would otherwise flag: | Local idiom | Where it is correct | |---|---| | Tab indentation | php-src and its extensions, Linux kernel | | `goto cleanup` / `goto err` | Kernel, OpenSSL, curl, php-src: the dominant multi-resource release idiom | | Macros containing `return` | `RETURN_*`/`RETVAL_*` in PHP extensions, `Py_RETURN_*` in CPython | | Project status types | `zend_result`, `CURLcode`, `int` plus `errno`: do not invent a parallel enum beside one | Never widen a scoped task into a repo-wide restyle because adjacent untouched C predates a rule here. **When the target is a PHP extension** (`php_*.h`, `PHP_FUNCTION`, `zend_`, `config.m4`), load [php-extension-c.md](./references/php-extension-c.md) before applying any rule below. Layout, macros, the error model, memory, and assertions all carry extension-specific overrides, and the memory one in particular inverts the base guidance: extensions use a request-scoped allocator, not `malloc`/`free`. ## Tooling | Tool | Purpose | |-----...

Details

Author
iliaal
Repository
iliaal/whetstone
Created
6 months ago
Last Updated
3 days ago
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category