code-simplification-patterns

Apply code-simplification patterns to PHP, TypeScript, and Python code.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/GGEdu/claude-god-mode-template --skill code-simplification-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-simplification-patterns
Source: https://github.com/GGEdu/claude-god-mode-template/tree/main/skills/code-simplification-patterns
Command: npx skills add https://github.com/GGEdu/claude-god-mode-template --skill code-simplification-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterns for simplifying working code to reduce cognitive load. Early returns, async/await, extract nested logic, eliminate redundant state, simplify booleans, flatten collections. Behavior preservation is non-negotiable.

Core Features & Use Cases

  • Early returns to reduce nesting and clarify the happy path.
  • Promise-to-async/await conversion and parallel execution where safe.
  • Extracting nested logic into named functions for readability and maintainability.
  • Eliminating redundant state by deriving values from existing data.

Quick Start

Review a codebase and apply the listed simplification patterns to reduce cognitive load without changing observable behavior.

Frequently Asked Questions about code-simplification-patterns

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

FAQPage Schema
How do I use early returns and guard clauses to reduce code nesting?

Early returns and guard clauses reduce code nesting by checking failure conditions first and exiting immediately. This flattens the happy path, reducing cognitive load while preserving observable behavior in languages like PHP, TypeScript, and Python.

What is the best way to refactor nested logic into readable functions?

Refactoring nested logic involves extracting conditional blocks into named functions. This simplifies the parent function and improves readability by giving extracted blocks descriptive names, ensuring non-breaking transformations during real-world codebase refactoring.

How do I convert Promise chains to async/await for code simplification?

Promise-to-async/await conversion simplifies asynchronous code by replacing .then() chains with linear async/await syntax. This pattern applies safe transformations and enables parallel execution where applicable, reducing cognitive load without changing behavior.

Can I apply refactoring patterns across PHP, TypeScript, and Python?

Yes, these code-simplification patterns apply across PHP, TypeScript, and Python. They address language-agnostic issues like early returns, nested logic extraction, and redundant state elimination while enforcing strict non-breaking changes.

How do I eliminate redundant state when simplifying booleans?

Eliminating redundant state involves deriving values from existing data instead of maintaining separate variables. Simplifying booleans and flattening collections reduces cognitive load while ensuring the refactoring preserves non-negotiable behavior.