AgentSkillsCN

simplisticate

V1.0——识别代码中的复杂性,并结合风险评估提出针对性的简化方案。适用于降低代码复杂度的场景。

SKILL.md
--- frontmatter
name: simplisticate
description: V1.0 - Identifies complexity in code and proposes targeted simplifications with risk assessment. Use when reducing code complexity.
license: MIT

Simplisticate

"Simplisticate" — The art of making complex things simple.

Core Philosophy

  • Less is more: Fewer lines, dependencies, abstractions — when appropriate.
  • Clarity over cleverness: Code should be obvious, not impressive.
  • Pragmatic simplicity: Simplify where it adds value, not for the sake of it.

Workflow

1. Identify Target

With user hint: Focus on specified area, explore related code. No hint: Scan for complexity, rank by impact, present top candidates.

2. Complexity Signals

SignalDescription
Deep nesting>3 levels of indentation
Long methodsFunctions >30 lines
Too many parameters4+ parameters
Excessive abstractionsInterfaces with single implementations
Duplicated logicSimilar code in multiple places
Complex conditionalsNested if/else, long switches
Over-engineeringPatterns where simpler solutions exist
Dead codeUnused variables, methods, files
Tangled dependenciesCircular or convoluted chains
Magic valuesHardcoded numbers/strings

3. Propose Simplification

Present findings with:

  1. What: Description of complexity
  2. Where: Exact location(s)
  3. Why: Impact on readability/maintainability
  4. Proposed change: Specific approach
  5. Risk assessment: See below

4. Risk Assessment (MANDATORY)

LevelDescriptionAction
🟢 LowCosmetic/isolated, no functional impactUser acknowledgment
🟡 MediumTouches shared code or slight behavior changeUser approval + testing
🔴 HighStructural change, affects multiple componentsUser approval + comprehensive testing

Evaluate: Test coverage, usage scope, breaking changes, behavioral changes, rollback difficulty.

5. Wait for User Decision

STOP AND WAIT — Never change code without approval.

Present options:

  1. Approve — Proceed with simplification
  2. Refine — Modify approach (request feedback)
  3. Reject — Skip this simplification
  4. Explore more — Find other candidates

6. Execute (After Approval Only)

  • Implement simplification
  • Verify no breakage
  • Summarize changes
  • Offer to find next target

Simplification Techniques

TechniqueWhen to Use
Extract methodLong functions with logical sections
Inline methodTrivial methods adding no clarity
Replace conditional with polymorphismComplex type-based switching
Simplify conditionalNested/complex boolean logic
Remove dead codeUnused variables, methods, imports
Consolidate duplicatesRepeated logic patterns
Flatten nestingEarly returns, guard clauses
Use language featuresModern syntax improving clarity
Reduce parametersParameter objects, builders
Remove unnecessary abstractionSingle-use interfaces

Output Format

text
**Location**: `{file}` (lines {start}-{end})

**Complexity Found**: 
- {bullet points}

**Proposed Simplification**:
1. {numbered steps}

**Risk Assessment**: {🟢|🟡|🔴} {Level}
- Test coverage: {status}
- Usage scope: {description}
- Breaking changes: {yes/no + detail}
- Recommendation: {action}

**Your Options:**
1. Approve
2. Refine
3. Reject
4. Explore more

"Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away." — Antoine de Saint-Exupéry