clang

Recommend Clang flags, clang-tidy checks, and LTO/PGO workflows for C and C++ projects.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill clang-awfixers-stuff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clang
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/clang
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill clang-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Help developers choose the right clang/clang++ flags, interpret Clang diagnostics and optimization remarks, configure sanitizers, and integrate LLVM tooling so builds are faster, safer, and easier to debug across platforms including macOS and FreeBSD.

Core Features & Use Cases

  • Diagnostic tuning: Improve error messages, enable fix-it hints, and control template backtraces to make compiler output actionable.
  • Static analysis & linting: Recommend clang-tidy check sets, suppression patterns, and workflows for applying automatic fix-its.
  • Performance tooling: Advise LTO (thin vs full), PGO instrumentation and profile application, and interpreting optimization remarks to guide code changes.
  • Platform-specific guidance: Address Apple/FreeBSD toolchain quirks, clang-cl usage on Windows, and linker selection such as lld.

Quick Start

Ask the clang skill to recommend clang and linker flags, clang-tidy checks, and sanitizer or PGO steps to resolve the current build errors and improve optimization for my C/C++ project.

Frequently Asked Questions about clang

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure clang-tidy checks and apply automatic fix-its for my C++ project?

Clang-tidy check sets are configured by recommending specific checks, suppression patterns, and workflows for applying automatic fix-its. This provides actionable static analysis and linting guidance for C and C++ projects to improve code safety.

What is the difference between ThinLTO and full LTO when optimizing LLVM builds?

ThinLTO and full LTO differ in their link-time optimization approaches for LLVM builds. The clang skill advises selecting between them based on your toolchain, providing compatible LTO workflows to make builds faster and easier to debug.

How do I interpret clang diagnostics and enable fix-it hints for template backtraces?

Interpreting clang diagnostics involves tuning error messages, enabling fix-it hints, and controlling template backtraces to make compiler output actionable. This diagnostic tuning improves error messages so build issues are easier to resolve.

Does clang-cl work on Windows and what linker should I use with LLVM toolchains?

Clang-cl works on Windows and provides platform-specific guidance for LLVM toolchains, including selecting linkers like lld. This addresses toolchain quirks to ensure builds are compatible across macOS, FreeBSD, and Windows environments.

What are the steps to enable PGO instrumentation and apply profiles in a clang build?

Enabling PGO instrumentation involves profiling your C or C++ project and applying the generated profiles to guide code changes. The clang skill provides PGO instrumentation and profile application workflows compatible with your specific LLVM toolchain versions.

Why are my clang sanitizer builds failing on macOS or FreeBSD?

Clang sanitizer builds on macOS or FreeBSD often fail due to platform-specific toolchain quirks. The clang skill addresses these environment quirks and provides diagnostic tuning steps to configure sanitizers and resolve build errors.