code-simplification-edho-ferdian

Rewrites working code for clarity through behavior-preserving refactoring gated on passing tests.

2|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/edhoferdian/EEF --skill code-simplification-edho-ferdian-edhoferdian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-simplification-edho-ferdian
Source: https://github.com/edhoferdian/EEF/tree/main/.agents/skills/code-simplification-edho-ferdian
Command: npx skills add https://github.com/edhoferdian/EEF --skill code-simplification-edho-ferdian-edhoferdian

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working code often accumulates complexity — overlong functions, deep nesting, duplicated logic, and speculative abstractions — that makes it hard to read and maintain. This Skill actually rewrites that code for clarity while guaranteeing behavior never changes, rather than just reporting the issues. ## Core Features & Use Cases - Behavior-preserving refactoring: Extracts functions, flattens nesting with guard clauses, consolidates duplicate branches, and collapses unnecessary indirection — always verified against a passing test suite. - Two-direction simplification: Fixes both under-factored code (too long, too nested, duplicated) and over-factored code (just-in-case abstractions, single-implementation interfaces, pointless wrappers). - Safety-net gating: Requires a runnable test suite before any rewrite, or writes characterization tests first; without coverage it limits changes to mechanically-obvious ones only. - Use Case: A user says "sederhanakan kode ini" about a 200-line function with 5-level nesting. The Skill runs the tests, extracts sub-tasks one pattern at a time, verifies green after each change, and reports before/after complexity metrics. ## Quick Start Ask the assistant to simplify or refactor a specific working function or file while keeping its behavior identical, for example by saying "refactor this module to reduce nesting and remove duplication without changing behavior".

Frequently Asked Questions about code-simplification-edho-ferdian

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor code without changing its behavior?

Run the existing test suite first to capture a baseline, then apply one refactoring pattern at a time — extract function, guard clause, or duplication merge — and re-run tests after each change. If no tests exist, write characterization tests that lock in current observable behavior before rewriting.

What is the difference between code simplification and code review?

Code review identifies complexity, duplication, and over-abstraction issues and reports them read-only. Code simplification actually rewrites the working code to fix those issues, gated on a passing test suite so behavior is preserved.

Can I refactor code that has no test coverage?

Only with explicit risk acceptance, and limited to mechanically-obvious changes like pure renames or block extraction without reordering. The safer path is writing characterization tests first to lock in current behavior before any restructuring.

When should I remove an abstraction instead of extracting one?

Remove an abstraction when it has exactly one real caller, adds no behavior of its own, and no second implementation is realistically coming. Keep it when three or more call sites genuinely diverge — collapsing that would create duplication instead.

Why should refactoring not be mixed with bug fixes or features?

Mixing a rewrite with a behavior change makes the diff impossible to review with confidence, since reviewers cannot tell which changes preserve behavior and which alter it. Each simplification pass should be one isolatable, revertable unit of work.