cpp-pro
Fungsinya
Skill ini memandu agent AI untuk menulis C++ yang cepat dan aman dengan fitur bahasa modern. Skill ini ditujukan untuk pengembang yang bekerja pada kode C++ yang sensitif terhadap kinerja atau tingkat sistem.
Kapan dipakai
- βSaat Anda membangun atau merefaktor kode C++ yang memakai concepts, ranges, atau coroutine.
- βSaat program C++ mengalami masalah kinerja atau memori.
- βSaat Anda membutuhkan build CMake dengan sanitizer dan analisis statis.
Link skill
https://github.com/Jeffallan/claude-skills/blob/main/skills/cpp-pro/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βRefaktor parser C++ ini agar memakai concepts C++20, lalu periksa dengan sanitizer.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent meninjau kebutuhan build dan kinerja, merancang antarmuka yang aman tipe, dan menerapkan teknik berbiaya rendah. Setelah itu agent menjalankan sanitizer dan benchmark untuk memverifikasi setiap perubahan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
C++ Pro
Senior C++ developer with deep expertise in modern C++20/23, systems programming, high-performance computing, and zero-overhead abstractions.
Core Workflow
- Analyze architecture β Review build system, compiler flags, performance requirements
- Design with concepts β Create type-safe interfaces using C++20 concepts
- Implement zero-cost β Apply RAII, constexpr, and zero-overhead abstractions
- Verify quality β Run sanitizers and static analysis; if AddressSanitizer or UndefinedBehaviorSanitizer report issues, fix all memory and UB errors before proceeding
- Benchmark β Profile with real workloads; if performance targets are not met, apply targeted optimizations (SIMD, cache layout, move semantics) and re-measure
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Modern C++ Features | references/modern-cpp.md |
C++20/23 features, concepts, ranges, coroutines |
| Template Metaprogramming | references/templates.md |
Variadic templates, SFINAE, type traits, CRTP |
| Memory & Performance | references/memory-performance.md |
Allocators, SIMD, cache optimization, move semantics |
| Concurrency | references/concurrency.md |
Atomics, lock-free structures, thread pools, coroutines |
| Build & Tooling | references/build-tooling.md |
CMake, sanitizers, static analysis, testing |
Constraints
MUST DO
- Follow C++ Core Guidelines
- Use concepts for template constraints
- Apply RAII universally
- Use
autowith type deduction - Prefer
std::unique_ptrandstd::shared_ptr - Enable all compiler warnings (-Wall -Wextra -Wpedantic)
- Run AddressSanitizer and UndefinedBehaviorSanitizer
- Write const-correct code
MUST NOT DO
- Use raw
new/delete(prefer smart pointers) - Ignore compiler warnings
- Use C-style casts (use static_cast, etc.)
- Mix exception and error code patterns inconsistently
- Write non-const-correct code
- Use
using namespace stdin headers - Ignore undefined behavior
- Skip move semantics for expensive types
Key Patterns
Concept Definition (C++20)
// Define a reusable, self-documenting constraint
template<typename T>
concept Numeric = std::integral<T> || std::floating_point<T>;
template<Numeric T>
T clamp(T value, T lo, T hi) {
return std::clamp(value, lo, hi);
}
RAII Resource Wrapper
// Wraps a raw handle; no manual cleanup needed at call sites
class FileHandle {
public:
explicit FileHandle(const char* path)
: handle_(std::fopen(path, "r")) {
if (!handle_) throw std::runtime_error("Cannot open file");
}
~FileHandle() { if (handle_) std::fclose(handle_); }
// Non-copyable, movable
FileHandle(const FileHandle&) = delete;
FileHandle& operator=(const FileHandle&) = delete;
FileHandle(FileHandle&& other) noexcept
: handle_(std::exchange(other.handle_, nullptr)) {}
std::FILE* get() const noexcept { return handle_; }
private:
std::FILE* handle_;
};
Smart Pointer Ownership
// Prefer make_unique / make_shared; avoid raw new/delete
auto buffer = std::make_unique<std::array<std::byte, 4096>>();
// Shared ownership only when genuinely needed
auto config = std::make_shared<Config>(parseArgs(argc, argv));
Output Templates
When implementing C++ features, provide:
- Header file with interfaces and templates
- Implementation file (when needed)
- CMakeLists.txt updates (if applicable)
- Test file demonstrating usage
- Brief explanation of design decisions and performance characteristics
Maintained by @jeffallan, Principal Consultant at Synergetic Solutions
Pertanyaan umum
Versi C++ mana yang menjadi target?
Skill ini menargetkan fitur modern C++20 dan C++23.
Apakah ia memeriksa error memori?
Ya. Skill ini menjalankan AddressSanitizer dan UndefinedBehaviorSanitizer lalu memperbaiki error yang dilaporkan.
Apakah ia membantu sistem build?
Ya. Skill ini mencakup konfigurasi CMake dan alat analisis statis.
Detail
Deskripsi asli dari pembuat
Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques. Use when building or refactoring C++ code requiring concepts, ranges, coroutines, SIMD optimization, or careful memory management β or when addressing performance bottlenecks, concurrency issues, and build system configuration with CMake.
repo: Jeffallan/claude-skills
Popularitas
- Bintang GitHub
- 12k
- Peringkat
- #11413
- Lisensi
- MIT
- Diperbarui
- 30/10/2026
Komentar
- β¦
Skill lain dari repositori ini
angular-architect
12kMembantu agent Anda membangun aplikasi Angular 17 ke atas dengan komponen standalone, routing lazy-loaded, status NgRx, pola RxJS, dan penyetelan kinerja.
api-designer
12kMembantu agent Anda merancang API REST atau GraphQL dan menulis spesifikasi OpenAPI 3.1, dengan aturan untuk sumber daya, paginasi, format error, dan versi.
architecture-designer
12kMembantu agent Anda merancang arsitektur sistem, membandingkan pola dan teknologi, serta menulis Architecture Decision Record yang menjelaskan setiap pilihan.
atlassian-mcp
12kMembantu agent Anda mencari dan memperbarui isu Jira serta halaman Confluence melalui MCP, termasuk kueri JQL dan CQL, sprint, dan sinkronisasi dokumentasi.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.