Agent skill

Simplify Code

by HezaoHezao in HezaoHezao/poirot

Sequential 3-lens cleanup of recent code changes. An agent skill from HezaoHezao/poirot.

MITAuto-check passedDevelopment

Install Simplify Code

skills CLI
$ npx skills add HezaoHezao/poirot --skill simplify-code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HezaoHezao/poirot simplify-code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HezaoHezao/poirot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/poirot/backend/agents/skill/builtin_skills/core/simplify-code .claude/skills/simplify-code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
simplify-code
GitHub stars
250
Token cost
~2k tokens
SKILL.md length
1,002 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

Sequential 3-lens cleanup of recent code changes. An agent skill from HezaoHezao/poirot.

  • Works in 3 steps: Identify the changes → Run three lenses (sequentially) → Aggregate and apply
  • Tasks that involve Code simplification
  • SKILL.md covers When to Use, The Process, Pitfalls and Related
  • Calls git

What it does

Simplify Code is an agent skill from HezaoHezao/poirot. Sequential 3-lens cleanup of recent code changes.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Code simplification. The repository describes itself as: Poirot is a deep research agent kernel built for those who care about how agents are architected. The licence is MIT.

When your agent uses it

  • Tasks that involve Code simplification

Example prompts

  • “/simplify-code”

Requirements

  • Pre-approved tools (allowed-tools): bash, read_file, str_replace, write_file

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Identify the changes
  2. Run three lenses (sequentially)
  3. Aggregate and apply

What it can do on your machine

Read from SKILL.md and the folder at commit 86bf279. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • bash
    • read_file
    • str_replace
    • write_file

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Simplify Code loads about 2k tokens when it runs. Until then it costs about 16 tokens; SKILL.md has 1,002 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~16
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HezaoHezao/poirot at commit 86bf279, republished under its MIT licence (© HezaoHezao). 1,002 words, ~1,964 tokens.

Download SKILL.mdSave it as .claude/skills/simplify-code/SKILL.md (or your agent's skills folder).
name
simplify-code
description
Sequential 3-lens cleanup of recent code changes.
allowed-tools
bash, read_file, str_replace, write_file
enabled
true
related-skills
requesting-code-review, test-driven-development, plan
license
MIT
author
Adapted from hermes-agent (Nous Research, MIT); inspired by Claude Code /simplify

Simplify Code — Sequential Review & Cleanup

Review your recent code changes with three focused lenses, aggregate findings, and apply the fixes worth applying.

Core principle: Three narrow reviews beat one broad review. Each one deeply searches the codebase for a single class of problem — reuse, quality, efficiency — without diluting attention across all three.

Poirot note: The original skill runs 3 reviewers in parallel via subagent delegation. Poirot has no subagents, so this version runs the 3 lenses sequentially in the same context. The methodology is identical; only the concurrency is lost.

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"

Optional modifiers the user may add — honor them:

  • Focus: "simplify focus on efficiency" → run only the efficiency lens. Recognized focuses: reuse, quality, efficiency.
  • Dry run: "simplify but don't change anything" / "just report" → run the three lenses, present findings, apply NOTHING. Ask before applying.
  • Scope: "simplify the last commit" / "simplify staged" / "simplify src/foo.py" → narrow the diff source accordingly.

Do NOT auto-run this after every edit. Invoke it only when the user asks.

The Process

Phase 1 — Identify the changes

Capture the diff to review. Pick the source by what the user asked for:

bash
# 1. Default: uncommitted working-tree changes (tracked files)
git diff

# 2. If that's empty, include staged changes
git diff HEAD

# 3. Scoped variants:
git diff --staged                 # "staged changes"
git diff HEAD~1                    # "the last commit"
git diff main...HEAD              # "this branch" / "my PR"
git diff -- src/foo.py            # specific file(s)

If git diff and git diff HEAD are both empty, fall back to files the user explicitly named or recently edited in this session. If you can't find any changed code, say so and stop.

Capture the full diff text. Note its size: if >2000 changed lines, warn the user and offer to scope down before proceeding.

Phase 2 — Run three lenses (sequentially)

Each lens gets the complete diff (not fragments — cross-file issues hide in the gaps) plus the repo path so it can search the wider codebase via bash (grep) and read_file.

For each lens:

  • 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.
  • Report findings as structured output:
    file:line → problem → suggested fix | confidence: high/medium/low | risk: SAFE/CAREFUL/RISKY
    • 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. Flag for human review — do NOT auto-apply.
  • Skip nits and style-only churn.

Run these three lenses (skip any the user's focus excludes):

Lens 1 — Code Reuse

Review this diff for code that duplicates functionality already in the codebase. Search utility modules, shared helpers, and adjacent files (use bash grep) for existing functions, constants, or patterns the new code could call instead of reimplementing. Flag: new functions that duplicate existing ones; hand-rolled logic that an existing utility already does. For each, name the existing thing to use and where it lives.

Lens 2 — Code Quality

Review this diff for quality problems. Look for: redundant state; parameter sprawl; copy-paste-with-variation; leaky abstractions; stringly-typed code (raw strings where a constant/enum exists); AI-generated slop patterns (extra comments restating obvious code, unnecessary defensive null-checks, as any casts). For each, give the concrete refactor.

Lens 3 — Efficiency

Review this diff for efficiency problems. Look for: unnecessary work (redundant computation, repeated file reads, N+1 access); missed concurrency; hot-path bloat; TOCTOU anti-patterns; memory issues (unbounded growth, missing cleanup); overly broad reads; silent failures (empty catch blocks, except: pass). For each, give the concrete fix and why it's faster/safer.

Show full SKILL.md (419 more words)Show less
Phase 3 — Aggregate and apply
  1. Merge the findings into one list, deduping where lenses overlap.
  2. Discard false positives — you have the most context; drop weak or wrong suggestions silently.
  3. Resolve conflicts. 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.
  4. Apply in risk-tier order:
    • SAFE first (auto-apply): unused imports, commented-out code, pass-through wrappers. 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. Present each with risk description and test coverage status. If the user opted for a dry run, present all three tiers and apply nothing.
  5. Verify you didn't break anything: run the project's targeted tests for the touched files, and re-run any linter/type check the repo uses. If a fix breaks a test, revert that one fix and report it.
  6. Summarize what you changed: a short list of applied fixes grouped by lens and risk tier, plus any findings you deliberately skipped and why.

Pitfalls

  • Give the WHOLE diff to each lens. Splitting the diff defeats the design — cross-file duplication and N+1s only show up with the full picture.
  • Lenses search, they don't guess. A reuse finding with no pointer to the existing utility is noise. Require file:line evidence; drop findings that lack it.
  • Apply ≠ rewrite. This is cleanup of the user's recent changes, not a license to refactor the whole module. Keep edits scoped to what the diff touched plus the minimal surrounding change a fix requires.
  • Respect project conventions. If the repo has AGENTS.md / CLAUDE.md or a linter config, fold those rules into the lens prompts so suggestions match house style.
  • Large diffs blow context. If the diff is huge, scope it down before reviewing — a 5000-line diff may truncate.
  • Over-trusting dead code tools. knip, ts-prune, depcheck flag exports that ARE used dynamically. Always grep for the symbol name before removing — a clean tool report is not proof.
  • Renaming without checking public contracts. Export names, API route paths, DB column names, config keys are contracts. Tag public-contract changes as RISKY; never auto-rename them.
  • Removing "unnecessary" error handling. An empty catch block might be intentional. Flag it, don't remove it; let the human decide.

Use requesting-code-review for the pre-commit security/quality gate. This skill is the standalone after-the-fact cleanup pass.

© HezaoHezao, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in poirot/backend/agents/skill/builtin_skills/core/simplify-code of HezaoHezao/poirot.

Open the folder on GitHubat commit 86bf279

Compare with similar skills

Simplify Code next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Simplify Code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Simplify Code this skillHezaoHezao/poirot250—~2kAutomated safety check: PassMIT
PonytailDavidObando/gsharp5658 repos~1.7kAutomated safety check: PassMIT
Ponytail Reviewkortix-ai/suna20k4 repos~593Automated safety check: PassCustom licence
Ponytail Lazy Developer ModeDietrichGebert/ponytail158k—~871Automated safety check: PassMIT
Code Simplification for ego-litecitrolabs/ego-lite17k—~1.2kAutomated safety check: PassMIT
Refactor Pass for Simplicitystar-history/star-history9.6k1 repos~168Automated safety check: PassMIT

Similar skills

  • Ponytail

    DavidObando/gsharp

    Forces the laziest solution that actually works, simplest, shortest, most minimal.

    565 GitHub starsUsed in 8 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Ponytail Review

    kortix-ai/suna

    Code review focused exclusively on over-engineering. An agent skill from kortix-ai/suna.

    20k GitHub starsUsed in 4 repos~593 tokens
    DevelopmentAuto-check passed
  • Ponytail Lazy Developer Mode

    DietrichGebert/ponytail

    Makes the agent pick the laziest solution that works: skip unneeded work, reuse what exists, prefer the standard library and platform features, and keep diffs small.

    158k GitHub stars~871 tokensUpdated today
    DevelopmentAuto-check passed
  • Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.

    17k GitHub stars~1.2k tokensUpdated 15 days ago
    DevelopmentAuto-check passed
  • Refactor Pass for Simplicity

    star-history/star-history

    Perform a refactor pass focused on simplicity after recent changes. Use when the user asks for a refactor/cleanup pass, simplification, or dead-code removal…

    9.6k GitHub starsUsed in 1 repo~168 tokens
    DevelopmentAuto-check passed
  • Over-Engineering Review

    DietrichGebert/ponytail

    Reviews a diff only for unnecessary complexity and lists what to delete or shrink, one numbered line per finding with the location, the cut and its replacement.

    158k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed

More from HezaoHezao/poirot

All 23 skills in this repo
  • Requesting Code Review

    HezaoHezao/poirot

    Pre-commit review: security scan, quality gates, auto-fix. An agent skill from HezaoHezao/poirot.

    250 GitHub starsUsed in 5 repos~1.6k tokens
    Auto-check passed
  • Research Paper Writing

    HezaoHezao/poirot

    ML paper pipeline: experiment design to submission. An agent skill from HezaoHezao/poirot.

    250 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Skill Creator

    HezaoHezao/poirot

    Create, edit, and evaluate agent skills iteratively. An agent skill from HezaoHezao/poirot.

    250 GitHub starsUsed in 1 repo~838 tokens
    Auto-check passed
  • Academic Paper Review

    HezaoHezao/poirot

    Structured peer-review of academic papers. An agent skill from HezaoHezao/poirot.

    250 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Blogwatcher

    HezaoHezao/poirot

    Monitor blogs and RSS/Atom feeds via blogwatcher-cli. An agent skill from HezaoHezao/poirot.

    250 GitHub stars~854 tokensUpdated 2 mo ago
    Auto-check passed
  • Bootstrap

    HezaoHezao/poirot

    Onboarding conversation to generate a user profile. An agent skill from HezaoHezao/poirot.

    250 GitHub stars~1.2k tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Simplify Code

What does Simplify Code do?

Sequential 3-lens cleanup of recent code changes. An agent skill from HezaoHezao/poirot. Simplify Code is an agent skill from HezaoHezao/poirot. Sequential 3-lens cleanup of recent code changes.

When should I use Simplify Code?

Simplify Code fits situations like: tasks that involve Code simplification.

How do I install Simplify Code in Claude Code?

Run `npx skills add HezaoHezao/poirot --skill simplify-code -a claude-code`. Or copy the skill folder (poirot/backend/agents/skill/builtin_skills/core/simplify-code in HezaoHezao/poirot) into .claude/skills/simplify-code in your project. Claude Code loads it when a task matches its description.

How do I install Simplify Code in Codex?

Run `npx skills add HezaoHezao/poirot --skill simplify-code -a codex`. Or copy the skill folder (poirot/backend/agents/skill/builtin_skills/core/simplify-code in HezaoHezao/poirot) into .agents/skills/simplify-code in your project. Codex loads it when a task matches its description.

Can I use Simplify Code in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HezaoHezao/poirot --skill simplify-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/simplify-code, .gemini/skills/simplify-code, .github/skills/simplify-code and .opencode/skills/simplify-code in your project.

What does Simplify Code need to run?

Going by SKILL.md and its folder, Simplify Code needs the command-line tools its instructions call (git). Its frontmatter pre-approves these tools: bash, read_file, str_replace, write_file.

Does Simplify Code access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Simplify Code safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Simplify Code use?

Simplify Code is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Simplify Code use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Simplify Code?

Skills that share tags, products or a category with Simplify Code: Ponytail (DavidObando/gsharp, 565 stars), Ponytail Review (kortix-ai/suna, 20k stars), Ponytail Lazy Developer Mode (DietrichGebert/ponytail, 158k stars) and Code Simplification for ego-lite (citrolabs/ego-lite, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Simplify Code?

HezaoHezao (a GitHub user) maintains it in HezaoHezao/poirot, which has 250 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on July 28, 2026.

Source: HezaoHezao/poirot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.