Agent skill

Satori Code Cleanup

by yuxino in yuxino/satori

清理 Satori 的死代码、无效代码、未使用 import/变量/导出/图标/文案键等。当用户说"清理垃圾代码"、"删死代码"、"清理无效代码"、"remove dead code" 或完成功能改动后希望保持代码整洁时使用。

MITAuto-check passedDocuments & Office

Install Satori Code Cleanup

skills CLI
$ npx skills add yuxino/satori --skill satori-code-cleanup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yuxino/satori satori-code-cleanup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yuxino/satori.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/satori-code-cleanup .claude/skills/satori-code-cleanup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
satori-code-cleanup
GitHub stars
137
Token cost
~487 tokens
SKILL.md length
134 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

清理 Satori 的死代码、无效代码、未使用 import/变量/导出/图标/文案键等。当用户说"清理垃圾代码"、"删死代码"、"清理无效代码"、"remove dead code" 或完成功能改动后希望保持代码整洁时使用。

  • Works in 8 steps: 未使用的 import——删除后 TypeScript 编译会报,也可用 npx… → 未使用的变量/常量/函数——特别是模块级导出的常量,先全局搜索确认无引用。 → 未使用的参数——如 askQuestion 的… → …
  • Tasks that involve Code simplification
  • SKILL.md covers 适用时机, Satori 代码结构(清理前先了解), 清理对象(按常见度排序) and 工作流, plus 2 more sections
  • Calls npx, cargo and git

What it does

Satori Code Cleanup is an agent skill from yuxino/satori. 清理 Satori 的死代码、无效代码、未使用 import/变量/导出/图标/文案键等。当用户说"清理垃圾代码"、"删死代码"、"清理无效代码"、"remove dead code" 或完成功能改动后希望保持代码整洁时使用。

Its SKILL.md is about 490 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering Code simplification. It works with Tauri and Rust. The repository describes itself as: AI PDF reader for macOS and Windows: ask about pages, diagrams and code, with local reading history. AI PDF 阅读器与教材问答。 The licence is MIT.

When your agent uses it

  • Tasks that involve Code simplification

Example prompts

  • “清理垃圾代码”
  • “清理无效代码”
  • “remove dead code”
  • “/satori-code-cleanup”

Requirements

  • Node.js

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. 未使用的 import——删除后 TypeScript 编译会报,也可用 npx tsc --noEmit 检测。
  2. 未使用的变量/常量/函数——特别是模块级导出的常量,先全局搜索确认无引用。
  3. 未使用的参数——如 askQuestion 的 selectionText(文本选择被框选取代后变死参)。
  4. 无引用的 DOM 元素/样式类——删除某交互后,index.html 里的元素、styles.css 里的类可能无人使用(如 selection-capsule:删 HTML 后 JS 还在 getElementById 会 null 崩溃,必须连带清)。
  5. 无引用的 Tauri 命令导出——api.ts 里封装了但前端从未 invoke 的(如 clearApiKey),删前端导出;Rust 端命令若属合理后端能力可保留。
  6. 无引用的类型/接口/枚举成员。
  7. 被注释掉的整段代码。
  8. 无效分支——如恒 false 的条件、永远 return 的代码。

What it can do on your machine

Read from SKILL.md and the folder at commit 54ffd8c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • cargo
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Satori Code Cleanup loads about 487 tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 134 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~487

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yuxino/satori at commit 54ffd8c, republished under its MIT licence (© yuxino). 134 words, ~487 tokens.

Download SKILL.mdSave it as .claude/skills/satori-code-cleanup/SKILL.md (or your agent's skills folder).
name
satori-code-cleanup
description
清理 Satori 的死代码、无效代码、未使用 import/变量/导出/图标/文案键等。当用户说"清理垃圾代码"、"删死代码"、"清理无效代码"、"remove dead code" 或完成功能改动后希望保持代码整洁时使用。

Satori 死代码清理

适用时机

  • 用户明确要求清理死代码/垃圾代码/无效代码。
  • 完成功能改动后,顺手清理由该改动遗留的死代码(例如删除某个交互后,它专属的 DOM 元素、样式、工具函数不再被引用)。
  • 重构或删除功能时,检查并移除连带失效的代码。

Satori 代码结构(清理前先了解)

  • 前端 src/:main.ts(主要工作区)、settings.ts(设置)、update.ts(版本更新)、reader.ts(滚动阅读器)、pdf.ts(PDF.js 封装)、markdown.ts(回答渲染)、api.ts(Tauri IPC 封装),以及各类策略模块。
  • Rust src-tauri/src/:lib.rs(命令注册/菜单)、qwen.rs(多 provider 流式客户端)、provider.rs、keychain.rs、store.rs、thumbs.rs、update.rs。
  • 样式 src/styles.css:组件样式按注释分区。

清理对象(按常见度排序)

  1. 未使用的 import——删除后 TypeScript 编译会报,也可用 npx tsc --noEmit 检测。
  2. 未使用的变量/常量/函数——特别是模块级导出的常量,先全局搜索确认无引用。
  3. 未使用的参数——如 askQuestion 的 selectionText(文本选择被框选取代后变死参)。
  4. 无引用的 DOM 元素/样式类——删除某交互后,index.html 里的元素、styles.css 里的类可能无人使用(如 selection-capsule:删 HTML 后 JS 还在 getElementById 会 null 崩溃,必须连带清)。
  5. 无引用的 Tauri 命令导出——api.ts 里封装了但前端从未 invoke 的(如 clearApiKey),删前端导出;Rust 端命令若属合理后端能力可保留。
  6. 无引用的类型/接口/枚举成员。
  7. 被注释掉的整段代码。
  8. 无效分支——如恒 false 的条件、永远 return 的代码。

工作流

  1. 先搜索再删:对每个疑似死代码,用 rg 全局搜索引用(.ts、.rs、.css、index.html、配置文件),确认无引用才删。注意区分"定义处"和"使用处"。
  2. 连带清理:删除一个功能时,把它专属的辅助函数、常量、类型、DOM 元素、样式一起删,不要只删调用点。特别是 HTML 元素删除后,JS 里对它的引用必须同步删(否则运行时 null 崩溃)。
  3. 检查交叉文件:main.ts 引用的函数可能定义在 reader.ts/pdf.ts;Rust 命令在 lib.rs 注册、前端在 api.ts 封装——删任一端要看另一端。
  4. 删完必验:npx tsc --noEmit + npx vite build(前端);cargo check(Rust)。改动样式后再确认相关类无人引用。
  5. 注意导出的公共 API:api.ts 的导出可能被 main.ts 引用,删之前全局搜。

反例(不要删)

  • 测试里引用的符号。
  • 配置/构建脚本里引用的路径或脚本(scripts/dev-app.sh、tauri.conf.json 里的字段)。
  • 对外部有约定意义的字符串(如 wire protocol 的 JSON 键、store.json 的字段名)。
  • 语义上是"未来扩展点"但注释明确说明用途的代码——拿不准时问用户。

完成标准

  • git diff --stat 只包含预期删除 + 必要的连带修改。
  • npx tsc --noEmit、npx vite build、cargo check 全绿。
  • 不留半删状态(例如只删了调用点、没删定义)。

© yuxino, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/satori-code-cleanup of yuxino/satori.

Open the folder on GitHubat commit 54ffd8c

Compare with similar skills

Satori Code Cleanup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Satori Code Cleanup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Satori Code Cleanup this skillyuxino/satori137—~487Automated safety check: PassMIT
Rust No Unwrapshencangsheng/easydb_app590—~802Automated safety check: PassMIT
Rust SQL Testshencangsheng/easydb_app590—~1.2kAutomated safety check: PassMIT
RTK Rust Code Simplifierrtk-ai/rtk83k—~1.1kAutomated safety check: PassApache-2.0
Cut Releasedelexw/claude-code-trace3771 repos~1.4kAutomated safety check: PassMIT
Resolve PR Reviewshencangsheng/easydb_app590—~2.4kAutomated safety check: PassMIT

Similar skills

  • Rust No Unwrap

    shencangsheng/easydb_app

    Enforces strict avoidance of unwrap() in Rust code. An agent skill from shencangsheng/easydb_app.

    590 GitHub stars~802 tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Rust SQL Test

    shencangsheng/easydb_app

    Enforces unit test requirements for the Rust data-processing modules in src-tauri/src/sql/ (generator.rs, parse.rs) and src-tauri/src/reader/ (excel.rs and other readers).

    590 GitHub stars~1.2k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.

    83k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Cut Release

    delexw/claude-code-trace

    Cuts a new versioned release of claude-code-trace end-to-end without asking any questions.

    377 GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Resolve PR Review

    shencangsheng/easydb_app

    Resolve pull request code review comments end-to-end. An agent skill from shencangsheng/easydb_app.

    590 GitHub stars~2.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Project Structure

    Eynzof/Hermes-CN-Desktop

    A skill your agent uses when orienting within the Hermes Agent CN Desktop codebase, locating source files, understanding the Tauri+React architecture, finding Rust commands or frontend modules, or…

    1.8k GitHub stars~4.2k tokensUpdated 18 days ago
    DevelopmentAuto-check: notes

More from yuxino/satori

  • Satori Dev Launch

    yuxino/satori

    启动 satori Tauri 应用进行开发/查看时使用。当用户说"启动看看"、"跑一下"、"打开应用"、验证 UI 改动等场景时使用。

    137 GitHub stars~399 tokensUpdated 17 days ago
    Auto-check passed
  • Satori Readme

    yuxino/satori

    维护 satori 的双语 README(英文 README.md + 简体中文 READMEZH.md)。当需要新增/修改 README 内容、保持双语同步、或避免"英文页面出现中文"这类混用问题时使用。

    137 GitHub stars~294 tokensUpdated 17 days ago
    Auto-check passed
  • Satori I18n

    yuxino/satori

    处理 satori 的界面语言。当前 satori 为纯中文单语(无 i18n 结构);当需要新增界面语言、把硬编码中文文案抽离、或排查某处文案不跟随时使用。

    137 GitHub stars~441 tokensUpdated 17 days ago
    Auto-check passed

Works with

Questions about Satori Code Cleanup

What does Satori Code Cleanup do?

清理 Satori 的死代码、无效代码、未使用 import/变量/导出/图标/文案键等。当用户说"清理垃圾代码"、"删死代码"、"清理无效代码"、"remove dead code" 或完成功能改动后希望保持代码整洁时使用。. Satori Code Cleanup is an agent skill from yuxino/satori.

When should I use Satori Code Cleanup?

Satori Code Cleanup fits situations like: tasks that involve Code simplification.

How do I install Satori Code Cleanup in Claude Code?

Run `npx skills add yuxino/satori --skill satori-code-cleanup -a claude-code`. Or copy the skill folder (.agents/skills/satori-code-cleanup in yuxino/satori) into .claude/skills/satori-code-cleanup in your project. Claude Code loads it when a task matches its description.

How do I install Satori Code Cleanup in Codex?

Run `npx skills add yuxino/satori --skill satori-code-cleanup -a codex`. Or copy the skill folder (.agents/skills/satori-code-cleanup in yuxino/satori) into .agents/skills/satori-code-cleanup in your project. Codex loads it when a task matches its description.

Can I use Satori Code Cleanup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yuxino/satori --skill satori-code-cleanup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/satori-code-cleanup, .gemini/skills/satori-code-cleanup, .github/skills/satori-code-cleanup and .opencode/skills/satori-code-cleanup in your project.

What does Satori Code Cleanup need to run?

Going by SKILL.md and its folder, Satori Code Cleanup needs the command-line tools its instructions call (npx, cargo and git). Our summary lists: Node.js.

Does Satori Code Cleanup access the network?

SKILL.md contains no URLs. Its commands use npx and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Satori Code Cleanup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Satori Code Cleanup use?

Satori Code Cleanup is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Satori Code Cleanup use?

About 487 tokens (SKILL.md is roughly 1.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Satori Code Cleanup?

Skills that share tags, products or a category with Satori Code Cleanup: Rust No Unwrap (shencangsheng/easydb_app, 590 stars), Rust SQL Test (shencangsheng/easydb_app, 590 stars), RTK Rust Code Simplifier (rtk-ai/rtk, 83k stars) and Cut Release (delexw/claude-code-trace, 377 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Satori Code Cleanup?

yuxino (a GitHub user) maintains it in yuxino/satori, which has 137 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 21, 2026.

Source: yuxino/satori on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.