Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

cpp-api-documentationCPP API 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

447

周安装

19

GitHub Stars

1

下载量

157
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cpp-api-documentation(CPP API 文档)
来源仓库:https://github.com/sentenz/skills
仓库路径:skills/cpp-api-documentation
安装命令:
npx skills add https://github.com/sentenz/skills --skill cpp-api-documentation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sentenz/skills --skill cpp-api-documentation

简介

cpp-api-documentation 指导为 C++ 头文件添加 Doxygen 兼容的注释,提升接口可读性和可维护性。

  • 适用于 API 设计、文档生成和团队协作,支持命名空间、类和函数级别的说明。
  • 仅作用于 header 文件,不创建新资源(如 Doxyfile),需遵循特定注释模板和交叉引用规则。
  • 建议与现有代码风格保持一致,避免过度注释,重点覆盖公共接口和设计意图。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

API Documentation

Instructions for AI coding agents on adding Doxygen-compatible documentation comments to C++ header files.

[!NOTE] This skill is for documenting header files only. Do NOT create new resource files (e.g., Doxyfile, scripts, README).

- 3.1. File Documentation - 3.2. Namespace Documentation - 3.3. Class Documentation - 3.4. Function/Method Documentation - 3.5. Cross-References - 3.6. Member Documentation - 3.7. Enumerations - 3.8. Grouping and Modules - 3.9. Inheritance - 3.10. Formula Documentation

- 6.1. File Header Template - 6.2. Namespace Template - 6.3. Class Template - 6.4. Function Template - 6.5. Member Variable Template - 6.6. Enumeration Template - 6.7. Module/Group Template - 6.8. Formula Template

1. Benefits

  • Discoverability Well-documented APIs enable developers to quickly understand and use components without reading implementation details.
  • Maintainability Documentation embedded in source code stays synchronized with implementation, reducing drift between code and documentation.
  • Traceability Documentation comments serve as living specifications, keeping API contracts synchronized with implementation.

2. Principles

Effective API documentation follows these core principles.

  • Complete Document all public APIs including classes, functions, parameters, return values, and exceptions. Private implementation details may be omitted.
  • Contextual Documentation provides context about usage patterns, performance characteristics, and thread safety guarantees.
  • Consistent Use a uniform style, format, terminology and structure throughout the API documentation using the patterns defined in this skill.
  • Concise Use clear, brief descriptions. Avoid redundant information that restates what is obvious from the signature.
  • Concrete Provide specific details about behavior, edge cases, and error conditions rather than vague statements.
  • Convenient Documentation should be easy to access and navigate, integrated with development tools and workflows.
  • Accurate Documentation must match the actual behavior. Update documentation whenever the implementation changes.
  • Actionable Include usage examples, preconditions, postconditions, and error handling to help developers use the API correctly.

3. Patterns

3.1. File Documentation

File-level documentation provides context for the entire header file.

  • Purpose Describes the file's role in the project architecture.
  • Author Identifies the original author(s) of the file.
  • License Specifies the licensing terms (typically SPDX identifier).

3.2. Namespace Documentation

Namespace-level documentation describes the purpose of the namespace.

  • Brief A one-line summary of what the namespace contains.
  • Details Extended description of the namespace's role and contents.

3.3. Class Documentation

Class-level documentation describes the abstraction.

  • Brief A one-line summary of what the class represents.
  • Details Extended description of responsibilities, invariants, and usage patterns.
  • Template Parameters For template classes, document each template parameter's purpose and constraints.

3.4. Function/Method Documentation

Function-level documentation describes the contract.

  • Brief A one-line summary of what the function does.
  • Parameters Document each parameter with @param including direction ([in], [out], [in,out]).
  • Return Value Document the return value with @return or @retval for specific values.
  • Exceptions Document thrown exceptions with @throws or @exception.
  • Warnings Use @warning for critical warnings about misuse.
  • Notes Use @note for important information.
  • Preconditions Document preconditions with @pre.
  • Postconditions Document postconditions with @post.
  • Code Examples Use @code and @endcode blocks for usage examples.

3.5. Cross-References

Cross-references link related documentation.

  • See Also Use @see to reference related functions, classes, or external resources.

3.6. Member Documentation

Member-level documentation clarifies data semantics.

  • Inline Comments Use ///< description for trailing inline documentation.
  • Block Comments Use /// description for preceding documentation.

3.7. Enumerations

Enumerations document possible values and their meanings.

  • Values Document each enumerator with a brief Inline Comments description.

3.8. Grouping and Modules

Organize related elements into logical groups.

  • Defgroups Use @defgroup to create named documentation modules.
  • Ingroups Use @ingroup to add elements to existing groups.
  • Memberof Use @memberof for explicit class membership.

3.9. Inheritance

Class hierarchies and inherited documentation.

  • Base Classes Document inherited classes with @copydoc or @copybrief to reuse base class documentation.

3.10. Formula Documentation

Mathematical formulas using LaTeX syntax for algorithms and technical documentation.

  • Inline Formulas Use \f$..\f$ for formulas that appear within running text (opens LaTeX math mode).
  • Inline Text-Mode Formulas Use \f(...\f) for LaTeX elements that don't require explicit math mode (e.g., logos like \LaTeX).
  • Displayed Formulas Use \f[...\f] for centered, unnumbered equations on separate lines.
  • Environment Formulas Use \f{environment}{...\f} for specific LaTeX environments (e.g., eqnarray*, align).
  • MathJax Alternative Enable USE_MATHJAX in Doxyfile for client-side formula rendering without requiring LaTeX installation.
  • Custom Macros Use FORMULA_MACROFILE configuration to define reusable LaTeX commands with \newcommand.

4. Workflow

[!IMPORTANT] Do NOT create Doxyfile, scripts, or other resource files. Only modify header files.
  1. Identify Identify undocumented or poorly documented public APIs in header files (e.g., src/<module>/<header>.hpp).
  2. Add Documentation Comments Add Doxygen-compatible documentation comments directly to header files following the templates below.
  3. Documentation Coverage Requirements Include comprehensive documentation for:

- All public classes, structs, and enums - All public and protected member functions - All function parameters and return values - All template parameters - Exception specifications - Thread safety guarantees when applicable - Complexity guarantees for algorithms

  1. Apply Templates Structure all documentation using the template patterns below.
  2. Review Review documentation for accuracy and readability.

5. Style Guide

Doxygen supports multiple comment styles. Use the Javadoc style for consistency.

  • Language Write documentation in clear, concise English. Use present tense for descriptions ("Returns the sum" not "Will return the sum").
  • Line Length Keep documentation lines under 100 characters for readability.
  • Block Comments Use /**... */ for multi-line documentation blocks. Each line within the block should start with *.
  • Comment Style Prefer /// for single-line documentation and /** */ for multi-line documentation blocks. Use Javadoc-style commands (@param, @return) rather than Qt-style (\param, \return).
  • Brief Descriptions Use @brief for explicit brief descriptions.
  • Detailed Descriptions Add detailed descriptions after the brief, separated by a blank line or using @details.
  • Parameter Direction Always specify parameter direction using [in], [out], or [in,out] for clarity.
  • Code Examples Use @code and @endcode blocks for usage examples within documentation.
  • Cross-References Use @see to reference related functions, classes, or external resources.
  • Warnings and Notes Use @note for important information and @warning for critical warnings.
  • Deprecation Mark deprecated APIs with @deprecated including migration guidance.
  • TODO Items Use @todo for planned improvements visible in generated documentation.
  • Order of Tags Follow this order for function documentation: @brief @details (if needed) @tparam (for templates) @param @return @throws @pre @post @note @warning @see @deprecated

6. Template

Use these templates for new documentation. Replace placeholders with actual values.

6.1. File Header Template

[!NOTE] Place the @file block after the include guard (#pragma once or #ifndef/#define). This ensures the documentation is parsed once along with the declarations it describes and keeps preprocessor directives separate from API documentation.
#pragma once

/**
 * @file <filename>.hpp
 * @brief One-line description of the file's purpose.
 *
 * Detailed description of the file's contents and design decisions.
 *
 * @author <author_name>
 * @copyright Copyright (c) <year> <organization>
 * @license SPDX-License-Identifier: <license_identifier>
 */

6.2. Namespace Template

/**
 * @brief One-line description of namespace contents.
 *
 * Detailed description of the namespace's role, the types of
 * components it contains, and how they relate to each other.
 */
namespace namespace_name {

// Namespace contents

}  // namespace namespace_name

6.3. Class Template

/**
 * @brief One-line description of the class.
 *
 * Detailed description of the class responsibility, key invariants,
 * and usage patterns.
 *
 * @tparam T Description of template parameter and constraints.
 *
 * @note Thread safety: Describe thread safety guarantees.
 *
 * @see RelatedClass
 *
 * @code
 * ClassName<int> obj;
 * obj.method(param);
 * @endcode
 */
template <typename T>
class ClassName
{
  // ...
};

6.4. Function Template

/**
 * @brief One-line description of what the function does.
 *
 * Detailed description including algorithm details and edge cases.
 *
 * @param[in] param1 Description of the input parameter.
 * @param[out] param2 Description of the output parameter.
 * @param[in,out] param3 Description of bidirectional parameter.
 *
 * @return Description of the return value.
 * @retval specific_value Meaning of this specific return value.
 *
 * @throws std::invalid_argument If param1 is invalid.
 * @throws std::runtime_error If operation fails.
 *
 * @pre Preconditions that must be met before calling.
 * @post Postconditions guaranteed after successful execution.
 *
 * @note Important information for users.
 * @warning Critical warnings about potential misuse.
 *
 * @see relatedFunction()
 *
 * @code
 * auto result = functionName(input, output);
 * @endcode
 */
ReturnType functionName(const InputType& param1, OutputType& param2);

6.5. Member Variable Template

class ClassName
{
private:
  int count_;       ///< Number of items currently stored.
  bool is_valid_;   ///< Whether the object is in a valid state.

  /// Description for simple members.
  int simple_member_;

  /**
   * @brief Buffer for temporary storage.
   *
   * Detailed explanation of the member's purpose and
   * synchronization requirements.
   */
  std::vector<char> buffer_;
};

6.6. Enumeration Template

/**
 * @brief Description of what this enumeration represents.
 *
 * Detailed description of the enum's purpose and usage context.
 */
enum class EnumName
{
  Success,     ///< Operation completed successfully.
  Error,       ///< Operation failed with an error.
  Pending,     ///< Operation is still in progress.
  NotFound     ///< Requested item was not found.
};

6.7. Module/Group Template

/**
 * @defgroup module_name Module Display Name
 * @brief One-line description of the module.
 *
 * Detailed description of the module purpose and components.
 *
 * @{
 */

// Classes and functions belonging to this group

/** @} */  // End of module_name

6.8. Formula Template

/**
 * @brief Calculates the Euclidean distance between two points.
 *
 * The distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is
 * \f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.
 *
 * For complex equations, use displayed formulas:
 * \f[
 *   d = \sqrt{\sum_{i=1}^{n}(p_i - q_i)^2}
 * \f]
 *
 * Multi-line equations using eqnarray environment:
 * \f{eqnarray*}{
 *   E &=& mc^2 \\
 *   F &=& ma
 * \f}
 *
 * @param[in] x1 X-coordinate of the first point.
 * @param[in] y1 Y-coordinate of the first point.
 * @param[in] x2 X-coordinate of the second point.
 * @param[in] y2 Y-coordinate of the second point.
 *
 * @return The Euclidean distance \f$d \geq 0\f$.
 */
double distance(double x1, double y1, double x2, double y2);

7. References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.51%
按下载量换算56

Claude

29.38%
按下载量换算46

Cursor

19.44%
按下载量换算31

Gemini CLI

9.72%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills