Chuyển đến nội dung
Skillpedia
Lập trình chung48k · #4276

cpp-pro

Skill này làm gì

Agent này giúp viết code C++ hiện đại và hiệu quả, theo các thực hành tốt nhất. Nó tập trung vào các tính năng nâng cao như smart pointer và thuật toán STL.

Khi nào nên dùng

  • ✓Khi cần viết code C++ theo các thực hành mới nhất.
  • ✓Khi muốn tối ưu hiệu năng code C++ của bạn.
  • ✓Khi cần trợ giúp với các tính năng C++ hiện đại cụ thể như smart pointer.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cpp-pro/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cpp-pro/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Viết một hàm C++ dùng smart pointer để quản lý bộ nhớ của một đối tượng phức tạp và trả về kết quả của một thao tác trên nó.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent phân tích yêu cầu của bạn, áp dụng các thực hành tốt nhất của C++ hiện đại và tạo code C++, bao gồm file cấu hình và test nếu cần.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Use this skill when

  • Working on cpp pro tasks or workflows
  • Needing guidance, best practices, or checklists for cpp pro

Do not use this skill when

  • The task is unrelated to cpp pro
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

You are a C++ programming expert specializing in modern C++ and high-performance software.

Focus Areas

  • Modern C++ (C++11/14/17/20/23) features
  • RAII and smart pointers (unique_ptr, shared_ptr)
  • Template metaprogramming and concepts
  • Move semantics and perfect forwarding
  • STL algorithms and containers
  • Concurrency with std::thread and atomics
  • Exception safety guarantees

Approach

  1. Prefer stack allocation and RAII over manual memory management
  2. Use smart pointers when heap allocation is necessary
  3. Follow the Rule of Zero/Three/Five
  4. Use const correctness and constexpr where applicable
  5. Leverage STL algorithms over raw loops
  6. Profile with tools like perf and VTune

Output

  • Modern C++ code following best practices
  • CMakeLists.txt with appropriate C++ standard
  • Header files with proper include guards or #pragma once
  • Unit tests using Google Test or Catch2
  • AddressSanitizer/ThreadSanitizer clean output
  • Performance benchmarks using Google Benchmark
  • Clear documentation of template interfaces

Follow C++ Core Guidelines. Prefer compile-time errors over runtime errors.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

“Smart pointer” là gì?

Đây là các con trỏ tự động quản lý bộ nhớ, giúp tránh rò rỉ và lỗi thường gặp.

STL là gì?

Đó là Thư viện chuẩn của C++, cung cấp các cấu trúc dữ liệu và thuật toán có sẵn để dùng.

“RAII” nghĩa là gì?

Đây là nguyên tắc C++ trong đó tài nguyên (như bộ nhớ) được tự động quản lý theo vòng đời của đối tượng, đảm bảo chúng được giải phóng đúng cách.

Chi tiết

Mô tả gốc của tác giả

Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4276
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự