Skip to content
Skills Library
Programming · Building & coding

cpp-header-template

/cpp-header-template

Generate C++ header files following Google Style Guide. Use when creating new header files or asking for a header template.

Repository
pg_stat_ch ↗
Licence
Apache-2.0
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Generate C++ header files following Google Style Guide. Use when creating new header files or asking for a header template.

Original author description

Generate C++ header files following Google Style Guide. Use when creating new header files or asking for a header template.

How it works

  1. Usage
  2. Template
  3. Include Guard Format
  4. Struct Template
  5. Include Order
Original SKILL.md headings · 133 lines, 384 words
SKILL.md preview
---
name: cpp-header-template
description: Generate C++ header files following Google Style Guide. Use when creating new header files or asking for a header template.
disable-model-invocation: true
---

# C++ Header File Template Generator

Generate header files following Google C++ Style Guide conventions.

## Usage

Provide: class name, namespace, and file path to generate a compliant header.

## Template

```cpp
// Copyright [year] [copyright holder]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

#ifndef [PROJECT]_[PATH]_[FILENAME]_H_
#define [PROJECT]_[PATH]_[FILENAME]_H_

// C system headers (if needed)
// #include <sys/types.h>

// C++ standard library headers
#include <memory>
#include <string>
#include <vector>

// Other library headers
// #include "other/library.h"

// Project headers
// #include "project/base.h"

namespace [namespace] {

// Forward declarations (avoid when possible)

/// Brief description of the class.
///
/// Detailed description if needed. Include:
/// - Purpose and responsibilities
/// - Thread safety guarantees
/// - Example usage (for complex classes)
class [ClassName] {
 public:
  // Types and type aliases
  using ValueType = int;

  // Static constants
  static constexpr int kDefaultSize = 100;

  // Factory functions (if needed)
  static std::unique_ptr<[ClassName]> Create();

  // Constructors
  [ClassName]();
  explicit [ClassName](int value);

  // Rule of five - be explicit about copy/move
  [ClassName](const [ClassName]&) = default;
  [ClassName]& operator=([const ClassName]&) = default;
  [ClassName]([ClassName]&&) noexcept = default;
  [ClassName]& operator=([ClassName]&&) noexcept = default;

  // Destructor
  ~[ClassName]();

  // Public methods
  void Process();

  // Accessors and mutators
  int value() const { return value_; }
  void set_value(int value) { value_ = value; }

 protected:
  // Protected members (only if needed for inheritance)

 private:
  // Private methods
  void InternalHelper();

  // Data members (always private for classes)
  int value_ = 0;
  std::string name_;
};

}  // namespace [namespace]

#endif  // [PROJECT]_[PATH]_[FILENAME]_H_
```

## Include Guard Format

Convert path to uppercase with underscores:

| File Path | Guard |
|-----------|-------|
| `foo/bar/baz.h` | `FOO_BAR_BAZ_H_` |
| `src/http/parser.h` | `SRC_HTTP_PARSER_H_` |
| `my_project/utils.h` | `MY_PROJECT_UTILS_H_` |

## Struct Template

For passive data with public members and no invariants:

```cpp
namespace [namespace] {

/// Brief description.
struct [StructName] {
  int field_one;           // No trailing underscore for structs
  std::string field_two;
  float field_three = 0.0f;  // Default values OK
};

}  // namespace [namespace]
```

## Include Order

1. Related header (for `.cc` files)
2. Blank line
3. C system headers (`<unistd.h>`)
4. Blank line
5. C++ standard library (`<string>`, `<vector>`)
6. Blank line
7. Other libraries
8. Blank line
9. Project headers

Each section sorted alphabetically.

Versions

The database has no other skills named cpp-header-template.

Database snapshot: 13.11.2026 · package version 9b58eea05896 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cpp-review
    Review C++ code against Google C++ Style Guide. Use when reviewing C++ code, pull requests, or when asked to check code style compliance.
  • 100cpp-naming-check
    Check C++ naming conventions against Google Style Guide. Use when checking if names follow conventions or when renaming identifiers.
  • 85wp-header-run
    The step detail of the /wp-header run, split out of commands/wp-header.md so the command stays a short map — Step 4's wp-template prompt (header.php, the nav walker, the language switcher rule, class naming per template) and the CSS agent routing with the wp-tailwind author-mode…
  • 100cpp-modules
    C++20 modules skill for modern C++ projects. Use when working with named modules, module partitions, header units, CMake MODULE_SOURCES, Clang -fmodules-ts, BMI caching issues, or migrating from headers to modules. Activates on queries about C++20 modules, import statements,…
  • 90esp32-debug-header-contract
    Use when designing, reviewing, debugging or validating debug header contract for ESP32 firmware; apply target-specific constraints, failure analysis and measurable verification before release.
  • 100qt-cpp-docs
    Generates standalone Markdown reference documentation for any Qt/C++ source files — Qt Widgets classes, Qt Quick backends, Qt/C++ modules, plain C++ utilities, structs, free-function headers, and entry points like main.cpp. Use this skill to document any .h or .cpp file: Qt…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.