simplify

Simplifies code for readability while preserving exact behavior and project conventions.

1|Updated Jul 23, 2026
One-click install
npx skills add https://github.com/sanjanb/my-agent-harness --skill simplify-sanjanb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simplify
Source: https://github.com/sanjanb/my-agent-harness/tree/main/skills/simplify
Command: npx skills add https://github.com/sanjanb/my-agent-harness --skill simplify-sanjanb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working code often ends up harder to read than it needs to be, with deep nesting, long functions, and unclear names that slow down maintenance and review. This Skill guides behavior-preserving refactoring so code becomes easier to understand without changing what it does. ## Core Features & Use Cases - Behavior-Preserving Refactoring: Every simplification must keep inputs, outputs, side effects, and error behavior identical, with verification after each change. - Structured Simplification Process: A four-step workflow covering understanding the code first, spotting complexity signals, applying incremental changes, and verifying the final diff. - Convention-Aware Cleanup: Simplifications follow existing project conventions (AGENTS.md, neighboring code patterns) instead of imposing external style preferences. - Use Case: After a feature passes its tests but the implementation has nested ternaries and duplicated conditionals, use this Skill to refactor it into clear, reviewable code with a clean diff. ## Quick Start Ask the agent to simplify the recently modified function in your TypeScript file while preserving its exact behavior and following project conventions.

Frequently Asked Questions about simplify

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

FAQPage Schema
How do I refactor code without changing its behavior?

Understand the code's responsibility, callers, and edge cases first, then make one simplification at a time and verify behavior preservation after each change. Confirm outputs, error behavior, and side effects remain identical before keeping each edit.

When should I simplify code after implementing a feature?

Simplify after the feature works and tests pass but the implementation feels heavier than needed, or when review flags readability issues. Avoid simplifying code you do not yet understand or code about to be rewritten.

What are signs that code needs simplification?

Common signals include deep nesting, long functions with mixed responsibilities, nested ternaries, boolean flag arguments, repeated conditionals, misleading names, duplicated logic, dead code, and wrappers that add no value.

When should I avoid simplifying code?

Do not simplify code that is already clean, code you do not understand yet, performance-critical code where the simpler version is measurably slower, or modules you plan to rewrite entirely.

Does simplification follow existing project style conventions?

Yes, simplification must match the project's conventions by reading AGENTS.md and studying neighboring code for imports, naming, error handling, and type annotations. Changes that break project consistency are considered churn, not simplification.