simplifying-code
Skill43 starsChanged 58 days agoMITView on GitHub
Simplifies, polishes, and declutters code without changing behavior. Use when asked to simplify, clean up, refactor, declutter, remove dead code or AI slop, or improve readability, including analysis-only simplification reports.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- cropsgg/skillstheir own version, first seen May 25, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- cropsgg/skills★ 15same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- agent-native-architectureSkill
- brainstormingSkill
- code-reviewSkill
- cpp-systemsSkill
- c-systemsSkill
- debuggingSkill
- document-reviewSkill
- frontend-designSkill
- git-worktreeSkill
- linux-bash-scriptingSkill
- md-docsSkill
- meta-promptingSkill
- nodejs-backendSkill
- orchestrating-swarmsSkill
- php-laravelSkill
- pinescriptSkill
- planningSkill
- postgresqlSkill
- python-servicesSkill
- react-frontendSkill
- receiving-code-reviewSkill
- reflectSkill
- rust-systemsSkill
- terraformSkill
- test-auditSkill
- verification-before-completionSkill
- writingSkill
- writing-testsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 15 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Before removing a guard for an external hazard, reproduce its precondition and show the hazard is handled.
- Distinctive: line 16
Verify standard-library substitutions on empty, null, no-match, ordering, and zero-value cases.
- Distinctive: line 45
Stop and ask before proceeding when:
- Distinctive: line 54
Only simplify what was requested.
- Distinctive: line 55
Leave unchanged code untouched.
- Distinctive: line 56
Do not bundle unrelated cleanups into one patch.
- Distinctive: line 57
Do not introduce framework-wide patterns while simplifying a small local change
- Distinctive: line 58
Do not replace understandable duplication with opaque utility layers.
- Distinctive: line 59
Keep comments that explain intent, invariants, or non-obvious constraints, and tool directives (carve-outs).
- Distinctive: line 60
If a simplification would make the code harder to understand, skip it
- Distinctive: line 62
When unsure whether a block is dead code, ask instead of deleting
- Distinctive: line 71
No behavior change (same inputs produce same outputs)
- Distinctive: line 80
After applying simplifications, report:
- Distinctive: line 88
Read the relevant reference before implementing or reviewing the matching behavior:
- Distinctive: line 91
When chained with other skills on a shared resolved scope: orchestrated-simplification.md.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Simplifying Code
Working rules
- Preserve behavior, interfaces, side effects, and domain intent; prove any unshipped-shape exception has no consumers outside scope.
- Before removing a guard for an external hazard, reproduce its precondition and show the hazard is handled; otherwise retain it.
- Verify standard-library substitutions on empty, null, no-match, ordering, and zero-value cases.
- For analysis-only requests, identify targets and report proposed simplifications without editing code.
Principles
| Principle | Rule |
| Preserve behavior | Output must do exactly what the input did, with no silent feature additions or removals. Specifically preserve: async/sync boundaries (do not convert sync to async or reverse), error propagation paths (do not alter strategy), logging/telemetry/guards/retries that encode operational intent, and domain-specific steps (do not collapse into generic helpers that hide intent). One carve-out: a shape that existed only in an earlier iteration of the current unshipped scope is not protected behavior. Verify it has no deployed, persisted, public, external, dependent-branch, or in-repo caller outside the resolved scope, and that every required caller update fits inside the edit boundary; otherwise keep the compatibility path. This narrow exemption is about shapes with provably zero consumers; it never licenses removing a guard, which is governed by the evidence bar under AI Slop Removal |
| Explicit over clever | Prefer explicit variables over nested expressions. Readable beats compact |
| Simplicity over cleanliness | Prefer straightforward code over pattern-heavy "clean" code. Three similar lines beat a premature abstraction |
| Surgical changes | Touch only what needs simplifying. Match existing style, naming conventions, and formatting of the surrounding code |
| Surface assumptions | Before changing a block, identify what imports it, what it imports, and what tests cover it. Edit dependents in the same pass |
| Delete before simplifying | Prefer deletion over simplification, simplification over optimization, and optimization over automation. A pass that finds nothing to change is a valid, complete result |
Changing an interface, exported name, persisted format, or path reaches past the import graph. Enumerate the producers, consumers, schemas, fixtures, generators, manifests, scripts and CI recipes, config references, and documents that carry the old identifier, and migrate them in the same pass. Close out by searching for the old identifier: zero hits, or one line accounting for each intentional remainder. Renames rot in the fixture holding the old key and the .env.example entry, neither of which any import graph contains. When the identifier is a public or exported API, Stop Conditions applies first: confirm with the user, then enumerate; the sweep runs unprompted only for internal identifiers.
Process
- Read first: understand the full file and its dependents before changing anything. Apply Chesterton's Fence: when code looks unnecessary but its reason is unclear, check
git blamebefore removing it. First understand the reason, then decide if the reason still applies. - Identify invariants: what must stay the same? Public API, return types, side effects, error behavior
- Identify targets: find the highest-impact simplification opportunities. Impact = readability and maintainability; prioritize: control flow -> naming -> duplication -> data shaping -> types (see Smell -> Fix table)
- Apply in order: control flow → naming → duplication → data shaping → types. Structural changes first, cosmetic last. For analysis-only requests, describe the proposed changes instead of applying them.
- Verify: for applied changes, confirm behavior parity with relevant tests, type checks, and import checks. For analysis-only reports, identify the required checks and available evidence without claiming that proposed changes passed verification.
- Pre-submit scope audit: walk every changed line and ask "does the requested task explicitly require this line?" If no, revert it and list it as a follow-up under Residual Risks. For the pre-edit complement on ambiguous-scope requests ("simplify my project"), see
ia-verification-before-completion's Scope Confirmation gate.
Stop Conditions
Stop and ask before proceeding when:
- Simplification requires changing a public API (function signatures, return types, exports)
- Behavior parity cannot be verified (no tests exist and behavior is non-obvious)
- Code is intentionally complex for domain reasons (performance-critical, protocol compliance)
- Scope implies a redesign rather than a simplification
Constraints
- Only simplify what was requested; do not add features, expand scope, introduce new dependencies, or add speculative configurability or flexibility the request did not ask for
- Leave unchanged code untouched; do not add comments, docstrings, or type annotations to lines that were not simplified
- Do not bundle unrelated cleanups into one patch; each simplification should be a coherent, reviewable unit
- Do not introduce framework-wide patterns while simplifying a small local change
- Do not replace understandable duplication with opaque utility layers; three similar lines are better than a premature abstraction
- Keep comments that explain intent, invariants, or non-obvious constraints, and tool directives (carve-outs). Remove comments that restate obvious code behavior. Fix stale comments only on lines this pass touches.
- If a simplification would make the code harder to understand, skip it
- Watch for over-simplification: inlining too aggressively removes names that gave concepts meaning; combining unrelated logic into one function hides distinct responsibilities; removing abstractions that exist for testability breaks the test suite
- When unsure whether a block is dead code, ask instead of deleting
- For artifacts whose value is self-containment (prompts, skill and agent instructions, per-service configuration, vendored policy files), duplication is cheaper than a shared dependency until edits actually drift. Extract only after coordinated changes have repeatedly gone out of sync, or a real consumer of the shared form exists
Verify
For analysis-only reports, distinguish available evidence from checks required after implementation. Apply the following checks after code changes:
- Tests pass and types check after changes
- No behavior change (same inputs produce same outputs)
- Scope limited to requested files; no drive-by cleanups
- Match test scope to the importer count surfaced in step 1 (Surface assumptions). Zero external importers: scoped tests on the changed paths. One or more external importers, or shared/utility code edited: run tests covering each importer. Run the full suite when the test runner has no path-scoping mechanism.
Output
For analysis-only requests, report each target's location, proposed change, rationale, behavior risk, and required verification. Label proposals as unimplemented.
After applying simplifications, report:
- Scope touched: files and functions modified
- Key simplifications: what changed and why (one line each)
- Verification: tests pass, types check, no behavior change
- Residual risks: assumptions made, areas not touched that may need attention
Task-specific references
Read the relevant reference before implementing or reviewing the matching behavior:
- For identifying smells, removing AI-generated clutter, or eliminating a guard or workaround: simplification-patterns.md.
- When chained with other skills on a shared resolved scope: orchestrated-simplification.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

