code-simplify

Refactor changed source code for DRYness and clarity without altering behavior.

22|3|Updated Jul 28, 2024
One-click install
npx skills add https://github.com/webdevcody/go-mailing-list --skill code-simplify-webdevcody
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-simplify
Source: https://github.com/webdevcody/go-mailing-list/tree/main/.claude/skills/code-simplify
Command: npx skills add https://github.com/webdevcody/go-mailing-list --skill code-simplify-webdevcody

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It reduces duplicated, overly complex, poorly named, and inefficient code by reviewing recent diffs and simplifying them without changing behavior.

Core Features & Use Cases

  • Diff-driven scope and review: identifies changed files and reads them in full to target the exact areas that need cleanup.
  • Safety-first refactors: applies mechanical fixes directly, and routes structural changes through a test-net requirement to prevent behavior drift.
  • Smell-catalog-guided improvements: concurrently checks for reuse opportunities, code quality issues (DRY, naming, coupling, magic numbers), and efficiency problems (redundant work, missed concurrency, hot-path bloat).
  • User-gated structural changes: prompts before applying risky refactors and re-verifies with typecheck and safety tests afterward.

Quick Start

Ask the AI to run code-simplify on your latest changed files to clean up duplication and DRY violations while keeping behavior unchanged.

Frequently Asked Questions about code-simplify

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

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

To refactor code to be DRY without behavior changes, this skill reviews your git diff for code smells and routes structural changes through a prewritten test safety net. Mechanical fixes are applied directly while risky refactors are user-gated to prevent drift.

What is the best way to clean up duplicated code in a recent git diff?

Cleaning up duplicated code in a git diff is handled by diff-driven scoping that reads changed files in full to target exact areas. It concurrently checks for reuse opportunities and DRY violations, expanding to sibling files only when a flagged smell justifies it.

How does a code review identify code smells and efficiency issues?

A code review identifies code smells and efficiency issues by running parallel review agents guided by a shared catalog. These agents concurrently detect DRY violations, poor naming, tight coupling, magic numbers, redundant work, and missed concurrency opportunities.

Can I refactor code safely if I don't have tests for the changed files?

Refactoring safely without tests is not recommended because this skill enforces a structural-refactor safety net via prewritten tests. Mechanical fixes can be applied directly, but structural changes require a test net requirement to prevent behavior drift.

Does this refactoring approach work on my entire codebase or just changed files?

This refactoring approach works only on changed files by scoping via git diff against the merge-base. It focuses on a targeted set of files within the working tree, optionally expanding to sibling files only when a flagged code smell justifies it.

Why does my code refactor require typecheck and safety tests afterward?

Refactors require typecheck and safety tests afterward to re-verify that behavior remains unchanged after structural modifications. The skill prompts before applying risky refactors and uses these checks to enforce a strict safety net against behavior drift.