Skill站外收录 @skilllib/skill-2117939930272412237
cpp-interface-purpose-comments
在 C++ 接口头文件中为每个纯虚函数自动生成标准化的多行注释块,包含 Purpose 及可选的 Notes、Args 与 Return 说明,优先复用已有注释内容并保持原有格式,适用于批量补充或统一接口文档风格。
效率工具 AI 技能
Skills.MD
# Cpp Interface Purpose Comments
## Overview
Add comment with following template:
```cpp
/*
Purpose : (mandatory, brief or remark or description, merge with existing if there is)
Notes : (optional, don't emit this line if empty, merge with existing if there is)
Args : (optional, don't emit this line if empty, merge with existing if there is)
Return : (optional, don't emit this line if empty, merge with existing if there is)
*/
```
directly above each pure virtual method declaration in C++ interface headers.
- Prefer reading knowledges about specified functions from serena's memories first.
- Prefer multi-line comments.
- Keep everything as **SHORT** as possible.
- The comments should **ALWAYS** be in English.
- If there is **ALREADY** Purpose or comment for the interfaces there, use the existing purpose or comment instead of generating our own.
## Workflow
1. Confirm scope: target files or directories, desired comment text, and whether to skip existing comments.
2. Prefer scripted pass using `scripts/add_pure_virtual_purpose_comments.py` with `--dry-run` first.
3. Review changes and handle any missed edge cases with manual edits.
4. Package the skill when stable.
## Scripted workflow (preferred)
Run a dry run:
```
python scripts/add_pure_virtual_purpose_comments.py --dry-run --globs "*.h,*.hpp" <path>
```
Apply edits:
```
python scripts/add_pure_virtual_purpose_comments.py --globs "*.h,*.hpp" <path>
```
### Script behavior
- Detect statements containing `virtual` and `= 0;` with a function-like `(...)` pattern.
- Support multi-line declarations until the first `;`.
- Skip insertion if the nearest non-empty line above is a comment, unless `--force`.
- Preserve existing line endings and indentation.
### Parameters
- `--comment`: override the default comment text.
- `--globs`: comma-separated patterns for recursive directory scans.
- `--dry-run`: report changes without writing files.
- `--force`: insert even if a comment exists immediately above.
## Manual fallback
- Insert the comment directly above the first line of the declaration using the same indentation.
- For macro-heavy or generated code, prefer targeted edits to avoid unintended changes.
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「cpp-interface-purpose-comments」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次