.claude/skills/google-cpp-style/SKILL.md
Google C++ Style Guide rules for writing clean, maintainable C++ code. Use when writing C++, reviewing code, discussing naming conventions, formatting, class design, or any C++ best practices. Covers headers, scoping, classes, functions, naming, comments, and formatting.
npx skillsauth add clickhouse/pg_stat_ch google-cpp-styleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides the complete Google C++ Style Guide for C++20. Apply these rules when writing or reviewing C++ code.
| Topic | Key Rules |
|-------|-----------|
| Naming | Types: PascalCase, functions: PascalCase, variables: snake_case, constants: kPascalCase, macros: UPPER_CASE |
| Formatting | 80 char lines, 2-space indent, spaces (not tabs), { on same line |
| Headers | Self-contained, #define guards, include what you use |
| Classes | Prefer composition over inheritance, explicit constructors, private data members |
Code should target C++20. Do not use C++23 features or non-standard extensions.
For complete rules on specific topics:
#ifndef PROJECT_PATH_FILE_H_
#define PROJECT_PATH_FILE_H_
#include "project/public/header.h"
#include <sys/types.h>
#include <string>
#include <vector>
#include "other/library.h"
#include "project/internal.h"
namespace project {
class MyClass {
public:
MyClass();
explicit MyClass(int value);
void DoSomething();
int count() const { return count_; }
void set_count(int count) { count_ = count; }
private:
int count_;
};
} // namespace project
#endif // PROJECT_PATH_FILE_H_
class MyClass {
public:
// Types and type aliases
using ValueType = int;
// Static constants
static constexpr int kMaxSize = 100;
// Constructors and assignment
MyClass();
MyClass(const MyClass&) = default;
MyClass& operator=(const MyClass&) = default;
// Destructor
~MyClass();
// All other methods
void Process();
protected:
// Protected members (if needed)
private:
// Private methods
void InternalHelper();
// Data members
int value_;
};
// Returns an iterator positioned at the first entry >= `start_word`.
// Returns nullptr if no such entry exists.
// The client must not use the iterator after the table is destroyed.
std::unique_ptr<Iterator> GetIterator(absl::string_view start_word) const;
#define guards in all headersexplicitnullptr (not NULL or 0) for pointersoverride or final for virtual function overridesprivateusing namespace directivesstatic_cast, etc.)std::auto_ptr (use std::unique_ptr)testing
Create and push a new semver release tag. Asks for release type (patch/minor/major), validates commit exists on remote, bumps version, and pushes the tag.
development
Review C++ code against Google C++ Style Guide. Use when reviewing C++ code, pull requests, or when asked to check code style compliance.
development
Check C++ naming conventions against Google Style Guide. Use when checking if names follow conventions or when renaming identifiers.
development
Generate C++ header files following Google Style Guide. Use when creating new header files or asking for a header template.