write-code-comment

Write, review, and migrate code comments and documentation comments against implementation contracts.

Updated May 19, 2026
One-click install
npx skills add https://github.com/wenyue/SmartKit --skill write-code-comment-wenyue
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-code-comment
Source: https://github.com/wenyue/SmartKit/tree/main/docs/zh-CN/skills/write-code-comment
Command: npx skills add https://github.com/wenyue/SmartKit --skill write-code-comment-wenyue

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code comments often drift out of sync with implementations, restate obvious code, or miss critical contract obligations. This Skill provides disciplined guidance for writing, reviewing, and migrating comments so they accurately explain behavior, caller obligations, and design rationale. ## Core Features & Use Cases - Comment Writing Guidance: Explains how to document API contracts, lifecycle obligations, local rationale, and boundary cases with concrete, maintainer-style prose. - Read-Only Comment Audits: Reports actionable missing, misleading, outdated, or redundant comments at precise locations without modifying files. - Authorized Editing and Migration: Adds, modifies, deletes, or relocates comments within authorized scope, preserving valid meaning and machine-readable directives. - Use Case: During a refactor of a Go storage interface, use this Skill to document atomicity and retry semantics so callers understand timeout behavior, then audit the surrounding package for stale comments. ## Quick Start Ask the assistant to review the comments in a specific source file and rewrite any that are outdated or misleading based on the current implementation.

Frequently Asked Questions about write-code-comment

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

FAQPage Schema
How do I write good code comments for APIs?▼

API documentation should explain the caller contract: atomicity guarantees, retry semantics, lifecycle obligations, and boundary conditions that the signature cannot express. Start with the specific responsibility, then constraints that matter for correct use, avoiding restatement of parameter names.

How to review code comments for outdated or misleading content?▼

Perform a read-only audit comparing each comment against the current implementation and its contract evidence. Report actionable issues at exact locations, including missing, misleading, outdated, or redundant comments, and state which paths remain untested.

When should I delete a code comment instead of rewriting it?▼

Delete comments that merely restate what the code already expresses clearly, such as a helper whose name and body fully convey its purpose. Preserve comments that still carry valid meaning, and migrate useful information to an authorized location before removing the original.

Can comment editing change the underlying code?▼

No. Comment work does not grant permission to modify code, names, types, or structure. When implementation conflicts with its contract, the conflict and its owner are reported rather than silently resolved, unless separate code-change authorization exists.

What are the limitations of automated comment review?▼

Review conclusions are bounded by available evidence; uncovered areas and untested paths are explicitly flagged rather than assumed clean. If ownership, target requirements, or authorization cannot be determined, dependent operations stop and the gap is reported.