write-c

write-c is a skill for Claude Code from leifericf/agentic-sdk. It costs 33 tokens per session (1,432 once invoked), scanned A, original, MIT.

A set of rules for writing C code within a specific runtime, including where code belongs and who owns allocated memory.

In plain words
What is it for?
Use it when adding C source files, extending existing translation units, managing allocations, or crossing native module boundaries.
Why use it?
It reduces errors caused by unclear module boundaries, dependency direction, memory ownership, and control flow.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it when adding C source files, extending existing translation units, managing allocations, or crossing native module boundaries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leifericf/agentic-sdk/write-c
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add leifericf/agentic-sdk --skill write-c
Clone the repo
git clone --depth 1 https://github.com/leifericf/agentic-sdk

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for write-c

README.md
[![agentmods](https://agentmods.dev/badge/skills/leifericf/agentic-sdk/write-c/github.svg)](https://agentmods.dev/skills/leifericf/agentic-sdk/write-c)
Your own site
<a href="https://agentmods.dev/skills/leifericf/agentic-sdk/write-c"><img src="https://agentmods.dev/badge/skills/leifericf/agentic-sdk/write-c/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for write-c

Your own site · 80×15
<a href="https://agentmods.dev/skills/leifericf/agentic-sdk/write-c"><img src="https://agentmods.dev/badge/skills/leifericf/agentic-sdk/write-c.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,432 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.01432
Opus 5.5 $0.00013 $0.00573
Sonnet 5.5 $0.00007 $0.00286
Haiku 4.5 $0.00003 $0.00143

Measured 1mo ago against content hash 8574020ba310, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

write-c scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/write-c/SKILL.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

write-c

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.

Procedure

  1. Place it. Find the owning translation unit in the module map; read that TU end to end before adding to it. Start a new TU only when the responsibility is genuinely new, name it after the responsibility, and add it to the map and the build. Respect the dependency direction the map records; a new cross-module include is a cross-module escalation, not a local convenience.
  2. C discipline. The load-bearing rules, in order:
    • Ownership decision up front. Decide ownership of every allocation before writing: runtime-managed (allocated through the runtime's owner, with temporaries pinned across allocation points) or caller-owned (malloc, freed on every error path). Decide before writing, never retrofit. When a helper allocates twice, write the pin or ownership guard for the first before allocating the second. Never free a runtime-managed value through free; never let a caller-owned struct hold the only reference to a runtime-managed value across an allocation point.
    • Pin and free across yield and throw windows. A prim error is a longjmp past local cleanup, and a blocked or yielding call lets a collection run concurrently. Pin every Lisp value live across such a window; free a caller-owned allocation before firing a throw. Blocking IO counts as much as allocation does.
    • Explicit control flow. Validate early, return early. Invalid input and failure cases exit at the top; the normal path runs at low indentation, not nested inside success conditionals. One important action per line: no assignment inside conditionals, no nested ternaries, no multi-effect loop conditions, no short-circuit chains that hide real work. When resources accumulate, use a single cleanup path (one goto cleanup label) that is safe under partial initialization, not mirrored cleanup blocks in every error branch.
    • Deterministic cleanup. Every caller-owned allocation has a free on every path, including the error path. Buffers travel with lengths; bounds checks sit adjacent to the access they protect. Guard size and index arithmetic before allocation and pointer math (a SIZE_MAX overflow check precedes the multiply it protects), so a hostile length degrades as data instead of overflowing before the guard fires.
    • Error classes. Every failure path picks its class consciously: recoverable for anything a caller can catch and handle; a host or limit error for IO and capacity; abort only with a comment naming why recovery is impossible. User input must never reach an abort. Diagnostics name the failing operation and the reason, never a bare error or failed.
  3. Failure model. The core computes a plan and returns it; the caller acts. Untrusted input (a file from disk, bytes that cross the native edge, a length field a payload controls) is expected, not exceptional: validate it, return an error class when it is malformed, let the shell surface the diagnostic. A decision in C is an enum, a small struct, or a filled out-parameter; make the caller's switch explicit rather than burying the choice inside the effectful loop. No strict-aliasing violations, no pointer punning, no reliance on signed overflow.
  4. Verify like the lanes. Build with the project's cheap lanes first (the compile lane with warnings as errors is the floor), then the module's tests, then the full cheap lane set from the descriptor. If you wrote pointer-heavy or ownership-sensitive code, run the sanitizer and leak lanes yourself before the review wave; a use-after-free or a leak found in the wave is one the writer should have caught.

Read the full file on GitHub · 120 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 120 lines · 33 tokens per session scan A 8574020ba310

Subscribe to this mod's changes

write-c is a skill published in the GitHub repository leifericf/agentic-sdk (5 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 1,432 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

omarchy-app

Build a new desktop app for Omarchy the way Omarchy's own apps are built (Hype, Monologue, Omacut): C++ and Qt Quick, compiled with qmake6 and make into a single binary, following the Omarchy theme live, and installed as an Arch package so it shows up in the app launcher. Use when asked to make, build, or scaffold an…

omacom/omarchy · 138 tokens

zoom-meeting-sdk-unreal

Zoom Meeting SDK for Unreal Engine wrapper integrations. Use when building Unreal projects that embed Zoom meetings with C++ and Blueprint wrappers, including wrapper-to-SDK mapping concerns.

anthropics/knowledge-work-plugins · 41 tokens

doca-argp

Use this skill for hands-on DOCA Arg Parser CLI work on a shipped sample or new DOCA-using app — adding / removing / renaming flags; wiring docaargpinit → register params → docaargpstart → docaargpdestroy in order; picking a parameter type from the full public enum (DOCAARGPTYPESTRING, INT, BOOLEAN, DEVICE, DEVICEREP…

NVIDIA/skills · 267 tokens

cpu-kernels

Provides guidance for writing, optimizing, and benchmarking C++ CPU kernels with SIMD intrinsics (AVX2/AVX512) for the Hugging Face kernels ecosystem. Includes a two-phase workflow: Phase 1 correctness (generic → AVX2) and Phase 2 performance exploration (AVX512 with branching trial loop), runtime CPU dispatch, OpenMP…

huggingface/kernels · 89 tokens

llvm-learning

Comprehensive learning resources and tutorials for LLVM, Clang, and compiler development. Use this skill when helping users learn LLVM internals, find educational resources, or understand compiler concepts.

gmh5225/awesome-llvm-security · 39 tokens

llvm-security

Expertise in LLVM security features including sanitizers, hardening techniques, exploit mitigations, and secure compilation. Use this skill when implementing security-focused compiler features, analyzing vulnerabilities, or hardening applications.

gmh5225/awesome-llvm-security · 43 tokens