ワンクリックで
exploring-alternatives
Try 2-3 different approaches before implementing - don't settle for first design you think of
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Try 2-3 different approaches before implementing - don't settle for first design you think of
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Fork, clone to ~/.clank, run installer, edit CLAUDE.md
RED-GREEN-REFACTOR for process documentation - baseline without skill, write addressing failures, iterate closing loopholes
Skills wiki intro - mandatory workflows, search tool, brainstorming triggers
Interactive idea refinement using Socratic method to develop fully-formed designs
Execute detailed plans in batches with review checkpoints
Execute implementation plan by dispatching fresh subagent for each task, with code review between tasks
| name | Exploring Alternatives |
| description | Try 2-3 different approaches before implementing - don't settle for first design you think of |
| when_to_use | Before implementing any non-trivial solution. When you have your first idea and are ready to code. When solution feels complex. When choosing between approaches. When stuck on a design. When tempted to implement first idea immediately. When asking "is this the best approach?". When wondering "should I use library or custom code?". When evaluating trade-offs. When solution feels forced or awkward. When didn't consider alternatives. When implementation is fighting you. When choosing data structures or algorithms. When design decision needs justification. When comparing manual implementation vs using library. When solution has multiple viable paths. |
| version | 1.0.0 |
| languages | all |
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.
Always use before implementing:
Especially when:
Warning signs you need this:
Before exploring solutions, clarify the problem:
If problem is unclear, exploring solutions is premature.
Don't stop at first idea. Generate at least 2 more.
Techniques for generating alternatives:
Different data structures:
Different algorithms:
Different levels of abstraction:
Different responsibility allocation:
Different error handling:
For each approach, sketch it in pseudocode or bullet points.
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?
Choose based on:
Document why you picked it:
Only after comparing alternatives, implement the chosen approach.
If implementation fights you → return to Step 2. You might have picked wrong alternative.
| 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 |
Problem: Validate user registration data
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:
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)
Trade-offs:
class RegistrationValidator:
def __init__(self, data):
self.data = data
self.errors = []
def validate(self):
self._validate_email()
self._validate_password()
self._validate_username()
self._validate_age()
return len(self.errors) == 0, ", ".join(self.errors)
def _validate_email(self):
# Focused validation method
Trade-offs:
For this problem:
By exploring all three, you make informed decision instead of defaulting to first idea.
❌ Implementing first idea:
Think of approach → implement immediately → discover problems → hack fixes
✅ Exploring alternatives:
Think of approach → sketch it → think of alternative → sketch it → compare → pick best → implement cleanly
❌ "This is obviously the best way":
Without exploring, you don't know if it's best. Your "obvious" solution might be suboptimal.
✅ "Let me try two other approaches to confirm this is best":
Even if first idea wins, exploring validates your choice.
❌ Exploring in code:
Writing full implementations of multiple approaches wastes time and creates emotional attachment.
✅ Exploring in pseudocode/sketches:
Quick, cheap, easy to discard.
You implemented without exploring alternatives. Now what?
No exceptions:
Required steps:
This isn't punishment. It's good engineering.
Working code that's not the best approach = technical debt. Pay it now or pay interest later.
Time investment:
9 minutes now vs hours of maintenance later.
Before implementing:
During implementing:
All of these mean: Stop. Explore alternatives in pseudocode.
| Excuse | Reality |
|---|---|
| "First idea is obviously best" | Without exploring, you don't know. Try 2 more anyway. |
| "Don't want to waste time" | 5 minutes exploring saves hours of bad implementation. |
| "This approach already works" | Working ≠ best. Other approaches might be simpler. |
| "I'm experienced, I know the right approach" | Experience creates bias. Check your intuition. |
| "Problem is too simple to need alternatives" | Even simple problems benefit. Takes 2 minutes. |
| "Already started coding, too late" | Sunk cost fallacy. Still cheaper to explore now than debug later. |
| "Other approaches won't work" | How do you know without trying them? |
Before marking design complete:
Can't check all boxes? Return to Step 2 (generate alternatives).
Explore 2-3 alternatives minimum. Stop when:
Don't:
Balance: Enough exploration to find good solutions, not so much you never implement.
## Problem
[State the problem clearly]
## Alternative 1: [Name]
[Sketch the approach]
Pros: ...
Cons: ...
## Alternative 2: [Name]
[Sketch the approach]
Pros: ...
Cons: ...
## Alternative 3: [Name]
[Sketch the approach]
Pros: ...
Cons: ...
## Decision
Chose [Alternative X] because [reasoning based on requirements and trade-offs]
Use this template when designing non-trivial solutions.
From Code Complete:
From baseline testing:
With this skill: Systematic exploration before implementation.
For design iteration: See skills/designing-before-coding - exploring alternatives happens during the pseudocode phase (Step 7)
For complexity: See skills/architecture/reducing-complexity - simpler alternatives reduce complexity