
code-simplifier
Simplify and clean up code after changes are complete. Reduces complexity, improves readability, and ensures consistency.
- Installs
- 75
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/meleantonio/awesome-econ-ai-stuff --skill code-simplifier- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads code-simplifier automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Code Simplifier
Clean up and simplify code after making changes.
When to Use
Run this skill after completing a feature or fix to ensure the code is clean, readable, and maintainable.
Simplification Goals
Reduce Complexity
- Break long functions into smaller, focused ones
- Reduce nesting depth (max 3 levels)
- Simplify complex conditionals
- Extract magic numbers to named constants
Improve Readability
- Use descriptive variable and function names
- Add clarifying comments for non-obvious logic
- Ensure consistent formatting
- Remove unnecessary comments
Apply Pythonic Patterns
- Use list/dict/set comprehensions where appropriate
- Use
withstatements for resource management - Use
enumerate()instead of manual indexing - Use
zip()for parallel iteration - Use f-strings for formatting
- Use
pathlibfor file paths
Clean Up
- Remove unused imports
- Remove unused variables
- Remove commented-out code
- Remove redundant code paths
- Consolidate duplicate logic
Workflow
-
Identify Changed Files
- Focus on files modified in the current session
- Or specify files/directories as arguments
-
Analyze Each File
- Check for simplification opportunities
- Prioritize high-impact improvements
-
Apply Simplifications
- Make incremental changes
- Preserve original behavior
- Run tests after each change
-
Format and Lint
- Run
ruff format . - Run
ruff check --fix .
- Run
-
Verify
- Run tests:
pytest - Ensure behavior unchanged
- Run tests:
Arguments
Optionally specify files or directories to simplify.
Usage:
/code-simplifier- Simplify recently changed files/code-simplifier src/module.py- Simplify specific file/code-simplifier src/- Simplify entire directory
Example Transformations
Before:
result = []
for i in range(len(items)):
if items[i].is_valid == True:
result.append(items[i].value)
After:
result = [item.value for item in items if item.is_valid]
Before:
if x != None:
if y != None:
if z != None:
process(x, y, z)
After:
if all(v is not None for v in (x, y, z)):
process(x, y, z)
FAQ
What does the code-simplifier skill do?
Simplify and clean up code after changes are complete. Reduces complexity, improves readability, and ensures consistency.
How do I install code-simplifier?
Run npx skills add https://github.com/meleantonio/awesome-econ-ai-stuff --skill code-simplifier in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/code-simplifier/ (personal) or .claude/skills/code-simplifier/ (project).
Which AI agents can use code-simplifier?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is code-simplifier safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains code-simplifier?
It is published by meleantonio in meleantonio/awesome-econ-ai-stuff. It has 75 recorded installs.
More from meleantonio/awesome-econ-ai-stuff
academic-paper-writer
meleantonio/awesome-econ-ai-stuff
Draft economics papers with proper structure and academic style
stata-regression
meleantonio/awesome-econ-ai-stuff
Run regression analyses in Stata with publication-ready output tables.
stata-data-cleaning
meleantonio/awesome-econ-ai-stuff
Clean and transform messy data in Stata with reproducible workflows
r-econometrics
meleantonio/awesome-econ-ai-stuff
Run IV, DiD, and RDD analyses in R with proper diagnostics
beamer-presentation
meleantonio/awesome-econ-ai-stuff
Create academic presentations in Beamer with professional themes
lit-review-assistant
meleantonio/awesome-econ-ai-stuff
Search, summarize, and synthesize economics literature
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.