Inspiration
Every deadline in a learning platform looks exactly the same. A 10-point lab and a 100-point midterm get the same grey line and the same little icon. Three big ones can land in the same week, and nothing tells you where your next hour of study should go. So students study whatever is due next, not what weighs most, and find out at the end of term.
I've spent a lot of time inside Moodle, and I wanted something that hides in the platform students already use and makes the weight of each deadline impossible to ignore. Kiroween's Costume Contest was the perfect excuse: give a study tool a haunted costume, where the costume does the explaining.
What it does
Deadline Defense lives in Moodle as a small block (or imports any .ics calendar). Open it, and fog swallows the portal.
- The War Room gives one piece of counsel for tonight, the readiness of each course, and the topics you keep missing.
- Practice trials are five questions from one course. You can also drop in your own lecture notes (PDF) and they become questions, locally in your browser.
- The procession: the battlefield is your calendar. Every real deadline is a rigged, animated skeleton, its distance from the altar is its days left, and the altar is today. You pick one and duel it with questions from its own course; each correct answer breaks a seal.
- When a deadline arrives, every seal still on it costs grade by its weight, and the term ends with a projected transcript and what to revise next.
How we built it
The project was built spec-first with Kiro:
- Steering files set the product rules ("only correct study answers earn rewards", "useful first, game second"), the tech conventions and the art direction.
- A spec in EARS: 19 requirement groups, a design document and about 450 tracked tasks, amended through Kiro every time the design changed.
- 31 headless Kiro CLI runs, one small task each, with every prompt published in
.kiro/runs/. Kiro wrote the pure game rules, the question bank, the.icsparser, the notes-to-questions generator, thepostMessagecontract, the Moodle plugin, the hooks, a custom agent and the Playwright tests. Every diff was reviewed and tested before the next run, and the rendering layer was built on top of Kiro's rules;KIRO_USAGE.mdrecords who did what. - Hooks run the tests on every save, fact-check the question bank and guard the art direction, and a custom agent
deadline-devreconciles the spec with the code after each redesign.
The stack is Vite + TypeScript, Phaser 4 for the scenes, Three.js for the 3D battlefield (KayKit skeletons, CC0) and synthesised audio. Everything runs statically on GitHub Pages: no server, no accounts, no student data leaving the page.
The rules are math, so they are tested like math
A deadline's position on the field is its time left over a 14-day horizon:
$$\text{progress} = 1 - \frac{d_{\text{due}} - d_{\text{today}}}{14}$$
When it arrives with $s$ of its $S$ seals still intact, it scores
$$\text{score} = 100 - 75\,\frac{s}{S}$$
and the course grade is the weight-averaged score of everything that has arrived:
$$G_c = \frac{\sum_i w_i \,\text{score}_i}{\sum_i w_i}$$
So a fully neglected 10-point lab barely moves the grade, while a neglected 100-point exam can fail the course. That is the whole lesson of the game, written as a formula.
These rules are pure functions with 545 unit and property tests (139 fast-check properties). A headless simulation plays the entire demo semester with a simulated student to prove the design claims:
- a student who never answers fails;
- a student answering at 75% accuracy passes every course (average 96.7);
- prioritising by weight beats fighting whatever is nearest (lowest course grade 87.4 vs 83.3).
Challenges we ran into
- The game was too passive, twice. The first version was a tower defense, and watching towers shoot isn't studying. I redesigned it into duels (R18), then again into the procession (R19), where you choose what to fight and lose when a date arrives unprepared. The spec made those pivots safe: Kiro amended the requirements, rewrote the rules with tests, and the custom agent marked the old tasks as superseded so the spec never lied about the code.
- Balance. Time had to feel urgent without being unfair. Instead of guessing, the semester simulation tuned the clock: 8 seconds per day, slowed to $0.2\times$ while you think, and half a day lost per wrong answer.
- Security of the Moodle bridge. The block sends deadlines to the game with
postMessage. Reviews found an empty-allowlist hole and missing source checks; now origins are checked both ways and no tokens are ever sent. - Real PDFs are messy. Turning lecture notes into questions produced nonsense from citations and dangling pronouns until filters were added after testing on real slides.
- 3D on the web. The skeleton models started at 3.3 MB each; pruning unused animations and accessors brought them down to a few hundred KB, with procedural creatures as a fallback.
Accomplishments that we're proud of
- It's a real study tool, not a time-waster: the War Room's advice, the practice trials and the transcript all come from the same readiness model, and only correct answers ever earn anything.
- The design is proven, not claimed: a simulation of the whole semester shows that studying what weighs most wins.
- It plugs into a real LMS: a working Moodle 4.5 block plugin, or any
.icsexport, with no server and no accounts. - Accessible: fully keyboard playable, reduced motion, captions for every sound, extra time on last-stand questions.
- An honest Kiro workflow: every prompt published, every task tracked, and a log of exactly who did what.
What we learned
- Small tasks beat big prompts. One focused Kiro run per task, verified before the next, was far more reliable than asking for whole features.
- A spec is most valuable when the design changes. Two redesigns could have left a mess; instead the spec, the tests and the code moved together.
- Property-based tests and simulations turn design opinions into facts. "Studying what weighs most is better" stopped being a slogan and became a passing test.
- A costume can carry meaning. The horror theme isn't decoration: distance is time, size is weight, and the fog lifts only when you study.
What's next for Grade Defense
- Moodle quiz banks as questions: pull questions from the course's own question bank through the block, so every course has a trial on day one.
- Real grades in, real weights out: read the gradebook's category weights instead of points, and update the transcript as marks come in.
- Spaced repetition for the questions you miss, scheduled around the deadlines that need them.
- More platforms: Canvas and Blackboard calendars already work through
.ics; native plugins would add the in-page block.
Built With
- css3
- fast-check
- github
- github-actions
- gsap
- howler.js
- html5
- javascript
- kiro
- kiro-cli
- moodle
- pdf.js
- phaser.js
- php
- playwright
- three.js
- typescript
- vite
- vitest
- web-audio-api
- webgl