AgentSkillsCN

simplifier

当代码需要清理、移除冗余代码、降低复杂度或提升质量时使用,可选择“all”对整个项目进行全方位审计。

SKILL.md
--- frontmatter
name: simplifier
description: Use when code needs cleanup, dead code removal, complexity reduction, or quality improvement, with "all" for project-wide audit

Simplifier

Overview

Dispatch the simplifier agent to cleanup dead code, reduce complexity, and improve code quality. Focuses on Go and JavaScript/TypeScript codebases.

When to Use

  • After implementing features (cleanup pass)
  • After refactoring (dead code check)
  • When code feels too complex
  • When duplication is suspected
  • With "all" for full project quality audit
  • With specific scope for targeted cleanup

Invocation Modes

Default: /simplifier

Scans recent changes for cleanup opportunities.

code
Task tool with subagent_type="simplifier"
prompt: "Review recent code changes for dead code, complexity, and quality issues.
Identify modified files, find cleanup opportunities, suggest simplifications."

Scoped: /simplifier <scope>

Analyzes only the specified scope (file, module, function).

code
Task tool with subagent_type="simplifier"
prompt: "Review and simplify code in: [scope]
Focus only on this area. Find dead code, reduce complexity, improve quality."

Scope examples:

  • /simplifier src/handlers - simplify handlers module
  • /simplifier utils/parser.ts - simplify specific file
  • /simplifier internal/service - simplify Go service package
  • /simplifier UserService - simplify specific class/service

Comprehensive: /simplifier all

Planned, modular code quality audit covering the entire repository.

CRITICAL: Do not skip any aspect. Continue until ALL areas are reviewed.

Execution Flow

  1. Explore repository structure - Identify all code areas
  2. Create TodoWrite plan - One todo item per module/package
  3. Process sequentially - Complete each area before moving to next
  4. Mark progress - Update todos as each section completes

Quality Aspects to Review

Process each area one-by-one:

AspectWhat to Check
Dead importsUnused imports across all files
Dead variablesUnused variables and constants
Dead functionsUnused exported/internal functions
Dead code pathsUnreachable code after returns
Commented codeOld code blocks that should be removed
ComplexityDeeply nested conditionals, long functions
DuplicationRepeated code patterns, copy-paste
Magic valuesHardcoded numbers and strings
NamingUnclear or inconsistent names
PatternsInconsistent coding patterns

Example: Full Audit

code
/simplifier all

Creates todos like:

  • Scan and cleanup src/handlers/
  • Scan and cleanup src/services/
  • Scan and cleanup src/utils/
  • Scan and cleanup src/models/
  • Scan and cleanup internal/
  • Review cross-cutting patterns
  • Generate final quality report

Then dispatches simplifier agent for each area sequentially.

What the Agent Does

  • Detects unused imports, variables, functions
  • Finds unreachable code paths
  • Identifies complexity hotspots
  • Spots duplicated logic
  • Suggests simplifications with before/after code
  • Reports severity (HIGH/MEDIUM/LOW)

Examples

After adding a feature:

code
/simplifier
→ Reviews recent changes, suggests cleanup

Simplify specific module:

code
/simplifier src/services/payment
→ Focuses only on payment service

Simplify a complex function:

code
/simplifier processOrder
→ Analyzes and simplifies the function

Full project audit:

code
/simplifier all
→ Creates plan, systematically reviews every module

Language Focus

LanguageKey Checks
GoUnchecked errors, empty interface abuse, defer in loops, context propagation
JS/TSany abuse, unused hooks deps, mixed async patterns, optional chaining opportunities
PythonMutable defaults, broad exceptions, unused imports