writing-comments

Enforce comment formatting rules for Go and general programming projects.

13|6|Updated Feb 23, 2013
One-click install
npx skills add https://github.com/abhinav/home --skill writing-comments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-comments
Source: https://github.com/abhinav/home/tree/main/.claude/skills/writing-comments
Command: npx skills add https://github.com/abhinav/home --skill writing-comments

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates inconsistent, unclear, or unnecessary code comments that lead to confusion and maintenance headaches, ensuring every line of documentation adds value and clarity.

Core Features & Use Cases

  • Standardized Comment Style: Enforces consistent formatting for standalone and inline comments, improving code readability.
  • GoDoc Conventions: Guides on language-specific best practices, such as GoDoc style for exported items.
  • Value-Driven Comments: Teaches when to comment (explaining "why") and when to avoid unnecessary comments (when code is self-explanatory).
  • Use Case: Ensure all new code contributions adhere to a consistent, high-quality commenting standard, making codebases easier to understand and maintain for future developers.

Quick Start

BAD

// Start dispatcher

GOOD

// Start the dispatcher.

GOOD

// Workers must be spawned before sending the first event // or there will be a deadlock. for i := 0; i < numWorkers; i++ { go worker() }

Frequently Asked Questions about writing-comments

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

FAQPage Schema
How do I write consistent code comments across my Go project?

Consistent code comments follow standardized formatting: standalone comments start with capitalization and end with punctuation, inline comments start lowercase, and multi-line comments use // on each line. This uniform style improves readability and makes your codebase easier to maintain.

What's the best way to document exported functions in Go?

GoDoc conventions require documentation comments on exported items to start with the function name and explain purpose clearly. This generates automatic documentation and signals to developers what's publicly available in your package.

When should I add comments to my code?

Comment non-obvious logic, explain the 'why' behind complex decisions, and document gotchas like potential deadlocks. Avoid comments on self-explanatory code; focus on rationale and context that source code alone cannot convey.

Can I enforce comment formatting rules automatically in my codebase?

Yes. Apply comment formatting rules to enforce consistent style across contributions, ensuring standalone comments have proper capitalization and punctuation, GoDoc formats are correct, and inline comments follow lowercase conventions without manual review.

Does comment standardization work for general programming projects or just Go?

Comment formatting rules apply to both Go and general programming projects. While GoDoc is Go-specific, core principles—capitalization, punctuation, multi-line structure, and value-driven comments—transfer across languages to boost code quality and maintainability.