zh-code-comment

zh-code-comment is a skill for Claude Code, Codex from guyulong/cn-agent-skills. It costs 20 tokens per session (428 once invoked), scanned A, original, MIT.

A tool that generates standard Chinese comments for code in languages such as Python, JavaScript, TypeScript, and Java.

In plain words
What is it for?
Adding concise function and class documentation, explaining complicated code, clarifying ambiguous variables, and documenting TODO or FIXME items.
Why use it?
It helps explain functions, classes, parameters, return values, exceptions, and complex logic when existing comments are missing or unclear.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/guyulong/cn-agent-skills/zh-code-comment
Any agent
npx skills add guyulong/cn-agent-skills --skill zh-code-comment
Clone the repo
git clone --depth 1 https://github.com/guyulong/cn-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for zh-code-comment

README.md
[![agentmods](https://agentmods.dev/badge/skills/guyulong/cn-agent-skills/zh-code-comment.svg)](https://agentmods.dev/skills/guyulong/cn-agent-skills/zh-code-comment)
Your own site
<a href="https://agentmods.dev/skills/guyulong/cn-agent-skills/zh-code-comment"><img src="https://agentmods.dev/badge/skills/guyulong/cn-agent-skills/zh-code-comment.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 428 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00428
Opus 5 $0.00010 $0.00214
Sonnet 5 $0.00004 $0.00086
Haiku 4.5 $0.00002 $0.00043

Measured 4d ago against content hash dbbc70268bb3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

zh-code-comment scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/zh-code-comment/SKILL.md · 67 lines

What it actually says

中文代码注释生成器

使用场景

当代码缺少注释或注释质量不高时,自动生成规范的中文注释。

规则

  1. 函数注释:必须包含功能描述、参数说明、返回值说明
  2. 复杂逻辑:在复杂算法或业务逻辑前添加行内注释
  3. 类注释:说明类的职责和使用方式
  4. 命名辅助:变量名如果含义不明确,添加注释说明

注释模板

Python

def function_name(param1: str, param2: int) -> bool:
    """
    功能简述
    
    Args:
        param1: 参数1的说明
        param2: 参数2的说明
        
    Returns:
        返回值说明
        
    Raises:
        ValueError: 异常说明
    """

JavaScript/TypeScript

/**
 * 功能简述
 * @param {string} param1 - 参数1的说明
 * @param {number} param2 - 参数2的说明
 * @returns {boolean} 返回值说明
 */

Java

/**
 * 功能简述
 *
 * @param param1 参数1的说明
 * @param param2 参数2的说明
 * @return 返回值说明
 * @throws IllegalArgumentException 异常说明
 */

注意事项

  • 注释应简洁明了,避免废话
  • 代码自解释时不需要注释
  • 注释语言与项目保持一致,中文项目用中文注释
  • TODO/FIXME 注释必须说明原因和预期解决方案
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 67 lines · 20 tokens per session scan A dbbc70268bb3

Subscribe to this mod's changes

zh-code-comment is a skill published in the GitHub repository guyulong/cn-agent-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 20 tokens to every session and 428 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.