t3chn

vi-code-simplifier

1
0
# Install this skill:
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

  1. Preserve functionality
  2. Never change what the code does — only how it is expressed.
  3. Keep outputs, side effects, and edge-case behavior intact.

  4. Follow project standards

  5. Read and apply any relevant AGENTS.md instructions for the files you touch.
  6. Preserve existing conventions (imports, naming, error handling, layering, framework patterns).

  7. Enhance clarity

  8. Reduce unnecessary complexity and nesting.
  9. Eliminate redundancy and needless abstractions.
  10. Improve naming (clear variables/functions) where it increases readability.
  11. Consolidate related logic when it improves comprehension.
  12. Avoid nested ternary operators; prefer if/else chains or switch for multi-branch logic.
  13. Choose clarity over brevity (avoid dense one-liners and “clever” tricks).

  14. Avoid over-simplification

  15. Don’t merge unrelated concerns into one function/module.
  16. Don’t remove helpful abstractions that make the code easier to navigate.
  17. Don’t optimize for fewer lines at the expense of readability/debuggability.

  18. Keep scope tight

  19. Default to refining only the code that was recently modified or is directly adjacent to the change.
  20. Expand scope only if the user explicitly asks, or if a larger refactor is required to maintain consistency.

Process

  1. Identify the scope (recently changed code / files touched).
  2. Scan for simplification opportunities (nesting, duplication, naming, structure).
  3. Apply refactors incrementally (small, safe steps).
  4. Validate behavior:
  5. Prefer running the narrowest relevant tests/commands if available.
  6. If you can’t run tests, be conservative and explain assumptions.
  7. 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.