Agent skill
code-simplifier
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/code-simplifier-congdon1207-agents-md
SKILL.md
Code Simplifier Skill
Simplify and refine code for clarity, consistency, and maintainability.
Usage
/code-simplifier # Simplify recently modified files
/code-simplifier path/to/file.ts # Simplify specific file
/code-simplifier --scope=function # Focus on function-level simplification
What It Does
- Analyzes code for unnecessary complexity
- Identifies opportunities to simplify without changing behavior
- Applies KISS, DRY, and YAGNI principles
- Preserves all existing functionality
Simplification Targets
- Redundant code paths
- Over-engineered abstractions
- Unnecessary comments (self-documenting code preferred)
- Complex conditionals that can be flattened
- Verbose patterns that have simpler alternatives
Execution
Use the code-simplifier:code-simplifier subagent:
Task(subagent_type="code-simplifier:code-simplifier", prompt="Review and simplify [target files]")
Examples
Before:
function getData() {
const result = fetchData();
if (result !== null && result !== undefined) {
return result;
} else {
return null;
}
}
After:
function getData() {
return fetchData() ?? null;
}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?