c
Installation
SKILL.md
C Systems Style Skill
Apply this skill whenever a task involves C API design, struct design, allocation, ownership transfer, error handling, or multi-step resource initialization.
Primary Goal
Produce C code that is easy to read, easy to review, and easy to maintain over time:
- Prefer straightforward control flow over clever abstraction.
- Keep APIs explicit and cross-platform friendly.
- Minimize preprocessor magic.
- Avoid
typedef struct foo { ... } foo;-style aliasing unless there is a compelling API reason. - Prefer ordinary declarations over macro-generated declarations.
- Prefer
enum,static const, and normal helper functions over#definewhen they express the intent more clearly. - If memory allocation may fail, the call site must check it immediately.
- Allocation failure in wlframe-style code must log with
wlf_log_errno()before returning or unwinding. - Partial initialization must unwind in reverse order without leaking resources.
- Ownership transfer and nullable-return contracts must remain obvious.