Agent Skills: code-simplifier

Simplify and refine code for clarity, consistency, and maintainability while preserving functionality. Use when asked to "simplify", "clean up", or "refactor" code, after writing complex code that could benefit from simplification, or when code has grown hard to follow.

UncategorizedID: caarlos0/dotfiles/code-simplifier

Install this agent skill to your local

pnpm dlx add-skill https://github.com/caarlos0/dotfiles/tree/HEAD/skills/code-simplifier

Skill Files

Browse the full folder contents for code-simplifier.

Download Skill

Loading file tree…

skills/code-simplifier/SKILL.md

Skill Metadata

Name
code-simplifier
Description
Simplify recently-changed code without changing behavior. Use only when explicitly invoked (e.g. "simplify", "clean up", "refactor").

Scope: only files changed in the current session or git diff against the base branch. Do not wander into unrelated code.

Before:

  • Run the test suite. If it's red before you start, stop and report.
  • Read AGENTS.md / CONTRIBUTING.md / nearby code. Match existing conventions, don't import outside ones.

Rules:

  • Preserve behavior exactly. No API, signature, or output changes.
  • One concern per pass (rename OR extract OR flatten — not all three).
  • Don't touch tests unless the user asked.
  • Don't reorder imports.
  • Don't add abstractions. Remove them when they have one caller.
  • Prefer statements over nested expressions (no nested ternaries, no clever chains).
  • Delete comments that restate the code. Comments should explain why, not what. This includes comments that just paraphrase the signature or make tautological claims.
  • Stdlib over a dependency. Don't add a require/import of a new package to save three lines.
  • Don't expose things that don't need to be exposed, default should be private.
  • Clear up repeated code if possible.
  • Use DRY when it makes sense, even if it means touch code that was already there

After:

  • Run the tests again. They must still pass.
  • If the diff grew past ~50 lines or crossed unrelated files, stop and surface it before continuing.
  • Never commit. Leave staging and the commit message to the human.
  • Make sure any repository linters pass.