askill
code-minimization

code-minimizationSafety 95Repository

Write minimum necessary code following YAGNI principle to prevent bloat and over-engineering. Use when implementing features to keep the codebase lean and avoid premature optimization or speculative features.

0 stars
1.2k downloads
Updated 11/14/2025

Package Files

Loading files...
SKILL.md

Code Minimization

Instructions

Write minimum code

Implement what's needed NOW, not what MIGHT be needed.

Avoid:

  • Premature optimization
  • Speculative features
  • Over-abstraction
  • Unnecessary complexity

YAGNI principle

You Aren't Gonna Need It

Example

Python Example

# ❌ Over-engineered
class ValidatorFactory:
    def create(self, type):
        if type == 'basic': return BasicValidator()
        elif type == 'advanced': return AdvancedValidator()
        # 10 more types... (only use BasicValidator!)

# ✅ Minimal
class EntityValidator:
    def validate(self, entity):
        return entity.required_field is not None

JavaScript/Node.js Example

// ❌ Over-engineered
class ValidatorFactory {
    create(type) {
        if (type === 'basic') return new BasicValidator();
        else if (type === 'advanced') return new AdvancedValidator();
        // 10 more types... (only use BasicValidator!)
    }
}

// ✅ Minimal
class EntityValidator {
    validate(entity) {
        return entity.requiredField !== null && entity.requiredField !== undefined;
    }
}

Go Example

// ❌ Over-engineered
type ValidatorFactory struct{}

func (f *ValidatorFactory) Create(validatorType string) Validator {
    switch validatorType {
    case "basic":
        return &BasicValidator{}
    case "advanced":
        return &AdvancedValidator{}
    // 10 more types... (only use BasicValidator!)
    }
    return nil
}

// ✅ Minimal
type EntityValidator struct{}

func (v *EntityValidator) Validate(entity *Entity) bool {
    return entity.RequiredField != ""
}

Guidelines

Do: Solve current requirements simply Don't: Add "maybe later" features


For detailed patterns, see reference.md For more examples, see examples.md

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

82/100Analyzed 2/20/2026

Good quality skill covering YAGNI/code minimization principle with clear examples in Python, JavaScript, and Go. Well-structured with actionable guidelines. Located in dedicated skills folder indicating proper skill packaging. Missing tags for discoverability and references external files that weren't provided. Generic and reusable across projects.

95
85
85
75
85

Metadata

Licenseunknown
Version-
Updated11/14/2025
Publisherbinee108

Tags

No tags yet.