What it does
Recommended C code style and coding rules for standard C99 or later. Comes with AI agent skill to write, edit and format the code.
- Connects Instruction files the AI reads; connects to nothing
- Account or key No key needed
- Category Coding
For makers: add a badge to your README
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/skills/majerle-c-code-style)Use together with
MCP servers that connect the AI to services for the same work
Fallow
Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.
Desktop Commander
MCP server for terminal commands, file operations, and process management
Similar Skills
Same kind of work, ordered like the Skills list
| This one c-code-style | rea | graphify | archify | security-audit-skill | |
|---|---|---|---|---|---|
| Maker | MaJerle | morluto | Graphify-Labs | tt-a1i | cloudflare |
| Skills | 1 | 1 | 1 | 1 | 1 |
| GitHub stars | 1,359 | 461,751 | 148,352 | 96,757 | 73,156 |
| Last code change | Oct 24, 2026 | Nov 16, 2026 | Nov 16, 2026 | Nov 15, 2026 | Sep 15, 2026 |
| License | MIT | MIT | Apache-2.0 | Apache-2.0 | MIT |
1 skills (instruction sets) by MaJerle that an AI reads and follows · not an MCP server
How a Skill differs from MCP
MCP = the hands
Connects the AI to an outside service or data, such as reading Notion or creating an invoice. A program or server has to be running.
Skill = the manual
A text file that teaches the AI how to do a task. It connects to nothing.
Some overlap: a few Skills run scripts that call tools, and a few MCP servers only send knowledge. Start from the task you want done.
Works with
Claude Code
From the maker’s README and the folders in the repo
Install
Is it safe?
- Who made it
GitHub account MaJerle (person), 16 years old
- Use and upkeep
★ 1,359 stars · code last changed Oct 24, 2026
- Any scripts?
No, plain text files the AI reads and follows
- Uses the internet?
No scripts, so it does not go online by itself
- Changes machine-wide settings?
No hooks or writes to machine settings found
Checked automatically from the repo files at commit 9eb29e4 (read only, nothing was run). Not a safety guarantee: read it and decide for yourself
First: which AI do you use?
Pick your app and this page shows only how to install it there
Option 1Upload to claude.ai (web and app)
Uploading to claude.ai would fail: the description is over 200 characters (302). Use "Let the AI install it" instead
Option 1Let Claude Code install it
Copy this sentence and paste it into a Claude Code chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Restart Claude Code, then type /c-code-style or ask for a matching task and Claude picks it up
Checked against official docs Nov 12, 2026 · Source: code.claude.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.claude/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
Restart Claude Code, then type /c-code-style or ask for a matching task and Claude picks it up
ChatGPT desktop app
The ChatGPT desktop app has Codex built in, and Codex reads skills from ~/.agents/skills
Option 1Let ChatGPT install it
Open Codex in the ChatGPT desktop app and paste this sentence into the chat
The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Option 2Put the folder there yourself
Put the c-code-style folder at ~/.agents/skills/c-code-style
~ is your home folder ($HOME)
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
After installing
- ChatGPT desktop app: open Skills in the sidebar to see that the skill is there
- To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
- Codex picks up newly installed skills by itself; if one does not show up, restart Codex
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
ChatGPT on the web and mobile
Skills you install yourself do not work here; only skills that come with a plugin from the directory
To use this skill with ChatGPT, use the ChatGPT desktop app as above
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
Option 1Let Codex install it
Copy this sentence and paste it into a Codex chat · Works in Codex inside the ChatGPT desktop app, Codex CLI and the IDE extension
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Codex picks up newly installed skills by itself; if one does not show up, restart Codex · To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
Restart Codex, then ask for a matching task; Codex lists the skill
Option 1Let Cursor install it
Copy this sentence and paste it into a Cursor chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
In Cursor’s Agent chat, type / and pick c-code-style
Checked against official docs Nov 12, 2026 · Source: cursor.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.cursor/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
In Cursor’s Agent chat, type / and pick c-code-style
Option 1Let the AI install it
For other apps that read skills. The sentence gives the paths for Claude Code, Codex and Cursor so the AI picks the one for your app · Copy this sentence into the app’s chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Checked against official docs Nov 12, 2026 · Source: code.claude.com, learn.chatgpt.com, cursor.com
For Terminal users
Other apps that support Agent Skills (such as Gemini CLI or GitHub Copilot) use different folders. Check that app’s guide, then copy the folder with the SKILL.md there.
Skill folders checked against the official Claude Code, Codex and Cursor guides on Nov 11, 2026
View the original SKILL.md
The text below comes from the maker’s repo, not from PopNx MCP
5,196 characters · Open the full file on GitHub
---
name: 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".
---
# 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:
- Names (variables, parameters, struct/enum members) are lowercase with
underscores and **at least 3 characters**. Never a bare `__`/`_` prefix.
`static` module-private functions use a `prv_` prefix.
- Use `stdint.h` types (`uint8_t`, `int32_t`, ...) except `char`/`float`/`double`.
Avoid `stdbool.h`; use `1`/`0`.
- Don't rely on static initializers for `global`/`static` variables that need
a real startup value in embedded contexts — give the module an `init()`
function instead.
- Declare all locals at the top of a block, grouped by type, in order:
custom structs/enums (and their pointers) → integers (widest unsigned
first) → floating point.
- `const`-correct pointers and parameters; generic pointers are `void*`, cast
internally, never cast a `void*` return value.
- Every function with zero parameters uses `(void)`, never empty `()`.
- A function has **at most 2 `return` points**: one early return for
parameter/argument validation, one at the end. No `return` in the middle —
use a return-value variable to accumulate the result instead.
- Check a pointer against `NULL` before dereferencing it (unless the
surrounding code guarantees it can't be `NULL`). After `free(ptr)`,
immediately set `ptr = NULL`.
- Boolean-treated variables are compared with `if (x)` / `if (!x)`, never
`== 1` / `== 0`; counter/value variables use `> 0` / `== 0`, never bare
`if (x)`.
- Doxygen: every function (including `static` ones) gets a `\brief`, a
`\param[in]`/`\param[out]` per parameter, and a `\return` if it returns
non-`void`. The doc block goes at the function's **definition** (where the
body is, typically the `.c` file) — never duplicated at the declaration in
the header. Pad tags so description text starts at column 22 (see
`template.c`/`template.h` for the exact alignment). Wrap identifiers,
constants, and literals referenced in prose in backticks.
## 4. Format the code
After writing or editing any `.c`/`.h` file, run the formatter using this
repository's `.clang-format` (it's found automatically by walking up from the
file's directory — no path needed):
```sh
scripts/check-format.sh <changed-file.c> [<changed-file.h> ...]
```
This script:
1. Checks `clang-format` is on `PATH` and is version `20` or newer (this
repo's minimum — see `CODING_RULES.md`, General rules).
2. If missing or too old, prints the install command for the current OS
(`brew install llvm` on macOS, distro package or LLVM apt repo on Linux,
the LLVM installer on Windows) and exits non-zero — install it, then
re-run.
3. Otherwise runs `clang-format -i` on the given files.
To verify compliance without writing changes (e.g. before reporting a task
done), use `--check` instead:
```sh
scripts/check-format.sh --check <file.c> [<file.h> ...]
```
Exits `0` if already compliant, non-zero (with the specific violations) if
not.
## 5. Verified behavior
This flow was tested directly in this repository: `check-format.sh` correctly
refuses to run when `clang-format` is absent (prints the right install
command per OS and exits 1), and — once `clang-format` is installed —
correctly detects a deliberately mis-formatted file with `--check`, fixes it
with the default (in-place) mode, and re-verifies clean afterward.
`template.c` and `template.h` in this repository both pass `--check` as-is —
use them as a reference for exact formatting and doxygen alignment.
Discussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
From GitHub
- GitHub stars
- 1,359
- Maker
- MaJerle
- License
- MIT
- Last code change
- Oct 24, 2026
- SKILL.md files in the repo (including translated copies and templates)
- 1
- Topics
- c, c-code-style, c-rules, coding, rules, style