一键导入
write-c
Recipe for writing C in the runtime, module placement and the ownership and control-flow discipline. Invoked by writer agents when a C unit is dispatched.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Recipe for writing C in the runtime, module placement and the ownership and control-flow discipline. Invoked by writer agents when a C unit is dispatched.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review dimension for naming, idiom, comment debt, and AI tells against the codified per-language and prose standards. Invoked by reviewer agents over one module shard.
Recipe for writing Clojure, Functional Core / Imperative Shell at the function level (namespaces by domain), native wrappers, and the boundary discipline. Invoked when writing Clojure for the project.
Recipe for writing Elixir, pure functions in modules as the core and GenServer plus OTP as the shell, supervision trees, and NIF discipline for the C and Zig edge. Invoked when writing Elixir for the project.
Recipe for any English the agent produces in this project, commits, comments, docstrings, ADRs, design docs, skill bodies, changelog, error messages, project guides. Optimizes for terse, humanized prose with no em dashes and no AI tells. Invoke for any prose-writing activity.
Recipe for writing Zig, native bodies and edge wrappers, the allocator and lifetime discipline, and the hot-path rules. Invoked when writing or editing any Zig source.
Review dimension for module boundaries, dependency direction, pure/effect and native leakage, duplication, and oversized units. Invoked by reviewer agents over one module shard.
| name | write-c |
| description | Recipe for writing C in the runtime, module placement and the ownership and control-flow discipline. Invoked by writer agents when a C unit is dispatched. |
| user-invocable | false |
Write new C for the runtime. The standard is
skills/write-c/references/c-style.md (read it first). The architecture
it implements is Functional Core / Imperative Shell; the C expression of
that split, and the native boundary contract, live in
skills/shared/references/architecture.md. Placement comes from the
project's module map (the :architecture :modules entry in the
descriptor). The why behind the constraints is the ADR log: scan it
before designing anything that feels constrained by an unexplained rule.
free; never let a
caller-owned struct hold the only reference to a runtime-managed
value across an allocation point.goto cleanup label) that is safe under partial
initialization, not mirrored cleanup blocks in every error branch.SIZE_MAX overflow check precedes the multiply it protects), so
a hostile length degrades as data instead of overflowing before the
guard fires.A failing test against the intended behavior goes in before the implementation; write it, or coordinate with the write-tests dispatch. Never land implementation without the test that pins it. Edge cases are the point: empty, single, boundary sizes, values near the type limits, and malformed input that must degrade as data rather than crash. See write-tests for surface selection and the teeth every assertion needs.
Owns: the C translation unit, its ownership and cleanup discipline, and
the error classes it emits. Cites: the architecture contract in
skills/shared/references/architecture.md for the Functional Core /
Imperative Shell split and the native boundary contract; the module map
for placement; the ADR log for the why. Siblings: write-tests owns the
test surface selection; write-zig owns the Zig side of a C ABI edge;
write-prose owns the prose standard the comments ride on. Does not
invent ownership rules that contradict the style standard or an ADR, and
does not carry an unexplained constraint forward without scanning the
decision log first.
The C standard library and coreutils are the calibration target: inline
comments are rare one-liners, and documentation lives in the file-top
block comment. The full budget lives in prose-style.md; in short:
comment only the why (an ownership or lifetime constraint at a language
boundary, why a branch is unreachable, a non-obvious numeric or
algorithmic decision), never the what; a comment block is at most three
lines; file density above one line per fifty code lines is a finding;
no banners, no commented-out code, no change narrative.
Marker idiom: a block comment at the top of the translation unit stating
its single responsibility; // for inline, only for constraints the
code cannot say.
Public-facing text rule: never describe code as hand-written or hand-rolled in docstrings, docs, or changelog lines, and never carry an internal process identifier (a phase, task, slice, or run label) into a comment or commit. See write-prose.