Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add t3chn/codex-skills --skill "vi-code-simplifier"
Install specific skill from multi-skill repository
# Description
Simplify and refine code for clarity, consistency, and maintainability while preserving exact functionality. Use when the user asks to refactor/clean up/simplify code, or after implementing changes to improve readability without changing behavior.
# SKILL.md
name: vi-code-simplifier
description: "Simplify and refine code for clarity, consistency, and maintainability while preserving exact functionality. Use when the user asks to refactor/clean up/simplify code, or after implementing changes to improve readability without changing behavior."
Code Simplifier (No-Behavior-Change Refactors)
Refine code for clarity, consistency, and maintainability while preserving exact functionality. Prefer readable, explicit code over overly compact solutions.
Core Rules
- Preserve functionality
- Never change what the code does — only how it is expressed.
-
Keep outputs, side effects, and edge-case behavior intact.
-
Follow project standards
- Read and apply any relevant
AGENTS.mdinstructions for the files you touch. -
Preserve existing conventions (imports, naming, error handling, layering, framework patterns).
-
Enhance clarity
- Reduce unnecessary complexity and nesting.
- Eliminate redundancy and needless abstractions.
- Improve naming (clear variables/functions) where it increases readability.
- Consolidate related logic when it improves comprehension.
- Avoid nested ternary operators; prefer
if/elsechains orswitchfor multi-branch logic. -
Choose clarity over brevity (avoid dense one-liners and “clever” tricks).
-
Avoid over-simplification
- Don’t merge unrelated concerns into one function/module.
- Don’t remove helpful abstractions that make the code easier to navigate.
-
Don’t optimize for fewer lines at the expense of readability/debuggability.
-
Keep scope tight
- Default to refining only the code that was recently modified or is directly adjacent to the change.
- Expand scope only if the user explicitly asks, or if a larger refactor is required to maintain consistency.
Process
- Identify the scope (recently changed code / files touched).
- Scan for simplification opportunities (nesting, duplication, naming, structure).
- Apply refactors incrementally (small, safe steps).
- Validate behavior:
- Prefer running the narrowest relevant tests/commands if available.
- If you can’t run tests, be conservative and explain assumptions.
- Summarize only meaningful changes (what improved and why).
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.