Agent skill

Cppcheck Clang Format Precommit

by MidnightBSD in MidnightBSD/src

Run clang-format (prefer clang-format19), clang-tidy19, and cppcheck on staged C/C header changes before committing; auto-format then fail on serious diagnostics.

Custom licenceAuto-check passedSecurity

Install Cppcheck Clang Format Precommit

skills CLI
$ npx skills add MidnightBSD/src --skill cppcheck-clang-format-precommit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install MidnightBSD/src cppcheck-clang-format-precommit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/MidnightBSD/src.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/cppcheck-clang-format-precommit .claude/skills/cppcheck-clang-format-precommit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cppcheck-clang-format-precommit
GitHub stars
114
Token cost
~412 tokens
SKILL.md length
170 words
Files
2 (incl. scripts)
Skills in repo
5
Repo updated
First seen
Licence
Custom licence

At a glance

Run clang-format (prefer clang-format19), clang-tidy19, and cppcheck on staged C/C header changes before committing; auto-format then fail on serious diagnostics.

  • Works in 4 steps: Stage your changes (git add ...). → Run the pre-commit script → If it exits non-zero, fix findings and… → …
  • Security work in your project
  • SKILL.md covers Workflow, What it does and Notes
  • Runs Shell scripts from its folder; calls git

What it does

Cppcheck Clang Format Precommit is an agent skill from MidnightBSD/src. Run clang-format (prefer clang-format19), clang-tidy19, and cppcheck on staged C/C header changes before committing; auto-format then fail on serious diagnostics.

Its SKILL.md is about 410 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/precommit_c_sanity.sh`).

It sits in Security. The repository describes itself as: MidnightBSD OS source code.

When your agent uses it

  • Security work in your project

Example prompts

  • “/cppcheck-clang-format-precommit”

Requirements

  • A Bash shell

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Stage your changes (git add ...).
  2. Run the pre-commit script
  3. If it exits non-zero, fix findings and re-run until clean.
  4. Commit.

What it can do on your machine

Read from SKILL.md and the folder at commit 9450100. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cppcheck Clang Format Precommit loads about 412 tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 170 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~412

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 170 words (~412 tokens).

“Use this skill when you’re about to git commit C/C header changes and want an automated preflight for serious bugs/vulns and formatting consistency.”

— opening of SKILL.md by MidnightBSD, Custom licence
name
cppcheck-clang-format-precommit

Read the full SKILL.md on GitHub

Files

SKILL.md and 1 other file (scripts) in .agents/skills/cppcheck-clang-format-precommit of MidnightBSD/src.

  • SKILL.md
  • scripts/precommit_c_sanity.sh

Open the folder on GitHubat commit 9450100

Compare with similar skills

Cppcheck Clang Format Precommit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cppcheck Clang Format Precommit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cppcheck Clang Format Precommit this skillMidnightBSD/src114—~412Automated safety check: PassCustom licence
Fla Ascend Performancefla-org/flash-linear-attention5.8k—~6.3kAutomated safety check: PassMIT
Deepsec Documentation Guidevercel-labs/deepsec8.1k—~956Automated safety check: PassApache-2.0
Skill Scannergetsentry/skills1k4 repos~2.5kAutomated safety check: WarnApache-2.0
Serenity Aleabitoreddityan-labs/serenity-aleabitoreddit4801 repos~3.3kAutomated safety check: PassNone
Security Alert Triageelastic/agent-skills5921 repos~3.5kAutomated safety check: NotesApache-2.0

Similar skills

  • Fla Ascend Performance

    fla-org/flash-linear-attention

    Guidelines for Ascend NPU kernel / Triton-Ascend backend performance work in the FLA repo.

    5.8k GitHub stars~6.3k tokensUpdated today
    SecurityAuto-check passed
  • Deepsec Documentation Guide

    vercel-labs/deepsec

    Official

    Points the agent at deepsec's own docs to answer questions about initializing, configuring, resuming, scanning with and extending the vulnerability scanner.

    8.1k GitHub stars~956 tokensUpdated 8 days ago
    SecurityAuto-check passed
  • Skill Scanner

    getsentry/skills

    Official

    Scan agent skills for security issues. An agent skill from getsentry/skills.

    1k GitHub starsUsed in 4 repos~2.5k tokens
    SecurityAuto-check: warnings
  • Serenity Aleabitoreddit

    yan-labs/serenity-aleabitoreddit

    Apply trader Serenity's (@aleabitoreddit) AI/semiconductor supply-chain analytical lens to US-stock ideas and market judgment.

    480 GitHub starsUsed in 1 repo~3.3k tokens
    SecurityAuto-check passed
  • Security Alert Triage

    elastic/agent-skills

    Official

    Triage Elastic Security alerts — gather context, classify threats, create cases, and acknowledge.

    592 GitHub starsUsed in 1 repo~3.5k tokens
    SecurityAuto-check: notes
  • Shiro Attack CLI

    SummerSec/ShiroAttack2

    当用户要求利用、检测或测试 Apache Shiro rememberMe 反序列化漏洞 (Shiro-550, CVE-2016-4437) 时使用。触发词包括 "Shiro"、"rememberMe"、"shiro attack"、"CVE-2016-4437"、"Shiro-550"、"爆破 Shiro key"、"利用 Shiro"、"Shiro…

    2.6k GitHub stars~945 tokensUpdated 4 mo ago
    SecurityAuto-check passed

More from MidnightBSD/src

  • Security Advisory

    MidnightBSD/src

    Handle a security fix end to end for MidnightBSD src - triage a FreeBSD security advisory (FreeBSD-SA-) or CVE against this tree, port the fix to master and both stable branches, add the UPDATING…

    114 GitHub stars~2.2k tokensUpdated 4 days ago
    Auto-check passed
  • Update Updating

    MidnightBSD/src

    Add an entry to the UPDATING file at the repository root. An agent skill from MidnightBSD/src.

    114 GitHub stars~1.6k tokensUpdated 4 days ago
    Auto-check passed
  • Vendor Update

    MidnightBSD/src

    Import a new upstream release of third-party software into a MidnightBSD vendor branch and merge it into master (and optionally stable branches).

    114 GitHub stars~3.4k tokensUpdated 4 days ago
    Auto-check passed
  • Splint Post C Sanity

    MidnightBSD/src

    Run splint after cppcheck/clang-format/clang-tidy precommit sanity to find memory issues, API misuse, and contract violations in staged C code (tolerates older C parser limitations).

    114 GitHub stars~348 tokensUpdated 4 days ago
    Auto-check passed

Categories

Questions about Cppcheck Clang Format Precommit

What does Cppcheck Clang Format Precommit do?

Run clang-format (prefer clang-format19), clang-tidy19, and cppcheck on staged C/C header changes before committing; auto-format then fail on serious diagnostics. Cppcheck Clang Format Precommit is an agent skill from MidnightBSD/src. Run clang-format (prefer clang-format19), clang-tidy19, and cppcheck on staged C/C header changes before committing; auto-format then fail on serious diagnostics.

When should I use Cppcheck Clang Format Precommit?

Cppcheck Clang Format Precommit fits situations like: security work in your project.

How do I install Cppcheck Clang Format Precommit in Claude Code?

Run `npx skills add MidnightBSD/src --skill cppcheck-clang-format-precommit -a claude-code`. Or copy the skill folder (.agents/skills/cppcheck-clang-format-precommit in MidnightBSD/src) into .claude/skills/cppcheck-clang-format-precommit in your project. Claude Code loads it when a task matches its description.

How do I install Cppcheck Clang Format Precommit in Codex?

Run `npx skills add MidnightBSD/src --skill cppcheck-clang-format-precommit -a codex`. Or copy the skill folder (.agents/skills/cppcheck-clang-format-precommit in MidnightBSD/src) into .agents/skills/cppcheck-clang-format-precommit in your project. Codex loads it when a task matches its description.

Can I use Cppcheck Clang Format Precommit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MidnightBSD/src --skill cppcheck-clang-format-precommit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cppcheck-clang-format-precommit, .gemini/skills/cppcheck-clang-format-precommit, .github/skills/cppcheck-clang-format-precommit and .opencode/skills/cppcheck-clang-format-precommit in your project.

What does Cppcheck Clang Format Precommit need to run?

Going by SKILL.md and its folder, Cppcheck Clang Format Precommit needs a shell for the scripts in its folder and the command-line tools its instructions call (git). Our summary lists: A Bash shell.

Does Cppcheck Clang Format Precommit access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Cppcheck Clang Format Precommit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Cppcheck Clang Format Precommit use?

Cppcheck Clang Format Precommit has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Cppcheck Clang Format Precommit use?

About 412 tokens (SKILL.md is roughly 1.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cppcheck Clang Format Precommit?

Skills that share tags, products or a category with Cppcheck Clang Format Precommit: Fla Ascend Performance (fla-org/flash-linear-attention, 5.8k stars), Deepsec Documentation Guide (vercel-labs/deepsec, 8.1k stars), Skill Scanner (getsentry/skills, 1k stars) and Serenity Aleabitoreddit (yan-labs/serenity-aleabitoreddit, 480 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cppcheck Clang Format Precommit?

MidnightBSD (a GitHub organization) maintains it in MidnightBSD/src, which has 114 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 4, 2026.

Source: MidnightBSD/src on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.