code-simplification

code-simplification is a skill for Claude Code from lgbarn/shipyard. It costs 88 tokens per session (2,842 once invoked), scanned A, original, MIT.

A review guide for reducing unnecessary complexity in code, such as duplication, deep nesting, oversized functions, and one-use abstractions.

In plain words
What is it for?
Use it after implementation or during code review to find repeated patterns, remove dead code, and simplify working solutions.
Why use it?
It helps make code easier to read, maintain, and review after features or multiple generated changes have been added.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the shipyard plugin — 25 skills, 25 commands, 20 agents, 6 hooks shipped together

Good fit Use it after implementation or during code review to find repeated patterns, remove dead code, and simplify working solutions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lgbarn/shipyard/code-simplification
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 lgbarn/shipyard --skill code-simplification
Clone the repo
git clone --depth 1 https://github.com/lgbarn/shipyard

Made for: Claude Code.

Or install shipyard, the plugin that ships this one along with the rest of its 25 skills, 25 commands, 20 agents, 6 hooks.

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/lgbarn/shipyard/code-simplification/github.svg)](https://agentmods.dev/skills/lgbarn/shipyard/code-simplification)
Your own site
<a href="https://agentmods.dev/skills/lgbarn/shipyard/code-simplification"><img src="https://agentmods.dev/badge/skills/lgbarn/shipyard/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/lgbarn/shipyard/code-simplification"><img src="https://agentmods.dev/badge/skills/lgbarn/shipyard/code-simplification.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,842 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
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, 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 Prompt Injection · line 6
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
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.00088 $0.02842
Opus 5.5 $0.00035 $0.01137
Sonnet 5.5 $0.00018 $0.00568
Haiku 4.5 $0.00009 $0.00284

Measured 6d ago against content hash f5a201ba7cdc, 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 6d 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.

plugins/shipyard/skills/code-simplification/SKILL.md · 410 lines

How it starts

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

Code Simplification

When This Skill Activates

  • After all tasks in a phase are complete (before shipping)
  • When reviewing code generated by multiple builder agents
  • When a file has been touched by 3+ different tasks
  • When you notice patterns repeating across files
  • Before claiming a phase is production-ready

The simplifier agent references this skill for systematic cross-task analysis.

Natural Language Triggers

  • "simplify this", "clean up", "too complex", "reduce complexity", "this is bloated"

Overview

AI-generated code accumulates complexity. Each task is implemented in isolation by a fresh agent that can't see the full picture. After multiple tasks, duplication creeps in, abstractions multiply, and dead code lingers.

Core principle: The simplest code that works correctly is the best code. Complexity is a cost, not a feature.

This skill applies after implementation, not during. Don't prematurely optimize -- but don't ship bloat either.

Simplification Process

When reviewing code for simplification:

  1. Identify scope: What files changed in this phase? (Use git diff)
  2. Scan for duplication: Look for similar patterns across files
  3. Check complexity: Flag functions exceeding thresholds
  4. Find dead code: Look for unused definitions
  5. Spot over-engineering: Look for abstractions with single implementations
  6. Check AI patterns: Apply the AI anti-pattern checklist
  7. Prioritize findings:
    • High: Clear duplication (3+), dead code, obvious bloat
    • Medium: Complexity reduction, near-duplicates
    • Low: Style consistency, minor simplifications

Duplication Detection

What to Look For

Exact duplicates: Identical code blocks in different files or functions.

# RED FLAG: Same logic in two places
def validate_user_email(email):
    if not email or "@" not in email:
        raise ValueError("Invalid email")

def validate_contact_email(email):
    if not email or "@" not in email:
        raise ValueError("Invalid email")

Read the full file on GitHub · 410 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. 6d ago Changed · +2 tokens per session f5a201ba7cdc
  2. 1mo ago First seen · 410 lines · 86 tokens per session scan A 76ab193ee929

Subscribe to this mod's changes

code-simplification is a skill published in the GitHub repository lgbarn/shipyard (65 stars, last pushed 6d ago), licensed MIT. It adds 88 tokens to every session and 2,842 once invoked, about $0.0004 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.