Skip to content
Back to selected work

Self-Aware Writing

Author & Product Engineer·Since 2026

A living book that notices you while you read it — it knows where you are, remembers where you stopped, and won't build if the prose contradicts itself.

The problem

The reader's own attention is the subject, so the interface has to follow progress and memory without accounts or tracking — and the prose makes claims about itself that a later edit can quietly falsify.

What I owned

  • Concept, writing and product design — the book and the software are one artifact
  • Astro/TypeScript architecture where a chapter is one Markdown file everything else derives from
  • Custom remark/rehype plugins for stanza breaks and in-chapter page splitting
  • Reader behaviour: two reading modes, theme, progress, resume, offline PWA
  • A checker for the claims the book makes about itself, plus 75 Playwright tests run across desktop, mobile and Safari

Technical challenges

  • Chapters quote each other, so editing one file can falsify a sentence in another
  • The text promises a moment with no words on screen, which the page break has to deliver
  • Splitting pages at the AST level so the rail, pager and progress agree in both modes

Engineering decisions

  • Astro's file-format build, so the rebuild kept the URLs the hand-written site had published
  • Continuous reading by default and paged on request, with every page in the HTML either way
  • Self-checks run in CI, so a contradiction between chapters fails the build
  • Reader state in localStorage only — no analytics, no accounts, nothing leaving the browser

Technology

AstroTypeScriptPlaywrightremark / rehypePWA / Service WorkerMarkdown contentGitHub ActionsSEO / sitemap

Deliberately unfinished — chapters are added as they are written, and the next one sits listed and locked in the sidebar before it exists.