技能 C++ Pro

C++ Pro

安全

编写专业的C++代码

在AI辅助下编写更简洁、更快速、更易维护的C++代码。此技能帮助开发者生成可用于生产的代码、应用现代C++模式,并在无需深入专业知识的情况下优化性能。

支持: Claude Codex Code(CC)
🥉 73 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“C++ Pro”。 Write a function that calculates the Fibonacci sequence using dynamic programming

预期结果:

一个完整的C++函数,时间复杂度为O(n),具有正确的内存分配和使用示例。包含解释方法和边界情况处理的头注释。

正在使用“C++ Pro”。 Implement a thread-safe singleton pattern in C++11

预期结果:

完整的头文件和实现文件,使用Scott Meyers单例模式结合std::call_once和std::once_flag,并附有线程安全保证的说明。

安全审计

安全
v1 • 2/24/2026

This is a prompt-only skill with no executable code. Static analysis scanned 0 files and detected 0 security issues. The skill provides AI-driven C++ programming assistance through prompt templates without any direct system access, network requests, or file operations. Risk score is 0/100.

0
已扫描文件
0
分析行数
0
发现项
1
审计总数
未发现安全问题
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
50
社区
100
安全
83
规范符合性

你能构建什么

生成样板代码

快速创建类模板、头文件和Makefile,用于新项目

学习现代C++模式

获取现代C++惯用法和模式的解释与实现

优化现有代码

获得改进性能和内存效率的建议

试试这些提示

基础代码生成
Write a C++ function that [describe functionality]. Include proper error handling and comments.
模式实现
Implement the [Design Pattern name] pattern in C++. Show both header and implementation files with proper includes.
代码优化
Analyze this C++ code for performance issues and suggest improvements: [paste code]. Focus on [algorithm complexity/memory usage/IO operations].
现代C++迁移
Convert this legacy C++ code to modern C++ (C++17/20) style: [paste code]. Use smart pointers, range-based loops, and structured bindings where appropriate.

最佳实践

  • 请求代码时始终指定C++标准版本(C++11、C++14、C++17或C++20)
  • 提供关于构建系统(CMake、Make、vcpkg)的上下文,以获得更相关的代码
  • 在生产环境中使用前,审查生成的代码的内存安全和资源管理

避免

  • 避免使用原始指针,应优先使用智能指针
  • 不要忽略表示成功或失败的函数返回值
  • 避免使用C风格转换 - 应优先使用static_cast、dynamic_cast或reinterpret_cast

常见问题

此技能支持哪些C++标准?
此技能支持从C++11到C++20的所有现代C++标准。在提示中指定您偏好的版本。
此技能可以帮助模板元编程吗?
是的,此技能可以生成模板代码、类型特征和constexpr函数。请具体说明您的需求。
此技能会生成makefile或CMakeLists吗?
是的,您可以请求生成构建配置文件。在提示中指定您的构建系统和编译器。
此技能可以帮助C++并发编程吗?
是的,此技能可以使用std::thread、std::async、互斥锁和其他并发原语生成代码。
生成的代码是否可用于生产?
代码遵循最佳实践,但应进行审查。考虑边界情况、错误处理和您的具体需求。
如何从此技能获得更好的结果?
请具体说明需求:输入/输出类型、错误处理、性能约束和编码风格偏好。

开发者详情

文件结构

📄 SKILL.md