Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Exploring Alternatives

БесплатноБез исполняемых скриптовНе проверен

Try 2-3 different approaches before implementing - don't settle for first design you think of

obraот obra★ 43 звезды на GitHub27 установок в других каталогах

Об этом скилле

Exploring Alternatives

Overview

Don't settle for the first design you think of. Try multiple approaches, compare trade-offs, pick the best, THEN implement.

Core principle: Design is cheap to iterate. Code is expensive. Once you write code, emotional attachment makes it hard to throw away. Explore alternatives while iteration is still cheap.

Violating the letter of this rule is violating the spirit of good design.

When to Use

Always use before implementing:

  • Non-trivial features
  • Complex algorithms
  • System design decisions
  • Refactoring approaches
  • Architecture choices
  • Data structure selection

Especially when:

  • First idea feels complex
  • Multiple viable approaches exist
  • Stakes are high (production code, public APIs)
  • Design will be hard to change later

Warning signs you need this:

  • Jumping to implementation with first idea
  • "This is the obvious way" (without considering alternatives)
  • Solution feels forced or awkward
  • Fighting the implementation
  • Design keeps changing during coding

The Exploration Process

Step 1: Understand the Problem

Before exploring solutions, clarify the problem:

  • What exactly are we solving?
  • What are the constraints?
  • What are the requirements?
  • What are success criteria?

If problem is unclear, exploring solutions is premature.

Step 2: Generate 2-3 Alternatives

Don't stop at first idea. Generate at least 2 more.

Techniques for generating alternatives:

  1. Different data structures:

    • Array vs linked list vs tree vs hash table
    • List vs set vs dictionary
  2. Different algorithms:

    • Iterative vs recursive
    • Brute force vs optimized
    • Different algorithmic approaches (sort-based vs hash-based)
  3. Different levels of abstraction:

    • Direct implementation vs library
    • Custom code vs existing pattern
    • Simple specific vs generic flexible
  4. Different responsibility allocation:

    • One class vs multiple
    • Function vs class
    • Inline vs extracted
  5. Different error handling:

    • Exceptions vs return codes
    • Fail fast vs continue with defaults
    • Validate at boundary vs trust callers

For each approach, sketch it in pseudocode or bullet points.

Step 3: Compare Trade-offs

Evaluate each alternative against criteria:

Criterion Alternative 1 Alternative 2 Alternative 3
Simplicity Simple Complex Medium
Performance Fast Slow Medium
Maintainability Easy to modify Hard to change Medium
Testability Easy to test Hard to test Medium
Flexibility Rigid Very flexible Some flex
Development time Quick Slow Medium

Which criteria matter most for this problem?

Step 4: Pick the Best

Choose based on:

  • Requirements (which criteria actually matter)
  • Simplicity (default to simplest that meets requirements)
  • Long-term maintainability (code is read 10x more than written)

Document why you picked it:

  • "Chose approach 2 because performance is critical and measurements show approach 1 is too slow"
  • "Chose approach 1 because simplicity matters more than flexibility we don't need yet"

Step 5: Implement

Only after comparing alternatives, implement the chosen approach.

If implementation fights you → return to Step 2. You might have picked wrong alternative.

Quick Reference

When What to Explore Example Alternatives
Data structure choice Different structures Array, LinkedList, HashMap, Tree
Algorithm choice Different algorithms Iterative, Recursive, Different approach
Error handling Different strategies Exceptions, Return codes, Defaults
Responsibility Different decompositions One class, Multiple classes, Functions
Abstraction level Build vs use Custom implementation, Library, Framework
Complexity trade-off Simple vs flexible Specific solution, Generic solution

Example: Validation Function

Problem: Validate user registration data

Alternative 1: Manual Validation

def validate_registration(data: dict) -> tuple[bool, str]:
    if 'email' not in data:
        return False, "Missing email"
    if not re.match(email_pattern, data['email']):
        return False, "Invalid email"
    # ... validate each field manually

Trade-offs:

  • ✅ Simple, no dependencies
  • ✅ Full control
  • ❌ Verbose, repetitive
  • ❌ Easy to miss fields

Alternative 2: Pydantic Model

from pydantic import BaseModel, EmailStr, Field

class RegistrationData(BaseModel):
    email: EmailStr
    password: str = Field(min_length=8)
    username: str
    age: int = Field(ge=18)

def validate_registration(data: dict) -> tuple[bool, str]:
    try:
        RegistrationData(**data)
        return True, ""
    except ValidationError as e:
        return False, str(e)

**Tra

Полный SKILL.md на GitHub

Установить Exploring Alternatives в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Exploring Alternatives?

Try 2-3 different approaches before implementing - don't settle for first design you think of

Как установить скилл Exploring Alternatives?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Exploring Alternatives запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Exploring Alternatives с