**Opus**: Handles nested if/then/else reliably. Evaluates compound conditions. Follows complex decision trees. **Haiku**: Reliable with simple if/then. Degrades with: - Nested conditions (if A then if B then...) - Compound conditions (if A AND B OR C) - More than 3 branches **Mitigation**: Flatten decision trees. One condition per step. ``` BAD (nested): If the customer is premium AND the order is > $100 AND it's their first return, waive the fee. Otherwise if they're premium but the order is...
Installs into .claude/skills of the current project.
Are you the author of 2523 Conditional Logic 1414dc8f?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-2523-conditional-logic-1414dc8f)
# Conditional and Branching Logic
**Opus**: Handles nested if/then/else reliably. Evaluates compound
conditions. Follows complex decision trees.
**Haiku**: Reliable with simple if/then. Degrades with:
- Nested conditions (if A then if B then...)
- Compound conditions (if A AND B OR C)
- More than 3 branches
**Mitigation**: Flatten decision trees. One condition per step.
```
BAD (nested):
If the customer is premium AND the order is > $100 AND it's their
first return, waive the fee. Otherwise if they're premium but the
order is < $100, charge half fee. Otherwise charge full fee.
GOOD (flattened):
Step 1: Is customer premium? YES → go to Step 2. NO → charge full fee.
Step 2: Is order > $100? YES → go to Step 3. NO → charge half fee.
Step 3: Is this their first return? YES → waive fee. NO → charge half fee.
```
For complex branching, use a decision table:
```
| Premium? | Order > $100? | First return? | Action |
|----------|---------------|---------------|-------------|
| YES | YES | YES | Waive fee |
| YES | YES | NO | Half fee |
| YES | NO | any | Half fee |
| NO | any | any | Full fee |
Find the first matching row. Apply that action.
```
Decision tables eliminate reasoning — Haiku just pattern-matches.