Braineos
Sign in

Photo by ron dyar on Unsplash

A hidden score for every deck

by Miles Corran · November 18, 2026

Most features start with something a user sees. This one started with the opposite: a script that runs on nobody's screen, writes a number to a column nobody can read, and changes nothing about how the app behaves today. We built a quality score for every deck before we built anything that uses it.

Why build the score before the feature

The eventual idea -- surfacing deck quality somewhere, maybe in discovery, maybe as a signal for remixing -- needs a real distribution of scores to design against. You can't tune "what counts as a good deck" by staring at a spec; you need actual numbers across actual decks to see where they cluster, what a bad deck's score looks like next to a great one, and whether the thresholds we guessed at are anywhere close to reasonable. So the score comes first, quietly, as a script you run by hand (npm run quality:compute), with nothing in the app reading it yet.

Six signals, each capped on its own

The baseline score is deterministic and adds up to 100 from six independently-capped pieces, so one strong signal can't drown out the others:

  • Cards -- up to 25 points, full credit at 10 or more cards.
  • Votes -- up to 25 points, full credit at 5 or more.
  • Attempts -- up to 15 points, full credit at 10 or more study attempts.
  • Tags -- up to 10 points, full credit at 2 or more.
  • Remixes -- up to 10 points, full credit at 2 or more.
  • Description -- up to 15 points for a real one (20+ characters), 7 for a token one like "n/a", 0 for none at all.

Every deck gets this score with zero external dependencies -- no API key required, nothing that can fail or rate-limit.

An optional second opinion

If a GROQ_API_KEY is set, Groq's free tier reviews the actual card content and can add or subtract up to 20 points on top of the deterministic score. This is deliberately additive rather than its own separate score: a deck that's weak on every deterministic signal can't be rescued by one LLM call, but a deck that padded its way to a high card count with junk cards can still get marked down for it. Skip the API key entirely and every deck still gets scored -- just without that second opinion.

What's live today: nothing

This is the part worth being honest about. The score isn't wired into deck creation or editing, there's no cron running it on a schedule, and nothing in discovery, search, or a deck's own page shows it to anyone -- owner or visitor. It's a column that exists and a script that fills it in, full stop.

That's on purpose. Shipping the scoring logic separately from whatever eventually reads it means we get to look at real numbers across real decks first, and decide what "quality" should actually gate or boost once we've seen the data -- instead of guessing both halves of the problem at once.