Agent Skillscodeaholicguy/ai-devkit › simplify-implementation

simplify-implementation

GitHub

分析并简化现有代码实现,降低复杂度、提升可维护性与可扩展性。通过先分析后修改的流程,识别冗余逻辑与过度设计,提供提取、合并、解耦等重构方案,在用户批准前不修改代码,优先复用标准库或现有依赖。

skills/simplify-implementation/SKILL.md codeaholicguy/ai-devkit

触发场景

请求简化代码 降低代码复杂度 重构以提高可读性 清理实现细节 提升可维护性 减少技术债务

安装

npx skills add codeaholicguy/ai-devkit --skill simplify-implementation -g -y
更多选项

不安装直接使用

npx skills use codeaholicguy/ai-devkit@simplify-implementation

指定 Agent (Claude Code)

npx skills add codeaholicguy/ai-devkit --skill simplify-implementation -a claude-code -g -y

安装 repo 全部 skill

npx skills add codeaholicguy/ai-devkit --all -g -y

预览 repo 内 skill

npx skills add codeaholicguy/ai-devkit --list

SKILL.md

Frontmatter
{
    "name": "simplify-implementation",
    "description": "AI DevKit · Analyze and simplify existing implementations to reduce complexity, improve maintainability, and enhance scalability. Use when users ask to simplify code, reduce complexity, refactor for readability, clean up implementations, improve maintainability, reduce technical debt, or make code easier to understand."
}

Simplify Implementation Assistant

Reduce complexity with an analysis-first approach before changing code.

Hard Rules

  • Do not modify code until the user approves a simplification plan.
  • Readability over brevity. Some duplication beats the wrong abstraction.
  • Prefer reusing an existing function over introducing a new one — but only if it fits cleanly. Do not force-fit a near-match.
  • Before improving code, ask whether the function, abstraction, dependency, or custom logic needs to exist at all.
  • Prefer platform and standard-library features over custom code or dependencies. Use already-installed dependencies when they cleanly solve the problem; do not add a dependency for logic that is only a few clear lines.
  • For breaking changes: modify in place only when all callers are in-repo and updated in the same change. For public/external APIs, add a new function and deprecate the old one (parallel change).

Workflow

  1. Gather Context
  • Confirm targets, pain points, and constraints (compatibility, API stability, deadlines).
  • Search for past simplification decisions or known constraints: npx ai-devkit@latest memory search --query "<target area>" --tags "simplify"
  1. Analyze Complexity
  • Identify sources (nesting, duplication, coupling, over-engineering, magic values).
  • Run an existence check: can this code be deleted, delegated to the standard library, handled by a native platform feature, enforced by the database, or covered by an existing dependency?
  • Assess impact (LOC, dependencies, cognitive load, scalability blockers).
  1. Apply Readability Principles
  1. Propose Simplifications For each issue, apply a pattern:
  • Extract: Long functions → smaller, focused functions.
  • Consolidate: Duplicate code → shared utilities.
  • Flatten: Deep nesting → early returns, guard clauses.
  • Decouple: Tight coupling → dependency injection, interfaces.
  • Remove: Dead code, unused features, excessive abstractions.
  • Replace: Custom logic → standard-library, native platform, database, or already-installed dependency features.
  • Defer: Premature optimization → measure-first approach.
  1. Prioritize and Plan
  • Rank by impact/risk. Present plan with before/after snippets. Request approval.

Red Flags and Rationalizations

Rationalization Why It's Wrong Do Instead
"While I'm here, let me refactor this too" Scope creep breaks things Only simplify what was requested
"This abstraction will help later" Predicted reuse rarely materializes Remove it unless used twice today
"Shorter is simpler" Brevity can hide complexity Optimize for readability, not line count
"I'll add a v2 instead of updating callers" Accumulates dead code and forks the API Modify in place when callers are in-repo; parallel-change only for external/public APIs
"Existing fn is close enough — I'll bend it to fit" Wrong abstraction is costlier than duplication Reuse only on clean fit; otherwise keep the small duplicate

Validation

  • Verify no regressions, add tests for new helpers, update docs if interfaces changed.

Output Template

  • Target and Context
  • Complexity Analysis
  • Simplification Proposals (prioritized)
  • Recommended Order and Plan
  • Scalability Recommendations
  • Validation Checklist

版本历史

  • d4caf56 当前 2026-07-05 15:22

同 Skill 集合

skills/agent-communication/SKILL.md
skills/agent-management/SKILL.md
skills/changelog/SKILL.md
skills/dev-commit/SKILL.md
skills/dev-design/SKILL.md
skills/dev-implementation/SKILL.md
skills/dev-lifecycle/SKILL.md
skills/dev-planning/SKILL.md
skills/dev-pr/SKILL.md
skills/dev-requirements/SKILL.md
skills/dev-review/SKILL.md
skills/dev-testing/SKILL.md
skills/dev-worktree/SKILL.md
skills/document-code/SKILL.md
skills/memory/SKILL.md
skills/security-review/SKILL.md
skills/structured-debug/SKILL.md
skills/task/SKILL.md
skills/tdd/SKILL.md
skills/technical-writer/SKILL.md
skills/verify/SKILL.md

元信息

文件数
0
版本
d4caf56
Hash
7b3aa657
收录时间
2026-07-05 15:22

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-14 11:13
浙ICP备14020137号-1 $访客地图$