code-comment-guidelines

Enforce code-comment guidelines and JSDoc for public APIs.

8|1|Updated Dec 28, 2018
One-click install
npx skills add https://github.com/hiro0218/b.0218.jp --skill code-comment-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-comment-guidelines
Source: https://github.com/hiro0218/b.0218.jp/tree/main/.claude/skills/code-comment-guidelines
Command: npx skills add https://github.com/hiro0218/b.0218.jp --skill code-comment-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces meaningful commenting practices, guiding developers to avoid redundant comments, apply JSDoc to public APIs, and prefer refactoring over excessive commentary.

Core Features & Use Cases

  • Redundant Comment Detection: flags comments that restate obvious code behavior.
  • Public API Documentation: ensures exported APIs have JSDoc.
  • Refactoring Guidance: suggests extracting logic into well-named functions to reduce comments.
  • Use Case: In a PR, scan a module like src/utils/math.ts to improve comments and add JSDoc.

Quick Start

Ask the skill to review the comments in a file, for example: "Review src/utils/math.ts comments for redundancy and JSDoc coverage."

Frequently Asked Questions about code-comment-guidelines

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

FAQPage Schema
How do I identify and remove redundant comments in my code?

Redundant comments restate obvious code behavior without adding clarity. This Skill detects comments that merely echo what the code already expresses, then guides you to either remove them or refactor the code itself for better readability, reducing noise in your codebase.

What's the best way to document public APIs in TypeScript with JSDoc?

JSDoc provides structured API documentation for exported functions and classes. This Skill ensures all public APIs in TypeScript and JavaScript include JSDoc blocks, automatically flagging undocumented exports and suggesting comment templates that follow industry standards.

How do I improve code readability by refactoring instead of adding comments?

Extract complex logic into well-named functions to make intent self-evident, reducing reliance on explanatory comments. This Skill recommends refactoring opportunities where meaningful function names replace lengthy prose, improving both maintainability and code review clarity.

Can I apply comment guidelines during code review?

Yes. This Skill scans modules in pull requests to detect inconsistent, redundant, and non-informative comments across TypeScript, JavaScript, and other languages, then auto-suggests corrections to enforce consistent commenting practices before merge.

Does this work across multiple programming languages or just JavaScript?

This Skill applies comment guidelines across multiple languages with emphasis on TypeScript and JavaScript, where JSDoc for public APIs is prioritized. It addresses redundancy and refactoring opportunities in any language, adapting enforcement rules to language-specific conventions.

What counts as a non-informative comment that should be removed?

Non-informative comments state the obvious—like `i++` followed by `increment i`—or lack context about intent and decisions. This Skill flags these and distinguishes them from valuable comments that explain why code exists, trade-offs made, or edge cases handled.