Generating a Wardley Map with an LLM
When I was drafting the first chapters of Crafting Engineering Strategy, I thought I might write a chapter on GitLab’s strategy. GitLab is interesting because it has publicly shared so much of how they operate, that I figured it might be possible to write an interesting strategy document about them despite never having worked there.
In the end, I decided not to write that chapter, but I did create a Wardley map exploring GitLab’s strategy. That Wardley map was not included in the final edition of the book, including not being in the LLM-optimized format either, making it a perfect test case for whether an LLM can help us generate an effective wardley map.
This is a draft chapter from the The AI Companion to Crafting Engineering Strategy, which discusses how to use Crafting Engineering Strategy in an LLM to draft, refine, and improve engineering strategies.
Naive approach
A key part of creating a Wardley map is creating the value chains, as discussed in the chapter on refining strategy with Wardley maps. Creating the value chain is absolutely something an LLM can help with, but value chains are just text, so we’ve already covered effective patterns that apply to creating them.
However, creating an actual Wardley map image is definitely not something we’ve covered. As such, we’ll start from the discarded chapter’s user and value chains (available in this Gist), with the goal of converting it into a Wardley map.
We’ll start by uploading the Wardley mapping chapter, along with completed Wardley maps represented as images.
This project only has the Wardley mapping chapter, rather than the entire book,
in order to create more space in the project’s context window for the images.
If you used llm.py
and an LLM with a large context window, you could include
the entire book as normal.
Once we have the project set up, we use the user and value chains (as a reminder, (available here)) along with a short prompt to generate a Wardley map:
Create a wardley map image using the template
in this project these value chains:
{user and value chains text}
Using ChatGPT 4o, this generated a Wardley map diagram. Well, sort of.
The image has a lot of superficially Wardley map-like aspects, but it’s just not at all a Wardley map. For each correctly spelled label on the x-axis, there’s a nonsensical word in a box elsewhere on the map. I think we can conclude that direct image generation is not going to be the path forward for using an LLM to create a Wardley map.
Shifting complexity to a tool
Ok, that worked surprisingly badly.
Generally, when this happens, the secret is to shift complexity
to a tool. Frequently the best way to do so is creating a domain-specific language (DSL)
that allows LLMs to work in a format they love–text!–and pushes the other work
out of the LLM. That is what we did in the last chapter
with the systems
library and the systems-mcp
server.
Creating a DSL for Wardley maps would be a somewhat painful undertaking. Fortunately, there’s already a DSL for writing Wardley maps, Damon Skelhorn’s OnlineWardleyMaps. (Many thanks to Ben Mosior, whose post introduced me to OnlineWardleyMaps.)
I’ve created a file with several Wardley map DSL examples, which you can load into your project. After doing that, let’s redo the above prompt, this time prefacing it with:
Create a wardley map for the below value,
using the OnlineWardleyMaps syntax.
{same value chains as above, omitted for brevity}
The LLM generated this output, which I added to OnlineWardleyMaps.com, and successfully generated a compelling Wardley map.
To my eye, this is surprisingly good. There are absolutely pieces I would tweak, but that’s the nature of any Wardley map. Getting a rough draft up and working is exceptionally valuable, because it’s much easier to critique and iterate on something that exists.
Summary
In this chapter, we experienced the push and pull experience of working with LLMs to solve messy problems. Our first attempt to create a Wardley map by working with images resulted in an unusable mess. We then formulated a new approach, taking advantage of the existing OnlineWardleyMaps format, to translate the problem into a format that LLMs are adept at, DSLs.
You can now write a complex Wardley map rapidly, in a format that you can share quickly, and without having to learn the messy details of that format yourself. That’s pretty remarkable in my mind.