agentleFS
EasyJoy-TechnologiesEasyJoy-Technologies/openclaw-skills/skills/code-simplify/SKILL.md

code-simplify

Skill1 starsChanged 8 months agoMITView on GitHub

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.

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skill-creator.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

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

    line 12
  2. Distinctive:

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

    line 14
  3. Distinctive:

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

    line 16
  4. Very specific:

    Use sessions_spawn to launch all three agents concurrently.

    line 20
  5. Distinctive:

    Search for existing utilities and helpers that could replace newly written code.

    line 27
  6. Distinctive:

    Wait for all three agents to complete.

    line 56
  7. Distinctive:

    If the user confirms, apply fixes directly

    line 60
  8. Distinctive:

    If a finding is a false positive, note it and move on

    line 61

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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]

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.