PluginBench
Skill
Review
Audit score 70

code-simplifier

pproenca/dot-skills

Simplify code while preserving behavior using 47 prioritized best-practice rules.

What is code-simplifier?

A comprehensive code simplification guide with 47 rules across 8 categories (context discovery, behavior preservation, scope management, control flow, naming, duplication, dead code, and language idioms). Use when cleaning up code, reducing complexity, improving readability, or applying refactoring patterns while maintaining exact behavior.

  • Provides 47 prioritized simplification rules organized by impact (critical to incremental)
  • Ensures behavior preservation through explicit guidelines on outputs, errors, APIs, and side effects
  • Enforces scope discipline by focusing on recently modified code with minimal diffs
  • Simplifies control flow using early returns, guard clauses, and nesting reduction
  • Improves naming clarity with intention-revealing names and consistent vocabulary
  • Eliminates duplication and dead code following the rule of three

How to install code-simplifier

npx skills add https://github.com/pproenca/dot-skills --skill code-simplifier
Claude Code
Cursor
Windsurf
Cline

How to use code-simplifier

  1. 1.Read CLAUDE.md and check for linting/formatting configs in your project
  2. 2.Identify recently modified code sections to focus on
  3. 3.Apply rules in priority order: Context Discovery and Behavior Preservation first (critical)
  4. 4.Use Scope Management rules to keep changes small and focused
  5. 5.Apply Control Flow, Naming, Duplication, and Dead Code rules in sequence
  6. 6.Verify behavior preservation before finalizing changes
  7. 7.Keep diffs minimal and reviewable

Use cases

Good for
  • Cleaning up and refactoring recently modified code sections
  • Reducing nesting depth and cyclomatic complexity in control flow
  • Improving code readability through better naming and structure
  • Applying language-specific idiomatic patterns to modernize code
  • Removing dead code, stale comments, and unused artifacts
Who it's for
  • Backend and frontend developers refactoring existing codebases
  • Code reviewers looking for systematic simplification patterns
  • AI coding agents (Claude Code, Cursor) automating code cleanup
  • Teams adopting consistent code simplification standards
  • Developers working in TypeScript, Rust, Python, or Go projects

code-simplifier FAQ

Should I apply all 47 rules to every code change?

No. Start with CRITICAL rules (context discovery and behavior preservation), then apply HIGH-priority rules (scope and control flow). Apply MEDIUM and LOW-MEDIUM rules selectively based on code quality needs.

What if project conventions conflict with these rules?

Project conventions always take precedence. Read CLAUDE.md and existing code patterns first; these rules are guidelines that adapt to your project's style.

Can I refactor unrelated code while simplifying?

No. Focus only on recently modified code and avoid unrelated refactors. Keep changes small and reviewable; separate refactoring efforts belong in different commits.

How do I verify behavior is preserved?

Check that return values, error messages, side effects (logging, I/O, state changes), and public API signatures remain identical. Run tests before committing.

Which rules apply to my language?

Context, Behavior Preservation, Scope, Control Flow, Naming, Duplication, and Dead Code rules apply universally. Language Idioms rules are specific to TypeScript, Rust, Python, and Go.

Full instructions (SKILL.md)

Source of truth, from pproenca/dot-skills.


name: code-simplifier description: Code simplification skill for improving clarity, consistency, and maintainability while preserving exact behavior. Use when simplifying code, reducing complexity, cleaning up recent changes, applying refactoring patterns, or improving readability. Triggers on tasks involving code cleanup, simplification, refactoring, or readability improvements.

Community Code Simplification Best Practices

Comprehensive code simplification guide for AI agents and LLMs. Contains 47 rules across 8 categories, prioritized by impact from critical (context discovery, behavior preservation) to incremental (language idioms). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics.

Core Principles

  1. Context First: Understand project conventions before making any changes
  2. Behavior Preservation: Change how code is written, never what it does
  3. Scope Discipline: Focus on recently modified code, keep diffs small
  4. Clarity Over Brevity: Explicit, readable code beats clever one-liners

When to Apply

Reference these guidelines when:

  • Simplifying or cleaning up recently modified code
  • Reducing nesting, complexity, or duplication
  • Improving naming and readability
  • Applying language-specific idiomatic patterns
  • Reviewing code for maintainability issues

Rule Categories by Priority

PriorityCategoryImpactPrefixRules
1Context DiscoveryCRITICALctx-4
2Behavior PreservationCRITICALbehave-6
3Scope ManagementHIGHscope-5
4Control Flow SimplificationHIGHflow-9
5Naming and ClarityMEDIUM-HIGHname-6
6Duplication ReductionMEDIUMdup-5
7Dead Code EliminationMEDIUMdead-5
8Language IdiomsLOW-MEDIUMidiom-7

Quick Reference

1. Context Discovery (CRITICAL)

2. Behavior Preservation (CRITICAL)

3. Scope Management (HIGH)

4. Control Flow Simplification (HIGH)

5. Naming and Clarity (MEDIUM-HIGH)

6. Duplication Reduction (MEDIUM)

7. Dead Code Elimination (MEDIUM)

8. Language Idioms (LOW-MEDIUM)

Workflow

  1. Discover context: Read CLAUDE.md, lint configs, examine existing patterns
  2. Identify scope: Focus on recently modified code unless asked to expand
  3. Apply transformations: Use rules in priority order (CRITICAL first)
  4. Verify behavior: Ensure outputs, errors, and side effects remain identical
  5. Keep diffs minimal: Small, focused changes that are easy to review

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Related skills

More from pproenca/dot-skills and the wider catalog.