Skip to content
Back to skills

2523 Conditional Logic 1414dc8f

ASecurity

**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...

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 31, 2026
toolsgo

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 2523-conditional-logic_1414dc8f --agent claude-code

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.

Security grade badge for 2523 Conditional Logic 1414dc8f
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2523-conditional-logic-1414dc8f/badge)](https://www.skillsdirectory.com/skills/tools-only-2523-conditional-logic-1414dc8f)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# 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.

Files in this skill

  • README.md889 B
  • skill.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…