USE WHEN: recommending card cuts or swaps, validating card recommendations, checking color identity, evaluating cards for a deck, counting cards, reading oracle text before recommendations. COVERS: mandatory cut/swap workflow, oracle text verification, EDHREC-protected cards, color identity validation, card counting, card validation commands.
WHEN USER ASKS "Should I swap X for Y?" OR "What should I cut?"
YOU MUST FOLLOW THIS EXACT WORKFLOW:
<deckfile>-cache.json
npm run edhrec "Commander Name" -- --synergy
❌ NEVER:
# Validate color identity BEFORE presenting recommendations
npm run validate-cards -- <deck-file> "Card 1" "Card 2" "Card 3"
# Example output:
# ❌ Thassa's Oracle - color identity [U] not in commander [B, W]
# ✅ Mana Crypt - colorless, legal
# ✅ Opposition Agent - [B], legal in [B, W]
After validation passes, also:
npm run price-cards "Card 1" "Card 2" (batch up to 15)npm run collection find "Card Name"npm run fetch "Card Name" or npm run rulings "Card Name"🚨 NEVER HALLUCINATE CARD ABILITIES OR COSTS - Read fetched oracle text and verify CMC from output.
npm run validate-colors <deck-file> # Requires cache
npm run count <deck-file>
npx tsx packages/mtg-validation/src/cards/card-counter.ts <deck-file> --validate # Validate category headers
When user asks to reduce deck size:
Read commander oracle text FIRST - understand transformative effects:
Check EDHREC data SECOND (mandatory for every proposed cut):
npm run edhrec "Commander Name" -- --synergy
npm run edhrec "Commander Name" -- --category creatures
npm run edhrec "Commander Name" -- --category instants
npm run edhrec "Commander Name" -- --category sorceries
Systematic synergy check:
Prefer cutting expensive unowned cards (check pricing and collection data)
Example mistakes to avoid:
| Command | Purpose |
|---|---|
npm run fetch "Card Name" | Fetch and cache card data |
npm run fetch "Card 1" "Card 2" | Fetch multiple cards |
npm run fetch --cache | Show cache statistics |
npm run search-cards | Search Scryfall |
npm run rulings "Card Name" | Card details + official rulings |
npm run price-cards "Card 1" "Card 2" | Price multiple cards |
When user provides a raw card list (not a Moxfield URL):
npm run fetch "Card 1" "Card 2" ...npm run validate-import /tmp/cards.txt "Commander Name" commandernpm run countCommon type-guessing mistakes: