Inspiration

I can read thousands of Chinese characters, but when I pick up a pen, many of them are gone. There's a name for this: 提笔忘字, "pick up the pen, forget the character", or character amnesia. One common explanation is that we type by sound, so the hand stops practising the shape.

The legend of Cangjie says that when he invented writing, ghosts wept in the night. That gave me the idea: every character you've forgotten is a ghost, and you lay it to rest by writing it again. This is a resurrection project in two senses: it brings back forgotten characters, and it brings back Cangjie, a 1970s input method that types Chinese by shape, not sound, which is exactly the skill character amnesia takes away.

What it does

Ghost Script is a haunted handwriting game for 1,200 characters (HSK 3.0 writing levels 1 to 3: 300, 400 and 500 characters).

Each ghost is laid to rest in two steps:

  1. Summon: type the character's Cangjie code. Each key is a shape, and the parts of the character ink in as you type: 日 (A) and 月 (B) make 明, "bright".
  2. Write: draw the whole character by hand, stroke by stroke, on blank paper. Get it right and a red seal stamps it.

The first time you meet a ghost, the game shows you the code. When it comes back, the code is hidden and you rebuild the character from memory. Ghosts you struggle with or give up on return sooner (spaced repetition). The Graveyard shows every character in a level: unmet, restless or at rest.

It runs in any browser, on a laptop or a phone. All sounds are made in code with the Web Audio API: there are no audio files.

How I built it

I built Ghost Script solo in Kiro, using every part of it:

  • 13 specs (requirements → design → tasks), one per feature: the character dataset, the game core, the Cangjie séance, deployment, visual identity, the night sounds and more.
  • Steering: a content-accuracy rule says character data must never be generated by an AI model. Every stroke, code, pinyin and meaning comes from a public dataset through scripts, and anything missing is marked missing, not guessed.
  • Hooks: saving any data input file rebuilds the dataset and runs its tests. A bad row fails the check straight away and names the row.
  • A custom agent: a read-only accuracy reviewer that can only read files. It flags any claim in the app, specs or README that I can't source.
  • MCP and a Power: the Cangjie Oracle is an MCP server that answers lookups and decompositions from the dataset, not from memory. I packaged it as a self-contained Kiro Power that others can import.
  • Kiro IDE and the Kiro CLI, with parallel sub-agents for bigger tasks.

The data comes from five public sources: hanzi-writer-data (strokes), Make Me a Hanzi (decompositions), CC-CEDICT (pinyin and meanings), Unicode Unihan (Cangjie codes) and the HSK 3.0 character list. Every licence is listed in the app and the README.

Challenges I ran into

  • Proving correctness to people who can't read Chinese. Most judges can't spot a wrong character, so "it looks right" wasn't enough. The answer was tests: 7,863 unit and property tests and 258 end-to-end tests.
  • Never revealing the answer early. A property-based test suite tries every playable character at every step: 5,365 cases in one file. It caught a real bug where the answer flashed for a single render before the player had earned it.
  • Clues. The English clue for each ghost is picked from dictionary meanings, and an automatic pick was sometimes wrong or embarrassing. I added a reviewed override file, checked by the hook. 113 of the 900 harder clues have been reviewed by a person.
  • Trusting progress. Kiro once found that tasks had been ticked as done when their code didn't exist. It reset them and redid them. I learned to trust tests over checkboxes.
  • Packaging the Power. It first worked only inside my repo because of a relative path. I rebuilt it as a self-contained bundle and re-tested the import from scratch.

Accomplishments that I'm proud of

  • A game that teaches writing by shape, with real handwriting on blank paper, not multiple choice.
  • 1,200 characters with every field traced to a public source and no AI-written character data.
  • A Kiro Power that gives any AI agent verified Cangjie data.
  • Five people played the whole game on their own devices without getting stuck.

What I learned

Writing specs first made the build calmer: each feature had requirements I could test against. Steering and hooks turned my rules into things that were enforced automatically instead of things I had to remember. Property-based tests found bugs I would never have thought to test for.

Built With

Share this project:

Updates

Submission history