struct-layout
Installation
SKILL.md
C Struct Layout Skill
Apply this skill whenever a task involves C struct design, field ordering, alignment, cache locality, intrusive nodes, or public layout stability.
Primary Goal
Produce struct layouts that are technically justified, not accidental:
- Keep alignment and padding sensible.
- Keep hot fields in the first cache line when practical.
- Keep type-erasure or dispatch fields such as
implin a predictable location when the design depends on them. - Group related signals, listeners, and intrusive nodes so lifecycle and ownership remain obvious.
Use This Skill To
- Design new public or private structs.
- Review whether field order causes avoidable padding or poor locality.
- Decide where to place
impl,link,events, listeners, state flags, strings, and other metadata. - Evolve wlframe structs without making the layout harder to reason about.