skills/code-tidy/SKILL.md
整理 Java 代码。对 Git 未提交的 Java 类和方法添加/补充 Javadoc 注释,更新日期注释。当用户说"整理代码"、"添加注释"、"更新日期注释"时触发。
npx skillsauth add lltx/skills code-tidyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
整理 Git 未提交的 Java 代码,添加/补充 Javadoc 注释并更新日期。
| 参数 | 说明 | 示例 |
|------|------|------|
| $0 | 项目目录路径 | /code-tidy pigx/ |
| 无参数 | 使用当前工作目录 | /code-tidy |
重要:必须先 cd 到项目目录,再执行 git 命令(因为项目可能是独立的 git 仓库)。
cd ${PROJECT_DIR}
git status --porcelain | grep '\.java$' | awk '{print $2}'
如果没有未提交的 Java 文件:提示用户并退出。
CURRENT_DATE=$(date +"%Y-%m-%d")
CURRENT_YEAR=$(date +"%Y")
对每个未提交的 Java 文件执行以下操作:
检查:类声明前是否有 Javadoc 注释(/** ... */)
如果缺失,在类声明前添加:
/**
* 类功能描述
*
* @author lengleng
* @date ${CURRENT_DATE}
*/
如果已有注释但缺少 @author 或 @date,补充缺失的标签。
仅处理:public 和 protected 方法
跳过:
@Override 注解的方法如果缺失,在方法声明前添加:
/**
* 方法功能描述
*
* @param paramName 参数说明
* @return 返回值说明
*/
| 类型 | 查找模式 | 更新为 |
|------|----------|--------|
| @date | @date YYYY/MM/DD 或 @date YYYY-MM-DD | ${CURRENT_DATE} |
| Copyright | Copyright © YYYY 或 Copyright YYYY | ${CURRENT_YEAR} |
注意:@since 版本号保持不变。
展示每个文件的修改情况:
@author 作者名@date 创建/修改日期@param 每个参数说明(如有)@return 返回值说明(非 void 方法)@throws 异常说明(如有)devops
搜索 PIG 官方文档并总结答案。当用户询问 PIG CLOUD、PIG AI、pigx 相关的技术问题、配置方法、功能说明,或明确说"查文档"、"搜一下"、"怎么配置"、"怎么实现"时触发。遇到 PIG 框架相关具体问题时应主动搜索文档后再回答,不要依赖训练数据中可能过期的信息。
tools
USE THIS SKILL whenever user says 网络慢、网速慢、网速优化、网络延迟高、Wi-Fi 慢、DNS 慢、MTU 问题、packet loss、VPN/代理影响网速、mDNS 异常、speedtest-cli, or asks Codex to make the internet/network faster. Diagnose network performance with read-only baselines first, separate ISP/Wi-Fi/DNS/MTU/proxy/background-process causes, then propose reversible fixes with before/after verification.
development
Simplifies, refines, and optimizes Java code for clarity, safety, and maintainability while preserving all functionality. Use whenever you've written or modified Java code, when the user asks to "simplify", "clean up", "optimize", "refactor", or "review" Java code, when implementing Java features, fixing Java bugs, or when code feels overly verbose or unsafe. Also use proactively after completing any Java coding task — if Java files were touched, apply this skill before declaring done.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.