Creator · addyosmani
Last updated · Sep 1, 2026
Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.
Sandbox only
Install targets
Codex install prompt
Install the "code-simplification" agent skill from https://github.com/addyosmani/agent-skills/tree/main/skills/code-simplification. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-code-simplification","task":"Install code-simplification","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
GitHub automation
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/agent-skills --skill code-simplification
Maintenance
fresh
11d since push
Risk
Needs review
Financial research output is not financial advice; require human review before any live investment decision
GitHub quality
90K
95/100 Quality · 78/100 Trust
Coverage tags
Review notes
Financial research output is not financial advice; require human review before any live investment decision · The skill is process-oriented and does not include scripts or commands, which limits direct security risks, but it does not explicitly instruct agents to avoid auto-applying changes or executing code.
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
90K GitHub stars
Repo activity
90K stars, 9.7K forks
Maintenance
11d since push
License
MIT
Install
npx skills add addyosmani/agent-skills --skill code-simplification
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/agent-skills --skill code-simplificationDo not use when
Alternative
168.6K Stars
npx skills add mattpocock/skills --skill code-review
Alternative
40.8K Stars
npx skills add appsmithorg/appsmith
Alternative
175.7K Stars
npx skills add mattpocock/skills --skill implement
Alternative
31.0K Stars
npx skills add vercel-labs/agent-skills --skill vercel-react-best-practices
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20code-simplification%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20code-simplification%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-code-simplification/install
Agent should check
Copy prompt
Task: Use code-simplification in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20code-simplification%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-code-simplification/install
Install command: npx skills add addyosmani/agent-skills --skill code-simplification
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-code-simplification/install
LLM text format
/api/skills/addyosmani-code-simplification/install?format=text
Find alternatives
/api/skills/search?q=code-simplification&limit=3
Agent prompt
Use code-simplification for this task. Review https://www.openagentskill.com/api/skills/addyosmani-code-simplification/install, then install with: npx skills add addyosmani/agent-skills --skill code-simplificationRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-code-simplification
LLM text
/api/registry/manifest/addyosmani-code-simplification?format=text
Install alias
/api/registry/install/addyosmani-code-simplification
Recommend
/api/registry/recommend?task=Use%20code-simplification%20in%20an%20agent%20workflow&limit=3
Agent fit
GitHub automation
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
GitHub automation
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS90K GitHub stars
Stars/forks activity
PASS90K stars, 9.7K forks; issue activity unavailable in current metadata
Recent maintenance
PASS11d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Manage repositories
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Review a branch or diff against repository standards and the originating spec in two independent analysis passes.
Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
Implement work from an approved spec or ticket set, run focused and full tests, invoke code review, and commit the result to the current branch.
React and Next.js performance guidance for writing, reviewing, and refactoring production UI code.
--- name: code-simplification description: Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity. ---
# Code Simplification
> Inspired by the [Claude Code Simplifier plugin](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/code-simplifier/agents/code-simplifier.md). Adapted here as a model-agnostic, process-driven skill for any AI coding agent.
## 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.
``` ASK BEFORE EVERY CHANGE: → 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? → Do all existing tests still pass without modification? ```
### 2. Follow Project Conventions
Simplification means making code more consistent with the codebase, not imposing external preferences. Before simplifying:
``` 1. Read CLAUDE.md / project conventions 2. Study how neighboring code handles similar patterns 3. Match the project's style for: - Import ordering and module system - Function declaration style - Naming conventions - Error handling patterns - Type annotation depth ```
Simplification that breaks project consistency is not simplification — it's churn.
### 3. Prefer Clarity Over Cleverness
Explicit code is better than compact code when the compact version requires a mental pause to parse.
```typescript // UNCLEAR: Dense ternary chain const label = isNew ? 'New' : isUpdated ? 'Updated' : isArchived ? 'Archived' : 'Active';
// CLEAR: Readable mapping function getStatusLabel(item: Item): string { if (item.isNew) return 'New'; if (item.isUpdated) return 'Updated'; if (item.isArchived) return 'Archived'; return 'Active'; } ```
```typescript // UNCLEAR: Chained reduces with inline logic const result = items.reduce((acc, item) => ({ ...acc, [item.id]: { ...acc[item.id], count: (acc[item.id]?.count ?? 0) + 1 } }), {});
// CLEAR: Named intermediate step const countById = new Map<string, number>(); for (const item of items) { countById.set(item.id, (countById.get(item.id) ?? 0) + 1); } ```
### 4. Maintain Balance
Simplification has a failure mode: over-simplification. Watch for these traps:
- **Inlining too aggressively** — removing a helper that gave a concept a name makes the call site harder to read - **Combining unrelated logic** — two simple functions merged into one complex function is not simpler - **Removing "unnecessary" abstraction** — some abstractions exist for extensibility or testability, not complexity - **Optimizing for line count** — fewer lines is not the goal; easier comprehension is
### 5. Scope to What Changed
Default to simplifying recently modified code. Avoid drive-by refactors of unrelated code unless explicitly asked to broaden scope. Unscoped simplification creates noise in diffs and risks unintended regressions.
## The Simplification Process
### Step 1: Understand Before Touching (Chesterton's Fence)
Before changing or removing anything, understand why it exists. This is Chesterton's Fence: if you see a fence across a road and don't understand why it's there, don't tear it down. First understand the reason, then decide if the reason still applies.
``` BEFORE SIMPLIFYING, ANSWER: - What is this code's responsibility? - What calls it? What does it call? - What are the edge cases and error paths? - Are there tests that define the expected behavior? - Why might it have been written this way? (Performance? Platform constraint? Historical reason?) - Check git blame: what was the original context for this code? ```
If you can't answer these, you're not ready to simplify. Read more context first.
### Step 2: Identify Simplification Opportunities
Scan for these patterns — each one is a concrete signal, not a vague smell:
**Structural complexity:**
| Pattern | Signal | Simplification | |---------|--------|----------------| | Deep nesting (3+ levels) | Hard to follow control flow | Extract conditions into guard clauses or helper functions | | Long functions (50+ lines) | Multiple responsibilities | Split into focused functions with descriptive names | | Nested ternaries | Requires mental stack to parse | Replace with if/else chains, switch, or lookup objects | | Boolean parameter flags | `doThing(true, false, true)` | Replace with options objects or separate functions | | Repeated conditionals | Same `if` check in multiple places | Extract to a well-named predicate function |
**Naming and readability:**
| Pattern | Signal | Simplification | |---------|--------|----------------| | Generic names | `data`, `result`, `temp`, `val`, `item` | Rename to describe the content: `userProfile`, `validationErrors` | | Abbreviated names | `usr`, `cfg`, `btn`, `evt` | Use full words unless the abbreviation is universal (`id`, `url`, `api`) | | Misleading names | Function named `get` that also mutates state | Rename to reflect actual behavior | | Comments explaining "what" | `// increment counter` above `count++` | Delete the comment — the code is clear enough | | Comments explaining "why" | `// Retry because the API is flaky under load` | Keep these — they carry intent the code can't express |
**Redundancy:**
| Pattern | Signal | Simplification | |---------|--------|----------------| | Duplicated logic | Same 5+ lines in multiple places | Extract to a shared function | | Dead code | Unreachable branches, unused variables, commented-out blocks | Remove (after confirming it's truly dead) | | Unnecessary abstractions | Wrapper that adds no value | Inline the wrapper, call the underlying function directly | | Over-engineered patterns | Factory-for-a-factory, strategy-with-one-strategy | Replace with the simple direct approach | | Redundant type assertions | Casting to a type that's already inferred | Remove the assertion |
### Step 3: Apply Changes Incrementally
Make one simplification at a time. Run tests after each change. **Submit refactoring changes separately from feature or bug fix changes.** A PR that refactors and adds a feature is two PRs — split them.
``` FOR EACH SIMPLIFICATION: 1. Make the change 2. Run the test suite 3. If tests pass → commit (or continue to next simplification) 4. If tests fail → revert and reconsider ```
Avoid batching multiple simplifications into a single untested change. If something breaks, you need to know which simplification caused it.
**The Rule of 500:** If a refactoring would touch more than 500 lines, invest in automation (codemods, sed scripts, AST transforms) rather than making the changes by hand. Manual edits at that scale are error-prone and exhausting to review.
### Step 4: Verify the Result
After all simplifications, step back and evaluate the whole:
``` COMPARE BEFORE AND AFTER: - Is the simplified version genuinely easier to understand? - Did you introduce any new patterns inconsistent with the codebase? - Is the diff clean and reviewable? - Would a teammate approve this change? ```
If the "simplified" version is harder to understand or review, revert. Not every simplification attempt succeeds.
## Language-Specific Guidance
### TypeScript / JavaScript
```typescript // SIMPLIFY: Unnecessary async wrapper // Before async function getUser(id: string): Promise<User> { return await userService.findById(id); } // After function getUser(id: string): Promise<User> { return userService.findById(id); }
// SIMPLIFY: Verbose conditional assignment // Before let displayName: string; if (user.nickname) { displayName = user.nickname; } else { displayName = user.fullName; } // After const displayName = user.nickname || user.fullName;
// SIMPLIFY: Manual array building // Before const activeUsers: User[] = []; for (const user of users) { if (user.isActive) { activeUsers.push(user); } } // After const activeUsers = users.filter((user) => user.isActive);
// SIMPLIFY: Redundant boolean return // Before function isValid(input: string): boolean { if (input.length > 0 && input.length < 100) { return true; } return false; } // After function isValid(input: string): boolean { return input.length > 0 && input.length < 100; } ```
### Python
```python # SIMPLIFY: Verbose dictionary building # Before result = {} for item in items: result[item.id] = item.name # After result = {item.id: item.name for item in items}
# SIMPLIFY: Nested conditionals with early return # Before def process(data): if data is not None: if data.is_valid(): if data.has_permission(): return do_work(data) else: raise PermissionError("No permission") else: raise ValueError("Invalid data") else: raise TypeError("Data is None") # After def process(data): if data is None: raise TypeError("Data is None") if not data.is_valid(): raise ValueError("Invalid data") if not data.has_permission(): raise PermissionError("No permission") return do_work(data) ```
### React / JSX
```tsx // SIMPLIFY: Verbose conditional rendering // Before function UserBadge({ user }: Props) { if (user.isAdmin) { return <Badge variant="admin">Admin</Badge>; } else { return <Badge variant="default">User</Badge>; } } // After function UserBadge({ user }: Props) { const variant = user.isAdmin ? 'admin' : 'default'; const label = user.isAdmin ? 'Admin' : 'User'; return <Badge variant={variant}>{label}</Badge>; }
// SIMPLIFY: Prop drilling through intermediate components // Before — consider whether context or composition solves this better. // This is a judgment call — flag it, don't auto-refactor. ```
## Common Rationalizations
| Rationalization | Reality | |---|---| | "It's working, no need to touch it" | Working code that's hard to read will be hard to fix when it breaks. Simplifying now saves time on every future change. | | "Fewer lines is always simpler" | A 1-line nested ternary is not simpler than a 5-line if/else. Simplicity is about comprehension speed, not line count. | | "I'll just quickly simplify this unrelated code too" | Unscoped simplification creates noisy diffs and risks regressions in code you didn't intend to change. Stay focused. | | "The types make it self-documenting" | Types document structure, not intent. A well-named function explains *why* better than a type signature explains *what*. | | "This abstraction might be useful later" | Don't preserve speculative abstractions. If it's not used now, it's complexity without value. Remove it and re-add
Decision snapshot
90,428 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for code-simplification, ready for a manual X post.
A practical pick for the next repo task: code-simplification: Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is ha... 90.4K stars https://www.openagentskill.com/skills/addyosmani-code-simplification?ref=x
Listing + install path for code-simplification: https://www.openagentskill.com/skills/addyosmani-code-simplification?ref=x Install: npx skills add addyosmani/agent-skills --skill code-simplification
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-code-simplification?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-code-simplification?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-code-simplification/audit)
[](https://www.openagentskill.com/skills/addyosmani-code-simplification?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Code Review
Review a branch or diff against repository standards and the originating spec in two independent analysis passes.
168.6K StarsAppsmith
Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
40.8K StarsImplement
Implement work from an approved spec or ticket set, run focused and full tests, invoke code review, and commit the result to the current branch.
175.7K StarsVercel React Best Practices
React and Next.js performance guidance for writing, reviewing, and refactoring production UI code.
31.0K StarsPermission surface
filesystem or document access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness