Deckwright · Mana Base Builder

Mana Base Builder: spec

Version 0.3.0Updated 2026-11-09

The Mana base guide (prez, deckwright/261109-mana-base-guide) already holds a land and rock catalog that Jaime wants kept exactly as it is. This spec adds a guided builder above it. A player gives a commander or a decklist, gets target land and colour-source counts, walks six steps that each show only the cards for that step, collects a mana base list while watching prices and targets, and exports a buy list. A Craft it for me button runs the same steps automatically under a budget.

It is the user-facing half of the Deckwright mana base feature request of 2026-11-01 (my-lib/runtime/deliverables/261101-deckwright-manabase-package-feature-request.md), and it may be the first Deckwright piece we publish.

1. Decisions already made

These come from Jaime, 2026-11-09:

2. The page

2.1 Order on the page

  1. A short header and a jump link to the Card Catalog.
  2. The builder: Step 1 to Step 6, then the list and export.
  3. The Card Catalog, as today.

2.2 The builder, step by step

  1. Step 1 · Your deck. Paste a decklist or pick a commander. With only a commander, the player also gives an average mana value and a count of cheap draw and ramp spells, or accepts defaults. Output: colour identity, land count (Karsten’s 99-card formula), colour sources needed per colour (Karsten’s table, from the deck’s hardest costs), the utility land budget (6 to 10), and a ramp target (about 10).
  2. Step 2 · Any-colour lands. The free ones, the conditional ones (with the share of the deck that meets each condition when a decklist was given), and the costly ones only in three or more colours.
  3. Step 3 · Lands that make two or more of your colours. The identity’s ranked list, best first.
  4. Step 4 · Utility lands. First the ones that make your colours, which replace a basic. Then the colourless ones, by job: a few staples pre-filled, the rest open for the player.
  5. Step 5 · Basics. The remainder, split by colour pips, with a warning when too few basics remain for the lands that count them.
  6. Step 6 · Rocks. The core, the identity’s rocks, then utility rocks by job.

Each step shows only its own cards, filtered to the identity. Each card row shows its price and an Add button. Cards already on the list are marked.

2.3 The list

2.4 Export

2.5 Craft it for me

Inputs: Step 1’s deck (or a commander, identity and target average mana value) and a budget preset ($25, $100, $500, no cap) or a number. An Owned only preset arrives with collection upload, since $0 means choosing from a collection. It walks Steps 2 to 6 with the same data the guided path uses: the fill order cut at the budget, Deckwright’s colour-source checks, the free coloured utility lands, then open slots for colourless ones until the research task lands. The result lands in the list, where the player can change anything.

2.6 The guided feel

One step is open at a time, with a progress bar across the six, the recommended picks highlighted, a running price and meters that react to each pick. Finishing a step moves to the next. The player can always jump around. No account, no sign-in.

3. Data

3.1 One data file, versioned

Everything the builder and the catalog show comes from one JSON file, mana-data.json:

Part Holds
meta schema version, build date, source dates
rules Karsten formula constants, sources table, utility budget, ramp target
tiers tier ids, labels, explanations, order
cards every land and rock in the catalog
identities per identity: ranked lands and rocks
steps per step: title, explanation, which tiers and groups it shows
staples colourless utility staples, empty until the research task fills it

The page code reads fields by name, ignores unknown fields and renders whatever tiers, groups and steps the data names. A new cycle, a re-tiered land, a new step or new explanation text is a data change and needs no code change. The page checks meta.schema_version and shows a plain error banner if it cannot read the file. A schema test runs on every build of the file.

3.2 The compact card index

For reading decklists: every Commander-legal card’s name, mana cost, mana value, type and colour identity, plus two fields Deckwright computes and the browser cannot: whether the card counts as cheap draw or ramp, and its coloured pips. Measured 2026-11-09: 32,116 cards, 2.3 MB raw, 0.53 MB compressed. One static file, card-index.json.

3.3 Images

Only the cards the builder and catalog show, about 450, at 240 px wide in WebP: roughly 10 MB in total. Fetched once from Scryfall at build time and served as static files from prgn.ai. The catalog keeps its embedded images until it moves to the same files.

3.4 Prices

From Deckwright’s card store, which already loads Scryfall’s daily bulk files (prices included): the cheapest paper, non-foil USD price of any tournament-legal printing, dated. The page shows the date. Memorabilia printings (Collectors’ Edition, 30th Anniversary Edition, gold-bordered) are excluded: on 2026-11-09 the cheapest Savannah in the store was a $200.05 30th Anniversary copy against $417.79 for Revised.

4. Hosting and refresh

5. Logic and drift

6. Phases

Each phase ships to prez, ends with an independent review, and is done only when its checks pass.

Phase Ships Done when
1 Data file, steps layout, identity picker catalog unchanged; steps match catalog
2 Step 1 decklist tool drift test passes on all fixtures
3 List, meters, export TCGplayer import tested by hand
4 Craft it for me Leinore result matches our hand-built base
5 /refresh-mana-guide skill a run with no changes pushes nothing; a run after new prices pushes
R Research: colourless utility staples a research note with a ranked list and its method

7. Not in v1

8. Decisions

  1. Refresh: on demand through a skill (Jaime, 2026-11-09).
  2. Price basis: cheapest tournament-legal paper non-foil printing (Jaime, 2026-11-09).
  3. Colourless utility staples: from research only; none until the research task delivers (Jaime, 2026-11-09).
  4. Budget presets: $25, $100, $500 and no cap; $0 becomes Owned only with collection upload (Jaime, 2026-11-09).