clang

clang is a skill for Codex from OutlineDriven/outline-driven-development. It costs 51 tokens per session (1,671 once invoked), scanned A, original, Apache-2.0.

A guide for C and C++ projects that use Clang, a compiler and code-analysis tool. It covers compiler diagnostics, optimization reports, static checking with clang-tidy, link-time optimization, profile-guided optimization, and moving from GCC to Clang.

In plain words
What is it for?
Use it when investigating C or C++ builds, checking code with clang-tidy, tuning optimization, configuring LTO or PGO, or migrating a GCC build.
Why use it?
It helps interpret compiler and optimizer output and choose commands for common Clang tasks. It also keeps suggested flags aligned with the installed compiler version.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it when investigating C or C++ builds, checking code with clang-tidy, tuning optimization, configuring LTO or PGO, or migrating a GCC build.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/outlinedriven/outline-driven-development/clang
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.

Any agent
npx skills add OutlineDriven/outline-driven-development --skill clang
Clone the repo
git clone --depth 1 https://github.com/OutlineDriven/outline-driven-development

Made for: Codex.

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 clang

README.md
[![agentmods](https://agentmods.dev/badge/skills/outlinedriven/outline-driven-development/clang/github.svg)](https://agentmods.dev/skills/outlinedriven/outline-driven-development/clang)
Your own site
<a href="https://agentmods.dev/skills/outlinedriven/outline-driven-development/clang"><img src="https://agentmods.dev/badge/skills/outlinedriven/outline-driven-development/clang/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 clang

Your own site · 80×15
<a href="https://agentmods.dev/skills/outlinedriven/outline-driven-development/clang"><img src="https://agentmods.dev/badge/skills/outlinedriven/outline-driven-development/clang.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,671 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00051 $0.01671
Opus 5 $0.00026 $0.00835
Sonnet 5 $0.00010 $0.00334
Haiku 4.5 $0.00005 $0.00167

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

Security

Grade A, and why

clang 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 3d 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.

.devin/skills/clang/SKILL.md · 49 lines

How it starts

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

Clang

Contract

Field Bound contract
Trigger A project compiles with clang or clang++ and the user asks for better diagnostics, wants to see what the optimizer did or skipped, wants static analysis with clang-tidy, needs LTO through lld or LLVM PGO, or is moving a GCC build to Clang.
Authority Read-only. The skill emits flags, commands, and readings to chat; clang-tidy --fix is shown but the user runs it. Rollback is not needed because no project file is written. No remote mutation.
Side effect Chat output. Scratch compiles target a scratch file, never the project tree.
Done The requested flag set or command is reported, every flag in it is confirmed against the installed Clang, and every remark or diagnostic in the request has a reading and a next action.

Inputs

  • Compiler version: required, from clang --version. The current stable line is LLVM/Clang 23.1.0; Apple's clang reports an Apple version and lags upstream.
  • The task: required. One of diagnostics, remarks, static analysis, LTO, PGO, GCC migration, or macOS specifics.
  • Source file or compile command that reproduces the question: required for diagnostics and remarks.
  • Linker available (ld.lld, ld64, GNU ld): required for LTO questions.

Procedure

  1. Confirm the compiler and driver: run clang --version. On macOS, xcrun clang resolves to the Xcode toolchain; Homebrew LLVM installs a separate upstream clang. Done when: the vendor and version are recorded.
  2. Map GCC flags to Clang where they differ. Clang accepts most GCC driver flags. Differences that matter: -Oz shrinks harder than -Os; -flto=thin selects ThinLTO; -fprofile-instr-generate and -fprofile-instr-use select LLVM's own PGO format while -fprofile-generate and -fprofile-use keep the GCC-compatible format; -Weverything enables every warning and suits a one-off audit, not a production build; --analyze runs the Clang Static Analyzer where GCC has -fanalyzer. Attributes differ: gate GCC-only attributes with __has_attribute(name). Done when: each GCC flag in the request has its Clang spelling or a note that it is unchanged.
  3. Tune diagnostics with confirmed flags: -ferror-limit=N stops after N errors (default 20); -fno-elide-type prints full template types; -fdiagnostics-show-template-tree shows a tree diff for template mismatches; -ftemplate-backtrace-limit=N bounds the instantiation backtrace; -fdiagnostics-parseable-fixits emits fix-its in a machine-readable form; -fdiagnostics-format=vi or msvc changes the location format. Fix-it hints already print inline by default. Done when: the diagnostic flags are stated with their effect.
  4. Read optimization remarks. Emit them with -Rpass=<regex> (transform happened), -Rpass-missed=<regex> (transform skipped), -Rpass-analysis=<regex> (why), for example clang -O2 -Rpass-analysis=loop-vectorize src.c. Save all remarks with -fsave-optimization-record, which writes <object>.opt.yaml next to the object file. Interpret: an inline remark on a hot path is good; loop not vectorized: loop control flow is not understood calls for restructuring the loop; a reordering-safety remark calls for __restrict__ or #pragma clang loop vectorize(assume_safety) after the user proves no aliasing. Done when: each remark in the request has a reading and a next action.
  5. Run static analysis. Built-in analyzer: clang --analyze -Xanalyzer -analyzer-output=text src.c. clang-tidy: clang-tidy src.cpp -- -std=c++20 -I<dir> for one file, -p build/ against compile_commands.json (generate it with cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON), run-clang-tidy -j<N> -p build/ for the tree, -checks='clang-analyzer-*,bugprone-*,modernize-*,performance-*' to select families, --fix to apply fix-its in place. Suppress one line with // NOLINT(check-name) or the following line with // NOLINTNEXTLINE(check-name). Done when: the analysis command and check families match the code class.
  6. Configure LTO. Full: clang -O2 -flto -fuse-ld=lld. Thin: clang -O2 -flto=thin -fuse-ld=lld. Confirm the linker with clang -fuse-ld=lld -Wl,--version. ThinLTO links faster than full LTO on large programs; measure the code-quality difference on the project rather than assuming a ratio. -fwhole-program-vtables and -fvirtual-function-elimination need LTO. On macOS the default linker is ld64; -fuse-ld=lld needs an upstream LLVM install. Done when: the LTO mode, linker, and confirmation command are stated.
  7. Configure PGO: clang -O2 -fprofile-instr-generate to instrument, run the workload (writes default.profraw; set LLVM_PROFILE_FILE="prog-%p.profraw" for parallel runs), llvm-profdata merge -output=prog.profdata *.profraw, then clang -O2 -fprofile-instr-use=prog.profdata. Sampling-based profiles use -fprofile-sample-use=<file>. The full flow, context-sensitive PGO, and BOLT: use pgo. Done when: the four PGO commands are listed.
  8. Handle macOS specifics when asked: set the deployment target with -mmacosx-version-min=X.Y; sanitizer runtimes are injected at load, so do not strip a sanitized binary; xcrun clang selects the Xcode toolchain. Done when: the macOS points relevant to the request are stated.
  9. Confirm every flag against the installed Clang with a scratch compile; drop any the driver rejects and say so. Done when: no unconfirmed flag remains.

Read the full file on GitHub · 49 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 49 lines · 51 tokens per session scan A 0ef0f9c98ab1

Subscribe to this mod's changes

clang is a skill published in the GitHub repository OutlineDriven/outline-driven-development (52 stars, last pushed 3d ago), licensed Apache-2.0. It adds 51 tokens to every session and 1,671 once invoked, about $0.0003 per session on Opus 5. 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-09-06.

Related

Other skills, from other repositories

cpp-pro

Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques. Use when building or refactoring C++ code requiring concepts, ranges, coroutines, SIMD optimization, or careful memory management — or when addressing performance…

Jeffallan/claude-skills · 79 tokens

memory-safety-patterns

Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.

rmyndharis/antigravity-skills · 45 tokens

cpp

Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics. Use for: C/C++ questions, C/C++ interview preparation, modern language features, RAII/memory management, templates/generics, CUDA…

crazyguitar/cppcheatsheet · 0 tokens

cpp-debugging

Use when a C++ failure involves memory lifetime, undefined behavior, native crashes, or debugger-only state — debug with symbols, sanitizers, and platform-native debuggers before patching symptoms.

drvoss/everything-copilot-cli · 42 tokens

memory-safety-patterns

Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.

RudyCity/superagent · 45 tokens

gcc

GCC compiler skill for C/C++ projects. Use when selecting optimization levels, warning flags, debug builds, LTO, sanitizer instrumentation, or diagnosing compilation errors with GCC. Covers flag selection for debug vs release, ABI concerns, preprocessor macros, profile-guided optimization, and integration with build…

mohitmishra786/low-level-dev-skills · 85 tokens