simplify
Skill1 starsChanged 59 days agoMITView on GitHub
代码简化与复杂度降低。当需要重构代码、提升可读性、降低圈复杂度、消除重复、简化逻辑、清理代码、让代码更简洁、更易维护、减少嵌套、提取方法、重命名变量、删除死代码、代码瘦身时使用。
119 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- thistleknot/skillsedited, first seen Nov 8, 2026
- PeanutGT/NutsSkillstheir own version, first seen Nov 8, 2026
- Ovich/charrettetheir own version, first seen Nov 8, 2026
- caidanw/skillstheir own version, first seen Nov 8, 2026
- Ovich/swarmstormtheir own version, first seen Nov 8, 2026
- alexandrosandre/agentic-engineeringtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use codex-system, design-tracker and 8 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.
gaebalaiSkillcodex-system
PROACTIVELY consult Codex CLI, your highly capable supporter with exceptional reasoning and task completion abilities. Codex is a trusted expert you should ALWAYS consult BEFORE making decisions on: design choices, implementation approaches, debugging strategies, refactoring plans, or any non-trivial problem. When uncertain, consult Codex. Don't hesitate - Codex provides better analysis. Explicit triggers: "think deeper", "analyze", "second opinion", "consult codex".
Also in 3 projects that use this
gaebalaiSkilldesign-tracker
PROACTIVELY track and document project design decisions without being asked. Activate automatically when detecting architecture discussions, implementation decisions, pattern choices, library selections, or any technical decisions. Also use when user explicitly says "記録して", "設計どうなってる", "record this". Do NOT wait for user to ask - record important decisions immediately.
Also in 3 projects that use this
mdrubelamin2Skillverification-planning
Plans how to prove a change works or broke nothing: frames the claim, designs an evidence path from the system itself, and requires every check to be able to fail.
Also in 3 projects that use this
devbrother2024Skillartifact-design
단독 self-contained HTML 산출물(랜딩 페이지, 정적 문서·리포트, 독립 대시보드, 데모·게임, 개발 전 UX/UI 대안 비교 목업)을 만들 때 팔레트·타이포그래피·레이아웃을 의도적으로 설계하고 템플릿·AI스러운 디자인을 피하도록 돕는 디자인 가이드. HTML/CSS를 쓰기 전에 로드한다. "랜딩 만들어줘", "이 내용 단일 HTML로 예쁘게", "UX 대안 HTML로 비교해줘", "디자인 잡아줘"처럼 단독 HTML 아티팩트를 만들거나 비교하는 요청에 활성화하고, 기존 앱(React·Vue 등)의 인앱 컴포넌트 수정이나 순수 백엔드·로직 작업에는 쓰지 않는다.
Also in 3 projects that use this
codebycoreySkillbatch
Create multiple proposals from free-form feature descriptions. Use when planning several features at once, batch creating proposals, or setting up related changes.
Also in 4 projects that use this
mehd-ioSkilldataviz
Also in 3 projects that use this
- +3 more from gaebalai
Other versions119 projects use a version of this.
Word for word · 1
- mike22890/opencode-skills-cn★ 1100% same
Edited · 2
- akitaonrails/my-skills★ 28388% same
- thistleknot/skills★ 086% same
Wrote their own version · 116
- Z3Prover/z3★ 13ksame name
- aaddrick/claude-desktop-debian★ 5.5ksame name
- CherryHQ/cherry-studio-app★ 4.1ksame name
- elliothux/open-compute★ 3.3ksame name
- meta-pytorch/OpenEnv★ 2.8ksame name
- huggingface/OpenEnv★ 2.8ksame name
- bholmesdev/hubble.md★ 1.5ksame name
- kdlbs/kandev★ 1.1ksame name
- truffle-ai/dexto★ 659same name
- deadlock-mod-manager/deadlock-mod-manager★ 584same name
106 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 repository40 other files it gives its agents.
- aestheticsSkill
- applying-ui-design-systemSkill
- avoid-ai-writingSkill
- clonedepsSkill
- codemapSkill
- code-masterySkill
- code-refactor-astSkill
- copywritingSkill
- croSkill
- db-schema-designerSkill
- frontend-designSkill
- github-workflowSkill
- git-workflowSkill
- humanize-fictionSkill
- human-voiceSkill
- life-planningSkill
- literary-craftSkill
- long-taskSkill
- marketing-psychologySkill
- masterpiece-writingSkill
- mcp-builderSkill
- mermaid-diagram-generatorSkill
- orchestrating-adversarial-reviewsSkill
- pandocSkill
- persuasion-craftSkill
- pptxSkill
- pricingSkill
- privacy-guardSkill
- product-strategySkill
- property-based-testingSkill
- psychology-masterySkill
- research-masterySkill
- self-editSkill
- shopping-advisorSkill
- skill-creatorSkill
- story-endingsSkill
- system-designSkill
- thinking-craftSkill
- wealth-masterySkill
- wisdom-philosophySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 22 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 110 edited versions we read keep these.
22
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 19
After a feature is working and tests pass, but the implementation feels heavier than it needs to be
- Distinctive: line 21
When you encounter deeply nested logic, long functions, or unclear names
- Distinctive: line 22
When refactoring code written under time pressure
- Distinctive: line 23
When consolidating related logic scattered across files
- Distinctive: line 24
After merging changes that introduced duplication or inconsistency
- Distinctive: line 37
Don't change what the code does - only how it expresses it.
- Distinctive: line 39
Before every change, ask:
- Distinctive: line 52
Read AGENTS.md / project conventions
- Distinctive: line 64
Keep helpful names even if they cost a few extra lines
- Distinctive: line 70
Don't inline away names that carry meaning
- Distinctive: line 71
Don't merge unrelated logic into one larger function
- Distinctive: line 72
Don't remove abstractions that serve testability or extensibility
- Distinctive: line 73
Don't optimize for line count over comprehension
- Distinctive: line 77
Default to simplifying recently modified code.
- Distinctive: line 83
Before changing or removing anything, understand why it exists.
- Distinctive: line 93
If you can't answer these, read more context first.
- Distinctive: line 116
Use the proportionate final-state verification plan to check preservation
- Distinctive: line 117
Keep it only when the evidence supports preservation
- Distinctive: line 128
No behavior, error handling, or side effects changed
- Distinctive: line 132
Prefer straightforward TypeScript over clever compression
- Distinctive: line 135
Keep refactors tightly scoped to the task or review feedback
- Distinctive: line 139
Use a proportionate final-state verification plan for the final diff.
“Common” is measured: kept by at least 6 in 10 of the 110 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Simplification
何时触发
关键词命中即触发:简化/降复杂度/消重复/减少嵌套/提取方法/重命名/清理/代码瘦身/可读性。
Overview
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines - it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
When to Use
- After a feature is working and tests pass, but the implementation feels heavier than it needs to be
- During code review when readability or complexity issues are flagged
- When you encounter deeply nested logic, long functions, or unclear names
- When refactoring code written under time pressure
- When consolidating related logic scattered across files
- After merging changes that introduced duplication or inconsistency
When NOT to use:
- Code is already clean and readable - don't simplify for the sake of it
- You don't understand what the code does yet - comprehend before you simplify
- The code is performance-critical and the "simpler" version would be measurably slower
- You're about to rewrite the module entirely - simplifying throwaway code wastes effort
The Five Principles
1. Preserve Behavior Exactly
Don't change what the code does - only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
Before every change, ask:
- Does this produce the same output for every input?
- Does this maintain the same error behavior?
- Does this preserve the same side effects and ordering?
- What proportionate final-state verification will reveal a behavior change?
2. Follow Project Conventions
Simplification means making code more consistent with the codebase, not imposing external preferences.
Before simplifying:
- Read
AGENTS.md/ project conventions - Study how neighboring code handles similar patterns
- Match the project's style for imports, naming, function style, error handling, and type annotations
Simplification that breaks project consistency is not simplification - it's churn.
3. Prefer Clarity Over Cleverness
Explicit code is better than compact code when the compact version requires a mental pause to parse.
- Replace nested ternaries with readable control flow
- Replace dense inline transforms with named intermediate steps when they clarify intent
- Keep helpful names even if they cost a few extra lines
4. Maintain Balance
Watch for over-simplification:
- Don't inline away names that carry meaning
- Don't merge unrelated logic into one larger function
- Don't remove abstractions that serve testability or extensibility
- Don't optimize for line count over comprehension
5. Scope to What Changed
Default to simplifying recently modified code. Avoid unrelated drive-by refactors unless explicitly asked.
Process
Step 1: Understand Before Touching
Before changing or removing anything, understand why it exists.
Answer:
- What is this code's responsibility?
- What calls it? What does it call?
- What are the edge cases and error paths?
- Are there tests that define expected behavior?
- Why might it have been written this way?
If you can't answer these, read more context first.
Step 2: Look for Simplification Opportunities
Signals:
- Deep nesting
- Long functions with mixed responsibilities
- Nested ternaries
- Boolean flag arguments
- Repeated conditionals
- Generic or misleading names
- Duplicated logic
- Dead code
- Wrappers or abstractions that add no value
Step 3: Apply Changes Incrementally
Make one simplification at a time.
For each simplification:
- Make the change
- Use the proportionate final-state verification plan to check preservation
- Keep it only when the evidence supports preservation
Separate refactoring from feature work whenever possible.
Step 4: Verify the Result
After simplifying, confirm:
- The code is genuinely easier to understand
- The diff is clean and reviewable
- Project conventions still match
- No behavior, error handling, or side effects changed
Guidance for This Repository
- Prefer straightforward TypeScript over clever compression
- Preserve existing runtime behavior, tests, and hooks
- Favor explicit names and smaller focused helpers when they improve readability
- Keep refactors tightly scoped to the task or review feedback
Final-state verification
Use a proportionate final-state verification plan for the final diff. Run checks required by repository and release instructions; add or repeat evidence only when the changed scope or a stated uncertainty warrants it.
链式触发(与 code-mastery 配合)
本 skill 通常不独立使用,必须与 code-mastery 链式触发:
[1] code-mastery (找标准) → [2] simplify (自动简化) → [4] /code-review (确认)触发规则:
- 用户说"简化这段代码" / "清理" / "重写" → 先调 code-mastery 看标准,再调本 skill 自动简化
- 用户说"重构"(语义模糊)→ 优先调 code-mastery + 本 skill(小改动),需要 AST 级重构才调 code-refactor-ast
/code-review输出"应该改"项时 → 自动用本 skill 处理能自动化的部分
职责边界:
- ✅ 本 skill 管:单文件内命名清理、控制流清晰、嵌套变早返回、提取局部函数、删除冗余代码
- ❌ 不管:跨文件重构、AST 变换、架构解耦、提取接口(→
code-refactor-ast)
铁律:
- ❌ 跳过 code-mastery 直接调本 skill(可能"简化"出违反大师标准的代码)
- ❌ 用本 skill 做行为变更(必须 100% 保留行为)
- ✅ 改动后跑测试 + 调 /code-review 确认
与其他 skill 协作:
- 在三件套链中位置:[1] code-mastery → [2] simplify → [3] code-refactor-ast → [4] /code-review
- 处理不了的上抛 [3] code-refactor-ast
- 不与 [3] 并行调用(必须先 [2] 再 [3])
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.

