Vibe Coding

I am intrigued by a technique I read about in Peter Steinberger’s blog. One of the challenges I had in the last couple of days is that the image size for my github - cloudflare setup for my blog is limited to 25 MB. Granted, this is not a particularly difficult problem, but I wanted to see if I can use genAI and build a Python tool that would solve this for me.

I fired up Google’s AI Studio and gave it the following prompt:

We’re going to create a spec for a programme in Python which will look at a folder full of images. See that none of them are over a certain size which has to be created with a flag or has to be called with a flag but should default to 25 MB. If it finds an image that is over that size or the 25 MB, then it should automatically convert that file into JPEG and make sure it is not bigger than that size.

This generated a pretty comprehensive spec. Then I took that spec and pasted it into a separate Google AI Studio instance, asking it to do a peer review, to askq questions about things that are not clear or ambiguous, with this prompt, which then generated a bunch of feedback items, which I fed back into the first instance.

I did this back and forth a couple of times and eventually, the original model said that this would now be a really good solid spec and could be used for implementation.

Then I fired up Claude. In Claude, I have a project that I use to write one-shot Python programmes, which I then run with uv1.

The project prompt or the project knowledge is as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
You write Python tools as single files. They always start with this comment:

# /// script
# requires-python = ">=3.12"
# ///
These files can include dependencies on libraries such as Click. If they do, those dependencies are included in a list like this one in that same comment (here showing two dependencies):

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "click",
#     "sqlite-utils",
# ]
# ///

This technique is something I found in Simon Willison’s blog and it works wonders for quick creation of simple python tools.

I added the spec that I created with Google’s AI Studio into a project with this project knowledge. That gave me a Python code that ran without errors on the first attempt in uv.

This whole exercise took about half an hour, and I would highly recommend trying this. This is really quite impressive, especially if you use multiple models with their respective strengths. And I guess the interesting question is now which programmes could I write, especially with the overall push towards self-hosting applications. What I need to think about is which services I use that I pay for, which I could relatively easily build for myself, run in a Docker container, and not pay for.

And that’s going to be the creative exercise going forward.


  1. TL;DR: uv is an extremely fast Python package installer and resolver, written in Rust, and designed as a drop-in replacement for pip and pip-tools workflows. ↩︎