Claude Code, Google C++ Style Guide, and the Plugin I Had to Build Myself

Tatsuhiko Arai (新井 竜彦)

Tatsuhiko Arai (新井 竜彦)

· 9 min read
Just an image

everything-claude-code (ECC) is the community plugin for Claude Code. It covers a lot of ground: Python patterns, Go idioms, Kotlin coroutines, Rust ownership, TypeScript quirks. The rule and skill inventory is genuinely impressive.

C++ is covered too — there's a cpp-coding-standards skill. But it targets a generic C++ style, not specifically the Google C++ Style Guide. If your codebase uses Google's conventions — snake_case_ class members, kPascalCase constants, PascalCase functions, the entire Google header-include order — you're on your own.

A quick search turned up nothing closer. So the path of least resistance was to build it.

What a Claude Code Plugin Actually Is

Before writing any content, it helps to understand the two separate mechanisms Claude Code uses for developer guidance: skills and rules.

Skills are on-demand reference files. You invoke them explicitly — /gglcpp:google-cpp-style-guide — and they load a comprehensive document into the context. Think of them as structured cheat sheets you pull up when you need them.

Rules are auto-loaded based on file patterns. When Claude Code opens a .cpp, .h, or .cc file, it scans for rule files whose paths: frontmatter matches, and loads them into context automatically. No invocation needed.

A plugin bundles both, along with two configuration files that tell Claude Code how to find and install them:

.claude-plugin/
  plugin.json       # plugin identity and metadata
  marketplace.json  # marketplace listing schema
skills/
  google-cpp-style-guide/
    SKILL.md        # the on-demand reference
rules/
  cpp/
    coding-style.md
    hooks.md
    patterns.md
    security.md
    testing.md

Building the Skill

The skill file is the comprehensive reference — naming conventions, header rules, scoping, classes, functions, feature restrictions, formatting, and a checklist. It needs three frontmatter fields to be discoverable:

---
name: google-cpp-style-guide
description: Google C++ Style Guide rules and conventions. Use when writing, reviewing, or refactoring C++ code in projects that follow Google's C++ style.
origin: gglcpp
---

The origin field is what makes it appear as /gglcpp:google-cpp-style-guide rather than just /google-cpp-style-guide. Without it matching the plugin name, the skill either doesn't appear or collides with other plugins.

The content itself is derived from the upstream guide. The Google C++ Style Guide is published under CC-BY 3.0, which allows redistribution with attribution — the license gglcpp uses as well.

Building the Rules

Each rule file covers one concern: naming and formatting, hook configurations, RAII and smart pointer patterns, memory safety, and GoogleTest setup. Every file needs a paths: frontmatter block, or Claude Code won't load it:

---
paths:
  - "**/*.cpp"
  - "**/*.hpp"
  - "**/*.cc"
  - "**/*.hh"
  - "**/*.cxx"
  - "**/*.h"
---

Rule files intentionally stay condensed. They're summaries, not the full reference. When something needs deeper treatment, they link back to the skill.

One thing worth knowing: Claude Code's rules discovery is fully recursive. A file at ~/.claude/rules/gglcpp/cpp/coding-style.md is found and loaded the same way as ~/.claude/rules/cpp/coding-style.md. This matters for the install path decision below.

The Install Path Problem

Naming the install directory cpp/ would conflict with any existing cpp/ rules a user already has. Claude Code merges rule sets; two files covering the same topic from different sources leads to redundant or contradictory guidance in context.

The solution: install under gglcpp/cpp/ rather than cpp/ directly. The recursive discovery means nothing breaks, and users can keep both without collision:

# Global install — works alongside any existing ~/.claude/rules/cpp/
cp -r rules/cpp ~/.claude/rules/gglcpp/cpp

Installing and Using gglcpp

Step 1 — Add the marketplace

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

Step 2 — Install the skill

claude plugin install google-cpp-style-guide@gglcpp

After this, the skill is available in any session:

/gglcpp:google-cpp-style-guide

Or just reference it naturally:

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

Step 3 — Install the rules (optional but recommended)

The skill is on-demand. The rules load automatically whenever C++ files are open. For the auto-load behavior, copy the rules into your Claude rules directory:

# Project-local
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

# Or globally
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

Once in place, opening any C++ file causes Claude Code to automatically load the relevant rules. No invocation, no extra prompt engineering.

What the Rules Actually Cover

  • coding-style.md — naming table, header rules, include order, class layout, what to avoid (no RTTI, no exceptions, no C++20 modules)
  • hooks.md — ready-to-paste Claude Code hook configs for clang-format -style=Google, cpplint, and clang-tidy with google-* checks; also a recommended CI pipeline sequence
  • patterns.md — RAII, smart pointer ownership model, error handling without exceptions, composition over inheritance
  • security.md — buffer safety, integer overflow, undefined behavior prevention, input validation patterns
  • testing.md — GoogleTest fixtures, parameterized tests, mocking with gMock, AddressSanitizer and UBSan setup, coverage with gcov

The hooks file is especially useful in practice — the Claude Code hook configs for clang-format and clang-tidy are copy-paste ready for .claude/settings.json.

The Short Version

  1. ECC doesn't cover Google C++ specifically, so I built a plugin that does.
  2. A Claude Code plugin needs plugin.json, marketplace.json, a SKILL.md with origin: frontmatter, and rule files with paths: frontmatter.
  3. Install under gglcpp/cpp/ (not cpp/) to avoid colliding with existing rules — Claude Code's recursive discovery handles the depth.
  4. Skill install: claude plugin marketplace add https://github.com/tatsu/gglcpp then claude plugin install google-cpp-style-guide@gglcpp.
  5. Rules install: copy five .md files to ~/.claude/rules/gglcpp/cpp/ and they load automatically when C++ files are open.
  6. Repo: https://github.com/tatsu/gglcpp

A Few Things Worth Internalizing

  • The origin: frontmatter field in SKILL.md is what namespaces the skill under the plugin name. Skip it and invocation either breaks or collides.
  • Rules and the skill need to stay consistent. The rule files are condensed summaries of the skill; a correction in one place usually needs a matching fix in the other.
  • Claude Code's paths: frontmatter is the entire mechanism for auto-loading rules. No paths: block means the file is never loaded, even if it's in the right directory.
  • Claude Code's recursive rules discovery is a useful property that isn't prominently documented — it's what makes namespace-safe install paths possible.
Tatsuhiko Arai (新井 竜彦)

About Tatsuhiko Arai (新井 竜彦)

Embedded software engineer (Qt, C/C++, Python). Medical imaging (DICOM) contractor. AWS All Certifications Engineer – Japan (2024–2025).

Copyright © 2026 Tatsuhiko Arai. All rights reserved.
Made by Web3Templates· Github