Code simplifier

From OpenHands/extensions · View interactive version

Code simplifier is an AI agent skill from the GitHub repository OpenHands/extensions. Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Analyzes recently modified code across three dimensions - code reuse, code quality, and efficiency - and provides actionable improvement suggestions. This skill should be used when the user

How to use this skill

Skill file

Code Simplifier

Analyze recently modified code and suggest refinements that improve clarity, consistency, and maintainability - without changing what the code does. The review covers three complementary aspects:

  1. Code Reuse - Eliminate duplication, consolidate shared logic, leverage existing utilities.
  2. Code Quality - Improve naming, reduce complexity, enforce project standards from AGENTS.md.
  3. Efficiency - Fix algorithmic issues, remove unnecessary work, optimize resource usage.

Review Process

Identify the Scope

By default, focus on recently modified code. Use git diff or the file list from the current PR/MR to determine the changed files. When the user specifies a different scope, follow their instruction:

Sub-Agent Delegation (Preferred)

When sub-agent capability is available, delegate each review aspect to a separate sub-agent for parallel, focused analysis:

  1. Code Reuse Review Agent - Read references/code-reuse-review.md and analyze the changed files for duplication and consolidation opportunities.
  2. Code Quality Review Agent - Read references/code-quality-review.md and analyze the changed files for clarity, naming, complexity, and standards compliance.
  3. Efficiency Review Agent - Read references/efficiency-review.md and analyze the changed files for performance and resource usage issues.

Each sub-agent should:

After all sub-agents complete, synthesize their findings into a single consolidated report.

Sequential Review (Fallback)

When sub-agents are not available, perform all three reviews sequentially:

  1. Read references/code-reuse-review.md - review for duplication and reuse
  2. Read references/code-quality-review.md - review for clarity and standards
  3. Read references/efficiency-review.md - review for performance and resources

Apply the criteria and output format from each reference document.

Guiding Philosophy

Consolidated Output Format

Present the combined results from all three review aspects:

## Code Simplification Review

### Scope
[List of files reviewed and how scope was determined]

### Code Reuse
[Findings from the reuse review, using **[REUSE]** tags]

### Code Quality
[Findings from the quality review, using **[QUALITY]** tags]

### Efficiency
[Findings from the efficiency review, using **[EFFICIENCY]** tags]

### Summary
[Overall assessment: is the code in good shape, or does it need significant refinement?]
[Prioritized list of the most impactful changes to make first]

When a review aspect has no findings, include it with an explicit "no issues found" statement rather than omitting the section.

Reference Files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.