code-simplify

Simplify recently changed code while preserving behavior and passing tests.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/japurcell/skills --skill code-simplify-japurcell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-simplify
Source: https://github.com/japurcell/skills/tree/main/skills/code-simplify
Command: npx skills add https://github.com/japurcell/skills --skill code-simplify-japurcell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Simplify recently changed code (or the specified scope) while preserving exact behavior.

Core Features & Use Cases

  • Read AGENTS.md and study project conventions before touching code.
  • Identify the target code — recent changes or a broader scope as specified.
  • Understand the code's purpose, callers, edge cases, and test coverage before touching it.
  • Scan for simplification opportunities: deep nesting, long functions, nested ternaries, generic names, duplicated logic, and dead code.
  • Apply simplification incrementally — run tests after each change.
  • Verify all tests pass, the build succeeds, and the diff is clean.
  • If tests fail, revert the change and reconsider; use the code-review skill to review results.

Quick Start

Provide the target code scope and run the simplification workflow, then validate that all tests pass.

Frequently Asked Questions about code-simplify

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I simplify code without altering behavior?

To simplify code without altering behavior, you must analyze context, apply incremental refactoring, and run tests after each change to verify the exact behavior is preserved.

What is the best way to refactor legacy code safely?

Refactoring legacy code safely involves studying project conventions, understanding callers and test coverage, scanning for duplicated logic, and verifying all tests pass after each incremental change.

How do I reduce code complexity in recently changed modules?

To reduce code complexity in recently changed modules, scan for long functions, nested ternaries, and dead code, apply refactoring incrementally, and validate that the build succeeds and the diff is clean.

What should I do if tests fail during code simplification?

If tests fail during code simplification, you should immediately revert the change, reconsider the refactoring approach, and use a code-review to evaluate the results before attempting another modification.

Can I automate code simplification across different programming languages?

Yes, you can automate code simplification across different programming languages supported by the workflow by identifying opportunities like generic names and deep nesting, then applying incremental refactoring with test verification.

Do I need project conventions before refactoring code?

Yes, you need to read project conventions like AGENTS.md before refactoring code to ensure the simplification aligns with existing styles and maintains the structural integrity of the target modules.