cpp-interface-purpose-comments

Add Purpose comments above pure virtual method declarations in C++ headers.

246|46|Updated Jan 20, 2021
One-click install
npx skills add https://github.com/hzqst/MetaHookSv --skill cpp-interface-purpose-comments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-interface-purpose-comments
Source: https://github.com/hzqst/MetaHookSv/tree/main/.claude/skills/cpp-interface-purpose-comments
Command: npx skills add https://github.com/hzqst/MetaHookSv --skill cpp-interface-purpose-comments

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill adds a standard Purpose comment above each pure virtual method declaration in C++ interface headers (.h/.hpp). Use when asked to batch annotate interface classes or enforce a consistent comment block above virtual ... = 0; declarations.

Core Features & Use Cases

  • Automatic placement of Purpose comment blocks above each pure virtual method declaration in headers (.h/.hpp).
  • Scripted workflow with scripts/add_pure_virtual_purpose_comments.py, supporting --dry-run and batch scans with --globs.
  • Handles multi-line declarations, preserves indentation, and respects existing comments unless forced.

Quick Start

Run the tool on your header files to insert standard Purpose comments above every pure virtual method declaration.

Frequently Asked Questions about cpp-interface-purpose-comments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically add comments to pure virtual methods in C++ headers?

You can automatically add standard Purpose comments to pure virtual methods in C++ headers by running a script that scans interface files and inserts comment blocks above `virtual ... = 0;` declarations. It supports batch annotation across directories using glob patterns.

Can I batch annotate C++ interface classes across multiple header files?

Yes, you can batch annotate C++ interface classes across multiple header files. The tool supports batch scans with the `--globs` argument, allowing you to target multiple `.h` and `.hpp` files in a directory for consistent comment insertion.

Does the C++ pure virtual method commenting tool support dry runs?

Yes, the C++ pure virtual method commenting tool supports dry runs. You can use the `--dry-run` flag to preview where standard Purpose comments will be inserted above pure virtual method declarations without modifying the actual header files.

Will adding Purpose comments to C++ headers mess up my indentation and formatting?

Adding Purpose comments to C++ headers will not mess up your indentation and formatting. The tool preserves existing code formatting, respects existing comments unless forced, and correctly handles multi-line pure virtual method declarations.

Do I need to install external Python libraries to annotate C++ interface headers?

You do not need to install external Python libraries to annotate C++ interface headers. The tool runs using a standalone Python script that relies solely on the standard library, requiring no external dependencies to function.

What is the best way to enforce consistent comments above pure virtual method declarations?

The best way to enforce consistent comments above pure virtual method declarations is to use an automated scripted workflow. This ensures a standard Purpose comment block is placed above every `virtual ... = 0;` declaration in your C++ interface headers uniformly.