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

simplify简化

Agent Skill

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

总安装

216

周安装

9

GitHub Stars

3,617

下载量

72
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/alvinunreal/oh-my-opencode-slim --skill simplify

简介

simplify 专注于降低代码复杂度而不改变原有功能,提升可维护性与新人理解效率。

  • 适用于重构臃肿函数、清理深层嵌套逻辑或优化命名清晰度等代码健康度改进场景。
  • 每次简化后需通过行为等价性测试,确保输出结果与原始实现完全一致。
  • 优先处理高频修改区域与核心业务逻辑,避免在非关键路径上过度优化。
  • 推荐在特性冻结期后集中使用此技能,防止引入新 bug 的同时保持演进灵活性。

SKILL.md

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?
  • Do all existing tests still pass without modification?

2. Follow Project Conventions

Simplification means making code more consistent with the codebase, not imposing external preferences.

Before simplifying:

  1. Read AGENTS.md / project conventions
  2. Study how neighboring code handles similar patterns
  3. 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:

  1. Make the change
  2. Run relevant tests
  3. Keep it only if behavior is preserved

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

Verification Checklist

  • Existing tests pass without modification
  • Build/typecheck/lint still pass
  • No unrelated files were refactored
  • No error handling was weakened or removed
  • The result is simpler to review than the original

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.27%
按下载量换算25

Claude

27.81%
按下载量换算20

Cursor

20.87%
按下载量换算15

Gemini CLI

9.96%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

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

来源信息

继续浏览同类 Skills