跳到正文
FunCoding

搜索

搜索文档、Skill 和 MCP

simplify-implementation

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.

代码质量与审查1.6kskills/simplify-implementation/SKILL.md

安装

把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。

读取 https://funcoding.ai/skills/codeaholicguy/ai-devkit/simplify-implementation/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

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).
  • Delete or inline before adding: remove dead code, one-caller wrappers, redundant guards, stale tests, and unused configuration first.

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?
  • Apply the existence check to tests and scaffolding: remove stale, duplicate, implementation-detail-only, unused, or no-longer-relevant tests, assertions, and fixtures without unique behavioral coverage.
  • Apply the reader-load test: can a new reader answer where key values come from and what can change them quickly? Count needless layers and hidden mutable state.
  • Assess impact (LOC, dependencies, cognitive load, boundary leakage, scalability blockers).
  1. Apply Readability Principles
  • Apply the readability guide and its "Reading Test".
  • Prefer domain-shaped structures over scattered conditionals when they remove branches, duplicated rules, or invalid states. Do not add an abstraction that only moves code around.
  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.
  • Redesign: Repeated implementation friction, patched branches, or synchronized flags → revisit the model before another local cleanup.
  1. Prioritize and Plan
  • Rank by impact/risk. Present plan with before/after snippets. Request approval.

Red Flags and Rationalizations

RationalizationWhy It's WrongDo Instead
"While I'm here, let me refactor this too"Scope creep breaks thingsOnly simplify what was requested
"This abstraction will help later"Predicted reuse rarely materializesRemove it unless used twice today
"Shorter is simpler"Brevity can hide complexityOptimize for readability, not line count
"I'll add a v2 instead of updating callers"Accumulates dead code and forks the APIModify 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 duplicationReuse only on clean fit; otherwise keep the small duplicate

Validation

  • Preserve meaningful regression, public-contract, and interaction coverage. Update stale tests to intentional behavior; never delete tests merely to make failures pass.
  • 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

相似的 Skill

claude-api
anthropics/skills180k

claude-api

Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).

代码质量与审查

ponytail-review
DietrichGebert/ponytail158k

ponytail-review

Quality review of a change: is the logic right, is it safe, does it hold under real load, is risky code tested, is it fast enough, and is every line needed. Reads the connected code, not only the diff. Each finding is explained in plain English. Use for "review this", "code review", "review the last commit", "review my PR", "is this over-engineered", /ponytail-review.

代码质量与审查

code-review-and-quality
addyosmani/agent-skills103k

code-review-and-quality

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

代码质量与审查

documentation-and-adrs
addyosmani/agent-skills103k

documentation-and-adrs

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

代码质量与审查

code-simplification
addyosmani/agent-skills103k

code-simplification

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

代码质量与审查

understand
Egonex-AI/Understand-Anything86k

understand

Analyze a codebase to produce an interactive knowledge graph for understanding architecture, components, and relationships

代码质量与审查