Code Comment for Openclaw

A professional code annotation engine that replaces verbose AI-generated comments with concise, senior-level technical documentation in natural Chinese.

yhongm
v1.0.0
Apr 21, 2026
0
824
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install code-comment

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install code-comment using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Code Comment?

The Code Comment skill is designed to act as a Senior Tech Lead, focusing on removing the robotic, redundant, and literal explanations often generated by standard AI tools. It targets the removal of obvious comments that explain what code does in favor of meaningful insights that explain why a specific logic exists. By enforcing a strict no AI flavor policy, it ensures your repository maintains a clean, professional, and human-centric documentation style.

This skill supports a wide array of mainstream programming languages including Java, C++, Kotlin, JavaScript, TypeScript, Python, Rust, Go, and React (JSX/TSX). It prioritizes native Chinese output, stripping away machine-translated phrasing and unnecessary punctuation to deliver code that is ready for immediate production use.

Code Comment Use Cases

  • Refactoring legacy codebases to improve readability and remove technical debt in documentation.
  • Cleaning up AI-generated code snippets to ensure they meet professional coding standards.
  • Standardizing comment styles across multi-language projects for team consistency.
  • Reviewing and optimizing docstrings (JSDoc, KDoc, etc.) for better clarity and brevity.
  • Protecting sensitive logic with concise warnings about concurrency or performance risks.

How Code Comment Works

  1. The skill identifies all existing comments within the provided code block across various supported languages.
  2. It filters out obvious comments that merely repeat the code's literal meaning (e.g., i++ // increment i).
  3. It maps verbose AI phrasing to concise technical terminology using a specialized internal mapping table.
  4. Documentation strings are restructured to maintain necessary tags like @param and @return while simplifying the descriptive text.
  5. The final output is rendered as a complete, runnable file within a language-specific Markdown block, strictly excluding explanatory prose.

Code Comment Setup

To integrate this skill into your environment, ensure your agent has access to the Openclaw Skills directory. No external dependencies are required beyond a compatible AI agent host.

# Example: Triggering code-comment via CLI
openclaw run code-comment --path ./src/main.ts

Code Comment Data Schema & Taxonomy

The skill processes and outputs data based on the following taxonomy:

Data Type Description
Input Raw source code with verbose or AI-generated comments
Processed Logic Preservation of variable names, imports, and functional logic
Output Markdown-wrapped code block with optimized Chinese comments
Format Language-specific syntax (e.g., JSDoc for TS, Docstring for Python)

Code Comment Advanced Features

  • Multi-language support with context-aware syntax detection for React JSX vs. standard JavaScript.
  • Strict adherence to 5-word limits for inline comments to maintain extreme brevity.
  • Automated mapping of machine-translated terms to industry-standard developer jargon (e.g., changing 'back-up value' to 'fallback').
  • Zero-logic-mutation guarantee ensuring that only comment blocks are modified, leaving the execution logic untouched.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*