Building ParliamentXP: Pairing with Grok Bot on a Real Product

Every Wednesday at noon, the Prime Minister stands up for half an hour of questions. Prime Minister’s Questions is the most-watched bit of Parliament. But if you want to know what was actually said, who asked what, and what the government actually promised, you end up in Hansard, Parliament’s official record. It’s thorough and it’s accurate, but if you don’t already know your way around it, it can feel like a wall of text.

So I built ParliamentXP, a more approachable way to follow UK Parliament, starting with PMQs. It’s for students, journalists, and anyone who’s curious but doesn’t have the time or patience to learn Hansard.

The interesting part is how it got built. As a software engineer, I’m used to being the one planning and writing the code. This time I worked as the lead on a two-person team, where my co-worker, Grok Bot, did the hands on work.

Pairing with an AI coworker

I built the site with Grok Bot. I’d describe what I wanted, it would write the code, open the changes in a private GitHub repository, and send me a Netlify preview link so I could see each change on a real page before anything went live. Nothing was merged until I said “Merge” — the review discipline didn’t change, only who was writing the code.

Most of my steering was short, everyday code review comments. Things like “the ‘read the exchange’ links in the highlights section do not work”, or “move the summary, analysis, commitments beneath the highlights”. Each time, it fixed the problem, sent a fresh preview, and waited for me to sign off.

It felt less like delegating and more like pairing with a developer who never tires of “not quite, try again” — freeing me up to focus on design decisions and quality bar rather than implementation details.

The automation I handed off

A site like this needs to be accurate and up to date. PMQs happens every week, and nobody wants to read last Wednesday’s summary on a Thursday.

Rather than writing the scheduling and scraping code myself, I specced out what I needed and let Grok Bot build it. It set up three routines, writing both the schedules and the scripts:

  • Wednesday at 2:30pm, it rebuilds that week’s PMQs from Hansard.
  • Wednesday at 4pm, a backup run kicks in in case Hansard is running late. That’s exactly what happened on 18 November: the 2:30 run found nothing yet, and the 4pm run published.
  • Thursday at about 9am, an accuracy check re-verifies every quote and link, and rebuilds the page if Hansard has revised the record overnight.

Each run pulls in the official transcript, links each question to the parliamentlive.tv video at the right moment, adds official Parliament photos from Flickr, and drafts plain-language summaries, topic tags, and judgements about how important (or funny) each exchange was. All of those are clearly marked for review. Then it checks every link and every quote against Hansard, runs an accessibility audit, publishes, and sends me a short report with a screenshot.

Here’s the report from 18 November: 30 questions from 24 MPs, all 39 photos in place, 191 out of 191 Hansard links and 62 out of 62 video links checked, every quote matched, and zero accessibility problems.

I also asked for one simple rule: a broken link must never stop the page going out. If a video or Hansard link fails, it’s quietly hidden and checked again later. And when Hansard and Flickr changed their formats, the routines spotted it, fixed their own scripts, and told me what they’d done. I didn’t have to touch anything.

It isn’t only for the weekly slot either. The day after the Milburn Review statement on welfare and youth jobs on 17 November, I asked for it to be published as a special session, and it now has its own permanent page: the Milburn Review session, all 102 questions of it.

Under the bonnet: how the automation actually works

I wanted to know what’s really going on when the “routines” run, so I asked Grok Bot to show me the code. The answer turned out to be a mix of two quite different things.

The part that’s ordinary code. Most of the work is done by a set of Python scripts in the site’s pipeline folder, about 3,800 lines in all. One command, build.py, runs them in order. build_pmqs.py fetches the session from the Hansard API, and hansard_locate.py works out where PMQs sits in that day’s record. flickr_photos.py finds the official photo album, and video_links.py and video_captions.py line up each question with the parliamentlive.tv recording using its subtitles. scores.py works out the importance and humour scores, and check_session.py checks everything at the end. That last script finishes with a simple code: OK, FAIL (don’t publish), STALE (Hansard has changed, so rebuild) or WARN (a few links hidden, publish anyway). This part does exactly the same thing every time.

The part that isn’t. Every week Grok Bot also writes two small files of its own for that session, annotations-<date>.py and judgements-<date>.py. These hold the plain-English summaries, the topic tags (chosen from a fixed list in vocabulary.py), the funny lines and the government’s commitments. Writing those means reading the debate and making a call, which a script can’t do. There are guardrails, though. Every quote has to appear word for word in Hansard, and scores.py stops the build if one doesn’t. Grok Bot also follows a step-by-step run sheet it wrote for itself. It reads the check results, decides whether to publish, rebuild or wait, and then writes my report.

When things change underneath it. This is where the difference really shows. On 4 November Hansard re-filed PMQs under a different heading the day after we’d built it, and it even reused the previous fortnight’s page IDs, which broke the links for both weeks. The fix was hansard_locate.py, which now finds PMQs again from scratch on every build and never trusts a saved ID. On 28 October the photo album wasn’t found automatically, so the album search was rewritten to check every page of Parliament’s albums, cope with different title wordings and try again a few times. As it turned out, the album simply hadn’t been posted yet, so the 4pm backup run now adds any photos that arrive late. Then on 18 November Flickr changed how its photo pages are built, and photo matching broke in the middle of a run. Grok Bot changed flickr_photos.py, added retries for network drops, committed the fix and told me about it in that afternoon’s report.

So could it just be a fixed function? Partly, yes, because a lot of it already is. The building, checking and “hide a bad link but keep publishing” rule are all code with clear results, so a simple scheduled job could run them. But that job would need things the project doesn’t have today. The timings currently live in Grok Bot’s routines, not in a server schedule, so it would need a scheduler of its own. It would need an AI service, called through code, to write the summaries and judgements under the same quote checks. It would need code that turns those check results into decisions and alerts. The real catch is the format changes. Each one so far was different, and you can’t write a fix in advance for a change you haven’t seen. A fixed function would simply stop and wait for someone to repair it. With the setup I have, the repair is part of the weekly run.

So the honest picture is this. The dependable, repetitive bits are proper code that I could run without Grok Bot. Grok Bot adds the reading and judgement, and the willingness to fix things as they change.

Designing to make politics more interesting

The design all comes from one idea: understanding what happened matters more than watching it. Video and timestamps are there if you want them, but they’re visually lighter. The words come first.

A few of the design choices I made:

  • Highlights first. Each session opens with the most important exchanges and the lighter moments, then the full list of questions. Every session also has its own People, Topics and Photos pages.
  • Plain-language summaries. Every exchange gets a short summary in everyday English, with a “Read the exchange” link if you want the full wording.
  • Scores in words, not numbers. You’ll see “High importance” or “Medium funny” instead of a mark out of 100.
  • Clear labels. Topic tags and question types look clearly different, so you can scan a page at a glance.
  • Who asked. A “questions by party” and “questions by region” charts.
  • What was promised. A commitments section pulls out what the government actually said it would do.
  • Accessible by default. Clean links, visible keyboard focus, and zero accessibility violations as a condition of every release.
  • No black boxes. A “How the scores work” explainer at the bottom of each page shows how the judgements are made.

What I learned

The biggest lesson is that directing an AI coworker well is its own skill, separate from writing code yourself. A clear sense of who the product is for, a strong opinion on what good looks like, and the willingness to keep saying “nearly, but move that bit” — that’s what actually determines the output, not who’s typing.

If you’ve ever struggled to navigate Hansard, or you just want to know what happened at PMQs without watching all of it, have a look at ParliamentXP. I’d love to hear what you think.