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

deslop-simplify-ai-codedeslop 简化 ai 代码

Agent Skill

deslop-simplify-ai-code 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

559

周安装

24

GitHub Stars

2

下载量

196
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/adibfirman/dotfiles --skill deslop-simplify-ai-code

简介

该技能简化代码复杂度,提升可读性与一致性,保留原有功能不变。

  • 识别冗余模式、魔法数字与不必要抽象,匹配项目现有风格与命名约定。
  • 适用于 PR 审查或代码重构,聚焦消除“代码 slop”而非最小化改动。
  • 安装前需确认项目上下文,建议结合 git diff 提供具体变更范围。
  • deslop-simplify-ai-code 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Deslop: Simplify Code

Expert code simplification focused on clarity, consistency, and maintainability while preserving exact functionality. Analyze code for unnecessary complexity, redundant patterns, and opportunities to make code more readable and idiomatic. Match existing code style, naming conventions, and patterns in the codebase.

Workflow

  1. Understand project context: Review existing code style, patterns, and conventions in the codebase
  2. Get the code to review: via git diff, PR review, file selection, or paste — don't assume branch naming or tooling
  3. Identify slop patterns across the entire file if it's been touched
  4. Simplify: Remove or refactor each instance to match project idioms
  5. Verify: Run tests if available. If not, review the diff carefully and manually verify behavior. For frontend code, visually verify UI still renders correctly. Provide a summary report of what changed and why.

Slop Patterns

Comments

Rule: Prefer WHY over WHAT.

Remove:

  • Comments restating what code does: // increment counter above counter++
  • Section dividers: // ========== VALIDATION ==========
  • Redundant docstrings documenting self-evident parameters
  • "Note:" or "Important:" prefixes that add nothing
  • Comments explaining language basics

Carve-out: WHAT comments are acceptable for:

  • Complex regex patterns
  • Non-obvious bit manipulation
  • Mathematical formulas where the code IS the implementation
  • Cases where the logic genuinely can't be simplified further

Transform WHAT → WHY:

# SLOP: describes what
# Check if user is active
if user.is_active:

# CLEAN: explains why
# Inactive users can't access billing portal
if user.is_active:
// SLOP: restates the code
// Loop through all items and process each one
for item in items:
    process(item)

// CLEAN: no comment needed, or explain why this approach
// Process sequentially - parallel causes rate limit errors
for item in items:
    process(item)

Null/Error Handling

Remove redundant checks:

# SLOP: checking what's already guaranteed
if user is not None and user is not empty and is_valid_type(user):
    if user.name is not None and user.name is not empty:

# CLEAN: trust the type system or add one meaningful check
if user and user.name:

Simplify excessive try-catch:

# SLOP: catch-log-rethrow adds nothing
try:
    do_thing()
catch error:
    log("Error doing thing:", error)
    throw error

# CLEAN: let it propagate or handle meaningfully
do_thing()

Also watch for:

  • Swallowed errors: try {...} catch {} — at minimum log it, ideally handle or propagate
  • Generic error messages: catch (e) {throw new Error("Something went wrong")} — preserves no context; include the original error or relevant details
  • Error string parsing: checking error.message === "not found" instead of using error types, codes, or structured error objects

Abstractions

Flatten unnecessary layers — but match the codebase's testing patterns:

  • In Python/JS/TS: prefer direct calls; use monkey-patching or test fixtures for mocking
  • In Java/C#: interfaces and wrapper classes are idiomatic for testability via DI — keep if they serve that purpose
  • In Go: keep if it implements an interface for testing; flatten otherwise

General rule: remove abstractions that do nothing AND aren't required by the language/framework. Keep if there are 2+ callers or a test that depends on it.

Watch for:

  • Single-use helper functions that obscure rather than clarify
  • Wrapper classes around simple operations
  • "Manager", "Handler", "Service" suffixes on thin wrappers
  • Config objects for 1-2 values

Verbosity

# SLOP
is_user_valid = user.is_active == true
if is_user_valid == true:
    return true
else:
    return false

# CLEAN
return user.is_active

Common patterns:

  • == true / == false comparisons
  • Intermediate variables used once
  • if x: return true; else: return falsereturn x
  • Unnecessary destructuring then reassembly
  • Unused imports, wildcard imports (import *), importing entire libraries for one function

Naming

Fix over-descriptive names:

  • userDataResponseObjectuser
  • isCurrentlyProcessingDataprocessing
  • handleOnClickButtonEventonClick

Structure

Remove:

  • Constructors that do nothing AND aren't required by the language/framework
  • Getters/setters that just proxy fields
  • Interfaces implemented by one class
  • Abstract classes with one child
  • Enums with one value

Logs/Debug

Remove:

  • Bare print() / console.log() / System.out.println() debug statements
  • Verbose entry/exit logging: Entering function X with params...
  • Success logs that spam output: Successfully processed item 1 of 10000

Keep:

  • Structured logging with levels (logger.debug(...)) — these are controlled by log level config and useful for ops/debugging
  • Error logging with context
  • Audit logs for important operations

Review Checklist

Must Fix

  1. Does this comment explain WHY, not WHAT? (with carve-outs for complex logic)
  2. Is this null check protecting against something that can actually happen?
  3. Could this be expressed more directly?

Should Fix

  1. Does this abstraction earn its complexity? (consider language context)
  2. Is this name proportional to the scope?

Nice to Have

  1. Does this match existing patterns in the codebase?
  2. Would a maintainer find this clearer or more confusing?

Guiding Principles

  • Preserve behavior: Never change what the code does, only how it's expressed
  • Match the codebase: New code should look like it belongs — follow existing conventions, including testing patterns
  • Simplify, don't clever: Prefer obvious solutions over clever ones
  • Earn complexity: Every abstraction, check, or layer must justify its existence
  • Readable > short: Clarity beats brevity when they conflict

Edge Cases

Don't remove:

  • Defensive checks at API boundaries (external input)
  • Comments required by linters or documentation generators
  • Abstractions that enable testing or future extension (if there's a concrete existing use case — not hypothetical)
  • Explicit type annotations in ambiguous contexts
  • Structured debug-level logging (logger.debug(...))

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.84%
按下载量换算72

Claude

30.95%
按下载量换算61

Cursor

16.57%
按下载量换算32

Gemini CLI

9.43%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills