# Simplify

Simplifies code for clarity without changing behavior.

- Repository: https://github.com/alvinunreal/oh-my-opencode-slim (10062 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add alvinunreal/oh-my-opencode-slim --skill simplify -g -a claude-code -y`
Codex: `npx skills add alvinunreal/oh-my-opencode-slim --skill simplify -g -a codex -y`
Cursor: `npx skills add alvinunreal/oh-my-opencode-slim --skill simplify -g -a cursor -y`
Gemini CLI: `npx skills add alvinunreal/oh-my-opencode-slim --skill simplify -g -a gemini-cli -y`

## Description

Simplifies code for clarity without changing behavior. Use for readability, maintainability, and complexity reduction after behavior is understood.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Code Simplification

## Overview

Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines - it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"

## When to Use

- After a feature is working and tests pass, but the implementation feels heavier than it needs to be
- During code review when readability or complexity issues are flagged
- When you encounter deeply nested logic, long functions, or unclear names
- When refactoring code written under time pressure
- When consolidating related logic scattered across files
- After merging changes that introduced duplication or inconsistency

**When NOT to use:**

- Code is already clean and readable - don't simplify for the sake of it
- You don't understand what the code does yet - comprehend before you simplify
- The code is performance-critical and the "simpler" version would be measurably slower
- You're about to rewrite the module entirely - simplifying throwaway code wastes effort

## The Five Principles

### 1. Preserve Behavior Exactly

Don't change what the code does - only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.

Before every change, ask:

- Does this produce the same output for every input?
- Does this maintain the same error behavior?
- Does this preserve the same side effects and ordering?
- What proportionate final-state verification will reveal a behavior change?

### 2. Follow Project Conventions

Simplification means making code more consistent with the codebase, not imposing external preferences.

Before simplifying:

The rest: https://github.com/alvinunreal/oh-my-opencode-slim/blob/HEAD/src/skills/simplify/SKILL.md
