lean-code

Enforce DRY and YAGNI principles during code generation and refactoring.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers avoid common pitfalls during code generation, modification, and refactoring, leading to cleaner, more maintainable, and efficient code by preventing unnecessary complexity.

Core Features & Use Cases

  • Prevent Fallbacks: Avoid adding code for legacy versions or non-existent features.
  • Eliminate Duplication: Ensure logic is written once and reused.
  • Remove Unused Code: Keep codebases lean by omitting unnecessary arguments or patterns.
  • Use Case: When generating a new API endpoint, use this skill to ensure you're not adding backward compatibility for a version that will never be released, or duplicating existing validation logic.

Quick Start

Use the lean-code skill to refactor the provided Python function, removing any redundant checks.

Frequently Asked Questions about lean-code

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

FAQPage Schema
How do I prevent technical debt when generating new code?

To prevent technical debt during code generation, apply lean principles like DRY and YAGNI to eliminate duplication and omit unused arguments, ensuring cleaner and more maintainable software development.

What is the best way to refactor code to remove redundant checks?

Refactoring code to remove redundant checks involves eliminating over-defensive programming patterns and avoiding unnecessary backward compatibility for non-existent features, which keeps your codebase lean and efficient.

How do I eliminate code duplication when creating a new API endpoint?

Eliminate code duplication when creating a new API endpoint by enforcing the DRY principle, ensuring validation logic is written once and reused rather than copying existing patterns.

Why should I avoid over-defensive programming patterns in software development?

Avoid over-defensive programming patterns in software development because they add unnecessary complexity and fallbacks for legacy versions, directly increasing technical debt and reducing code efficiency.

When do I need to apply YAGNI principles during code modification?

Apply YAGNI principles during code modification when you need to remove unused code and prevent adding features that are not currently necessary, keeping the codebase lean and preventing future technical debt.

Does lean code generation work for optimizing existing Python functions?

Lean code generation works for optimizing existing Python functions by applying refactoring principles to strip unnecessary arguments and redundant checks, resulting in cleaner and more efficient code.