cpp-formatter

Format C++ code according to 20+ style rules with safety checks.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/armandli/get-skilled --skill cpp-formatter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-formatter
Source: https://github.com/armandli/get-skilled/tree/main/skills/cpp-formatter
Command: npx skills add https://github.com/armandli/get-skilled --skill cpp-formatter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automatically formats your C++ code to adhere to a comprehensive set of 20+ style rules, ensuring consistency and readability across your codebase.

Core Features & Use Cases

  • Automated Code Formatting: Applies rules for whitespace, braces, preprocessor directives, namespaces, types, and semantic transformations.
  • C++ Standard Awareness: Detects the C++ standard and applies rules accordingly (e.g., C++17 features).
  • Use Case: You've just finished writing a complex C++ module and want to ensure it matches your team's established coding standards before committing. Run this Skill to automatically reformat the entire file.

Quick Start

Use the cpp-formatter skill to format the C++ file located at 'src/main.cpp'.

Frequently Asked Questions about cpp-formatter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically format C++ code to enforce a consistent style?

Format C++ code across multiple files by running the formatter against each file path, applying its 20+ style rules to ensure consistent readability, brace placement, and whitespace handling throughout the entire project.

Does the C++ formatter support different C++ standard versions like C++17?

The formatter detects the C++ standard version in your code and applies relevant rules accordingly, ensuring standard-specific features like C++17 constructs are handled safely without causing compilation errors.

What C++ style rules are applied during the code formatting process?

The formatting process applies 20+ rules covering whitespace, braces, preprocessor directives, namespaces, types, and semantic transformations to comprehensively standardize C++ code structure.

Can C++ code formatting cause compilation errors during refactoring?

Safety checks are included during formatting to prevent compilation errors, ensuring semantic transformations and structural changes maintain the integrity and compilability of your C++ code.

What is the best way to ensure C++ code matches team coding standards before committing?

Run an automated C++ formatter applying a predefined set of 20+ style rules to your file, polishing code structure and ensuring it matches established team coding standards before committing.