smithery.ai

forge-lang-cpp

C++ development standards including make/cmake, g++/clang++, and static analysis. Use when working with C++ files (.cpp, .hpp, .cc, .hh).

First seen Apr 30, 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,112 B
  • docs SUMMARY.md 159 B

History

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

SKILL.md

C++ Development

Building

# With Make
make

# With CMake
mkdir -p build && cd build
cmake ..
make

# Direct compilation
g++ -std=c++20 -Wall -Wextra -Werror -o program main.cpp

Testing

# With Makefile test target
make test

# With CTest (CMake)
cd build && ctest -V

# With Google Test
./build/tests/run_tests

Static Analysis

# Cppcheck
cppcheck --enable=all --std=c++20 --error-exitcode=1 src/

# Clang-tidy
clang-tidy src/*.cpp -- -std=c++20

# Clang static analyzer
scan-build make

Memory Checking

# Valgrind
valgrind --leak-check=full ./program

# AddressSanitizer
g++ -fsanitize=address -g -o program main.cpp

# UndefinedBehaviorSanitizer
g++ -fsanitize=undefined -g -o program main.cpp

Formatting

# Format with clang-format
clang-format -i src/*.cpp include/*.hpp

# Check without changing
clang-format --dry-run --Werror src/*.cpp include/*.hpp

Project Structure

project/
├── src/
│   ├── main.cpp
│   └── module.cpp
├── include/
│   └── module.hpp
├── tests/
│   └── test_module.cpp
├── CMakeLists.txt
└── README.md

CMakeLists.txt Template

cmake_minimum_required(VERSION 3.20)
project(MyProject VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_compile_options(-Wall -Wextra -Werror -pedantic)

add_executable(program src/main.cpp src/module.cpp)
target_include_directories(program PRIVATE include)

enable_testing()
add_subdirectory(tests)

TDD Cycle Commands

# RED: Write test, run to see it fail
cd build && make && ctest -V

# GREEN: Implement, run to see it pass
cd build && make && ctest -V

# REFACTOR: Clean up, ensure tests still pass
cd build && make clean && cmake .. && make && ctest -V
clang-format --dry-run --Werror src/*.cpp