React / probability / deck building
HandForge
A local probability workbench I built for a friend who wanted a clearer way to reason about deck-building choices.
I wanted the tool to make it possible to paste a deck, tag cards into meaningful groups, define the question that
mattered, and see whether the odds actually moved instead of guessing whether a ratio change was worth the slot.
What it does
- Parses pasted deck lists and combines duplicate card names into a normalized deck.
- Lets users tag cards as starters, resources, search, draw, combo pieces, dead cards, or custom groups.
- Supports generic card-game rules and a Pokemon TCG preset with opening hands, prize cards, and valid-hand rules.
- Builds target questions visually: zone, card or tag, operator, count, and AND/OR logic.
- Compares Deck A and Deck B with percentage-point deltas and practical interpretation.
HandForge
Pokemon TCG preset
Deck A
60 / 60
Legal size
Current question
Setup hand
Opening 7: Basic + Energy
Deck B
+2 starters
+4.8 pts
Engine shape
The app uses exact probability where the target can be modeled cleanly, then falls back to seeded Monte Carlo
simulation for more complex scenarios. The seed makes simulation runs reproducible, and heavier calculations run
through a worker so the interface can stay responsive while the deck changes.
- Exact probability and hypergeometric calculations for target conditions.
- Seeded simulation with configurable sample counts.
- Distribution, flow-stage, comparison, and sensitivity charts.
- Local persistence for decks, targets, and ruleset settings.
Why it belongs
HandForge started as a favor for a friend, which is part of why it works as a portfolio piece. It was not built
around a vague product thesis; it was built around one person trying to make better calls while tuning a deck.
That constraint kept the app honest: take a real decision, turn the hidden math into a usable interface, and make
the result inspectable enough that a player can trust it without becoming the probability engine.
User flow
- Choose the ruleset before judging the hand.
- Edit Deck A directly, or paste a count-plus-name deck list.
- Use tags to turn card names into probability groups.
- Define the target without writing a formula.
- Use Deck B to test whether a ratio change is worth the slot.
Build notes
- React and TypeScript application with Recharts visualizations.
- Vitest coverage for parsing, validation, probability, comparison, and simulation behavior.
- Playwright coverage for onboarding and the main analysis workflow.
- Designed as a local workbench: fast to run, easy to inspect, and intentionally focused.