simplify

Simplifies code for readability while preserving exact behavior and passing existing tests.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/MDSIXONE/opencode-config --skill simplify-mdsixone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: simplify
Source: https://github.com/MDSIXONE/opencode-config/tree/main/skills/simplify
Command: npx skills add https://github.com/MDSIXONE/opencode-config --skill simplify-mdsixone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working code often accumulates unnecessary complexity—deep nesting, long functions, unclear names, and duplicated logic—that slows down reviews and future maintenance. This Skill provides a disciplined refactoring process that reduces complexity without changing behavior, so cleanup never introduces regressions. ## Core Features & Use Cases - Behavior-Preserving Refactoring: Every change must keep inputs, outputs, side effects, error handling, and edge cases identical, verified against existing tests. - Five Guiding Principles: Preserve behavior, follow project conventions, prefer clarity over cleverness, avoid over-simplification, and scope changes to recently modified code. - Structured Four-Step Process: Understand the code first, identify simplification signals (nested ternaries, boolean flags, dead code), apply changes incrementally with test runs, then verify with a final checklist. - Use Case: After shipping a feature with passing tests, run this Skill to flatten deeply nested conditionals, rename misleading variables, and remove dead code—producing a clean, reviewable diff with zero behavior change. ## Quick Start Ask the agent to simplify the recently modified module using the simplify skill while keeping all tests passing and behavior unchanged.

Frequently Asked Questions about simplify

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

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

Understand the code's responsibility, callers, and edge cases first, then make one simplification at a time and run the relevant tests after each change. Keep a change only if all existing tests pass without modification, confirming behavior is preserved.

When should I simplify code after a feature is complete?▼

Simplify after the feature works and tests pass but the implementation feels heavier than needed, or during code review when readability issues are flagged. Avoid simplifying code you do not yet understand or code about to be rewritten.

What are signs that code needs simplification?▼

Common signals include deep nesting, long functions with mixed responsibilities, nested ternaries, boolean flag arguments, repeated conditionals, misleading names, duplicated logic, dead code, and wrappers that add no value.

Can simplification make code worse instead of better?▼

Yes. Over-simplification inlines away meaningful names, merges unrelated logic, or removes abstractions that support testability. The goal is clarity for a new team member, not fewer lines, so balance readability against compactness.

Should refactoring be mixed with feature work in one change?▼

No. Separate refactoring from feature work whenever possible and scope simplification to recently modified code. This keeps diffs clean and reviewable and avoids unrelated drive-by changes that complicate review.