gccdiag

Parse compile_commands.json to verify C/C++ builds with configurable compiler arguments.

1|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/IndianBoy42/dot-opencode --skill gccdiag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gccdiag
Source: https://github.com/IndianBoy42/dot-opencode/tree/main/skills/gccdiag
Command: npx skills add https://github.com/IndianBoy42/dot-opencode --skill gccdiag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Quickly validate that C/C++ sources compile with the exact arguments defined in the project's compile_commands.json by sourcing build data from the compilation database discovered in the repo hierarchy.

Core Features & Use Cases

  • Automatic discovery: Searches upward from the current directory to locate the first compile_commands.json and parses it as the compilation database.
  • Configurable behavior: Supports per-project tweaks via .gccdiag or _gccdiag files in the current directory or above, as well as a global config at $XDG_CONFIG_HOME/gccdiag/.
  • Practical use cases: Ideal for CI and local development when you need reproducible compiler invocations and quick verification of changes against the exact compile commands.

Quick Start

Run gccdiag on a source file to verify it compiles using the detected compile_commands.json.

Frequently Asked Questions about gccdiag

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

FAQPage Schema
How do I verify a C++ build using compile_commands.json?

To verify a C++ build using compile_commands.json, the Skill automatically locates and parses the compilation database in your project hierarchy to drive accurate compiler verification with the exact arguments defined for your sources.

What is the best way to validate C/C++ sources against exact compile commands?

Validating C/C++ sources against exact compile commands is done by sourcing build data directly from the compilation database discovered in the repository hierarchy, ensuring reproducible compiler invocations for both local development and CI pipelines.

How do I customize compiler arguments when using a compilation database?

You can customize compiler arguments by applying configuration keys such as additional_args, default_args, and args_to_ignore through per-project .gccdiag or _gccdiag files, or a global configuration located at $XDG_CONFIG_HOME/gccdiag/.

Does compile_commands.json discovery work if the file is in a parent directory?

Yes, compile_commands.json discovery works for parent directories by traversing upward from the current working directory to find and parse the first match, ensuring accurate build verification without requiring the file in your immediate folder.

Why is my C/C++ source not compiling with the correct build flags?

If a C/C++ source is not compiling with the correct build flags, it may be due to missing or incorrect configuration keys in your .gccdiag file; use additional_args, default_args, and args_to_ignore to tailor the compiler invocation accurately.

Can I use gccdiag for CI pipelines to check C++ builds?

Yes, you can use gccdiag for CI pipelines to check C++ builds because it provides reproducible compiler invocations and quick verification of changes against the exact compile commands sourced from the project's compilation database.