C++20 coding standards, naming conventions, concepts, ranges, constexpr, file organization, and Doxygen documentation practices for high-performance computing.
View on GitHubysyecust/everything-claude-code
everything-claude-code
skills/coding-standards/SKILL.md
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/ysyecust/everything-claude-code/blob/main/skills/coding-standards/SKILL.md -a claude-code --skill coding-standardsInstallation paths:
.claude/skills/coding-standards/# C++20 Coding Standards & Best Practices
Universal coding standards for C++20 HPC projects following Google C++ Style and C++ Core Guidelines.
## Code Quality Principles
### 1. Readability First
- Code is read more than written
- Clear variable and function names (Google C++ Style)
- Self-documenting code preferred over comments
- Consistent formatting (clang-format)
### 2. KISS (Keep It Simple, Stupid)
- Simplest solution that works
- Avoid over-engineering
- No premature optimization
- Easy to understand > clever code
### 3. DRY (Don't Repeat Yourself)
- Extract common logic into functions
- Create reusable templates
- Share utilities across modules
- Avoid copy-paste programming
### 4. YAGNI (You Aren't Gonna Need It)
- Don't build features before they're needed
- Avoid speculative generality
- Add complexity only when required
- Start simple, refactor when needed
## Naming Conventions (Google C++ Style)
### Types and Classes
```cpp
// PascalCase for types
class ParticleSystem;
struct MeshConfig;
enum class IntegrationMethod { kExplicitEuler, kRK4, kVerlet };
// Template parameters: single uppercase or PascalCase
template <typename T>
template <typename ValueType>
```
### Functions
```cpp
// PascalCase for functions
void ComputeForces(std::span<Particle> particles);
double CalculateEnergy(const SimState& state);
[[nodiscard]] bool IsConverged(double residual, double tol);
// Accessors: no Get prefix for simple getters
class Mesh {
public:
int NumVertices() const { return vertices_.size(); }
double TimeStep() const { return dt_; }
void SetTimeStep(double dt) { dt_ = dt; }
};
```
### Variables
```cpp
// snake_case for local and function parameters
int particle_count = 1000;
double time_step = 0.01;
const auto& mesh_data = solver.GetMesh();
// kPascalCase for constants
constexpr int kMaxIterations = 10000;
constexpr double kBoltzmannConstant = 1.380649e-23;
static constexpr size_t kCacheLineSize = 64;
// Trailing underscore for member variabl