Grimoire
Grimoire (hereinafter the “Application”) is a daily rune-deduction puzzle from SpellWare. Each day hides a spell made of four runes. You have six attempts to work out which runes it contains and where they sit, and every guess tells you how close you were.
1. User Documentation
Section titled “1. User Documentation”This section is for those interacting with a live instance of the Application.
Getting Started
Section titled “Getting Started”The Application is available at grimoire.spellware.dev.
You can play straight away, without an account. If you sign in with Discord, the Application keeps your streaks, statistics, achievements and profile. Signing in only asks for the identify scope, so the Application never sees your email address.
How to Play
Section titled “How to Play”There are twelve runes in four elements, with three runes in each:
| Element | Runes |
|---|---|
| Fire | Ember, Flare, Cinder |
| Water | Tide, Frost, Mist |
| Earth | Root, Stone, Moss |
| Air | Gale, Wisp, Zephyr |
A spell is made of four different runes, so a guess cannot use the same rune twice. Choose four runes and cast your spell. Every rune you cast is scored in one of four ways:
| Result | Meaning | How it looks |
|---|---|---|
| Exact | The right rune in the right place | A solid tile with a filled diamond |
| Present | The rune is in the spell, but in a different place | A white tile with a heavy outline and a ring |
| Kindred | The rune is not in the spell, but it shares an element with the rune that belongs in that place | A tinted tile with a dashed edge and a half-filled circle |
| Absent | None of the above | A plain tile with no mark |
The palette of runes also marks what you have learned. A rune you know is in the spell has a diamond or a ring, and a rune you know is not has a cross and a line through its name.
Click a rune, or press the key printed on it. The keys are 1 to 9 for Ember, Flare, Cinder, Tide, Frost, Mist, Root, Stone and Moss, then 0 for Gale, the minus key for Wisp and the equals key for Zephyr. Backspace takes the last rune out, and Enter casts the spell.
Each element is drawn in its own colour (red for fire, blue for water, green for earth and gold for air), and runes that could still be in the spell glow softly. The colour is only a help. Every rune has its own shape, and every result has its own mark and is also described in words for screen readers, so nothing depends on seeing colour.
The Daily Puzzle
Section titled “The Daily Puzzle”There is one puzzle a day. Puzzle 1 was on 1 December 2026, and a new puzzle starts at midnight Pacific time. The day is counted on the Pacific calendar, so a puzzle still starts at midnight through daylight saving changes. When you finish, the Application shows a countdown to the next puzzle.
Use the Share button to copy your result. It contains your guess count and a row of symbols for each guess, and it never reveals the spell. You can post it in the #grimoire channel of the SpellWare Discord server, where players share their daily progress. Please keep the spell for any puzzle out of that channel, because every puzzle in the archive can still be played, and put any talk about how to solve a puzzle in spoiler tags.
The Archive
Section titled “The Archive”Any earlier puzzle can be played from the archive, newest first. Archive plays count towards your statistics and achievements, but never towards a streak. If you are signed in, the archive shows which puzzles you solved, failed or started.
Playing Without an Account
Section titled “Playing Without an Account”A guest’s guesses are kept in the browser. Clearing the browser’s storage removes them. When you sign in, the Application brings the puzzles you finished as a guest into your account. Because nothing can prove when a guest played, those puzzles count like archive plays: they appear in your statistics and achievements, but do not count towards a streak. A puzzle you have started but not finished, and today’s puzzle, are carried over when you open them.
Statistics and Streaks
Section titled “Statistics and Streaks”Your profile shows the number of puzzles you have played, your win rate, your current and longest streak, your average number of guesses, your points and a chart of how many guesses your wins took.
A streak is a run of consecutive puzzles, each solved on its own Pacific day. A puzzle counts if you started it on its own day, even if you finish just after midnight. Missing a day, failing a puzzle on its own day or solving one from the archive ends or skips the streak.
Achievements and Points
Section titled “Achievements and Points”There are 17 achievements. Each earns points, and some also earn a badge.
| Achievement | How to earn it | Points |
|---|---|---|
| First Cast | Solve your first puzzle | 5 |
| Apprentice | Solve 10 puzzles | 10 |
| Adept | Solve 50 puzzles | 25 |
| Archmage | Solve 100 puzzles | 50 |
| Grand Archmage | Solve 365 puzzles | 100 |
| Warming Up | Solve puzzles on 3 days in a row | 5 |
| Week Keeper | Solve puzzles on 7 days in a row | 10 |
| Month Keeper | Solve puzzles on 30 days in a row | 25 |
| Centurion | Solve puzzles on 100 days in a row | 50 |
| Year Keeper | Solve puzzles on 365 days in a row | 100 |
| Close Call | Solve a puzzle with your very last guess | 5 |
| Phoenix | Solve a puzzle straight after failing the one before it | 10 |
| Historian | Solve 10 puzzles from the archive | 10 |
| Elementalist | Make a guess that uses a rune from every element | 5 |
| Kindred Spirits | Make a guess where every rune is kindred to the spell | 10 |
Two more achievements are hidden until you earn them, and they are worth no points. Knowing the answer makes them easy, so they are only a mark of luck or skill.
Your own profile lists every achievement that is not hidden, with how far you have got and a progress bar. Each achievement has its own icon, and the ones you have not yet earned are dimmed.
Badges
Section titled “Badges”A badge is flair that you can show on your profile. You choose one as your primary badge. Badges come from three places:
- Achievement badges are unlocked by First Cast, Archmage, Week Keeper, Month Keeper, Centurion, Year Keeper and Phoenix.
- Awarded badges are given by an administrator: Founder, Staff, Supporter, Contributor and Beta Tester.
- SpellWare Member is given automatically to members of the SpellWare Discord server. You are never asked for any extra permission for it.
Your Profile
Section titled “Your Profile”Every player has a public profile at /u/ followed by their profile address. The address is made from your Discord username when you first sign in. It has 3 to 24 lower case letters, digits and hyphens, it is unique, and you can change it in the settings.
In the settings you can choose a display name to show instead of your Discord name, write a bio of up to 280 characters and choose your primary badge. Your name and bio are shown exactly as you typed them, as plain text.
Profiles are public by default. You can make yours private in the settings, and then it behaves as though it did not exist: nobody else can see it, and you do not appear on the leaderboards.
Your Avatar
Section titled “Your Avatar”You can upload a picture, copy your Discord avatar once, or use one of the default avatars. A copy is fetched once and then becomes a picture of the Application’s own. Nothing is ever loaded from Discord in other people’s browsers.
- Uploads can be PNG, JPEG, WebP or GIF, up to 2 MiB, and you can upload ten an hour.
- Whatever you upload, the Application makes a new 256 pixel square WebP picture from its pixels and throws the original away. That removes details such as the location in a photo, turns a photo the right way up, and keeps only the first frame of an animation.
- If you have no picture, you have one of six default avatars, chosen from your Discord ID.
Leaderboards
Section titled “Leaderboards”There are three leaderboards: the longest current streaks, the longest streaks ever, and the most wins. A player is listed when all of these are true:
- Their profile is public and has not been hidden by a moderator.
- They are not banned or delisted.
- Their account is at least 7 days old.
- They have finished at least 7 puzzles.
- They have no flag from the fair play checks that is open or confirmed.
Streaks only count puzzles solved on their own day. Wins count every puzzle solved, including those from the archive. A current streak board is often empty, because a streak that is no longer alive today does not count.
Reporting a Player
Section titled “Reporting a Player”If you see a profile or an avatar that you think breaks our rules, open that player’s profile and use Report this player. You choose whether you are reporting their name, bio and address or their uploaded avatar, then give a reason and, if you want, a note of up to 300 characters. The reasons are harassment, impersonation, inappropriate content, personal information, spam and something else, which needs a note.
A report only asks a moderator to look. Nothing happens to the player because of it, however many people report, and a group cannot get somebody hidden by reporting them together. The player is never told that anyone reported them, or who. You can report the same thing only once, you cannot report yourself, and you can make 20 reports a day.
Fair Play and Moderation
Section titled “Fair Play and Moderation”The Application cannot stop a determined cheater, so it aims to make cheating unrewarding and to notice the obvious cases:
- Lucky achievements are hidden and worth no points.
- Automatic checks raise a flag when a pattern looks unusual, such as solving on the very first guess, sending guesses almost at once, or solving a long run of puzzles with an efficiency that few players reach. A flag only asks a moderator to look. Nobody is banned automatically, and the player is never told.
- Moderators can clear or confirm a flag, take a player off the leaderboards without changing anything else, hide a profile, take down an avatar, give or take back awarded badges, and ban a player. A ban ends their sessions and refuses their login. Every action is written to a log.
An honest player can trip a check by being lucky, quick or consistent, which is why every flag is reviewed by a person.
Feedback and Bugs
Section titled “Feedback and Bugs”If you have feedback or a bug report, please let us know in the Discord community. Share your daily progress in the #grimoire channel of the same server.
2. Technical Documentation
Section titled “2. Technical Documentation”This section is for those interested in running their own instance of the Application. The Application is closed source, so this section describes how it is built and configured rather than linking to its code.
Architecture
Section titled “Architecture”The Application is a pnpm monorepo, version 0.1.0, that requires Node.js 24 or newer.
| Package | What it holds |
|---|---|
packages/shared | The rune catalogue, the scoring rules, spell generation, the solver, the achievements, badges and leaderboard rules |
apps/server | Fastify, MongoDB, Discord login, Cloudflare R2 avatar storage and the page server |
apps/client | The browser app, built with Vite and plain TypeScript with no framework |
The server uses Fastify with the cookie, Helmet and rate limit plugins, the official MongoDB driver, the AWS S3 client for Cloudflare R2, Sharp for pictures and @nhcarrigan/logger. Errors go to the alerts server through the logger.
How the Puzzles Are Chosen
Section titled “How the Puzzles Are Chosen”There are 11,880 possible spells. A solver plays every one of them the way a careful player would, always guessing a spell that is still possible. Daily puzzles are drawn only from the 9,561 spells that the solver clears in four guesses or fewer, which is about 26 years of puzzles. The order is a one-off shuffle that is fixed in the server’s source and never sent to the browser. It must not be regenerated or reordered once the game is live, because players are partway through it, and a test fails if the rules, the runes or the solver change underneath it.
The server holds no state about a guess. The browser sends the puzzle number and every guess so far, and the server scores them and reveals the spell only once the puzzle is finished. For a signed-in player the same request saves the game, and the guesses must carry on from what is already saved, so a stale tab or a second device cannot rewrite a game.
A player’s statistics, streaks and achievements are recalculated from all of their plays whenever a play finishes. Nothing is incremented, so recalculating is safe to repeat.
Environment Variables
Section titled “Environment Variables”Every variable is listed in prod.env, with secrets as 1Password references.
| Variable | Required | Purpose |
|---|---|---|
PORT | No | The port the app listens on, bound to 127.0.0.1. Defaults to 3000 |
PUBLIC_URL | Yes | The public address, used for the OAuth redirect and to check where changes come from |
DISCORD_CLIENT_ID | Yes | The Discord application’s client ID |
DISCORD_CLIENT_SECRET | Yes | The Discord application’s client secret |
DISCORD_BOT_TOKEN | Yes | The token of a bot that is in the SpellWare server, used to check who is a member |
DISCORD_GUILD_ID | Yes | The Discord server whose members earn the member badge |
ADMIN_DISCORD_IDS | No | The Discord IDs of the administrators, separated by commas. Leave it empty for none |
R2_ACCOUNT_ID | Yes | The Cloudflare account that holds the avatar bucket |
R2_ACCESS_KEY_ID | Yes | The access key for the bucket |
R2_SECRET_ACCESS_KEY | Yes | The secret for the access key |
R2_BUCKET | Yes | The name of the private bucket where avatars are stored |
MONGO_URI | Yes | The MongoDB connection string |
MONGO_DATABASE | No | The database name. Defaults to grimoire |
LOG_TOKEN | No | The alerts server token. When it is empty, errors go to the console |
CLIENT_DIST | No | The built browser app. Defaults to ../client/dist |
The server refuses to start if a required variable is missing.
Deployment
Section titled “Deployment”- Create the Discord application and add the redirect
https://grimoire.spellware.dev/auth/callback. Only theidentifyscope is used. - Invite a bot to the SpellWare server. It needs no special permission, because it only looks members up.
- Create a private Cloudflare R2 bucket for avatars, and an access key that can read and write it.
- Create the item in 1Password with the fields
prod.envrefers to, and setPUBLIC_URLtohttps://grimoire.spellware.dev. - Add the server block for
grimoire.spellware.devto the NGINX configuration and reload NGINX. It proxies the app on its local port, and allows request bodies of up to 3 MiB, because an avatar may be up to 2 MiB and the default limit is 1 MiB. - Build and start the app with
pnpm install && pnpm build && pnpm --filter @grimoire-daily/server start. The start script runs the server throughop run, which resolves the secret references.
Avatars
Section titled “Avatars”Pictures are kept in the private R2 bucket under random identifiers, and the server serves them itself. Because the bucket is not public, a moderator’s removal takes effect at once, and browsers and proxies keep a copy for an hour at most. An upload is judged by what the file really is and not by its name or content type, and a picture of more than 25 million pixels is refused before it is decoded. There is no automatic scan of uploads beyond Cloudflare’s own CSAM scanning of what passes through its cache, so avatars are reported and removed by hand.
Security
Section titled “Security”- Every page response carries a Content Security Policy with a fresh nonce on each script, plus the other Helmet headers. The raw
index.htmlis never served as a file, because it would have no nonce. The policy allows inline event handler attributes, because the consent banner from the shared headers script needs them, so the client always shows text from other people as text and never as markup. - Login, uploads, reports, imports and the administrators’ routes are rate limited, and every request that changes something must come from the Application’s own address.
- Only a hash of each session token is stored, a session lasts seven days, and MongoDB removes expired sessions on its own.
- The reported player is never told who reported them, and a private, hidden, banned or missing profile all get the same 404.
Analytics
Section titled “Analytics”The Application loads the shared SpellWare headers script from cdn.spellware.dev/headers/index.js, which brings the layout, footer, consent banner, Google Analytics, HubSpot tracking and the community popup. The page opts out of the shared header only, because the Application has its own navigation bar. The Application sends no analytics events of its own.
3. Legal Documentation
Section titled “3. Legal Documentation”The Application inherits SpellWare’s global legal documents:
- Privacy Policy: https://docs.spellware.dev/#/privacy
- Terms of Service: https://docs.spellware.dev/#/terms
- License: https://docs.spellware.dev/#/license
Data the Application Keeps
Section titled “Data the Application Keeps”| Data | Kept |
|---|---|
| Discord ID, username and avatar identifier | Kept so that you can sign in, be shown to others and copy your Discord avatar |
| Display name, bio, profile address, primary badge and privacy choice | Kept until you change them |
| Uploaded avatar | The processed 256 pixel WebP picture only. The original is never kept |
| Your guesses and when the server first saw each one | Kept for every puzzle you play while signed in, so that your games can be restored and unusual patterns can be found |
| Statistics, streaks, achievements, points and badges | Kept, and recalculated from your plays |
| Whether you are in the SpellWare Discord server | Remembered for 24 hours |
| Session tokens | Only a hash of each token is kept, and it expires after seven days |
| Reports about a profile or an avatar | The reason, an optional note and who reported, which only administrators can see |
| Fair play flags and the moderation log | Kept, and only administrators can see them |
The Application sets two cookies. The session cookie holds your session while you are signed in, and a short-lived cookie holds a one-off value while you sign in with Discord. Both are used only to sign you in. A guest’s guesses are kept in the browser’s local storage, and the page you were on when you chose to sign in is kept in the tab’s session storage, until you return. None of these are sent anywhere else.
4. Contributing Documentation
Section titled “4. Contributing Documentation”The Application is closed source and does not accept code contributions. Feedback and bug reports are welcome in the Discord community.
Development Setup
Section titled “Development Setup”For maintainers, the project uses:
- TypeScript with ESLint and a zero warnings policy.
- Vitest for tests, with 100% coverage enforced in every package. The server tests start their own in-memory MongoDB, so no database is needed.
- pnpm for package management.
pnpm installpnpm lintpnpm testpnpm buildTo check how fair the puzzles are, run pnpm balance. It plays every possible spell with the solver and reports how many guesses it needs, which is 3.86 on average with all twelve runes and never more than six.
To run locally, set PORT=3000 and PUBLIC_URL=http://localhost:5173 in a copy of prod.env that you save as dev.env, and add http://localhost:5173/auth/callback as a redirect in the Discord application. Then start the server, and run the Vite dev server, which proxies /api, /auth and /avatars to it:
pnpm --filter @grimoire-daily/server buildop run --env-file=dev.env -- node apps/server/prod/index.jspnpm --filter @grimoire-daily/client dev