clang-format
Skill2 starsChanged 2 months agoApache-2.0View on GitHub
Use when a PR changes C or C++ formatting governed by clang-format or .clang-format, including indentation, braces, spacing, alignment, include ordering, line breaking, macro-sensitive layout, or formatting-only review.
In this repository18 other files it gives its agents.
- accessibility-reviewSkill
- apex-reviewSkill
- appsec-compliance-reviewSkill
- commit-message-reviewSkill
- design-doc-conformanceSkill
- guideline-distillerSkill
- kernel-change-intentSkill
- kernel-driver-hardwareSkill
- kernel-execution-flowSkill
- kernel-locking-concurrencySkill
- kernel-resource-lifecycleSkill
- kernel-review-disciplineSkill
- kernel-security-auditSkill
- kernel-subsystem-guidesSkill
- linux-kernel-reviewSkill
- qodo-calibrate-rulesSkill
- terraform-reviewSkill
- toml-portal-migration-auditSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read the changed file and the repository's .clang-format before judging style.
- Distinctive: line 14
Do not replace an existing project configuration with a template unless explicitly requested.
- Distinctive: line 15
Do not run tools or claim that a formatter was executed.
- Distinctive: line 17
Treat bundled templates and integrations as reference material, not evidence that a changed line is invalid.
- Distinctive: line 22
Read the authoritative config and the changed diff.
- Distinctive: line 30
Read the current config and identify the smallest option change.
- Very specific: line 31
Check version compatibility in references/complete/clang-format-style-options.md.
- Distinctive: line 66
Every finding must include all of these fields:
- Distinctive: line 74
If no Rule ID and exact Rule text can be established, do not report a clang-format rule violation.
- Distinctive: line 96
Do not infer a formatting violation solely from a generic preference.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
clang-format
Review C and C++ formatting from the unified diff and the repository's committed .clang-format policy. This skill is an LLM review lens, not a formatter execution workflow.
Boundaries
- Formatting review covers layout and clang-format behavior only. Do not report correctness, safety, security, API, or architecture findings unless the user separately asks for semantic review.
- Read the changed file and the repository's
.clang-formatbefore judging style. The project configuration is authoritative over bundled templates. - Do not replace an existing project configuration with a template unless explicitly requested.
- Do not run tools or claim that a formatter was executed. Review only changed lines and the context needed to establish the rule violation.
- Preserve generated, vendored, excluded, or intentionally unformatted code. Check
.clang-format-ignoreand local project guidance. - Treat bundled templates and integrations as reference material, not evidence that a changed line is invalid.
Route the request
- Existing configuration analysis or formatting-only review:
- Read the authoritative config and the changed diff.
- Match the changed line to a rule in the Rule index below.
- Report only violations that can be proven from the diff and rule text.
- New configuration:
- Confirm no authoritative project config already exists.
- Select the closest file under
assets/configs/, then make minimal overrides. - Validate the proposed config change by reasoning through representative changed constructs. Do not claim execution.
- Configuration change:
- Read the current config and identify the smallest option change.
- Check version compatibility in
references/complete/clang-format-style-options.md. - Compare the changed construct with the configured rule. Do not propose repository-wide reformatting.
- Troubleshooting:
- State that runtime confirmation is outside this skill. Use the configured option and changed code as evidence.
- Consult
references/cli-usage.mdand the relevant option guide only for interpretation.
- Editor or git integration:
- Review examples under
assets/integrations/. - Adapt them to the repository instead of installing or copying them blindly.
- Review examples under
Option navigation
- Alignment:
references/01-alignment.md - Line breaking and wrapping:
references/02-breaking.md - Braces:
references/03-braces.md - Indentation:
references/04-indentation.md - Spacing:
references/05-spacing.md - Include handling:
references/06-includes.md - Language-specific behavior:
references/07-languages.md - Comments:
references/08-comments.md - Penalties and advanced options:
references/09-advanced.md - Working examples:
references/quick-reference.md - CLI details:
references/cli-usage.md - Complete CLI reference:
references/complete/clang-format-cli.md - Complete style-options reference:
references/complete/clang-format-style-options.md
Repository-specific review guidance
- The repository's
.clang-formatis authoritative for reviewed C and C++ files. Inspect it rather than substitutingassets/configs/linux-kernel.clang-formator another generic template. - For macro-heavy C, include representative headers and source files with
ForEachMacros,IfMacros,AttributeMacros, andWhitespaceSensitiveMacrosbehavior when validating configuration changes. - Respect
// clang-format offand// clang-format onregions. Do not remove markers or treat intentionally preserved layout inside them as a formatting defect. - Validate a focused change on representative files and inspect the diff for macro damage, preprocessor movement, include changes, and excessive churn.
- In Qodo review, report formatting findings only when they are in scope and supported by the authoritative config. Route semantic C concerns to the appropriate semantic review skill instead of attaching them to clang-format findings.
Finding contract
Every finding must include all of these fields:
Rule ID: the stable ID from the Rule index, such asCF-001.Rule text: the exact configuration line or rule text quoted below.Evidence: changed file path and changed line. Never invent a line number.Reason: why the changed text violates that rule.Fix: the smallest source change that restores compliance.
If no Rule ID and exact Rule text can be established, do not report a clang-format rule violation.
Rule index for the repository configuration
These IDs are a local review adaptation because the source .clang-format has no rule IDs.
The quoted text is the source rule text and must be preserved in findings.
- CF-001:
BreakBeforeBraces: Linux - CF-001 semantics: function, type, and namespace opening braces go on the next line. Control-statement braces stay on the same line. Never report an attached
if,for,while, orswitchbrace as a CF-001 violation. - CF-002:
ColumnLimit: 100 - CF-003:
ContinuationIndentWidth: 8 - CF-004:
IndentCaseLabels: false - CF-005:
IndentGotoLabels: false - CF-006:
IndentWidth: 8 - CF-007:
InsertNewlineAtEOF: true - CF-008:
SpaceBeforeParens: ControlStatementsExceptControlMacros - CF-009:
SortIncludes: Never - CF-010:
UseTab: ForContinuationAndIndentation - CF-011:
ForEachMacrosincludes the project macro being reviewed. - CF-012:
IfMacrosincludesCHECKIF. - CF-013:
WhitespaceSensitiveMacrosincludesCOND_CODE_0,COND_CODE_1,IF_DISABLED,IF_ENABLED,LISTIFY,STRINGIFY,Z_STRINGIFY, andDT_FOREACH_PROP_ELEM_SEP.
Do not infer a formatting violation solely from a generic preference. Cite one of these IDs and its exact text.
Review scope
Review only changed C/C++ lines and necessary context. Respect clang-format off/on, generated or vendored paths, and macro-sensitive constructs. Do not claim that a candidate is confirmed when the diff does not show the relevant formatting.
Bundled resources
Seven configuration examples are under assets/configs/:
assets/configs/google-cpp-modified.clang-formatassets/configs/linux-kernel.clang-formatassets/configs/microsoft-visual-studio.clang-formatassets/configs/modern-cpp17-20.clang-formatassets/configs/compact-dense.clang-formatassets/configs/readable-spacious.clang-formatassets/configs/multi-language.clang-format
Integration examples are:
assets/integrations/pre-commitassets/integrations/vimrc-clang-format.vimassets/integrations/emacs-clang-format.el
Reporting
State the authoritative config, changed file and line, Rule ID, exact Rule text, evidence, and fix. Use the Maintainability category for formatting-only findings. Do not claim that clang-format or another CLI ran. Separate formatting findings from semantic review.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

