スキル一覧に戻る
martimramos

forge-lang-cpp

by martimramos

0🍴 0📅 2025年12月21日
GitHubで見るManusで実行

SKILL.md


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

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

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です