AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Code Tidy

skill-lihongwei-cn-lihongwei-cn-code-tidy · by LiHongwei-cn

>

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-lihongwei-cn-lihongwei-cn-code-tidy

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-lihongwei-cn-lihongwei-cn-code-tidy)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Code Tidy? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

代码洁癖

> 代码如房间——所有东西在正确的位置,按顺序排列,不留冗余。

执行流程

第一步:扫描

逐文件扫描当前改动涉及的所有文件:

  1. 无用 importgrep 检查每个 import 是否在文件中被使用
  2. 死函数:检查定义了但从未调用的函数/方法
  3. 注释掉的代码:查找被 // # /* */ 注释掉的代码块(不是说明性注释)
  4. 冗余注释:函数名已经说明意图的行内注释、// TODO 已完成的注释
  5. 多余文件:临时 .md.txttest_*.tmp、备份文件

第二步:排序

检查并修正元素顺序:

  • Imports:标准库 → 第三方 → 本地模块,组内字母序
  • JSON keys:字母序排列
  • CSS 属性:定位 → 盒模型 → 排版 → 视觉 → 其他
  • HTML 属性idclassstyledata-*href/src → 其他
  • 函数定义:public → private,同组内按依赖关系排列(被调用者在前)

第三步:清理

实际执行清理操作:

# 删除未使用的 import
# 删除死函数
# 删除注释掉的代码块
# 删除冗余注释
# 删除多余文件
# 排序 imports / keys / attributes

第四步:验证

清理完成后确认:

  • [ ] 代码能正常运行(不因清理而破坏)
  • [ ] 没有引入新的 lint 错误
  • [ ] 文件行数有减无增(或者增的只是必要的逻辑)

特殊规则

不清理的情况

  • 用户明确要求保留的代码
  • 虽然未使用但是 API 导出的一部分(如 __all__exports
  • 文档中引用的示例代码
  • 打算后续使用的 TODO 注释(需有明确的后续计划和日期)

CSS 属性排序参考

1. 定位: position, top, right, bottom, left, z-index
2. 盒模型: display, width, height, margin, padding, border
3. 排版: font-*, text-*, line-height, letter-spacing
4. 视觉: color, background, opacity, box-shadow
5. 其他: cursor, transition, transform, animation

HTML 属性排序参考

1. id
2. class  
3. style
4. data-* (按字母序)
5. href / src / alt
6. type / name / value
7. target / rel / download
8. 事件属性 on*

安装残留清理

每次 brew installpip installnpm install、文件下载后,执行:

自动清理步骤

# 包管理器缓存
brew cleanup                    # Homebrew 旧版本
pip3 cache purge                # pip 下载缓存
npm cache clean --force         # npm 缓存

# 安装包残留
find ~/Downloads -name "*.dmg" -delete
find ~/Downloads -name "*.pkg" -delete

# 临时目录
find /tmp -maxdepth 1 -user $(whoami) -delete 2>/dev/null

# .DS_Store(项目中)
find . -name ".DS_Store" -delete

# Python 编译缓存
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null
find . -name "*.pyc" -delete

清理检查清单

  • [ ] .dmg / .pkg 安装包已删除
  • [ ] 解压的临时文件夹已删除
  • [ ] brew cleanup 已执行
  • [ ] pip cache 已清除
  • [ ] 项目内无 .DS_Store
  • [ ] 项目内无 __pycache__ / *.pyc

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.