nousresearch/hermes-agent/simplify-code
Claude Code and agent skill by nousresearch/hermes-agent
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Parallel 4-agent cleanup of recent code changes.
Install
npx vskill@latest install nousresearch/hermes-agent/simplify-codeSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Simplify Code — Parallel Review & Cleanup
Review your recent code changes with four focused reviewers running in parallel, aggregate their findings, and apply the fixes worth applying.
This is a cleanup pass, not a bug hunt. You are improving the quality of code that already works — removing duplication, flattening needless complexity, cutting waste, and deepening band-aid fixes. Do not go hunting for correctness bugs here; that's what requesting-code-review is for.
Core principle: Four narrow reviewers beat one broad reviewer. Each one deeply searches the codebase for a single class of problem — reuse, quality, efficiency, altitude — without diluting its attention across all four. They run concurrently, so you pay the latency of one review, not four.
When to Use
Trigger this skill when the user says any of:
- "simplify" / "simplify my changes" / "simplify these changes"
- "review my code" / "review my recent changes" / "clean up my changes"
- "/simplify" (if they're carrying the Claude Code habit over)
Optional modifiers the user may add — honor them:
- Focus: "simplify focus on efficiency" → run only the efficiency reviewer
(or weight the aggregation toward it). Recognized focuses: reuse, quality (also accepts simplification), efficiency, altitude.
- Dry run: "simplify but don't change anything" / "just report" → run the
four reviewers, present findings, apply NOTHING. Ask before applying.
- Scope: "simplify the last commit" / "simplify staged" / "simplify
src/foo.py" → narrow the diff source accordingly (see Phase 1).
Do NOT auto-run this after every edit or tack it onto the end of unrelated tasks. It costs four subagents' worth of tokens — invoke it only when the user explicitly asks.
The Process
Phase 1 — Identify the changes
Capture the diff to review. Pick the source by what the user asked for, in this default order:
If git diff and git diff HEAD are both empty and there's no git repo or no changes, fall back to the files the user explicitly named or that were recently created/edited in this session. If you genuinely can't find any changed code, say so and stop — there's nothing to simplify.
Capture the full diff text. Note its size: if it's very large (say >2000 changed lines), warn the user that four subagents each carrying the full diff will be token-heavy, and offer to scope it down (per-directory, per-commit) before proceeding.
Phase 2 — Launch four reviewers in parallel
Use delegate_task batch mode — pass all four tasks in one tasks array so they run concurrently. Four is the right fan-out for this pattern; it's within the delegation.max_concurrent_children budget on any default install.
No delegation available? If you can't call delegate_task in this context (you're a leaf subagent, delegation is disabled, or the budget is exhausted), do NOT skip the review or drop angles. Work through all four reviewer angles yourself, sequentially, in this context — same search standards, same finding format. Then say clearly in your final summary that this was a single-pass inline review, not the parallel fan-out, so the user knows what actually ran.
Give every reviewer the complete diff (not fragments — cross-file issues hide in the gaps) plus the absolute repo path so they can search the wider codebase. Each reviewer gets terminal, file, and search toolsets (so they can git, read_file, and search_files/grep).
Tell each reviewer to:
- Search the existing codebase for evidence (don't reason from the diff alone).
- Apply Chesterton's Fence: before flagging anything for removal, run
git blame on the line to understand why it exists. If you can't determine the original purpose, mark it confidence: low — don't guess.
- Report findings as structured output with the concrete cost, confidence,
and risk: `` file:line → problem → cost (what's duplicated/wasted/harder to maintain) → suggested fix | confidence: high/medium/low | risk: SAFE/CAREFUL/RISKY `` The cost field forces each finding to justify itself — a finding that can't articulate what the problem actually costs is probably a nit.
- SAFE = proven not to affect behavior (unused imports, commented-out
code, pass-through wrappers). Auto-apply these.
- CAREFUL = improves without changing semantics (rename local variable,
flatten nested ternary, extract helper). Apply with test verification.
- RISKY = may change behavior or breaks public contracts (N+1
restructuring, public API rename, memory lifecycle change). Flag for human review — do NOT auto-apply.
- Skip nits and style-only churn. Only flag things that materially improve
the code.
Pass these four goals (drop any the user's focus excludes):
Reviewer 1 — Code Reuse
Review this diff for code that duplicates functionality already in thecodebase. Search utility modules, shared helpers, and adjacent files(use search_files / grep) for existing functions, constants, or patternsthe new code could call instead of reimplementing. Flag: new functionsthat duplicate existing ones; hand-rolled logic that an existing utilityalready does (manual string/path manipulation, custom env checks, ad-hoctype guards, re-implemented parsing). For each, name the existing thing touse and where it lives.
Reviewer 2 — Code Quality
Review this diff for quality problems. Look for: redundant state (valuesthat duplicate or could be derived from existing state; caches that don'tneed to exist); parameter sprawl (new params bolted on where the functionshould have been restructured); copy-paste-with-variation (near-duplicateblocks that should share an abstraction); leaky abstractions (exposinginternals, breaking an existing encapsulation boundary); stringly-typedcode (raw strings where a constant/enum/registry already exists — check thecanonical registries before flagging); deeply nested conditionals (ternarychains, 3+-level if/else pyramids — flatten with guard clauses, earlyreturns, or a lookup table); AI-generated slop patterns (extracomments restating obvious code like// increment counterabovecount++;unnecessary defensive null-checks on already-validated inputs;as anycasts that bypass the type system; patterns inconsistent with the rest ofthe file). For each, give the concrete refactor.
Reviewer 3 — Efficiency
Review this diff for efficiency problems. Look for: unnecessary work(redundant computation, repeated file reads, duplicate API calls, N+1access patterns); missed concurrency (independent ops run sequentially);hot-path bloat (heavy/blocking work on startup or per-request paths);TOCTOU anti-patterns (existence pre-checks before an op instead of doingthe op and handling the error); memory issues (unbounded growth, missingcleanup, listener/handle leaks; long-lived callbacks or objects built asclosures that capture the whole enclosing scope — everything capturedstays alive as long as the object does, so prefer a small class orexplicit-fields struct that copies only what it needs); overly broad reads(loading whole files when a slice would do); silent failures (empty catchblocks, ignored error returns,except: pass,.catch(() => {})with nohandling, error propagation gaps — these hide bugs and should at minimumlog before swallowing). For each, give the concrete fix and why it'sfaster or safer.
Reviewer 4 — Altitude
Review this diff for changes implemented at the wrong depth — band-aidslayered on top of shared infrastructure instead of fixes to theinfrastructure itself. Signs of a too-shallow fix: a special case added toa generic code path to handle one caller (anif (caller == X)branch, atype check, a magic-value escape hatch); a symptom patched at the callsite while sibling call sites keep the same flaw; a workaround stacked onan earlier workaround; a wrapper added to avoid touching the thing thatactually needs changing; configuration or flags introduced to route arounda broken default instead of fixing the default. For each, identify theunderlying mechanism the change is dodging and describe the deeper fix —generalize the shared path, fix the root default, or fix the whole bugclass — and honestly note when the deeper fix is large enough that itshould be its own task rather than part of this cleanup. Read thesurrounding code andgit blamefirst: what looks like a band-aid issometimes a deliberate boundary (compat shims, staged migrations,vendored-code isolation). Don't flag those.
Phase 3 — Aggregate and apply
Wait for all four to return (batch mode returns them together).
- Merge the findings into one list, deduping where reviewers overlap —
when two findings target the same line or the same underlying mechanism, collapse them into one.
- Discard false positives — you have the most context; you don't have to
argue with a reviewer, just drop weak or wrong suggestions silently.
- Resolve conflicts. Reviewers can disagree (Reviewer 1: "use existing
util X"; Reviewer 3: "X is slow, inline it"). Default resolution order: correctness > the user's stated focus > readability/reuse > micro-perf. Don't apply a perf "fix" that hurts clarity unless the path is genuinely hot. When two suggestions are mutually exclusive and both defensible, pick the one that touches less code and note the alternative.
- Apply in risk-tier order:
- SAFE first (auto-apply): unused imports, commented-out code,
pass-through wrappers, redundant type assertions. Run tests after.
- CAREFUL next (apply with verification, one file at a time): rename
locals, flatten ternaries, extract helpers, consolidate dupes. Run tests after each file. Revert any that break.
- RISKY last (flag for review — do NOT auto-apply): N+1 restructuring,
public API changes, concurrency fixes, error-handling changes. Present each with risk description and test coverage status. Altitude findings usually land here — deepening a fix means touching shared infrastructure, so present the deeper fix and let the user decide whether to do it now or as a follow-up. If the user opted for a dry run, present all three tiers and apply nothing.
- Verify you didn't break anything: run the project's targeted tests for
the touched files (not the full suite), and re-run any linter/type check the repo uses. If a fix breaks a test, revert that one fix and report it.
- Summarize what you changed: a short list of applied fixes grouped by
reviewer category and risk tier, plus any findings you deliberately skipped and why. If you ran inline (no delegation), say so here.
Pitfalls
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 94 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/software-development/simplify-code/SKILL.md
Popularity
- Repository stars
- 238,159
- Repository forks
- 48,445
- 7-day trend score
- 62
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nousresearch/hermes-agent/simplify-code)