Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

cleansecleanse 命令行

Agent Skill

cleanse 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

343

周安装

14

GitHub Stars

25

下载量

110
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/andrewgleave/skills --skill cleanse

简介

cleanse 通过扁平化控制流、消除冗余代码等方式提升代码可读性与可维护性。

  • 适用于重构遗留系统、代码审查或为新成员准备易于理解的代码库。
  • 按顺序执行多个重构 pass,包括嵌套条件展开、注释清理与函数提取。
  • 使用前请确认代码行为不变,并在版本控制下备份原始文件以防回滚需要。
  • 建议在小型模块先行测试,验证重构后功能等效性与性能表现。

SKILL.md

Scope

If the user specified files or directories, review those. If not, ask what they'd like you to review before proceeding.

Goal

Make this code trivially easy to pick up cold. Someone opening this file in six months should understand what it does in seconds. All changes should preserve the original functionality and behavior.

What to look for

Read the target code carefully, then apply these passes in order. Make changes directly — don't list suggestions.

1. Flatten control flow

Nested conditionals are the single biggest readability killer. Flatten them.

  • Convert if/else chains to early returns and guard clauses. Put the bail-out condition at the top, happy path below.
  • When a function has a single meaningful path wrapped in a conditional, invert the condition and return early.
  • If an else block just returns or continues, remove the else — the early return already handles it.

2. Strip noise

Remove anything that doesn't help the reader understand the code:

  • Comments that restate the code// increment counter above counter += 1 is noise. Delete.
  • Redundant type annotations — if the type is obvious from the right-hand side and the language supports inference, remove the annotation.
  • Unnecessary intermediate variables — if a variable is used once on the next line, inline it (unless the name adds genuine clarity).

Only keep comments that explain *why* — workarounds, constraints, non-obvious business rules. These are valuable. Remove everything else.

3. Simplify logic

  • Collapse trivial if/else into a single expression where the language supports it (ternary, nil-coalescing, pattern matching).
  • Replace boolean flags that track state across a loop with early exits or functional transforms (map, filter, first).
  • Inline one-use helpers that are short enough to read in place. Don't extract helpers for one-time operations — three similar lines is better than a premature abstraction.

4. Improve naming

  • Rename vague variables: data, result, temp, info, val, obj — these tell the reader nothing. Use names that say what the thing *is*.
  • But keep names short for tightly-scoped temps (loop indices, short closures) and when a single word is enough. i is fine in a 3-line loop.
  • Follow the language's naming conventions. camelCase in JS/Swift, snake_case in Python/Rust, etc.
  • Method names should describe what they do without needing a comment. If you need a comment to explain what a method does, rename the method.

5. Move declarations close to usage

Variables defined at the top of a function but not used until line 40 force the reader to hold them in mental memory. Move declarations to just before first use. This makes extraction easier later.

6. Break up long functions

If a function is doing multiple distinct things sequentially, split it — each piece should do one thing and be readable on its own. Apply the same passes above to each extracted function. If extracting would require threading many parameters or the logic is deeply interleaved, don't force it — flag it as a readability concern instead.

How to apply changes

  1. Read the target files thoroughly.
  2. Make all changes directly. Be efficient — batch related edits.
  3. After editing, verify the code still compiles/parses if possible (run the project's lint or build command if one exists).
  4. List changes briefly — the diff tells the full story.

What NOT to do

  • Don't add comments, docstrings, or type annotations that weren't there before (unless renaming made something ambiguous).
  • Don't refactor architecture or move files between modules. This is a clarity pass, not a redesign.
  • Don't change public API signatures unless the name is actively misleading.
  • Don't be clever. The goal is code so boring and obvious that it is self-documenting and can be read cold.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

展示第三方安全扫描或审计结果

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

平台分布

Codex

35.62%
按下载量换算39

Claude

32.94%
按下载量换算36

Cursor

18.04%
按下载量换算20

Gemini CLI

9.68%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills