Skip to content

Deck Synergy Analysis #209

Description

@Doberjohn

Part of #204

Description

Analyze a deck's synergies client-side using pre-computed synergy data, triggered by a CTA button.

Requirements

  • "Analyze Synergies" CTA button in deck builder
  • Load pre-computed synergy JSON files for each unique card in the deck
  • Cross-reference all synergy pairs that exist within the deck
  • Calculate deck synergy score using weighted sum formula
  • Display: single deck synergy score number
  • Loading state while fetching/computing (could be non-trivial for 60-card decks)

Weighted Sum Formula

Perfect (9-10): score × 3
Strong  (7-8):  score × 2
Moderate (4-6): score × 1
Weak    (<4):   score × 0.5

Deck Score = sum of all weighted pair scores

Architecture

  • Entirely client-side — no API needed
  • Synergy data already exists as /data/synergies/{cardId}.json files
  • For a 60-card deck: load synergy files for each unique card (~15-25 fetches), find intersecting pairs
  • Consider web worker if computation blocks UI

Phase

Phase 3 (weeks 5-6) — depends on deck builder UI existing and benefits from all rules being landed

Future Enhancements

  • Breakdown by playstyle
  • Top synergy pairs list
  • "Cards that would improve your deck" suggestions
  • Live analysis (as you add cards) instead of CTA-triggered

Files

  • apps/web/src/features/deck/hooks/useDeckAnalysis.ts

Metadata

Metadata

Assignees

Labels

engineSynergy enginefeatureNew feature or functionality

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions