google-cpp-style

Applies Google's C++ style conventions when writing or reviewing C++ code.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/chughtapan/google-guide-skills --skill google-cpp-style-chughtapan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-cpp-style
Source: https://github.com/chughtapan/google-guide-skills/tree/main/skills/google-cpp-style
Command: npx skills add https://github.com/chughtapan/google-guide-skills --skill google-cpp-style-chughtapan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? C++ codebases drift into inconsistent naming, header usage, ownership patterns, and formatting when style rules are not enforced, making code harder to review and maintain. This Skill gives an agent the concrete rules from Google's C++ Style Guide so it can write and review C++ that follows those conventions. ## Core Features & Use Cases - Header and include rules: Enforces self-contained headers, #define guards, include-what-you-use, and include ordering. - Language feature guidance: Covers exceptions (prohibited), RTTI, smart pointer ownership, implicit conversions, copy/move semantics, and C++20 targeting. - Naming and formatting conventions: Defines snake_case variables, PascalCase types and functions, k-prefixed constants, 80-column lines, and braced control statements. - Use Case: While reviewing a pull request that adds a new C++ class, the agent flags a missing explicit on a single-argument constructor, an unsigned integer used for a count, and a header that relies on transitive includes. ## Quick Start Review this C++ file against the Google C++ style guide and list every violation with the recommended fix.

Frequently Asked Questions about google-cpp-style

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

FAQPage Schema
How do I review C++ code against the Google style guide?

Load this Skill and ask the agent to review the C++ file or diff. It checks headers, naming, ownership, implicit conversions, and formatting against the Google C++ Style Guide and reports each violation with the rule behind it.

What C++ naming conventions does the Google style guide use?

Types and functions use PascalCase, variables and namespaces use snake_case, class data members add a trailing underscore, and constants use a leading k with mixed case like kDaysInAWeek. Filenames are lowercase with underscores or dashes.

Does the Google C++ style guide allow exceptions?

No. The guide prohibits C++ exceptions entirely, including related features like std::exception_ptr and std::nested_exception. Error handling should use return values or other mechanisms instead.

Which C++ standard version does this style guide target?

The guide currently targets C++20, meaning C++23 features should not be used. The targeted version advances over time as the guide is updated.

When should I use a struct instead of a class in Google style C++?

Use a struct only for passive data carriers with all public fields and no invariants between fields. If the type needs invariants, access control, or is expected to evolve, use a class instead.

What are the limitations of this C++ style Skill?

It is a style and review guide, not a C++ language tutorial, and it does not teach programming fundamentals. Repository-specific requirements and newer authoritative guidance take precedence over its rules.