Recommended-C-style-and-coding-rules

Recommended-C-style-and-coding-rules is a cursor rule for Cursor from AhmedAbouelkher/micro_market. It costs 0 tokens per session (9,238 once invoked), scanned A, original, MIT.

A guide to writing C code, including naming, layout, comments, functions, data structures, and formatting. C is a programming language commonly used for systems and embedded software.

In plain words
What is it for?
It guides the writing and formatting of C files, headers, comments, macros, and related documentation.
Why use it?
It helps new changes match the style of the surrounding project instead of introducing inconsistent code.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It guides the writing and formatting of C files, headers, comments, macros, and related documentation.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ahmedabouelkher/micro_market/recommended-c-style-and-coding-rules
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.

Clone the repo
git clone --depth 1 https://github.com/AhmedAbouelkher/micro_market

Made for: Cursor.

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 Recommended-C-style-and-coding-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/ahmedabouelkher/micro_market/recommended-c-style-and-coding-rules/github.svg)](https://agentmods.dev/rules/ahmedabouelkher/micro_market/recommended-c-style-and-coding-rules)
Your own site
<a href="https://agentmods.dev/rules/ahmedabouelkher/micro_market/recommended-c-style-and-coding-rules"><img src="https://agentmods.dev/badge/rules/ahmedabouelkher/micro_market/recommended-c-style-and-coding-rules/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 Recommended-C-style-and-coding-rules

Your own site · 80×15
<a href="https://agentmods.dev/rules/ahmedabouelkher/micro_market/recommended-c-style-and-coding-rules"><img src="https://agentmods.dev/badge/rules/ahmedabouelkher/micro_market/recommended-c-style-and-coding-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 9,238 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.00000 $0.09238
Opus 5 $0.00000 $0.04619
Sonnet 5 $0.00000 $0.01848
Haiku 4.5 $0.00000 $0.00924

Measured 10d ago against content hash acdabf71fa6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

Recommended-C-style-and-coding-rules 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 10d 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.

.cursor/rules/Recommended-C-style-and-coding-rules.mdc · 1,362 lines

How it starts

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

Table of Contents

The single most important rule

Let's start with the quote from GNOME developer site.

The single most important rule when writing code is this: check the surrounding code and try to imitate it.

As a maintainer it is dismaying to receive a patch that is obviously in a different coding style to the surrounding code. This is disrespectful, like someone tromping into a spotlessly-clean house with muddy shoes.

So, whatever this document recommends, if there is already written code and you are patching it, keep its current style consistent even if it is not your favorite style.

Integration with VSCode

VScode comes with pre-installed clang-format tool (part of LLVM package) that has been design to help developers with auto-format tool during code development.

As such, it allows users to format code on file change (and save). When file is saved, vscode will try to invoke the clang-format and format the code. Rules to use are in .clang-format file. If clang-format cannot find the rules in the path of current file, it will go all the way up to the root, until one is found. If still none is available, default rules are then being used.

Read the full file on GitHub · 1,362 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. 10d ago First seen · 1,362 lines · 9,238 tokens per session scan A acdabf71fa6d

Subscribe to this mod's changes

Recommended-C-style-and-coding-rules is a cursor rule published in the GitHub repository AhmedAbouelkher/micro_market (2 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 9,238 tokens. 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.