Using AI IDE Windsurf from Codeium to generate a minimal DBOS application

Christoph Bussler
7 min readNov 25, 2024

--

Look ma, no hands

Goal

My goal was to create a minimal and headless DBOS (https://www.dbos.dev/) application as example to get started with the AI IDE Windsurf (https://codeium.com/windsurf) from Codeium (https://codeium.com/).

Preliminaries

The following preliminaries were in place:

  • A directory called minimal-dbos was created by me
  • A PostgreSQL database system is running locally on my laptop with default connection parameter values; otherwise DBOS will raise an exception currently upon launch (https://github.com/dbos-inc/dbos-transact-py/issues/150)
  • I installed the default installation of Windsurf from Codeium without any subscription at this point as I am getting started with Windsurf

Observations

See below for a full log of my actions and interactions with Windsurf— it is lengthy, but full of interesting details, I promise.

Here some initial key observations I made along the way:

  • It is possible to entirely interact with Windsurf’s chat/agent-like functionality and outside the code itself
  • A single complex prompt is possible with somewhat detailed instructions and that accomplishes quite a lot as a start
  • Windsurf explains what it does and summarizes along the way; this is a nice feature as it helps you keep track of your interaction
  • It explicitly asks the user to confirm terminal command executions. The log below does not contain the explicit requests for command execution anymore (there are buttons provided to accept or reject a command), just the result of the execution after one of the buttons was pressed.
  • Windsurf detects issues in the environment, e.g., a new version of pip being available
  • Recognizes errors and fixes them. And, most importantly, it does not give up after the first error, it keeps going fixing its own errors, quite impressive!
  • It can run external scripts, like for example mypy

Initial thoughts

To get to this more complex initial prompt I had to provide specific input that Windsurf was not able to figure out on its own, for example, the fact that DBOS.launch() and DBOS.destroy() had to be called upon application startup. Some key knowledge like this I had to provide in the prompt as Windsurf was not able to determine this by itself.

Note to package providers: make much documentation available as possible so that the learning processes picks up as many details as possible.

And here is the challenge or risk: I had to help Windsurf with specifics in the prompt. This requires me to know the specifics, and those I learned weeks back the hard way by building a DBOS application by hand. I wonder how I would have gotten to a working application without prior knowledge.

Below is a complete log of my first use of Windsurf. It is quite fascinating, I happily admit. And as you might imagine yourself, you can keep going forever with asking for more improvements, functionality, and so on, at it is quite fun and motivating.

Minor observation: Windsurf uses “I”, ”you”, “we”, “our” for communication — it wants to be part of the stellar team 🙂.

The complete log to create a minimal DBOS application with test cases

Start: a complex prompt detailing my instructions

My icon, the red compass (true north :-)), shows what I typed as prompt, everything else is the output provided by Windsurf.

Code generated (without me making a single change manually)

Directory

main.py

dbos-config.yaml

Next steps: ask Windsurf to implement improvements

Improvement: use DBOS.logger instead of print()

Improvement: add Python type declarations to the extent possible

Improvement: run mypy for type checking

Improvement: refactor naming

Note: the change below shows some cleverness: not only was the step name changed, but the log statements and the return string value as well.

Improvement: create tests with high code coverage

Note: to generate a working test case I needed to provide specific input. Windsurf did not recognize that there still was an error and that DBOS() is part of the main.py file and requires the actual invocation of DBOS.launch().

Improvement: install the latest pip

Note: the first command it presented was upgrading pip for the entire system, and not the virtual environment. So I rejected it — and the reaction was great because it figured out by itself I only want to update the virtual environment.

Methodology

This is my first use of an AI IDE editor. However, it appears to me that from a methodology perspective it is best to

  • start with a small working application or piece of logic
  • iterate over it with refactoring and improvement

Sounds like not a notable insight, however, they say: check-in small and often, and this seems to be a good starting point.

Summary

Fascinating when using Windsurf the first time. I like the approach of continuously being in the loop and the approach to show the diffs in the code in order to observe the proposed changes.

Lot’s to try out more, like integration with Git or maybe the IntelliJ plugin. Let’s see what the limits are.

--

--

No responses yet