Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计未展示

code-cleanup代码清理

Agent Skill

code-cleanup 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

432

周安装

18

GitHub Stars

公开资料未说明

下载量

144
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-cleanup(代码清理)
来源仓库:https://github.com/wade56754/ai_ad_spend02
仓库路径:skills/code-cleanup
安装命令:
npx skills add wade56754/ai_ad_spend02 --skill "code-cleanup"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add wade56754/ai_ad_spend02 --skill "code-cleanup"

简介

用于查找、检索和筛选相关信息。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

  • 适合根据关键词快速定位候选结果。
  • 使用时需确认搜索范围和过滤条件。
  • 建议结合原始 README 进一步了解实现细节。
  • code-cleanup 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Code Cleanup Skill

Scan projects for redundant code and generate cleanup reports.

Quick Start

# Scan for dead code (unused imports, functions, variables)
python scripts/scan_dead_code.py backend/

# Scan for stale code (old TODOs, debug statements, commented code)
python scripts/scan_stale_code.py src/

# Check unused dependencies
python scripts/scan_unused_deps.py .

Scripts

ScriptDetectsConfidence
scan_dead_code.pyUnused imports, functions, classes, variablesHigh
scan_stale_code.pyCommented code, old TODOs, debug statementsMedium
scan_unused_deps.pyUnused packages in requirements.txt/package.jsonLow

Usage

scan_dead_code.py

python scripts/scan_dead_code.py <dir> [--format json|text] [--ignore "test_*"]

Detects:

  • Unused imports (high confidence, safe to remove)
  • Unused functions/classes not starting with _ (medium confidence)
  • Unused top-level variables (medium confidence)

scan_stale_code.py

python scripts/scan_stale_code.py <dir> [--todo-days 90] [--no-debug]

Detects:

  • Commented-out code blocks
  • TODOs/FIXMEs older than N days (default: 90)
  • Debug statements: print(, console.log(, debugger, pdb

scan_unused_deps.py

python scripts/scan_unused_deps.py <dir> [--type python|node|all]

Checks:

  • requirements.txt vs actual imports
  • package.json dependencies vs actual imports

Output Format

All scripts output JSON by default:

{
  "target": "backend/",
  "issues": [
    {
      "type": "unused_import",
      "file": "services/user.py",
      "line": 3,
      "code": "import os",
      "confidence": "high",
      "suggestion": "Remove unused import: os"
    }
  ],
  "summary": {
    "total": 15,
    "high": 10,
    "medium": 5,
    "low": 0
  }
}

Confidence Levels

LevelMeaningAction
highDefinitely unusedSafe to remove
mediumLikely unusedReview before removing
lowPossibly unusedManual inspection needed

Cleanup Workflow

  1. Run scan scripts on target directory
  2. Review JSON output, filter by confidence
  3. For each issue: remove, keep, or defer
  4. Apply changes (Claude can help edit files)
  5. Run tests to verify nothing broke

Safety Notes

  • Scripts are read-only (scan only, no modifications)
  • Always backup before bulk cleanup
  • Run tests after cleanup
  • Some "unused" code may be used dynamically (reflection, __getattr__, lazy imports)
  • Ignore __init__.py re-exports

References

  • Detection patterns: references/detection-patterns.md
  • Cleanup examples: references/cleanup-examples.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.14%
按下载量换算41

windsurf

24.25%
按下载量换算35

trae

16.63%
按下载量换算24

OpenCode

12.34%
按下载量换算18

weavefox

8.33%
按下载量换算12

Codex

3.81%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills