code-simplifier
Skill12 starsChanged 13 days agoMITView on GitHub
調用官方 code-simplifier agent 簡化程式碼。當使用者要求簡化、降低複雜度、清理冗餘,或執行 8 步開發迴圈步驟 3 時啟用。不適用於 PR 審查(用 code-reviewer)。
59 other projects use a version of this.
Adopted by
Most recently taken up by
- euxx/claude-skills-for-copilottheir own version, first seen Nov 8, 2026
- aktsmm/Agent-Skillstheir own version, first seen Nov 8, 2026
- ValorVie/custom-skillstheir own version, first seen Nov 8, 2026
- ZhouYinLong-lab/Dog-Skillstheir own version, first seen Nov 8, 2026
- simonwong/skillstheir own version, first seen Nov 6, 2026
- islandhopper81/claude-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use tdd-rust, type-design-analyzer and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
FlorianBruniauxSkilltdd-rust
Also in 3 projects that use this
PaulKinlanSkilltype-design-analyzer
Analyzes type design quality focusing on encapsulation, invariant expression, usefulness, and enforcement. Provides quantitative ratings (1-10) for each dimension.
Also in 3 projects that use this
PaulKinlanSkillcomment-analyzer
Analyzes code comments for accuracy, completeness, and long-term maintainability. Identifies misleading comments, comment rot, and documentation gaps.
Also in 4 projects that use this
ufodev-ioSkillsecurity-guardian
Comprehensive security layer for all interactions with Claude: audits code, dependencies, commands, configs, and AI-generated output for vulnerabilities. Protects against prompt injection, data leaks, unsafe advice, and social engineering. Works in Cursor, Claude Code, claude.ai, and API contexts. Use always as a background security protocol in any Claude-powered environment.
Also in 3 projects that use this
SentrySkillfind-bugs
Find bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit code on the current branch.
Also in 3 projects that use this
tossSkillpr-triage
Classify and summarize a PR for efficient review
Also in 3 projects that use this
- +1 more from PaulKinlan
Other versions59 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 59
- rtk-ai/rtk★ 86ksame name
- tisfeng/Easydict★ 15ksame name
- elie222/inbox-zero★ 13ksame name
- getsentry/skills★ 1.1ksame name
- Azure/azqr★ 799same name
- DoubleML/doubleml-for-py★ 798same name
- deadlock-mod-manager/deadlock-mod-manager★ 584same name
- microsoft/ghqr★ 528same name
- feiskyer/codex-settings★ 248same name
- wesm/middleman★ 198same name
49 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- skills/gate-guard/hooks/CLAUDE.mdCLAUDE.md
- skills/self-improving-agent/CLAUDE.mdCLAUDE.md
- skills/self-improving-agent/hooks/CLAUDE.mdCLAUDE.md
- skills/tech-diagram-gif/scripts/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- dd-loopSkill
- design-brainstormSkill
- frontend-designSkill
- plan-reviewSkill
- reviewSkill
- self-improving-agentSkill
- task-plannerSkill
- tech-diagram-gifSkill
- verification-gateSkill
- worktree-managerSkill
- writing-great-skillsSkill
The file
Files
Code Simplifier — 官方 agent 包裝器
本 skill 只負責介面層:定範圍 → 調用官方 code-simplifier agent → 呈現結果。 簡化邏輯全在 agent 內,不在此重複。
範圍決定
- 8 步開發迴圈步驟 3(最常見):範圍 = 該功能段落從起點到現在的變更(
git diff <起點>, 起點 =~/.claude/scripts/check-claude-md.sh --segment-base的輸出),不詢問,直接執行。 一段常有好幾個 commit,HEAD~1只看得到最後一個;取不到起點(指令 exit 非 0 或輸出是空的)時當成「範圍不明」問一題,不要退回HEAD~1。 專案有task-planner進度表時例外:起點改用表上這段 commits 欄的起點。 表在哪不用問 —— 根目錄 CLAUDE.md 第一個##之前的指路句會寫明檔名(通常在docs/designs/); 沒有那句指路就是沒有進度表,照--segment-base走。回頭做BLOCKED過的段落時, 中間插做別段會把--segment-base往後推,用它會漏掉這段先前已寫好的部分 - 使用者指明檔案/目錄/片段:照指示,不追問
- 範圍不明:問一題 —「要簡化哪個範圍?(預設:最近修改的檔案)」,其餘參數用預設
預設不含測試檔;使用者要求才包含。
Agent 調用
依序嘗試 subagent_type:
code-simplifier:code-simplifier(plugin 命名空間)code-simplifier(本地~/.claude/agents/code-simplifier.md)
兩者皆回 Agent type not found → 停下,請使用者跑 ./install-dd-pipeline.sh 補齊。
Prompt 模板:
請簡化以下程式碼,提高可讀性與可維護性,保留所有功能:
範圍:{檔案清單或片段}
重點:降低圈複雜度、改善命名、移除冗餘、簡化條件(early return、減少巢狀)。
約束:不改公開 API 簽名;有測試必須全過。
輸出:簡化摘要 + 關鍵變更的 Before/After 對比。結果呈現
轉述 agent 的簡化摘要與 Before/After 對比。統計數字只引用 agent 實際回報的, 沒有就不列 — 禁止自行估算複雜度指標。
簡化後提醒(在 8 步迴圈中則直接續行步驟 4):用 git diff 審查變更,重跑測試確認行為不變。
範圍外
- 架構層重構(模組拆分、設計模式)、效能調校 — 超出簡化範疇,明說不做
- 第三方 / 生成的程式碼 — 不修改
- 效能關鍵段落 — 「看似複雜但高效」的寫法保留,標註說明即可
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

