# C Code Style

Write, edit, or review C (and C-compatible header) code according to C coding style...

- Repository: https://github.com/MaJerle/c-code-style (1357 stars)
- Category: Writing
- License: MIT
- Last updated: 2026-10-24
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add MaJerle/c-code-style --skill c-code-style -g -a claude-code -y`
Codex: `npx skills add MaJerle/c-code-style --skill c-code-style -g -a codex -y`
Cursor: `npx skills add MaJerle/c-code-style --skill c-code-style -g -a cursor -y`
Gemini CLI: `npx skills add MaJerle/c-code-style --skill c-code-style -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add MaJerle/c-code-style`

## Description

Write, edit, or review C (and C-compatible header) code according to C coding style rules, then check and run clang-format to enforce formatting. Trigger on "write C code", "edit a .c/.h file", "review C code style", "format C code", "run clang-format", "check clang-format", "apply the C style guide".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# C code style

This skill applies whenever you are writing, editing, or reviewing `.c` or `.h`
files in a project that adopts this style guide. The full rule set lives in
[`CODING_RULES.md`](../../../CODING_RULES.md) at the repository root, that
file is the single source of truth (this repository's `README.md` is just a
symlink to it, so it renders on the GitHub front page). This skill exists to
make the rules operational: what to self-apply while writing code, and how to
run the formatter afterward.

## 1. Read the rules first

Before writing or editing C code, read `CODING_RULES.md` in this repository
(or wherever this skill was installed alongside it, if it's not there, the
checklist in step 3 below is a self-contained fallback). Do not rely on
memory of "typical" C style, several of this guide's rules are deliberately
non-default (e.g. `(void)` on zero-parameter functions, at most 2 `return`
points per function, no `stdbool.h`).

## 2. What `clang-format` fixes for you

Don't hand-format these, write reasonably and let the formatter normalize
them in step 4: indentation and spacing, brace placement, pointer-asterisk
alignment, function-prototype alignment, trailing commas in struct
initializers, blank-line and parenthesis spacing.

## 3. What `clang-format` will NOT fix, apply these yourself while writing

These are semantic or naming rules; a formatter cannot infer them. Apply them
as you write, not after:

The rest: https://github.com/MaJerle/c-code-style/blob/HEAD/.claude/skills/c-code-style/SKILL.md
