/universal:simplifying-codefrom Universal
Refactors existing code to be smaller, clearer, safer, and more idiomatic while preserving behavior. Use for cleanup, deduplication, and local refactoring, not new features or rewrites.
Ships in Universal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run this skill as a disciplined, behavior-preserving cleanup and hardening pass over code that already exists or has just been written. The goal is smaller, clearer, safer, more idiomatic, more reusable, and more maintainable code.
This is not a rewrite license. Prefer deletion, reuse, narrower boundaries, and targeted fixes over new architecture. Expand scope only when the current change cannot be simplified safely without touching adjacent code.
For a simplification review, inspect and report opportunities without editing. Apply fixes only when cleanup or implementation is authorized by the current request or enclosing workflow. Preserve that mode throughout the steps below.
git reset, git checkout --, git clean, force pushes, recursive deletes, or equivalent operations unless the user specifically requested that operation.This skill is deliberately universal. It should not contain detailed rules for any single platform or framework.
At the start of the task, infer the target stack from file extensions, manifests, project files, imports, package managers, test files, and the user's wording. If a more specific skill is available for that stack, compose with it:
Examples of companion-skill areas include mobile platforms, web frameworks, backend runtimes, data systems, game engines, embedded systems, infrastructure-as-code, and security-sensitive domains.
Start by identifying the code that should be reviewed. Use the same baseline surface for all review passes so findings are not biased by later edits.
Run when available:
git status --short
git diff --stat
git diff --name-status
Then choose the surface:
git diff HEAD so staged and unstaged edits are considered together.git diff is acceptable, but still note the changed file list from git status --short.git ls-files --others --exclude-standard; ordinary diffs will not show them.Freeze the initial file list before editing. Expand the surface only for a concrete reason: deleting a duplicated helper, updating necessary call sites, moving a fallback into an existing compatibility layer, or fixing a compile/test error introduced by the cleanup.
Inspect enough context to avoid cargo-cult fixes:
Do not apply a rule merely because it is common elsewhere. Match the host codebase unless the local convention is actively causing the problem being fixed.
Before editing, identify the contracts the changed code appears to rely on:
Use this map to distinguish safe simplification from behavior change.
When a requested proof names an invariant, or a simplification changes an enforcement model or state transition, use verifying-invariants to preserve the relevant boundary with the lightest adequate evidence. Do not turn ordinary cleanup into a proof exercise, refactor, or test-infrastructure project.
Start with behavior preservation, reuse, and cognitive load. Add the concurrency, security, performance, and testing passes when the scoped code implicates those concerns. A requested full audit covers every applicable pass; record a short reason for any exclusion. Keep one frozen surface and consolidate findings before editing. Use independent reviewers only when they add useful evidence within the caller’s delegation and verification rules.
Read the selected pass sections in review-passes before classifying findings.
Classify findings before changing code:
For each skipped real finding, keep a short note explaining why it was not changed. Do not mention speculative findings that proved false unless the user needs to know.
Skip edits in review-only mode and report actionable opportunities instead. When editing:
git diff --check or the repository equivalent before final verification when practical.Choose verification based on the touched files and repository conventions. Prefer documented commands over guesses. Select only checks that add needed evidence; this is not a command sequence. If a focused behavior check already compiles the same dependent graph, do not also run a compile-only command on the unchanged snapshot. Reuse completed evidence from the enclosing workflow.
Choose among:
If no command is obvious, inspect project files to discover one. If discovery is expensive or ambiguous, run the narrowest safe build/test command and report the limitation.
Include the command and result in the final response. Capture verification results separately: the exit status of a compound shell command belongs to its final operation unless earlier statuses were recorded explicitly. If a command fails for an unrelated pre-existing reason, report that separately from issues introduced by the cleanup.
Before finalizing, confirm the compact checklist.
Load only the reference relevant to the current step:
Finish with a concise summary:
If no fixes were needed, say the reviewed surface was already clean and list the verification performed. Do not invent changes, tests, or results.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kylehughes/agent-plugins-for-making-good-software --plugin universal13 skills in this plugin
/brainstorming-design-specsDevelop an implementation-ready design through research and dialogue. Use proactively when product scope, requirements, or engineering tradeoffs remain unresolved; skip specified changes ready to implement./compiling-agent-goalsCompile specs, plans, or issues into bounded agent goal contracts with acceptance evidence and stopping conditions. Use proactively when preparing a persistent-agent handoff; this authors the contract, not the implementation./debugging-root-causesInvestigate bugs, crashes, regressions, and failures via minimal reproduction, competing hypotheses, and discriminating probes. Use proactively for first-pass root-cause diagnosis; skip read-only reviews and stalled escalation briefs./delivering-changesCarry a requested change through implementation, simplification, hardening, and required checks to a PR-ready handoff. Use proactively when the user delegates end-to-end delivery; preserve narrower requests and project checkpoints./designing-documentsOrganize substantive documents for understanding, decisions, action, and lookup. Use when creating, revising, or reviewing document structure, explanations, onboarding, or findability; preserve constrained edits and useful existing structures./designing-verification-strategiesDesign platform-agnostic test and verification strategies: pick test boundaries, write non-vacuous assertions, and control time, I/O, and nondeterminism. Use proactively for test planning and testability; skip formal invariant proofs.Other plugins' skills for the same job