Inspiration

I'm a second-year student in Chhapra, Bihar. Around me, many people still browse on prepaid data and one bar of 2G or 3G. Opening a single news article can pull down 2-5 MB of scripts, trackers and images before a word of text shows up. In 1991 the University of Minnesota had already solved this with Gopher: plain menus and plain text that load instantly on anything. The web replaced Gopher in 1993, and pages have only got heavier since. So for Kiroween I dug Gopher up.

What it does

Phantom Gopher is a gateway that turns any web page into a Gopher menu:

  • A seance summary at the top: 3-4 key sentences. It comes from a built-in extractive summariser, or from a free local open-weight model through Ollama.
  • The outline of the page, a full-text item, and every link. Each link is itself a Gopher menu, so you can keep browsing the whole web this way.
  • The weight it removed, shown in a line like original 474.6 KB -> gopher 4.9 KB (99.0% lighter). A /stats ledger counts the bytes exorcised in each session.
  • Search through Gopher type-7 items, backed by Wikipedia's free API.

There are two ways in, and both serve the same responses:

  1. A real RFC 1436 Gopher server on port 7070. Lynx, Bombadillo and curl gopher:// all work.
  2. A haunted CRT web terminal for any browser: phosphor glow, scanlines, a drifting ghost, and full keyboard navigation. The whole terminal is about 6 KB.

It has no accounts, no API keys and no running cost.

How we built it with Kiro

  • Spec-driven development.
    • I started with a Kiro spec in .kiro/specs/phantom-gopher/. requirements.md has 8 requirements in EARS notation, and design.md has the architecture and sequence diagrams.
    • The design also lists six correctness properties: menu framing round-trip, text termination, extractor totality, summary faithfulness, wrap safety and no duplicate sentences.
    • tasks.md turns these into 11 tasks, and I ran them one at a time in Kiro.
    • Compared with vibe coding, the spec forced me to decide early that both front ends share one Gateway.handle(). Because of that, the browser terminal never drifted from the real protocol.
  • Property-based testing.
    • Every correctness property became a Hypothesis test.
    • P1 caught display strings containing TAB characters, which corrupt a Gopher menu. P5 caught a wrap bug with very long URLs.
    • P6 caught BBC teaser cards repeating the same sentence in the summary.
  • Steering docs.
    • product.md, tech.md and structure.md are always included. They hold the zero-cost rule: no paid APIs, no keys, standard library only.
    • spooky-voice.md uses fileMatch, so it only loads for UI files. That kept the Halloween tone consistent without cluttering backend work.
    • gopher-rfc1436.md uses auto inclusion, and Kiro pulls it in whenever I touch protocol code. Biggest win: Kiro stopped suggesting requests and API-key-based summarisers.
  • Agent hooks.
    • tests-on-save.json (PostFileSave on *.py) runs the suite, including the properties, after every agent edit.
    • guard-kiro-dir.json (PreToolUse on write tools) blocks any change that would gitignore /.kiro.
    • rfc-review-on-stop.json (agent Stop) makes Kiro re-check protocol framing and the zero-cost rule before it finishes a turn.
    • spec-task-done.json runs the tests plus a live TCP and HTTP smoke test after each spec task.
  • MCP.
    • The fetch MCP server let Kiro read RFC 1436 and real heavy pages from inside the IDE, so it could test the extractor against live HTML.
    • The git MCP server gave it status and diffs while it worked through tasks.

Challenges we ran into

  • Finding the article inside modern HTML. My first extractor treated Wikipedia's <body class="... vector-toc-available"> as a table of contents and threw away the entire page. The fix was to match class tokens rather than substrings, and to never mark html, body, main or article as noise.
  • Free AI that runs on a laptop. Paid LLM APIs were off the table. Instead I wrote an extractive summariser that needs no model at all, and made Ollama with a 0.5B model an optional upgrade with automatic fallback.
  • Keeping a 35-year-old protocol honest. Gopher menus are TAB-framed and terminated with a lone .. One stray tab or dot breaks real clients, which is why those rules became property tests.

Accomplishments that we're proud of

  • It cut a real Wikipedia page by 99% (474.6 KB to 4.9 KB) and the BBC News front page by 98%, measured live.
  • It's a real Gopher server that real 1990s-style clients can browse.
  • It runs on the standard library alone, needs zero dependencies, and costs nothing.
  • It has 15 tests, including 6 property-based correctness properties tied back to the requirements.

What we learned

Gopher's tiny RFC 1436 protocol forced hard choices about what a page really needs: headings, text and links survive, scripts and trackers don't. Writing the requirements and correctness properties first, then property-based tests with Hypothesis, caught extractor edge cases (nested tables, broken HTML, non-ASCII titles) we would have missed by hand. And measuring every page's before/after size kept the project honest: BBC News went from 357 KB to 6.4 KB, Wikipedia's Gopher article from 474 KB to 4.9 KB.

What's next for Phantom Gopher

  • Hindi and other Indian-language summaries from local open-weight models (?lang=hi).
  • A rupee ledger that turns bytes saved into data money saved.
  • An SMS or USSD bridge so feature phones with no data can request a page summary.
  • A public Gopher hole people can reach from any Gopher client.

Built With

Share this project:

Updates

Submission history