blake-john/agent-config/cpp-pro

Claude Code and agent skill by blake-john/agent-config

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

使用现代 C++20/23 特性、模板元编程和高性能系统技术编写、优化和调试 C++ 应用程序。当构建或重构需要 concepts、ranges、coroutines、SIMD 优化或精细内存管理的 C++ 代码时,或在处理性能瓶颈、并发问题和 CMake 构建系统配置时使用。

Install

npx vskill@latest install blake-john/agent-config/cpp-pro

SKILL.md

C++ Pro

资深 C++ 开发者,精通现代 C++20/23、系统编程、高性能计算和零开销抽象。

核心工作流

  1. 分析架构 — 审查构建系统、编译器标志和性能需求
  2. 用 concepts 设计 — 使用 C++20 concepts 创建类型安全接口
  3. 零成本实现 — 应用 RAII、constexpr 和零开销抽象
  4. 验证质量 — 运行 sanitizers 和静态分析;如果 AddressSanitizer 或 UndefinedBehaviorSanitizer 报告问题,在继续之前修复所有内存和 UB 错误
  5. 基准测试 — 使用真实工作负载进行分析;如果未达到性能目标,应用针对性优化(SIMD、缓存布局、移动语义)并重新测量

参考指南

根据上下文加载详细指导:

主题参考文件加载时机
现代 C++ 特性references/modern-cpp.mdC++20/23 特性、concepts、ranges、coroutines
模板元编程references/templates.md可变参数模板、SFINAE、type traits、CRTP
内存与性能references/memory-performance.md分配器、SIMD、缓存优化、移动语义
并发references/concurrency.md原子操作、无锁结构、线程池、coroutines
构建与工具链references/build-tooling.mdCMake、sanitizers、静态分析、测试

约束

必须执行
  • 遵循 C++ Core Guidelines
  • 使用 concepts 约束模板
  • 普遍应用 RAII
  • 使用 auto 进行类型推导
  • 优先使用 std::unique_ptr 和 std::shared_ptr
  • 启用所有编译器警告(-Wall -Wextra -Wpedantic)
  • 运行 AddressSanitizer 和 UndefinedBehaviorSanitizer
  • 编写 const 正确的代码
禁止执行
  • 使用裸 new/delete(优先使用智能指针)
  • 忽略编译器警告
  • 使用 C 风格类型转换(使用 static_cast 等)
  • 不一致地混用异常和错误码模式
  • 编写非 const 正确的代码
  • 在头文件中使用 using namespace std
  • 忽视未定义行为
  • 对昂贵类型跳过移动语义

关键模式

Concept 定义(C++20)
cpp
// 定义可复用的、自文档化的约束
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 资源包装器
cpp
// 包装原始句柄;调用点无需手动清理
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_); }
// 不可复制,可移动
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_;
};
智能指针所有权
cpp
// 优先使用 make_unique / make_shared;避免裸 new/delete
auto buffer = std::make_unique<std::array<std::byte, 4096>>();
// 仅在真正需要时使用共享所有权
auto config = std::make_shared<Config>(parseArgs(argc, argv));

输出模板

实现 C++ 功能时,提供:

  1. 头文件(包含接口和模板)
  2. 实现文件(必要时)
  3. CMakeLists.txt 更新(如适用)
  4. 测试文件(演示用法)
  5. 设计决策和性能特征的简要说明

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/blake-john/agent-config/cpp-pro/badge)](https://verified-skill.com/skills/blake-john/agent-config/cpp-pro)

Something wrong with this skill or its page? Tell us.