comment-layout-and-formatting

Normalize indentation, spacing, and alignment of code comments.

130|35|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/kitchen-engineer42/pdf2skills --skill comment-layout-and-formatting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: comment-layout-and-formatting
Source: https://github.com/kitchen-engineer42/pdf2skills/tree/main/skills_samples/Steve%20McConnell%20Code%20Complete%20A%20Practical%20Handbook%20of%20Software%20Construction_output/comment-layout-and-formatting
Command: npx skills add https://github.com/kitchen-engineer42/pdf2skills --skill comment-layout-and-formatting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apply proper indentation and spacing rules to code comments to enhance readability and maintain code visual structure.

Core Features & Use Cases

  • Comment Indentation: When to apply: When writing or formatting code comments (excluding end-of-line comments). Align comments with the code they describe using the same indentation level. Ensure comments do not obscure the visual indentation structure of the code. Maintain visual hierarchy to help readers understand program logic structure
  • Comment Spacing: When to apply: When separating code blocks or emphasizing comments. Place at least one blank line before each comment to separate it from code. Optional: Use blank lines both before and after comments (two total). Pros: Better visual effect, easier to scan. Cons: Consumes more display space. Core principle: Having a consistent convention is more important than the specific details of the convention
  • Core principle: Having a consistent convention is more important than the specific details of the convention

Result

  • Code logical structure remains clearly visible
  • Comments are visually separated from code
  • Comments align with their corresponding code blocks

Quick Start

Apply the indentation and spacing rules to existing codebases to standardize and improve readability.

Frequently Asked Questions about comment-layout-and-formatting

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

FAQPage Schema
How do I format code comments to align with the code block indentation?

To format code comments with proper indentation, align them with the code they describe using the same indentation level. This ensures comments do not obscure the visual hierarchy and helps readers understand the program logic structure.

What is the best way to handle spacing around code comments for readability?

The best way to handle spacing is to place at least one blank line before each comment to separate it from the code. Optionally, use blank lines both before and after comments for a better visual effect that is easier to scan.

Do I need a specific coding standard to normalize comment indentation and spacing?

You do not need a specific coding standard to normalize comment indentation. The core principle is that having a consistent convention for spacing and alignment is more important than the specific details of the convention itself.

How does comment formatting apply across different programming languages?

Comment formatting applies across different programming languages by applying universal rules for indentation level, blank lines, and alignment with code blocks. This ensures consistent comment structure and documentation of logic across various coding standards.

Should I use blank lines before and after every comment in my codebase?

Using blank lines both before and after comments provides a better visual effect and makes code easier to scan, but it consumes more display space. Applying a consistent spacing convention across your codebase is more critical than the specific spacing choice.

Why do end-of-line comments require different formatting than block comments?

End-of-line comments require different formatting because standard comment indentation rules apply to standalone comments. Aligning block comments separately ensures they do not obscure the visual indentation structure of the code they describe.