Openclaw-skills code-simplify

Review code changes for reuse opportunities, quality issues, and efficiency problems, then fix issues found. Triggers on phrases like "simplify", "review my changes", "check code quality", "audit this code", "clean up changes", "review the diff". Use after making code changes to catch duplicated logic, hacky patterns, performance issues, and unnecessary complexity before committing.

install
source · Clone the upstream repo
git clone https://github.com/EasyJoy-Technologies/openclaw-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/code-simplify" ~/.claude/skills/easyjoy-technologies-openclaw-skills-code-simplify && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/code-simplify" ~/.openclaw/skills/easyjoy-technologies-openclaw-skills-code-simplify && rm -rf "$T"
manifest: skills/code-simplify/SKILL.md
source content

Code Simplify — Three-Way Parallel Code Review

Review all changed files for reuse, quality, and efficiency. Fix any issues found.

Phase 1: Identify Changes

Run

git diff
in the project directory (or
git diff HEAD
if there are staged changes) to see what changed.

If there are no git changes, review the most recently modified files that the user mentioned or that were edited earlier in this conversation.

If a specific file or directory was provided as argument, focus the review there.

Phase 2: Launch Three Review Agents in Parallel

Use

sessions_spawn
to launch all three agents concurrently. Pass each agent the full diff so it has the complete context.

Agent 1: Code Reuse Review

Prompt the agent with the diff and these instructions:

For each change:

  1. Search for existing utilities and helpers that could replace newly written code. Look for similar patterns elsewhere in the codebase — common locations are utility directories, shared modules, and files adjacent to the changed ones.
  2. Flag any new function that duplicates existing functionality. Suggest the existing function to use instead.
  3. Flag any inline logic that could use an existing utility — hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns.

Agent 2: Code Quality Review

Review the same changes for hacky patterns:

  1. Redundant state: state that duplicates existing state, cached values that could be derived
  2. Parameter sprawl: adding new parameters instead of generalizing or restructuring
  3. Copy-paste with slight variation: near-duplicate code blocks that should be unified
  4. Leaky abstractions: exposing internal details that should be encapsulated
  5. Stringly-typed code: raw strings where constants, enums, or typed values already exist
  6. Unnecessary comments: comments explaining WHAT (well-named identifiers already do that) — keep only non-obvious WHY

Agent 3: Efficiency Review

Review the same changes for efficiency:

  1. Unnecessary work: redundant computations, repeated file reads, duplicate API calls, N+1 patterns
  2. Missed concurrency: independent operations run sequentially when they could run in parallel
  3. Hot-path bloat: blocking work added to startup or per-request hot paths
  4. Recurring no-op updates: updates that fire unconditionally — add change-detection guards
  5. Unnecessary existence checks: pre-checking file/resource existence before operating (TOCTOU anti-pattern)
  6. Memory: unbounded data structures, missing cleanup, event listener leaks
  7. Overly broad operations: reading entire files when only a portion is needed

Phase 3: Aggregate and Fix

Wait for all three agents to complete. Aggregate their findings into a single report:

  1. Group findings by severity: 🔴 Critical / 🟡 Improvement / 🟢 Suggestion
  2. For each finding: file, line range, issue, recommended fix
  3. If the user confirms, apply fixes directly
  4. If a finding is a false positive, note it and move on

Output Format

## Code Review Summary

### 🔴 Critical (N issues)
- [file:line] Issue description → Fix

### 🟡 Improvements (N issues)
- [file:line] Issue description → Fix

### 🟢 Suggestions (N issues)
- [file:line] Issue description → Fix

### ✅ No issues found in: [areas]