Skip to content

Commit 7fb001f

Browse files
committed
simplifier polish
1 parent 4e7939f commit 7fb001f

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

  • agents/paulirish-skills/skills/code-simplifier

agents/paulirish-skills/skills/code-simplifier/SKILL.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: code-simplifier
3-
description: Installs and runs the Code Simplifier subagents (Code Reuse Reviewer, Code Quality Reviewer, and Efficiency Reviewer) to review and clean up code changes. Trigger this skill when the user asks to "simplify code", "run code simplifier", "review changes for quality", or "setup review agents".
3+
description: Installs and runs the Code Simplifier subagents for Gemini CLI (Code Reuse Reviewer, Code Quality Reviewer, and Efficiency Reviewer) to review and clean up code changes. Trigger this skill when the user asks to "simplify code", "run code simplifier", "review changes for quality", or "setup review agents".
44
---
55

66
# Code Simplifier Skill
@@ -9,12 +9,7 @@ When triggered, perform the following steps to execute a code simplification rev
99

1010
## Phase 1: Installation & Setup
1111

12-
1. **Check Dependencies**: You must install three review subagents in the project's `.gemini/agents/` directory (or user-level `~/.gemini/agents/` if requested).
13-
Ensure the following files are created:
14-
- `.gemini/agents/code-reuse-reviewer.md`
15-
- `.gemini/agents/code-quality-reviewer.md`
16-
- `.gemini/agents/efficiency-reviewer.md`
17-
12+
1. **Check Dependencies**:
1813
Ensure the `.gemini/settings.json` file in the project directory has `experimental.enableAgents` set to `true`:
1914
```json
2015
{
@@ -24,15 +19,18 @@ When triggered, perform the following steps to execute a code simplification rev
2419
}
2520
```
2621

22+
You must ensure the three review subagents are installed in the project's `.gemini/agents/` directory:
23+
- `.gemini/agents/code-reuse-reviewer.md`
24+
- `.gemini/agents/code-quality-reviewer.md`
25+
- `.gemini/agents/efficiency-reviewer.md`
26+
2727
2. **Create the Agents (If Missing)**: Use the `write_file` tool to create them if they do not exist:
28-
28+
2929
**Code Reuse Reviewer** (`.gemini/agents/code-reuse-reviewer.md`):
3030
```markdown
3131
---
3232
name: code_reuse_reviewer
3333
description: Reviews code changes to identify opportunities for reusing existing utilities and helpers.
34-
kind: local
35-
model: inherit
3634
---
3735
For each change:
3836
1. Search for existing utilities and helpers that could replace newly written code. Use grep_search to find similar patterns elsewhere in the codebase — common locations are utility directories, shared modules, and files adjacent to the changed ones.
@@ -45,8 +43,6 @@ When triggered, perform the following steps to execute a code simplification rev
4543
---
4644
name: code_quality_reviewer
4745
description: Reviews code changes for hacky patterns, redundant state, parameter sprawl, and leaky abstractions.
48-
kind: local
49-
model: inherit
5046
---
5147
Review the changes for hacky patterns:
5248
1. Redundant state: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls
@@ -61,8 +57,6 @@ When triggered, perform the following steps to execute a code simplification rev
6157
---
6258
name: efficiency_reviewer
6359
description: Reviews code changes for efficiency, unnecessary work, missed concurrency, and memory leaks.
64-
kind: local
65-
model: inherit
6660
---
6761
Review the changes for efficiency:
6862
1. Unnecessary work: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
@@ -73,11 +67,15 @@ When triggered, perform the following steps to execute a code simplification rev
7367
6. Overly broad operations: reading entire files when only a portion is needed, loading all items when filtering for one
7468
```
7569

76-
3. **Prompt for Refresh**: If you installed any files or modified settings in step 2, tell the user they must run the `/agents refresh` command to load the new agents. **Stop execution here and wait for the user to run the command.** Inform them they should ask to run the review again after refreshing.
70+
3. **Prompt for Refresh**: If you installed any files or modified settings in step 2, tell the user they must run the `/agents refresh` command to load the new agents. **Stop execution here and wait for the user to run the command.**
7771

7872
## Phase 2: Execution
7973

80-
4. **Review Changes**: Once the agents are available, run the review process. The user should specify what changes to review.
74+
4. **Identify Target**: Determine the specific code changes to review based on the user's request (e.g., a specific file, uncommitted changes, or a git diff). Ask them to specify what to review if they haven't already.
8175
5. **Parallel Invocation**: Invoke all three agents (`code_reuse_reviewer`, `code_quality_reviewer`, `efficiency_reviewer`) in parallel using their respective tools. Pass each agent the full context or diff of the changes to review.
82-
6. Aggregation and Fix: Wait for all three agents to complete. Aggregate their findings and fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on — do not argue with the finding, just skip it.
76+
6. **Aggregation and Fix**: Wait for all three agents to complete. Aggregate their findings and fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on — do not argue with the finding, just skip it.
77+
78+
79+
---
8380

81+
Attribution: The overall technique here was adapted from Claude Code's `/simplify` command, introduced in Feb 2026.

0 commit comments

Comments
 (0)