Skip to content

tatsu/gglcpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gglcpp — Google C++ Style Guide Plugin for Claude Code

A Claude Code plugin that brings the Google C++ Style Guide into your AI-assisted C++ development workflow.

Includes:

  • Skills — invoke on demand: style guide reference, testing patterns, build error resolution, and code review
  • Rules — auto-loaded coding style, hooks, patterns, security, and testing guidance for C++ files

Marketplace Install (Skill)

Step 1 — Add the marketplace

claude plugin marketplace add https://github.com/tatsu/gglcpp

Step 2 — Install the skill

claude plugin install gglcpp@gglcpp

Step 3 — Use the skill

In any Claude Code session, invoke it with:

/gglcpp:google-cpp-style-guide

Or reference it in your prompts:

Review this C++ code against the Google C++ Style Guide.

Rules Install (Manual Copy)

Note: Claude Code does not automatically install rules from plugins. You must copy the rule files manually into your project or global rules directory.

Rules are installed under gglcpp/cpp/ to avoid conflicts with any existing cpp/ rules you may have in place.

Option A — curl (project-level)

mkdir -p .claude/rules/gglcpp/cpp
for f in coding-style hooks patterns security testing; do
  curl -fsSL \
    "https://raw.githubusercontent.com/tatsu/gglcpp/main/rules/cpp/${f}.md" \
    -o ".claude/rules/gglcpp/cpp/${f}.md"
done

Option B — curl (global, all projects)

mkdir -p ~/.claude/rules/gglcpp/cpp
for f in coding-style hooks patterns security testing; do
  curl -fsSL \
    "https://raw.githubusercontent.com/tatsu/gglcpp/main/rules/cpp/${f}.md" \
    -o "${HOME}/.claude/rules/gglcpp/cpp/${f}.md"
done

Option C — clone and copy

git clone https://github.com/tatsu/gglcpp.git
# Project-local:
cp -r gglcpp/rules/cpp .claude/rules/gglcpp/cpp
# Or global:
cp -r gglcpp/rules/cpp ~/.claude/rules/gglcpp/cpp

What's Included

Skills

File Invoke as Description
skills/google-cpp-style-guide/SKILL.md /gglcpp:google-cpp-style-guide Full Google C++ Style Guide reference with examples
skills/google-cpp-testing/SKILL.md /gglcpp:google-cpp-testing GoogleTest/GMock setup, fixtures, mocking, sanitizers, and coverage
skills/google-cpp-build/SKILL.md /gglcpp:google-cpp-build Incremental build error resolution (CMake, cpplint, clang-tidy)
skills/google-cpp-review/SKILL.md /gglcpp:google-cpp-review Code review for memory safety, concurrency, and Google Style compliance

Rules (auto-loaded by Claude Code for C++ files)

File Description
rules/cpp/coding-style.md Naming, headers, classes, formatting summary
rules/cpp/hooks.md cpplint, clang-format, clang-tidy hook configurations
rules/cpp/patterns.md RAII, smart pointers, error handling, composition
rules/cpp/security.md Memory safety, buffer safety, UB prevention, input validation
rules/cpp/testing.md GoogleTest setup, fixtures, mocking, sanitizers, coverage

Rules are loaded automatically when Claude Code detects C++ files (*.cpp, *.h, *.cc, etc.).


Tooling Setup

clang-format (Google style)

Create .clang-format at your project root:

BasedOnStyle: Google

Apply:

clang-format -style=Google -i src/**/*.cpp src/**/*.h

cpplint

pip install cpplint
cpplint --recursive src/

clang-tidy

Create .clang-tidy at your project root:

Checks: "google-*,modernize-*,bugprone-*,readability-*"
WarningsAsErrors: "google-*"

Run:

clang-tidy src/*.cpp -- -std=c++20

C++ Version

This plugin targets C++20. C++23 features and non-standard extensions are not covered.


Source Material

Rules and skill content is derived from the Google C++ Style Guide, which is licensed under CC-BY 3.0.

The content was based on the following upstream commit (no release tag was available):

Field Value
Repository https://github.com/google/styleguide
Commit 3c5c895
Message Update C++ style guide (#971)

License

CC-BY 3.0 — same license as the Google C++ Style Guide.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

About

Google C++ Style Guide Plugin for Claude Code

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors