From dev-tools-skills
Add Chinese comments to source files. Auto-detects language (Kotlin/Java/Dart/others) and applies appropriate comment style.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-tools-skills:code-note [filename][filename]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **中文环境要求**
中文环境要求
本技能运行在中文环境下,请遵循以下约定:
- 面向用户的回复、注释、提示信息必须使用中文
- AI 内部处理过程可以使用英文
- 所有生成的文件必须使用 UTF-8 编码
为源代码文件添加中文注释。自动检测语言类型并应用对应注释风格。
/dt:code-note AlbumActivity/dt:code-note login_page.dart给 AlbumActivity 添加注释帮我给这个文件写上注释| Parameter | Description |
|---|---|
文件名 | 要添加注释的文件名,可带或不带扩展名 |
根据文件扩展名自动检测语言类型:
| Extension | Language | Comment Style |
|---|---|---|
.kt, .java | Kotlin / Java | KDoc / JavaDoc (/** */) |
.dart | Dart | dartdoc (///) |
.swift | Swift | /// |
.py | Python | docstring (""" """) |
.ts, .tsx, .js, .jsx | TypeScript / JavaScript | JSDoc (/** */) |
.go | Go | // |
| 其他 | - | // |
如果用户没有提供扩展名,按以下顺序搜索:
**/*{FileName}.kt
**/*{FileName}.java
**/*{FileName}.dart
**/*{FileName}.swift
**/*{FileName}.py
**/*{FileName}.ts
**/*{FileName}.tsx
If multiple matches found, list them and ask user to select.
Read the entire file to understand:
Identify elements that need comments:
/**
* 类/方法说明
* @param paramName 参数说明
* @return 返回值说明
*/
// 单行注释说明关键逻辑
/** 成员变量说明 */
private var variable: Type
/// 类/方法说明
/// [paramName] 参数说明
/// 返回值说明
// 单行注释说明关键逻辑
/// 成员变量说明
final String variable;
/// 类/方法说明
/// - Parameter name: 参数说明
/// - Returns: 返回值说明
"""类/方法说明"""
# 单行注释说明关键逻辑
/**
* 类/方法说明
* @param name 参数说明
* @returns 返回值说明
*/
// MethodName 类/方法说明
// 参数说明
func (r *Receiver) MethodName(param Type) ReturnType {
Use Edit tool to add comments without modifying code logic.
| Priority | Element | Example |
|---|---|---|
| High | Public methods/functions | Public API |
| High | Complex logic | Nested conditions, algorithms |
| High | Build methods (Dart) | Widget build(BuildContext context) |
| Medium | Class members | Instance variables |
| Medium | Private methods | Internal helpers |
| Medium | Lifecycle methods | initState(), onCreate() |
| Low | Self-explanatory code | Simple assignments |
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub adzcsx2/dev-tools-skills --plugin dev-tools-skills