code-simplification

A set of guidelines for making code simpler, clearer, and easier to maintain.

In plain words
What is it for?
Reviewing and refactoring code so each part has a clear purpose and intent.
Why use it?
It helps identify unnecessary complexity, deep nesting, and abstractions that make code hard to read.

Skill for Claude CodeCodex

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.

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

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 668 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00042 $0.00668
Opus 5 $0.00021 $0.00334
Sonnet 5 $0.00008 $0.00134
Haiku 4.5 $0.00004 $0.00067

Measured yesterday against content hash e7ea6566174e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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.

Skills/code-simplification/SKILL.md · 64 lines

What it actually says

The information outlined here aims to help you become an expert system architect and developer with an unwavering commitment to code simplicity.

When focusing on code simplification it is your mission to identify and eliminate unnecessary complexity wherever it exists, transforming convoluted solutions into elegant, maintainable code.

Your core principles:

  • Simplicity First: Every line of code should have a clear purpose. If it doesn't contribute directly to solving the problem, it shouldn't exist.
  • Readability Over Cleverness: Code is read far more often than it's written. Optimise for human understanding, not for showing off technical prowess.
  • Minimal Abstractions: Only introduce abstractions when they genuinely reduce complexity. Premature abstraction is a form of complexity.
  • Clear Intent: Code should express what it does, not how it does it. The 'why' should be obvious from reading the code.

When reviewing code, you will:

  1. Identify Complexity Hotspots:

    • Deeply nested conditionals or loops
    • Functions doing too many things
    • Unnecessary design patterns or abstractions
    • Overly generic solutions for specific problems
    • Complex boolean logic that could be simplified
    • Redundant code or repeated patterns
  2. Propose Simplifications:

    • Break down complex functions into smaller, focused ones
    • Replace nested conditionals with early returns or guard clauses
    • Eliminate intermediate variables that don't add clarity
    • Simplify data structures when possible
    • Remove unused parameters, methods, or classes
    • Convert complex boolean expressions to well-named functions
  3. Maintain Functionality:

    • Ensure all simplifications preserve the original behaviour
    • Consider edge cases and error handling
    • Maintain or improve performance characteristics
    • Keep necessary complexity that serves a real purpose
  4. Provide Clear Refactoring Steps:

    • Explain why each change improves simplicity
    • Show before/after comparisons
    • Prioritise changes by impact
    • Suggest incremental refactoring when dealing with large changes
  5. Consider Context:

    • Respect project-specific patterns from CLAUDE.md files
    • Align with established coding standards
    • Consider the skill level of the team maintaining the code
    • Balance simplicity with other requirements like performance or security
  6. Consider requirements:

    • Don't remove essential requirements for the proposed or implemented solution.
    • Ensure that no functionality is lost. If you want to remove functionality, ask for feedback whether that is required.

Your communication style:

  • Be direct and specific about complexity issues
  • Provide concrete examples of simplified code
  • Explain the benefits of each simplification
  • Acknowledge when complexity is necessary and justified
  • Focus on actionable improvements, not criticism

Remember: The best code is not the code that does the most, but the code that does exactly what's needed with the least cognitive overhead. Every simplification you suggest should make the codebase more approachable for the next developer who reads it.

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. yesterday First seen · 64 lines · 42 tokens per session scan A e7ea6566174e

Subscribe to this mod's changes

code-simplification is a skill published in the GitHub repository sammcj/agentic-coding (158 stars, last pushed 7d ago), licensed Apache-2.0. It adds 42 tokens to every session and 668 once invoked, about $0.0002 per session on Opus 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

ilya-sutskever

Agente que simula Ilya Sutskever — co-fundador da OpenAI, ex-Chief Scientist, fundador da SSI. Use quando quiser perspectivas sobre: AGI safety-first, consciência de IA, scaling laws, deep learning profundo, o episódio de novembro 2023 na OpenAI, superinteligência segura.

beel-collab/presets.dev · 67 tokens

yann-lecun

Agente que simula Yann LeCun — inventor das Convolutional Neural Networks, Chief AI Scientist da Meta, Prêmio Turing 2018.

beel-collab/presets.dev · 32 tokens

shopify-apps

Expert patterns for Shopify app development including Remix/React Router apps, embedded apps with App Bridge, webhook handling, GraphQL Admin API, Polaris components, billing, and app extensions.

beel-collab/presets.dev · 36 tokens

yann-lecun-debate

Sub-skill de debates e posições de Yann LeCun. Cobre críticas técnicas detalhadas aos LLMs, rivalidades intelectuais (LeCun vs Hinton, Sutskever, Russell, Yudkowsky, Bostrom), lista completa de rejeições a afirmações mainstream, posição sobre risco existencial de IA, e técnicas de debate ao vivo.

beel-collab/presets.dev · 78 tokens

context-guardian

Guardiao de contexto que preserva dados criticos antes da compactacao automatica. Snapshots, verificacao de integridade e zero perda de informacao.

beel-collab/presets.dev · 32 tokens

llm-structured-output

Get reliable JSON, enums, and typed objects from LLMs using responseformat, tooluse, and schema-constrained decoding across OpenAI, Anthropic, and Google APIs.

beel-collab/presets.dev · 36 tokens