From aura-frog
Detects and simplifies overly complex code using KISS principle. Flattens deep nesting (>3 levels), extracts long functions (>30 lines), reduces cyclomatic complexity (≤10), and applies simplification checklist.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aura-frog:code-simplifierThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Category:** Code Quality
Category: Code Quality
Rule Reference: rules/core/simplicity-over-complexity.md
Detect and simplify overly complex code. Apply KISS principle (Keep It Simple, Stupid).
Philosophy: The best code is code you don't have to write. Less is more.
Full Guide: Read rules/core/simplicity-over-complexity.md for comprehensive patterns and examples.
| Signal | Action |
|---|---|
| Deep nesting (>3 levels) | Flatten with early returns |
| Long function (>30 lines) | Extract smaller functions |
| Complex conditionals | Use lookup tables |
| Over-abstraction | Inline single-use code |
| Premature optimization | Remove unless profiled |
| Metric | Target |
|---|---|
| Cyclomatic complexity | ≤10 |
| Nesting depth | ≤3 |
| Function length | ≤30 lines |
| File length | ≤300 lines |
| Parameters | ≤3 |
Before writing or reviewing code, ask:
| Command | Purpose |
|---|---|
simplify <file> | Analyze and simplify a file |
simplify:check | Check complexity metrics |
quality:complexity | Full complexity report |
User: This function is too complex, simplify it
Claude: Let me analyze the complexity...
Complexity Analysis:
- Cyclomatic complexity: 15 (target: ≤10)
- Nesting depth: 5 (target: ≤3)
- Lines: 87 (target: ≤30)
Simplification Plan:
1. Convert nested ifs to early returns (-3 nesting)
2. Extract validation logic to separate function (-20 lines)
3. Replace switch with lookup table (-15 lines, -5 complexity)
4. Remove unused error handling branch
Applying changes...
Result:
- Cyclomatic complexity: 6 ✓
- Nesting depth: 2 ✓
- Lines: 28 ✓
rules/core/simplicity-over-complexity.mdcommands/quality/complexity.mdcommands/refactor.mdskills/code-reviewer/SKILL.mdRemember: Simple code is not dumb code. It takes skill to write simple code.
npx claudepluginhub nguyenthienthanh/aura-frog --plugin aura-frogReviews code for unnecessary complexity and guides simplification using cyclomatic complexity, nesting depth, and readability thresholds. Useful during code reviews or refactoring.
Simplifies code for clarity by reducing complexity while preserving exact behavior. Use when refactoring functional but hard-to-read code, during reviews, or for maintenance.
Analyzes and simplifies existing implementations to reduce complexity, improve maintainability, and enhance scalability. Use when users ask to simplify code, reduce complexity, refactor for readability, or reduce technical debt.