smithery.ai

coding-standard-cpp

Enforce C++ coding standards including camelCase or snake_case variables, PascalCase classes, and consistent file naming.

First seen Mar 20, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,659 B
  • docs SUMMARY.md 148 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

C++ Coding Standards

When reviewing or generating C++ code, follow these rules:

File Naming

  • Source files: snakecase or PascalCase with .cpp extension (e.g., userservice.cpp or UserService.cpp)
  • Header files: Same base name with .h, .hpp, or .hxx extension
  • Template files: .tpp or .inl for template implementations
  • Be consistent within a project

Header Guards / Pragma

  • Prefer #pragma once for modern compilers
  • Or use traditional guards: UPPERSNAKECASE with _HPP suffix
#pragma once
// or
#ifndef USER_SERVICE_HPP
#define USER_SERVICE_HPP
#endif

Namespace Naming

  • Namespaces: alllowercase or snakecase (e.g., myproject, data_processing)
  • Nested namespaces: Use C++17 syntax when possible (e.g., namespace project::utils {})
  • Avoid using namespace in headers

Variable Naming

  • Local variables: snakecase or camelCase (e.g., usercount or userCount)
  • Member variables: Prefix with m or suffix with (e.g., mdata or data)
  • Static members: Prefix with s (e.g., sinstance)
  • Constants: UPPERSNAKECASE or kPascalCase (e.g., MAX_SIZE or kMaxSize)
  • Global variables: Prefix with g (e.g., gconfig)

Function/Method Naming

  • Free functions: snakecase or camelCase (e.g., calculatetotal() or calculateTotal())
  • Member functions: camelCase or PascalCase (e.g., getUserId() or GetUserId())
  • Getters/Setters: get/set prefix or just property name (e.g., getName() or name())
  • Factory functions: Create, Make, or Build prefix (e.g., CreateUser())

Class/Type Naming

  • Classes: PascalCase (e.g., UserService, DataProcessor)
  • Structs: PascalCase (e.g., Point, Rectangle)
  • Interfaces: PascalCase with I prefix optional (e.g., ISerializable or Serializable)
  • Template parameters: Single letter or PascalCase (e.g., T, Container, KeyType)
  • Enums: PascalCase for type, UPPERSNAKECASE or PascalCase for values
  • Type aliases: PascalCase (e.g., using StringList = std::vector<std::string>;)

Smart Pointers

  • Use std::unique_ptr for single ownership
  • Use std::shared_ptr for shared ownership
  • Avoid raw new/delete

Organization

  • Include guards / pragma once
  • System includes (alphabetical)
  • Project includes (alphabetical)
  • Forward declarations
  • Namespace opening
  • Class declarations
  • Inline/template implementations