code-simplifier

Refactors recently modified code for clarity and consistency while preserving functionality.

1|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill code-simplifier-hamzaoui-louai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-simplifier
Source: https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend/tree/main/.opencode/skills/code-simplifier
Command: npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill code-simplifier-hamzaoui-louai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code that works but is hard to read accumulates technical debt: nested ternaries, redundant abstractions, and inconsistent patterns slow down reviews and future changes. This Skill refines recently modified code for clarity and maintainability without altering its behavior. ## Core Features & Use Cases - Behavior-Preserving Refactoring: Simplifies code structure while guaranteeing all original features, outputs, and behaviors remain intact. - Project Standards Enforcement: Applies established conventions such as ES modules, explicit return types, proper React component patterns, and consistent naming. - Complexity Reduction: Eliminates nested ternaries, redundant abstractions, unnecessary nesting, and overly compact one-liners in favor of explicit, readable code. - Use Case: After finishing a feature branch, ask the Skill to review the modified files; it rewrites a nested ternary status expression into a clear function with early returns and splits dense chained array operations into named steps. ## Quick Start Ask the assistant to simplify and clean up the code you just modified in this session without changing its behavior.

Frequently Asked Questions about code-simplifier

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

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

Behavior-preserving refactoring changes only how code is written, not what it does. This Skill reduces nesting, removes redundant abstractions, and rewrites dense expressions into explicit steps while keeping all original outputs and features intact.

How to refactor nested ternary operators in TypeScript?

Replace nested ternaries with a function using early returns or if/else chains, one branch per condition. For example, a chained loading/error/complete ternary becomes a getStatus function with explicit return type and sequential checks.

Does code simplification work with React components?

Yes, it applies React-specific standards such as explicit Props types and proper component patterns. It refines component code for readability while keeping rendering behavior and props contracts unchanged.

When should I not use automated code simplification?

Avoid it when the task requires new features, behavior changes, or broad rewrites of untouched code. The Skill scopes itself to recently modified code and stops to ask for clarification if success criteria or boundaries are unclear.

Can simplifying code make it worse?

Yes, over-simplification can hurt readability by creating overly clever one-liners or merging unrelated concerns. The Skill explicitly avoids dense one-liners and prioritizes explicit, debuggable code over fewer lines.