JustHTML: A Case Study in Vibe Engineering with AI-Assisted Development

AI Development

Explore JustHTML, a pure Python HTML parser demonstrating advanced AI-assisted development through 'vibe engineering.' Learn how its creator leveraged LLMs and rigorous engineering practices to build a robust, fully tested library, highlighting the shift from 'typing code' to 'designing and steering' complex projects.

The article discusses JustHTML, a new Python library for parsing HTML, released by Emil Stenström. It's noteworthy both as a useful library and as a case study in sophisticated AI-assisted programming.

First Impressions of JustHTML

The author initially didn't know JustHTML was written with AI assistance. The README highlighted several attractive characteristics:

  • Pure Python: This makes it easy to use in various Python environments, including Pyodide.
  • Comprehensive Test Suite: It "Passes all 9,200+ tests in the official html5lib-tests suite (used by browser vendors)," a significant achievement given the complexity of the HTML5 specification.
  • 100% Test Coverage: A rare and commendable feat.
  • CSS Selector Queries: This feature is particularly interesting given the author's past work on similar Python libraries.
  • Alternative to html5lib: The html5lib library has seen inconsistent maintenance, making alternatives like JustHTML appealing.
  • Compact Codebase: Only 3,000 lines of implementation code, with an additional ~11,000 lines for tests.

The author tested JustHTML on a phone, using Claude Code for web to build a Pyodide-powered HTML tool for experimentation. This quickly confirmed the core functionality.

Built Almost Entirely by LLMs

Further investigation revealed Emil Stenström's blog entry, "How I wrote JustHTML using coding agents," detailing its creation:

Emil explained that developing a full HTML5 parser is a complex, long-term project. He worked on it for several months during off-hours, utilizing VS Code with GitHub Copilot in Agent mode. He enabled automatic approval for most commands, with a blacklist for those requiring manual approval. An agent instruction prompted the system to continue working without interruption.

He leveraged multiple models, including Claude Sonnet 3.7, Gemini 3 Pro, and Claude Opus, a benefit of VS Code Agent mode's flexibility over provider-locked agents.

Vibe Engineering, Not Vibe Coding

Emil's 17-step account highlights the extensive software engineering involved beyond just typing code. This aligns with the concept of "vibe engineering," which the author previously described as a mature approach to AI-assisted development.

"Vibe coding," in contrast, involves using LLMs to generate code without proper review, suitable for prototypes but not for serious libraries or production systems. "Vibe engineering" represents expert programmers using coding agents responsibly to achieve high-quality, reliable outcomes.

Key aspects of Emil's approach (which readers are encouraged to review in full) include:

  • Early Test Suite Integration: He integrated the 9,200-test html5lib-tests conformance suite almost immediately, establishing a robust testing framework from the outset.
  • API Design: He defined the core API design—a TagHandler base class with handle_start() methods—and instructed the model to implement it.
  • Performance Benchmarking: A comparative benchmark was added to track performance against existing libraries like html5lib, leading to experiments with Rust optimizations.
  • Iterative Development: The original code was eventually discarded and rewritten as a rough port of Servo's html5ever Rust library.
  • Micro-optimizations: A custom profiler and new benchmark were developed, with Gemini 3 Pro used to achieve micro-optimizations that ultimately surpassed existing Pure Python libraries.
  • Code Cleanup: Test coverage was used to identify and remove unnecessary code.
  • Fuzz Testing: A custom fuzzer was built by the agent to generate numerous invalid HTML documents, strengthening the parser against unexpected inputs.

These practices demonstrate sophisticated development and Emil's deep experience as a software engineer, feeling more akin to a lead architect's role than a hands-on coder. This perfectly illustrates "vibe engineering" and the concept of "designing an agentic loop."

"The Agent Did the Typing"

Emil concluded his article by stating: "JustHTML is about 3,000 lines of Python with 8,500+ tests passing. I couldn’t have written it this quickly without the agent. But 'quickly' doesn’t mean 'without thinking.' I spent a lot of time reviewing code, making design decisions, and steering the agent in the right direction. The agent did the typing; I did the thinking."

The author fully agrees, emphasizing that coding agents automate the code-typing aspect, allowing developers to focus on higher-value intellectual tasks.