npx skills add https://github.com/pproenca/dot-skills --skill code-simplifier面向 AI 代理和 LLM 的全面代码简化指南。包含 8 个类别共 47 条规则,按影响程度从关键(上下文发现、行为保持)到渐进(语言习惯用法)进行优先级排序。每条规则都包含详细解释、对比错误与正确实现的真实示例以及具体的影响指标。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 | 规则数量 |
|---|---|---|---|---|
| 1 | 上下文发现 | 关键 | ctx- | 4 |
| 2 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 行为保持 |
| 关键 |
behave- |
| 6 |
| 3 | 范围管理 | 高 | scope- | 5 |
| 4 | 控制流简化 | 高 | flow- | 9 |
| 5 | 命名与清晰度 | 中高 | name- | 6 |
| 6 | 重复减少 | 中 | dup- | 5 |
| 7 | 死代码消除 | 中 | dead- | 5 |
| 8 | 语言习惯用法 | 低中 | idiom- | 7 |
ctx-read-claude-md - 简化前务必阅读 CLAUDE.mdctx-detect-lint-config - 检查代码检查和格式化配置ctx-follow-existing-patterns - 匹配文件和项目中现有的代码风格ctx-project-over-generic - 项目约定优先于通用最佳实践behave-preserve-outputs - 保留所有返回值和输出behave-preserve-errors - 保留错误消息、类型和处理方式behave-preserve-api - 保留公共函数签名和类型behave-preserve-side-effects - 保留副作用(日志记录、I/O、状态更改)behave-no-semantics-change - 禁止微妙的语义更改behave-verify-before-commit - 在最终确定前验证行为保持scope-recent-code-only - 仅专注于最近修改的代码scope-minimal-diff - 保持更改小而易于审查scope-no-unrelated-refactors - 不进行无关的重构scope-no-global-rewrites - 避免全局重写和架构更改scope-respect-boundaries - 尊重模块和组件边界flow-early-return - 使用提前返回来减少嵌套flow-guard-clauses - 使用卫语句处理前置条件flow-no-nested-ternaries - 切勿使用嵌套三元运算符flow-explicit-over-dense - 优先使用显式控制流而非密集表达式flow-flatten-nesting - 将深层嵌套扁平化至最多 2-3 层flow-single-responsibility - 每个代码块应只做一件事flow-positive-conditions - 优先使用肯定条件而非双重否定flow-optional-chaining - 使用可选链和空值合并flow-boolean-simplification - 简化布尔表达式name-intention-revealing - 使用揭示意图的名称name-nouns-for-data - 数据用名词,动作用动词name-avoid-abbreviations - 避免使用晦涩的缩写name-consistent-vocabulary - 在整个项目中保持词汇一致name-avoid-generic - 避免使用通用名称name-string-interpolation - 优先使用字符串插值而非连接dup-rule-of-three - 应用“三次原则”dup-no-single-use-helpers - 避免单一用途的辅助函数dup-extract-for-clarity - 仅在提高清晰度时进行提取dup-avoid-over-abstraction - 宁愿重复也不要过早抽象dup-data-driven - 使用数据驱动模式而非重复的条件判断dead-remove-unused - 删除未使用的代码产物dead-delete-not-comment - 删除代码,切勿注释掉dead-remove-obvious-comments - 删除陈述显而易见内容的注释dead-keep-why-comments - 保留解释“为什么”而非“是什么”的注释dead-remove-todo-fixme - 删除过时的 TODO/FIXME 注释idiom-ts-strict-types - 使用严格类型而非 any(TypeScript)idiom-ts-const-assertions - 使用 const 断言和 readonly(TypeScript)idiom-rust-question-mark - 使用 ? 进行错误传播(Rust)idiom-rust-iterator-chains - 在更清晰时使用迭代器链(Rust)idiom-python-comprehensions - 对简单转换使用推导式(Python)idiom-go-error-handling - 立即处理错误(Go)idiom-prefer-language-builtins - 优先使用语言和标准库内置功能阅读各个参考文件以获取详细解释和代码示例:
| 文件 | 描述 |
|---|---|
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装次数
128
代码仓库
GitHub 星标数
86
首次出现
2026 年 1 月 28 日
安全审计
安装于
opencode118
codex117
gemini-cli117
github-copilot115
cursor108
kimi-cli105
Comprehensive code simplification guide for AI agents and LLMs. Contains 47 rules across 8 categories, prioritized by impact from critical (context discovery, behavior preservation) to incremental (language idioms). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics.
Reference these guidelines when:
| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Context Discovery | CRITICAL | ctx- | 4 |
| 2 | Behavior Preservation | CRITICAL | behave- | 6 |
| 3 | Scope Management | HIGH | scope- | 5 |
| 4 | Control Flow Simplification | HIGH | flow- | 9 |
| 5 | Naming and Clarity | MEDIUM-HIGH | name- | 6 |
| 6 | Duplication Reduction | MEDIUM | dup- | 5 |
| 7 | Dead Code Elimination | MEDIUM | dead- | 5 |
| 8 | Language Idioms | LOW-MEDIUM | idiom- | 7 |
ctx-read-claude-md - Always read CLAUDE.md before simplifyingctx-detect-lint-config - Check for linting and formatting configsctx-follow-existing-patterns - Match existing code style in file and projectctx-project-over-generic - Project conventions override generic best practicesbehave-preserve-outputs - Preserve all return values and outputsbehave-preserve-errors - Preserve error messages, types, and handlingbehave-preserve-api - Preserve public function signatures and typesbehave-preserve-side-effects - Preserve side effects (logging, I/O, state changes)behave-no-semantics-change - Forbid subtle semantic changesscope-recent-code-only - Focus on recently modified code onlyscope-minimal-diff - Keep changes small and reviewablescope-no-unrelated-refactors - No unrelated refactorsscope-no-global-rewrites - Avoid global rewrites and architectural changesscope-respect-boundaries - Respect module and component boundariesflow-early-return - Use early returns to reduce nestingflow-guard-clauses - Use guard clauses for preconditionsflow-no-nested-ternaries - Never use nested ternary operatorsflow-explicit-over-dense - Prefer explicit control flow over dense expressionsflow-flatten-nesting - Flatten deep nesting to maximum 2-3 levelsname-intention-revealing - Use intention-revealing namesname-nouns-for-data - Use nouns for data, verbs for actionsname-avoid-abbreviations - Avoid cryptic abbreviationsname-consistent-vocabulary - Use consistent vocabulary throughoutname-avoid-generic - Avoid generic namesdup-rule-of-three - Apply the rule of threedup-no-single-use-helpers - Avoid single-use helper functionsdup-extract-for-clarity - Extract only when it improves claritydup-avoid-over-abstraction - Prefer duplication over premature abstractiondup-data-driven - Use data-driven patterns over repetitive conditionalsdead-remove-unused - Delete unused code artifactsdead-delete-not-comment - Delete code, never comment it outdead-remove-obvious-comments - Remove comments that state the obviousdead-keep-why-comments - Keep comments that explain why, not whatdead-remove-todo-fixme - Remove stale TODO/FIXME commentsidiom-ts-strict-types - Use strict types over any (TypeScript)idiom-ts-const-assertions - Use const assertions and readonly (TypeScript)idiom-rust-question-mark - Use ? for error propagation (Rust)idiom-rust-iterator-chains - Use iterator chains when clearer (Rust)idiom-python-comprehensions - Use comprehensions for simple transforms (Python)Read individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
128
Repository
GitHub Stars
86
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode118
codex117
gemini-cli117
github-copilot115
cursor108
kimi-cli105
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
48,300 周安装
基因富集与通路分析工具 | ORA/GSEA分析 | GO/KEGG/Reactome富集
124 周安装
飞书 CLI 画板工具:JSON 精排绘图与 Mermaid/PlantUML 图表导入,自动化架构图与流程图生成
124 周安装
Angular专家指南:现代Signals、独立组件、无Zone应用与SSR/水合技术
124 周安装
YouTube自动化工具:使用Rube MCP与Composio实现视频上传、管理与分析
124 周安装
Python PDF处理全攻略:合并拆分、文本表格提取、PDF创建与OCR识别
124 周安装
Python 报告生成器 | 自动化创建专业数据报告与图表 | 支持 PDF/HTML 输出
124 周安装
behave-verify-before-commitflow-single-responsibilityflow-positive-conditions - Prefer positive conditions over double negativesflow-optional-chaining - Use optional chaining and nullish coalescingflow-boolean-simplification - Simplify boolean expressionsname-string-interpolationidiom-go-error-handlingidiom-prefer-language-builtins - Prefer language and stdlib builtins