code-simplification

code-simplification is a skill for Claude Code from addyosmani/agent-skills. It costs 51 tokens per session (3,000 once invoked), scanned A, original, MIT.

A guide for making working code easier to read, maintain, and extend without changing what it does.

In plain words
What is it for?
Use it after features work, during code review, or when functions and modules have become difficult to understand.
Why use it?
It removes unnecessary complexity, confusing structure, and duplication that make future changes harder.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions Claude Code.

Part of the agent-skills plugin — 25 skills, 10 commands, 4 agents shipped together

Good fit Use it after features work, during code review, or when functions and modules have become difficult to understand.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/addyosmani/agent-skills/code-simplification
About the project

addyosmani/agent-skills is a collection of reusable workflows, quality checks, commands, and other instructions that guide AI coding agents through software development. It is for developers who want agents to follow consistent engineering practices, and the catalogue entries are its packaged skills, commands, agents, plugins, instructions, and hooks.

addyosmani/agent-skills · 107,397 stars · on GitHub · skills.addy.ie

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add addyosmani/agent-skills --skill code-simplification
Clone the repo
git clone --depth 1 https://github.com/addyosmani/agent-skills

Made for: Claude Code.

Or install agent-skills, the plugin that ships this one along with the rest of its 25 skills, 10 commands, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-simplification

README.md
[![agentmods](https://agentmods.dev/badge/skills/addyosmani/agent-skills/code-simplification/github.svg)](https://agentmods.dev/skills/addyosmani/agent-skills/code-simplification)
Your own site
<a href="https://agentmods.dev/skills/addyosmani/agent-skills/code-simplification"><img src="https://agentmods.dev/badge/skills/addyosmani/agent-skills/code-simplification/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-simplification

Your own site · 80×15
<a href="https://agentmods.dev/skills/addyosmani/agent-skills/code-simplification"><img src="https://agentmods.dev/badge/skills/addyosmani/agent-skills/code-simplification.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,000 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Rogue Agent · line 155
    Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
    Fix: Prevent the skill from modifying its own code, SKILL.md, or configuration files. Treat skill files as read-only at runtime.
  • low Excessive Agency · line 103
    Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.
    Fix: Limit the skill's scope to its documented purpose. Remove instructions that enable the agent to perform actions outside its stated functionality.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.03000
Opus 5.5 $0.00020 $0.01200
Sonnet 5.5 $0.00010 $0.00600
Haiku 4.5 $0.00005 $0.00300

Measured 1mo ago against content hash f0c5ed754057, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-simplification scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

8 near-identical copies found in the catalogue:

skills/code-simplification/SKILL.md · 332 lines

How it starts

The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Simplification

Inspired by the Claude Code Simplifier plugin. 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:

Read the full file on GitHub · 332 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 332 lines · 51 tokens per session scan A f0c5ed754057

Subscribe to this mod's changes

code-simplification is a skill published in the GitHub repository addyosmani/agent-skills (107,397 stars, last pushed 3d ago), licensed MIT. It adds 51 tokens to every session and 3,000 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

review

Fan out parallel read-only reviewers over a diff and consolidate one severity-ranked verdict.

helderberto/agent-skills · 18 tokens

visual-review

Two visual modes — render a PR diff as an HTML page with each hunk annotated by principle, or check a UI change in a real browser (screenshots, console, network). Use for a visual/HTML diff report, "check the UI", or "screenshot before/after". Don't use for text-only feedback (/code-review), unit tests (/tdd), or full…

helderberto/agent-skills · 84 tokens

code-review-and-quality

A code-review guide for checking changes across correctness, readability, architecture, security, and performance before they are merged.

vinvcn/addyosmani-agent-skills-zh · 53 tokens

feedback

Fetch unresolved review comments on a GitHub PR (Copilot and human), verify against the code, classify Address / Skip / Optional / Discuss. Use when asked to triage reviewer feedback, which comments to actually fix, or to sort signal from noise on a PR. Don't use to reply to or resolve threads, or to write a fresh…

helderberto/agent-skills · 75 tokens

doubt-driven-development

A development practice that puts an independent, fresh-context challenge in front of important coding decisions.

vinvcn/addyosmani-agent-skills-zh · 107 tokens

code-simplification

A code-review and refactoring guide for making existing code easier to read while keeping its behavior unchanged. Refactoring means changing how code is organized without changing what it does.

vinvcn/addyosmani-agent-skills-zh · 64 tokens